From 4f5c1378f85a7472341d4ff2122d4764a09af901 Mon Sep 17 00:00:00 2001 From: junotx Date: Fri, 12 Mar 2021 10:24:09 +0800 Subject: [PATCH 1/3] add monitoring dashboard query api Signed-off-by: junotx --- ...oring.kubesphere.io_clusterdashboards.yaml | 184 ++++++++++++++++++ .../monitoring.kubesphere.io_dashboards.yaml | 184 ++++++++++++++++++ go.mod | 8 +- go.sum | 82 +++++--- pkg/apis/addtoscheme_dashboard_v1alpha1.go | 7 + .../clusterdashboard/clusterdashboard.go | 88 +++++++++ .../clusterdashboard/clusterdashboard_test.go | 126 ++++++++++++ .../resources/v1alpha3/dashboard/dashboard.go | 88 +++++++++ .../v1alpha3/dashboard/dashboard_test.go | 143 ++++++++++++++ .../resources/v1alpha3/resource/resource.go | 4 + 10 files changed, 879 insertions(+), 35 deletions(-) create mode 100644 config/crds/monitoring.kubesphere.io_clusterdashboards.yaml create mode 100644 config/crds/monitoring.kubesphere.io_dashboards.yaml create mode 100644 pkg/apis/addtoscheme_dashboard_v1alpha1.go create mode 100644 pkg/models/resources/v1alpha3/clusterdashboard/clusterdashboard.go create mode 100644 pkg/models/resources/v1alpha3/clusterdashboard/clusterdashboard_test.go create mode 100644 pkg/models/resources/v1alpha3/dashboard/dashboard.go create mode 100644 pkg/models/resources/v1alpha3/dashboard/dashboard_test.go diff --git a/config/crds/monitoring.kubesphere.io_clusterdashboards.yaml b/config/crds/monitoring.kubesphere.io_clusterdashboards.yaml new file mode 100644 index 0000000000..4cc3e4dbc0 --- /dev/null +++ b/config/crds/monitoring.kubesphere.io_clusterdashboards.yaml @@ -0,0 +1,184 @@ + +--- +apiVersion: apiextensions.k8s.io/v1beta1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.2.4 + creationTimestamp: null + name: clusterdashboards.monitoring.kubesphere.io +spec: + group: monitoring.kubesphere.io + names: + kind: ClusterDashboard + listKind: ClusterDashboardList + plural: clusterdashboards + singular: clusterdashboard + scope: Cluster + validation: + openAPIV3Schema: + description: ClusterDashboard is the Schema for the culsterdashboards API + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + description: DashboardSpec defines the desired state of Dashboard + properties: + datasource: + description: Dashboard datasource + type: string + description: + description: Dashboard description + type: string + panels: + description: Collection of panels. Panel is one of [Row](row.md), [Singlestat](#singlestat.md) + or [Graph](graph.md) + items: + description: Supported panel type + properties: + bars: + description: Display as a bar chart + type: boolean + colors: + description: Set series color + items: + type: string + type: array + decimals: + description: Limit the decimal numbers + format: int64 + type: integer + description: + description: Panel description + type: string + format: + description: Display unit + type: string + id: + description: Panel ID + format: int64 + type: integer + lines: + description: Display as a line chart + type: boolean + stack: + description: Display as a stacked chart + type: boolean + targets: + allOf: + - items: + description: Query editor options + properties: + expr: + description: Input for fetching metrics. + type: string + legendFormat: + description: Legend format for outputs. You can make a + dynamic legend with templating variables. + type: string + refId: + description: Reference ID + format: int64 + type: integer + step: + description: Set series time interval + type: string + type: object + - items: + description: Query editor options + properties: + expr: + description: Input for fetching metrics. + type: string + legendFormat: + description: Legend format for outputs. You can make a + dynamic legend with templating variables. + type: string + refId: + description: Reference ID + format: int64 + type: integer + step: + description: Set series time interval + type: string + type: object + description: A collection of queries + type: array + title: + description: Name of the row panel + type: string + type: + description: Must be `row` + type: string + yaxes: + description: Y-axis options + items: + properties: + decimals: + description: Limit the decimal numbers + format: int64 + type: integer + format: + description: Display unit + type: string + type: object + type: array + required: + - type + type: object + type: array + templating: + description: Templating variables + items: + description: Templating defines a variable, which can be used as a + placeholder in query + properties: + name: + description: Variable name + type: string + query: + description: Set variable values to be the return result of the + query + type: string + type: object + type: array + time: + description: Time range for display + properties: + from: + description: Start time in the format of `^now([+-][0-9]+[smhdwMy])?$`, + eg. `now-1M`. It denotes the end time is set to the last month + since now. + type: string + to: + description: End time in the format of `^now([+-][0-9]+[smhdwMy])?$`, + eg. `now-1M`. It denotes the start time is set to the last month + since now. + type: string + type: object + title: + description: Dashboard title + type: string + type: object + type: object + version: v1alpha1 + versions: + - name: v1alpha1 + served: true + storage: true +status: + acceptedNames: + kind: "" + plural: "" + conditions: [] + storedVersions: [] diff --git a/config/crds/monitoring.kubesphere.io_dashboards.yaml b/config/crds/monitoring.kubesphere.io_dashboards.yaml new file mode 100644 index 0000000000..97bad94b10 --- /dev/null +++ b/config/crds/monitoring.kubesphere.io_dashboards.yaml @@ -0,0 +1,184 @@ + +--- +apiVersion: apiextensions.k8s.io/v1beta1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.2.4 + creationTimestamp: null + name: dashboards.monitoring.kubesphere.io +spec: + group: monitoring.kubesphere.io + names: + kind: Dashboard + listKind: DashboardList + plural: dashboards + singular: dashboard + scope: Namespaced + validation: + openAPIV3Schema: + description: Dashboard is the Schema for the dashboards API + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + description: DashboardSpec defines the desired state of Dashboard + properties: + datasource: + description: Dashboard datasource + type: string + description: + description: Dashboard description + type: string + panels: + description: Collection of panels. Panel is one of [Row](row.md), [Singlestat](#singlestat.md) + or [Graph](graph.md) + items: + description: Supported panel type + properties: + bars: + description: Display as a bar chart + type: boolean + colors: + description: Set series color + items: + type: string + type: array + decimals: + description: Limit the decimal numbers + format: int64 + type: integer + description: + description: Panel description + type: string + format: + description: Display unit + type: string + id: + description: Panel ID + format: int64 + type: integer + lines: + description: Display as a line chart + type: boolean + stack: + description: Display as a stacked chart + type: boolean + targets: + allOf: + - items: + description: Query editor options + properties: + expr: + description: Input for fetching metrics. + type: string + legendFormat: + description: Legend format for outputs. You can make a + dynamic legend with templating variables. + type: string + refId: + description: Reference ID + format: int64 + type: integer + step: + description: Set series time interval + type: string + type: object + - items: + description: Query editor options + properties: + expr: + description: Input for fetching metrics. + type: string + legendFormat: + description: Legend format for outputs. You can make a + dynamic legend with templating variables. + type: string + refId: + description: Reference ID + format: int64 + type: integer + step: + description: Set series time interval + type: string + type: object + description: A collection of queries + type: array + title: + description: Name of the row panel + type: string + type: + description: Must be `row` + type: string + yaxes: + description: Y-axis options + items: + properties: + decimals: + description: Limit the decimal numbers + format: int64 + type: integer + format: + description: Display unit + type: string + type: object + type: array + required: + - type + type: object + type: array + templating: + description: Templating variables + items: + description: Templating defines a variable, which can be used as a + placeholder in query + properties: + name: + description: Variable name + type: string + query: + description: Set variable values to be the return result of the + query + type: string + type: object + type: array + time: + description: Time range for display + properties: + from: + description: Start time in the format of `^now([+-][0-9]+[smhdwMy])?$`, + eg. `now-1M`. It denotes the end time is set to the last month + since now. + type: string + to: + description: End time in the format of `^now([+-][0-9]+[smhdwMy])?$`, + eg. `now-1M`. It denotes the start time is set to the last month + since now. + type: string + type: object + title: + description: Dashboard title + type: string + type: object + type: object + version: v1alpha1 + versions: + - name: v1alpha1 + served: true + storage: true +status: + acceptedNames: + kind: "" + plural: "" + conditions: [] + storedVersions: [] diff --git a/go.mod b/go.mod index b0b00721c8..9e48e27909 100644 --- a/go.mod +++ b/go.mod @@ -17,12 +17,14 @@ require ( github.com/containernetworking/cni v0.8.0 github.com/coreos/go-oidc v2.1.0+incompatible github.com/davecgh/go-spew v1.1.1 + github.com/deckarep/golang-set v1.7.1 // indirect github.com/dgrijalva/jwt-go v3.2.0+incompatible github.com/docker/distribution v2.7.1+incompatible github.com/docker/docker v1.4.2-0.20200203170920-46ec8731fbce github.com/elastic/go-elasticsearch/v5 v5.6.1 github.com/elastic/go-elasticsearch/v6 v6.8.2 github.com/elastic/go-elasticsearch/v7 v7.3.0 + github.com/elazarl/goproxy v0.0.0-20200315184450-1f3cb6622dad // indirect github.com/emicklei/go-restful v2.14.3+incompatible github.com/emicklei/go-restful-openapi v1.4.1 github.com/emirpasic/gods v1.12.0 // indirect @@ -39,8 +41,6 @@ require ( github.com/go-sql-driver/mysql v1.5.0 github.com/gocraft/dbr v0.0.0-20180507214907-a0fd650918f6 github.com/golang/example v0.0.0-20170904185048-46695d81d1fa - github.com/golang/mock v1.4.3 - github.com/golang/protobuf v1.4.2 github.com/google/go-cmp v0.5.0 github.com/google/uuid v1.1.1 github.com/gorilla/websocket v1.4.1 @@ -67,12 +67,12 @@ require ( github.com/prometheus/prometheus v1.8.2-0.20200907175821-8219b442c864 github.com/sony/sonyflake v1.0.0 github.com/speps/go-hashids v2.0.0+incompatible - github.com/spf13/afero v1.2.2 github.com/spf13/cobra v1.0.0 github.com/spf13/pflag v1.0.5 github.com/spf13/viper v1.4.0 github.com/stretchr/testify v1.6.1 github.com/xanzy/ssh-agent v0.2.1 // indirect + go.etcd.io/etcd v3.3.17+incompatible // indirect golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de golang.org/x/net v0.0.0-20200707034311-ab3426394381 golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d @@ -104,7 +104,7 @@ require ( k8s.io/metrics v0.18.6 k8s.io/utils v0.0.0-20200603063816-c1c6865ac451 kubesphere.io/client-go v0.0.0 - openpitrix.io/openpitrix v0.4.9-0.20200611125425-ae07f141e797 + kubesphere.io/monitoring-dashboard v0.1.1 sigs.k8s.io/application v0.8.4-0.20201016185654-c8e2959e57a0 sigs.k8s.io/controller-runtime v0.6.4 sigs.k8s.io/controller-tools v0.4.0 diff --git a/go.sum b/go.sum index c05028c483..75626a1b6c 100644 --- a/go.sum +++ b/go.sum @@ -1,3 +1,4 @@ +cloud.google.com/go v0.56.0 h1:WRz29PgAsVEyPSDHyk+0fpEkwEFyfhHn+JbksT6gIL4= cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKVk= cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= cloud.google.com/go/bigtable v1.2.0/go.mod h1:JcVAOl45lrTmQfLj7T6TxyMzIN/3FGGcFm+2xVAli2o= @@ -28,13 +29,12 @@ github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go github.com/MakeNowJust/heredoc v0.0.0-20171113091838-e9091a26100e h1:eb0Pzkt15Bm7f2FFYv7sjY7NPFi3cPkS3tv1CcrFBWA= github.com/MakeNowJust/heredoc v0.0.0-20171113091838-e9091a26100e/go.mod h1:64YHyfSL2R96J44Nlwm39UHepQbyR5q10x7iYa1ks2E= github.com/Masterminds/goutils v1.1.0/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU= -github.com/Masterminds/semver v1.5.0 h1:H65muMkzWKEuNDnfl9d70GUjFniHKHRbFPGBuZ3QEww= -github.com/Masterminds/semver v1.5.0/go.mod h1:MB6lktGJrhw8PrUyiEoblNEGEQ+RzHPF078ddwwvV3Y= github.com/Masterminds/semver/v3 v3.0.1 h1:2kKm5lb7dKVrt5TYUiAavE6oFc1cFT0057UVGT+JqLk= github.com/Masterminds/semver/v3 v3.0.1/go.mod h1:VPu/7SZ7ePZ3QOrcuXROw5FAcLl4a0cBrbBpGY/8hQs= github.com/Masterminds/sprig/v3 v3.0.0/go.mod h1:NEUY/Qq8Gdm2xgYA+NwJM6wmfdRV9xkh8h/Rld20R0U= github.com/Masterminds/squirrel v0.0.0-20161115235646-20f192218cf5/go.mod h1:xnKTFzjGUiZtiOagBsfnvomW+nJg2usB1ZpordQWqNM= github.com/Masterminds/vcs v1.13.0/go.mod h1:N09YCmOQr6RLxC6UNHzuVwAdodYbbnycGHSmwVJjcKA= +github.com/Microsoft/go-winio v0.4.12 h1:xAfWHN1IrQ0NJ9TBC0KBZoqLjzDTr1ML+4MywiUOryc= github.com/Microsoft/go-winio v0.4.12/go.mod h1:VhR8bwka0BXejwEJY73c50VrPtXAaKcyvVC4A4RozmA= github.com/Microsoft/hcsshim v0.8.6/go.mod h1:Op3hHsoHPAvb6lceZHDtd9OkTew38wNoXnJs8iY7rUg= github.com/NYTimes/gziphandler v1.1.1 h1:ZUDjpQae29j0ryrS0u/B8HZfJBtBQHjqw2rQ2cqUQ3I= @@ -51,11 +51,11 @@ github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdko github.com/Shopify/logrus-bugsnag v0.0.0-20171204204709-577dee27f20d/go.mod h1:HI8ITrYtUY+O+ZhtlqUnD8+KwNPOyugEhfP9fdUIaEQ= github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo= github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI= -github.com/StackExchange/wmi v0.0.0-20170410192909-ea383cf3ba6e/go.mod h1:3eOhrUMpNV+6aFIbp5/iudMxNCF27Vw2OZgy4xEx0Fg= github.com/VividCortex/gohistogram v1.0.0/go.mod h1:Pf5mBqqDxYaXu3hDrrU+w6nw50o/4+TcAqDqk/vUH7g= github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5/go.mod h1:SkGFH1ia65gfNATL8TAiHDNxPzPdmEL5uirI2Uyuz6c= github.com/agnivade/levenshtein v1.0.1/go.mod h1:CURSv5d9Uaml+FovSIICkLbAUZ9S4RqaHDIsdSBg7lM= github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af/go.mod h1:K08gAheRH3/J6wwsYMMT4xOr94bZjxIelGM0+d/wbFw= +github.com/alcortesm/tgz v0.0.0-20161220082320-9c5fe88206d7 h1:uSoVVbwJiQipAclBbw+8quDsfcvFjOpI5iCf4p/cqCs= github.com/alcortesm/tgz v0.0.0-20161220082320-9c5fe88206d7/go.mod h1:6zEj6s6u/ghQa61ZWa/C2Aw3RkjiTBOix7dkqa1VLIs= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751 h1:JYp7IbQjafoB+tBA3gMyHYHrpOtNuDiK/uB5uXxq5wM= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= @@ -66,6 +66,7 @@ github.com/aliyun/aliyun-oss-go-sdk v2.0.4+incompatible/go.mod h1:T/Aws4fEfogEE9 github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8= github.com/andybalholm/cascadia v1.0.0 h1:hOCXnnZ5A+3eVDX8pvgl4kofXv2ELss0bKcqRySc45o= github.com/andybalholm/cascadia v1.0.0/go.mod h1:GsXiBklL0woXo1j/WYWtSYYC4ouU9PqHO0sqidkEA4Y= +github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239 h1:kFOfPq6dUM1hTo4JG6LR5AXSUEsOjtdm0kw0FtQtMJA= github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239/go.mod h1:2FmKhYUyUczH0OGQWaF5ceTx0UBShxjsH6f8oGKYe2c= github.com/antihax/optional v0.0.0-20180407024304-ca021399b1a6/go.mod h1:V8iCPQYkqmusNa815XgQio277wI47sdRh1dUOLdyC6Q= github.com/apache/arrow/go/arrow v0.0.0-20191024131854-af6fa24be0db/go.mod h1:VTxUBvSJ3s3eHAg65PNgrsn5BtqCRPdmyXh6rAfdxN0= @@ -110,7 +111,6 @@ github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghf github.com/cespare/xxhash/v2 v2.1.1 h1:6MnRN8NT7+YBpUIWxHtefFZOKTAPgGjpQSxqLNn0+qY= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/chai2010/gettext-go v0.0.0-20160711120539-c6fed771bfd5/go.mod h1:/iP1qXHoty45bqomnu2LM+VVyAEdWN+vtSHGlQgyxbw= -github.com/chai2010/jsonmap v1.0.0/go.mod h1:+30HSZixzW7NVqyqXTDyQi0hsexrb6hnpvhuW0bot6s= github.com/chromedp/cdproto v0.0.0-20200424080200-0de008e41fa0/go.mod h1:PfAWWKJqjlGFYJEidUM6aVIWPr0EpobeyVWEEmplX7g= github.com/chromedp/chromedp v0.5.3/go.mod h1:YLdPtndaHQ4rCpSpBG+IPpy9JvX0VD+7aaLxYgYj28w= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= @@ -121,7 +121,9 @@ github.com/circonus-labs/circonusllhist v0.1.3/go.mod h1:kMXHVDlOchFAehlya5ePtbp github.com/clbanning/x2j v0.0.0-20191024224557-825249438eec/go.mod h1:jMjuTZXRI4dUb/I5gc9Hdhagfvm9+RyrPryS/auMzxE= github.com/cockroachdb/apd v1.1.0/go.mod h1:8Sl8LxpKi29FqWXR16WEFZRNSz3SoPzUzeMeY4+DwBQ= github.com/cockroachdb/cockroach-go v0.0.0-20181001143604-e0a95dfd547c/go.mod h1:XGLbWH/ujMcbPbhZq52Nv6UrCghb1yGn//133kEsvDk= +github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa h1:OaNxuTZr7kxeODyLWsRMC+OD03aFUH+mW6r2d+MWa5Y= github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= +github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd h1:qMd81Ts1T2OTKmB4acZcyKaMtRnY5Y44NuXGX2GFJ1w= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= github.com/container-storage-interface/spec v1.2.0 h1:bD9KIVgaVKKkQ/UbVUY9kCaH/CJbhNxe0eeB4JeJV2s= github.com/container-storage-interface/spec v1.2.0/go.mod h1:6URME8mwIBbpVyZV93Ce5St17xBiQJQY67NDsuohiy4= @@ -136,6 +138,7 @@ github.com/coreos/etcd v3.3.17+incompatible h1:f/Z3EoDSx1yjaIjLQGo1diYUlQYSBrrAQ github.com/coreos/etcd v3.3.17+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= github.com/coreos/go-oidc v2.1.0+incompatible h1:sdJrfw8akMnCuUlaZU3tE/uYXFgfqom8DBE9so9EBsM= github.com/coreos/go-oidc v2.1.0+incompatible/go.mod h1:CgnwVTmzoESiwO9qyAFEMiHoZ1nMCKZlZ9V6mm3/LKc= +github.com/coreos/go-semver v0.3.0 h1:wkHLiw0WNATZnSG7epLsujiMCgPAc9xhjJ4tgnAxmfM= github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/coreos/go-systemd v0.0.0-20190719114852-fd7a80b32e1f h1:JOrtw2xFKzlg+cbHpyrpLDmnN1HqhBfnX7WDiW7eG2c= github.com/coreos/go-systemd v0.0.0-20190719114852-fd7a80b32e1f/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= @@ -159,6 +162,7 @@ github.com/dave/jennifer v1.2.0/go.mod h1:fIb+770HOpJ2fmN9EPPKOqm1vMGhB+TwXKMZhr 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/daviddengcn/go-colortext v0.0.0-20160507010035-511bcaf42ccd/go.mod h1:dv4zxwHi5C/8AeI+4gX4dCWOIvNi7I6JCSX0HvlKPgE= +github.com/deckarep/golang-set v1.7.1 h1:SCQV0S6gTtp6itiFrTqI+pfmJ4LN85S1YzhDf9rTHJQ= github.com/deckarep/golang-set v1.7.1/go.mod h1:93vsz/8Wt4joVM7c2AVqh+YRMiUSc14yDtF28KmMOgQ= github.com/deislabs/oras v0.7.0/go.mod h1:sqMKPG3tMyIX9xwXUBRLhZ24o+uT4y6jgBD2RzUTKDM= github.com/denisenkom/go-mssqldb v0.0.0-20190204142019-df6d76eb9289/go.mod h1:xN/JuLBIz4bjkxNmByTiV1IbhfnYb6oo99phBn4Eqhc= @@ -167,7 +171,6 @@ github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZm github.com/dgryski/go-bitstream v0.0.0-20180413035011-3522498ce2c8/go.mod h1:VMaSuZ+SZcx/wljOQKvp5srsbCiKDEb6K2wC4+PiBmQ= github.com/dgryski/go-sip13 v0.0.0-20190329191031-25c5027a8c7b/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= github.com/dhui/dktest v0.3.0/go.mod h1:cyzIUfGsBEbZ6BT7tnXqAShHSXCZhSNmFl70sZ7c1yc= -github.com/disintegration/imaging v1.6.1/go.mod h1:xuIt+sRxDFrHS0drzXUlCJthkJ8k7lkkUojDSR247MQ= github.com/docker/cli v0.0.0-20190506213505-d88565df0c2d h1:qdD+BtyCE1XXpDyhvn0yZVcZOLILdj9Cw4pKu0kQbPQ= github.com/docker/cli v0.0.0-20190506213505-d88565df0c2d/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= github.com/docker/distribution v2.7.1+incompatible h1:a5mlkVzth6W5A4fOsS3D2EO5BUmsJpcB+cRlLU7cSug= @@ -186,6 +189,7 @@ github.com/docker/libtrust v0.0.0-20160708172513-aabc10ec26b7/go.mod h1:cyGadeNE github.com/docker/spdystream v0.0.0-20181023171402-6480d4af844c h1:ZfSZ3P3BedhKGUhzj7BQlPSU4OvT6tfOKe3DVHzOA7s= github.com/docker/spdystream v0.0.0-20181023171402-6480d4af844c/go.mod h1:Qh8CwZgvJUkLughtfhJv5dyTYa91l1fOUCrgjqmcifM= github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE= +github.com/dustin/go-humanize v1.0.0 h1:VSnTsYCnlFHaM2/igO1h6X3HA71jcobQuxemgkq4zYo= github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= github.com/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs= github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU= @@ -201,7 +205,9 @@ github.com/elastic/go-elasticsearch/v7 v7.3.0 h1:H29Nqf9cB9dVxX6LwS+zTDC2D4t9s+8 github.com/elastic/go-elasticsearch/v7 v7.3.0/go.mod h1:OJ4wdbtDNk5g503kvlHLyErCgQwwzmDtaFC4XyOxXA4= github.com/elastic/go-sysinfo v1.1.1/go.mod h1:i1ZYdU10oLNfRzq4vq62BEwD2fH8KaWh6eh0ikPT9F0= github.com/elastic/go-windows v1.0.1/go.mod h1:FoVvqWSun28vaDQPbj2Elfc0JahhPB7WQEGa3c814Ss= +github.com/elazarl/goproxy v0.0.0-20200315184450-1f3cb6622dad h1:zPs0fNF2Io1Qytf92EI2CDJ9oCXZr+NmjEVexrUEdq4= github.com/elazarl/goproxy v0.0.0-20200315184450-1f3cb6622dad/go.mod h1:Ro8st/ElPeALwNFlcTpWmkr6IoMFfkjXAvTHpevnDsM= +github.com/elazarl/goproxy/ext v0.0.0-20190711103511-473e67f1d7d2 h1:dWB6v3RcOy03t/bUadywsbyrQwCqZeNIEX6M1OtSZOM= github.com/elazarl/goproxy/ext v0.0.0-20190711103511-473e67f1d7d2/go.mod h1:gNh8nYJoAm43RfaxurUnxr+N1PwuFV3ZMl/efxlIlY8= github.com/ema/qdisc v0.0.0-20190904071900-b82c76788043/go.mod h1:ix4kG2zvdUd8kEKSW0ZTr1XLks0epFpI4j745DXxlNE= github.com/emicklei/go-restful v2.14.3+incompatible h1:i59XyRHAxKCVBw3vHzQlpP/+pi89wH1v1HL+RKyVgxk= @@ -212,7 +218,6 @@ github.com/emirpasic/gods v1.12.0 h1:QAUIPSaCu4G+POclxeqb3F+WPpdKqFGlw36+yOzGlrg github.com/emirpasic/gods v1.12.0/go.mod h1:YfzfFFoVP/catgzJb4IKIqXjX78Ha8FMSDh3ymbK86o= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/erikstmartin/go-testdb v0.0.0-20160219214506-8d10e4a1bae5/go.mod h1:a2zkGnVExMxdzMo3M0Hi/3sEU+cWnZpSni0O6/Yb/P0= github.com/evanphx/json-patch v4.9.0+incompatible h1:kLcOMZeuLAJvL2BPWLMIj5oaZQobrkAqrL+WFZwQses= github.com/evanphx/json-patch v4.9.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/evanphx/json-patch/v5 v5.0.0/go.mod h1:G79N1coSVB93tBe7j6PhzjmR3/2VvlbKOFpnXhI9Bw4= @@ -220,12 +225,14 @@ github.com/exponent-io/jsonpath v0.0.0-20151013193312-d6023ce2651d h1:105gxyaGwC github.com/exponent-io/jsonpath v0.0.0-20151013193312-d6023ce2651d/go.mod h1:ZZMPRZwes7CROmyNKgQzC3XPs6L/G2EJLHddWejkmf4= github.com/facette/natsort v0.0.0-20181210072756-2cd4dd1e2dcb/go.mod h1:bH6Xx7IW64qjjJq8M2u4dxNaBiDfKK+z/3eGDpXEQhc= github.com/fatih/camelcase v1.0.0/go.mod h1:yN2Sb0lFhZJUdVvtELVWefmrXpuZESvPmqwoZc+/fpc= +github.com/fatih/color v1.9.0 h1:8xPHl4/q1VyqGIPif1F+1V3Y3lSmrq01EabUW3CoW5s= github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU= github.com/fatih/structs v1.1.0 h1:Q7juDM0QtcnhCpeyLGQKyg4TOIghuNXrkL32pHAUMxo= github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= github.com/fatih/structtag v1.1.0/go.mod h1:mBJUNpUnHmRKrKlQQlmCrh5PuhftFbNv8Ys4/aAZl94= github.com/felixge/fgprof v0.9.1/go.mod h1:7/HK6JFtFaARhIljgP2IV8rJLIoHDoOYoUphsnGvqxE= github.com/felixge/httpsnoop v1.0.1/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= +github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568 h1:BHsljHzVlRcyQhjrss6TZTdY2VfCqZPbv5k3iBFa2ZQ= github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc= github.com/fogleman/gg v1.2.1-0.20190220221249-0403632d5b90/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k= github.com/franela/goblin v0.0.0-20200105215937-c9ffbefa60db/go.mod h1:7dvUGVsVBjqR7JHJk0brhHOZYGmfBYOrK0ZhYMEtBr4= @@ -236,8 +243,7 @@ github.com/fsouza/fake-gcs-server v1.7.0/go.mod h1:5XIRs4YvwNbNoz+1JF8j6KLAyDh7R github.com/garyburd/redigo v1.6.0/go.mod h1:NR3MbYisc3/PwhQ00EMzDiPmrwpPxAn5GI05/YaO1SY= github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= -github.com/gin-contrib/sse v0.0.0-20190301062529-5545eab6dad3/go.mod h1:VJ0WA2NBN22VlZ2dKZQPAPnyWw5XTlK1KymzLKsr59s= -github.com/gin-gonic/gin v1.4.0/go.mod h1:OW2EZn3DO8Ln9oIKOvM++LBO+5UPHJJDH72/q/3rZdM= +github.com/gliderlabs/ssh v0.1.1 h1:j3L6gSLQalDETeEg/Jg0mGY0/y/N6zI2xX1978P0Uqw= github.com/gliderlabs/ssh v0.1.1/go.mod h1:U7qILu1NlMHj9FlMhZLlkCdDnU1DBEAqr0aevW3Awn0= github.com/glycerine/go-unsnap-stream v0.0.0-20180323001048-9f0cb55181dd/go.mod h1:/20jfyN9Y5QPEAprSgKAUr+glWDY39ZiUEAYOEv5dsE= github.com/glycerine/goconvey v0.0.0-20190410193231-58a59202ab31/go.mod h1:Ogl1Tioa0aV7gstGFO7KhffUsb9M4ydbEbbxpcEDc24= @@ -249,8 +255,8 @@ github.com/go-logfmt/logfmt v0.5.0 h1:TrB8swr/68K7m9CcGut2g3UOihhbcbiMAYiuTXdEih github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= github.com/go-logr/logr v0.1.0 h1:M1Tv3VzNlEHg6uyACnRdtrploV2P7wZqH8BoQMtz0cg= github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas= +github.com/go-logr/zapr v0.1.1 h1:qXBXPDdNncunGs7XeEpsJt8wCjYBygluzfdLO0G5baE= github.com/go-logr/zapr v0.1.1/go.mod h1:tabnROwaDl0UNxkVeFRbY8bwB37GwRv0P8lg6aAiEnk= -github.com/go-ole/go-ole v1.2.1/go.mod h1:7FAglXiTm7HKlQRDeOQ6ZNUHidzCWXuZWq/1dTyBNF8= 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.19.4 h1:fSGwO1tSYHFu70NKaWJt5Qh0qoBRtCm/mXS1yhf+0W0= @@ -282,6 +288,7 @@ github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/me github.com/gobuffalo/attrs v0.0.0-20190224210810-a9411de4debd/go.mod h1:4duuawTqi2wkkpB4ePgWMaai6/Kc6WEz83bhFwpHzj0= github.com/gobuffalo/depgen v0.1.0/go.mod h1:+ifsuy7fhi15RWncXQQKjWS9JPkdah5sZvtHc2RXGlg= github.com/gobuffalo/envy v1.7.0/go.mod h1:n7DRkBerg/aorDM8kbduw5dN3oXGswK5liaSCx4T5NI= +github.com/gobuffalo/flect v0.2.0 h1:EWCvMGGxOjsgwlWaP+f4+Hh6yrrte7JeFL2S6b+0hdM= github.com/gobuffalo/flect v0.2.0/go.mod h1:W3K3X9ksuZfir8f/LrfVtWmCDQFfayuylOJ7sz/Fj80= 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= @@ -339,7 +346,6 @@ github.com/google/go-querystring v1.0.0 h1:Xkwi/a1rcvNg1PPYe5vI8GbeBY/jrVuDX5ASu github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= github.com/google/gofuzz v1.1.0 h1:Hsa8mG0dQ46ij8Sl2AYJDUv1oA9/d6Vk+3LG99Oe02g= github.com/google/gofuzz v1.1.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/google/gops v0.3.6/go.mod h1:RZ1rH95wsAGX4vMWKmqBOIWynmWisBf4QFdgT/k/xOI= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= github.com/google/pprof v0.0.0-20200417002340-c6e0a841f49a/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= @@ -353,12 +359,14 @@ github.com/gophercloud/gophercloud v0.10.0/go.mod h1:gmC5oQqMDOMO1t1gq5DquX/yAU8 github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= github.com/gorilla/handlers v1.4.0/go.mod h1:Qkdc/uu4tH4g6mTK6auzZ766c4CA0Ng8+o/OAirnOIQ= +github.com/gorilla/mux v1.7.3 h1:gnP5JzjVOuiZD07fKKToCAOjS0yOpj/qPETTXCCS6hw= github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= github.com/gorilla/websocket v1.4.1 h1:q7AeDBpnBk8AogcD4DSag/Ukw/KV+YhzLj2bP5HvKCM= github.com/gorilla/websocket v1.4.1/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/gosuri/uitable v0.0.1/go.mod h1:tKR86bXuXPZazfOTG1FIzvjIdXzd0mo4Vtn16vt0PJo= github.com/gregjones/httpcache v0.0.0-20181110185634-c63ab54fda8f h1:ShTPMJQes6tubcjzGMODIVG5hlrCeImaBnZzKF2N8SM= github.com/gregjones/httpcache v0.0.0-20181110185634-c63ab54fda8f/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= +github.com/grpc-ecosystem/go-grpc-middleware v1.1.0 h1:THDBEeQ9xZ8JEaCLyLQqXMMdRqNr0QAUJTIkQAUtFjg= github.com/grpc-ecosystem/go-grpc-middleware v1.1.0/go.mod h1:f5nM7jw/oeRSadq3xCzHAvxcr8HZnzsqU6ILg/0NiiE= github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 h1:Ovs26xHkKqVztRpIrF/92BcuyuQ/YW4NSIpoGtfXNho= github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= @@ -394,6 +402,7 @@ github.com/hudl/fargo v1.3.0/go.mod h1:y3CKSmjA+wD2gak7sUSXTAoopbhU08POFhmITJgmK github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/imdario/mergo v0.3.9 h1:UauaLniWCFHWd+Jp9oCEkTBj8VO/9DKg3PV3VCNMDIg= github.com/imdario/mergo v0.3.9/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= +github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/influxdata/flux v0.65.0/go.mod h1:BwN2XG2lMszOoquQaFdPET8FRQfrXiZsWmcMO9rkaVY= github.com/influxdata/influxdb v1.8.0/go.mod h1:SIzcnsjaHRFpmlxpJ4S3NT64qtEKYweNTUMb/vh0OMQ= @@ -409,14 +418,12 @@ github.com/jackc/pgx v3.2.0+incompatible/go.mod h1:0ZGrqGqkRlliWnWB4zKnWtjbSWbGk github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 h1:BQSFePA1RWJOlocH6Fxy8MmwDt+yVQYULKfN0RoTN8A= github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99/go.mod h1:1lJo3i6rXxKeerYnT8Nvf0QmHCRC1n8sfWVwXF2Frvo= github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= -github.com/jinzhu/gorm v1.9.2/go.mod h1:Vla75njaFJ8clLU1W44h34PjIkijhjHIYnZxMqCdxqo= -github.com/jinzhu/inflection v0.0.0-20180308033659-04140366298a/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc= -github.com/jinzhu/now v1.0.0/go.mod h1:oHTiXerJ20+SfYcrdlBO7rzZRJWGwSTQ0iUY2jI6Gfc= github.com/jmespath/go-jmespath v0.3.0 h1:OS12ieG61fsCg5+qLJ+SsW9NicxNkg3b25OyT2yCeUc= github.com/jmespath/go-jmespath v0.3.0/go.mod h1:9QtRXoHjLGCJ5IBSaohpXITPlowMeeYCZ7fLUTSywik= github.com/jmoiron/sqlx v1.2.0/go.mod h1:1FEQNm3xlJgrMD+FBdI9+xvCksHtbpVBBw5dYhBSsks= github.com/joeshaw/multierror v0.0.0-20140124173710-69b34d4ec901/go.mod h1:Z86h9688Y0wesXCyonoVr47MasHilkuLMqGhRZ4Hpak= github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg= +github.com/jonboulle/clockwork v0.1.0 h1:VKV+ZcuP6l3yW9doeqz6ziZGgcynBVQO+obU0+0hcPo= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= github.com/jsimonetti/rtnetlink v0.0.0-20200117123717-f846d4f6c1f4/go.mod h1:WGuG/smIU4J/54PblvSbh+xvCZmpJnFgr3ds6Z55XMQ= @@ -432,10 +439,10 @@ github.com/jung-kurt/gofpdf v1.0.3-0.20190309125859-24315acbbda5/go.mod h1:7Id9E github.com/jwilder/encoding v0.0.0-20170811194829-b4e1701a28ef/go.mod h1:Ct9fl0F6iIOGgxJ5npU/IUOhOhqlVrGjyIZc8/MagT0= github.com/kardianos/osext v0.0.0-20170510131534-ae77be60afb1/go.mod h1:1NbS8ALrpOvjt0rHPNLyCIeMtbizbir8U//inJ+zuB8= github.com/karrick/godirwalk v1.10.3/go.mod h1:RoGL9dQei4vP9ilrpETWE8CLOZ1kiN0LhBygSwrAsHA= +github.com/kelseyhightower/envconfig v1.4.0 h1:Im6hONhd3pLkfDFsbRgu68RDNkGF1r3dvMUtDTo2cv8= github.com/kelseyhightower/envconfig v1.4.0/go.mod h1:cccZRl6mQpaq41TPp5QxidR+Sa3axMbJDNb//FQX6Gg= github.com/kevinburke/ssh_config v0.0.0-20180830205328-81db2a75821e h1:RgQk53JHp/Cjunrr1WlsXSZpqXn+uREuHvUVcK82CV8= github.com/kevinburke/ssh_config v0.0.0-20180830205328-81db2a75821e/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM= -github.com/keybase/go-ps v0.0.0-20161005175911-668c8856d999/go.mod h1:hY+WOq6m2FpbvyrI93sMaypsttvaIL5nhVR92dTMUcQ= 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/compress v1.9.5/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= @@ -443,10 +450,12 @@ github.com/klauspost/cpuid v0.0.0-20170728055534-ae7887de9fa5/go.mod h1:Pj4uuM52 github.com/klauspost/crc32 v0.0.0-20161016154125-cb6bfca970f6/go.mod h1:+ZoRqAPRLkC4NPOvfYeR5KNOrY6TD+/sAC3HXPZgDYg= github.com/klauspost/pgzip v1.0.2-0.20170402124221-0bf5dcad4ada/go.mod h1:Ch1tH69qFZu15pkjo5kYi6mth2Zzwzt50oCQKQE9RUs= github.com/knq/sysutil v0.0.0-20191005231841-15668db23d08/go.mod h1:dFWs1zEqDjFtnBXsd1vPOZaLsESovai349994nHx3e0= -github.com/koding/multiconfig v0.0.0-20171124222453-69c27309b2d7/go.mod h1:Y2SaZf2Rzd0pXkLVhLlCiAXFCLSXAIbTKDivVgff/AM= +github.com/konsorten/go-windows-terminal-sequences v1.0.2 h1:DB17ag19krx9CFsz4o3enTrPXyIXCl+2iCXH/aMAp9s= github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/kr/pretty v0.2.0 h1:s5hAObm+yFO5uHYt5dYjxi2rXrsnmRpJx4OYvIWUaQs= github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pty v1.1.5/go.mod h1:9r2w37qlBe7rQ6e1fg1S/9xpWHSnaqNdHD3WcMdbPDA= +github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kshvakov/clickhouse v1.3.5/go.mod h1:DMzX7FxRymoNkVgizH0DWAL8Cur7wHLgx3MUnGwJqpE= github.com/kubernetes-csi/external-snapshotter/client/v3 v3.0.0 h1:OYDCOjVcx/5wNzlZ/At8otRibUlw0T6R0xOD31f32bw= @@ -456,6 +465,7 @@ github.com/kubesphere/sonargo v0.0.2/go.mod h1:ww8n9ANlDXhX5PBZ18iaRnCgEkXN0GMml github.com/kylelemons/godebug v0.0.0-20160406211939-eadb3ce320cb/go.mod h1:B69LEHPfb2qLo0BaaOLcbitczOKLWTsrBG9LczfCD4k= github.com/leanovate/gopter v0.2.4/go.mod h1:gNcbPWNEWRe4lm+bycKqxUYoH5uoVje5SkOJ3uoLer8= github.com/leodido/go-urn v0.0.0-20181204092800-a67a23e1c1af/go.mod h1:+cyI34gQWZcE1eQU7NVgKkkzdXDQHr1dBMtdAPozLkw= +github.com/lib/pq v1.2.0 h1:LXpIM/LZ5xGFhOpXAQUIMM1HdyqzVYM13zNdjCEEcA0= github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de h1:9TO3cAIGXtEhnIaL+V+BEER86oLrvS+kWobKpbJuye0= github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de/go.mod h1:zAbeS9B/r2mtpb6U+EI2rYA5OAXxsYw6wTamcNW+zcE= @@ -470,12 +480,15 @@ 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/mattn/go-colorable v0.1.6 h1:6Su7aK7lXmJ/U79bYtBjLNaha4Fs1Rg9plHpcH+vvnE= github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-ieproxy v0.0.0-20191113090002-7c0f6868bffe/go.mod h1:pYabZ6IHcRpFh7vIaLfK7rdcWgFEb3SFJ6/gNWuh88E= +github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-oci8 v0.0.7/go.mod h1:wjDx6Xm9q7dFtHJvIlrI99JytznLw5wQ4R+9mNXJwGI= github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= github.com/mattn/go-shellwords v1.0.5/go.mod h1:3xCvwCdWdlDJUrvuMn7Wuy9eWs4pE8vqg+NOMyg4B2o= +github.com/mattn/go-sqlite3 v1.11.0 h1:LDdKkqtYlom37fkvqs8rMPFKAMe8+SgjbwZ6ex1/A/Q= github.com/mattn/go-sqlite3 v1.11.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= github.com/mattn/go-tty v0.0.0-20180907095812-13ff1204f104/go.mod h1:XPvLUNfbS4fJH25nqRHfWLMa1ONC8Amw+mIA639KxkE= github.com/mattn/go-xmlrpc v0.0.3/go.mod h1:mqc2dz7tP5x5BKlCahN/n+hs7OSZKJkS9JsHNBRlrxA= @@ -506,6 +519,7 @@ github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJ 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/morikuni/aec v0.0.0-20170113033406-39771216ff4c h1:nXxl5PrvVm2L/wCy8dQu6DMTwH4oIuGN8GJDAlqDdVE= github.com/morikuni/aec v0.0.0-20170113033406-39771216ff4c/go.mod h1:BbKIizmSmc5MMPqRYbxO4ZU0S0+P200+tUnFx7PXmsc= github.com/mozillazg/go-cos v0.13.0/go.mod h1:Zp6DvvXn0RUOXGJ2chmWt2bLEqRAnJnS3DnAZsJsoaE= github.com/mozillazg/go-httpheader v0.2.1/go.mod h1:jJ8xECTlalr6ValeXYdOF8fFUISeBAdw6E61aqQma60= @@ -576,8 +590,11 @@ github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndr github.com/pquerna/cachecontrol v0.0.0-20171018203845-0dec1b30a021 h1:0XM1XL/OFFJjXsYXlG30spTkV/E9+gmd5GD1w2HE8xM= github.com/pquerna/cachecontrol v0.0.0-20171018203845-0dec1b30a021/go.mod h1:prYjPmNq4d1NPVmpShWobRqXY3q7Vp+80DqgxxUrUIA= github.com/pquerna/ffjson v0.0.0-20190813045741-dac163c6c0a9/go.mod h1:YARuvh7BUWHNhzDq2OM5tzR2RiCcN2D7sapiKyCel/M= +github.com/projectcalico/go-json v0.0.0-20161128004156-6219dc7339ba h1:aaF2byUCZhzszHsfPEr2M3qcU4ibtD/yk/il2R7T1PU= github.com/projectcalico/go-json v0.0.0-20161128004156-6219dc7339ba/go.mod h1:q8EdCgBdMQzgiX/uk4GXLWLk+gIHd1a7mWUAamJKDb4= +github.com/projectcalico/go-yaml v0.0.0-20161201183616-955bc3e451ef h1:Di9BaA9apb6DEstin8RdhKmlzQG76UMbmjPzjCVkMpc= github.com/projectcalico/go-yaml v0.0.0-20161201183616-955bc3e451ef/go.mod h1:1Ra2BftSa7Go38Gbq1q0bfmBFSSgUv+Cdc3SY8IL/C0= +github.com/projectcalico/go-yaml-wrapper v0.0.0-20161127220527-598e54215bee h1:yVWsNSlAuYoJ0CznHsYRPiFgsotoj07k00k5rQvGlHM= github.com/projectcalico/go-yaml-wrapper v0.0.0-20161127220527-598e54215bee/go.mod h1:UgC0aTQ2KMDxlX3lU/stndk7DMUBJqzN40yFiILHgxc= github.com/projectcalico/kube-controllers v3.8.8+incompatible h1:ZbCg0wJ+gd7i81CB6vOASiUN//oR4ZBl+wEdy0Vk1uI= github.com/projectcalico/kube-controllers v3.8.8+incompatible/go.mod h1:ZEafKeKN5wiNARRw1LZP8l10uEfp04C7redU848MMZw= @@ -606,7 +623,6 @@ github.com/rafaeljusto/redigomock v0.0.0-20190202135759-257e089e14a1/go.mod h1:J github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a h1:9ZKAASQSHhDYGoxY8uLVpewe1GDZ2vu2Tr/vTdVAkFQ= github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= github.com/retailnext/hllpp v1.0.1-0.20180308014038-101a6d2f8b52/go.mod h1:RDpi1RftBQPUCDRw6SmxeaREsAaRKnOclghuzp/WRzc= -github.com/robfig/cron v1.2.0/go.mod h1:JGuDeoQd7Z6yL4zQhZ3OPEVHB7fL6Ka6skscFHfmt2k= github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= github.com/rogpeppe/go-charset v0.0.0-20180617210344-2471d30d28b4/go.mod h1:qgYeAmZ5ZIpBWTGllZSQnw97Dj+woV0toclVaRGI8pc= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= @@ -624,8 +640,6 @@ github.com/segmentio/kafka-go v0.2.0/go.mod h1:X6itGqS9L4jDletMsxZ7Dz+JFWxM6JHfP github.com/sercand/kuberesolver v2.4.0+incompatible/go.mod h1:lWF3GL0xptCB/vCiJPl/ZshwPsX/n4Y7u0CW9E7aQIQ= github.com/sergi/go-diff v1.0.0 h1:Kpca3qRNrduNnOQeazBd0ysaKrUJiIuISHxogkT9RPQ= github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= -github.com/shirou/gopsutil v0.0.0-20180427012116-c95755e4bcd7/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA= -github.com/shirou/w32 v0.0.0-20160930032740-bb4de0191aa4/go.mod h1:qsXQc7+bwAM3Q1u/4XEfrquwF8Lw7D7y5cD8CuHnfIc= github.com/shopspring/decimal v0.0.0-20180709203117-cd690d0c9e24/go.mod h1:M+9NzErvs504Cn4c5DxATwIqPbtswREoFCre64PpcG4= github.com/shurcooL/httpfs v0.0.0-20190707220628-8d4bc4ba7749/go.mod h1:ZY1cvUeJuFPAdZ/B6v7RHavJWZn2YPVFQ1OSXhCGOkg= github.com/shurcooL/vfsgen v0.0.0-20181202132449-6a9ea43bcacd/go.mod h1:TrYk7fJVaAttu97ZZKrO9UbRa8izdowaMIZcxYMbVaw= @@ -634,11 +648,13 @@ github.com/sirupsen/logrus v1.4.2 h1:SPIRibHv4MatM3XXNO2BJeFLZwZ2LvZgfQ5+UNI2im4 github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= +github.com/soheilhy/cmux v0.1.4 h1:0HKaf1o97UwFjHH9o5XsHUOF+tqmdA7KEzXLpiyaw0E= github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= github.com/sony/gobreaker v0.4.1/go.mod h1:ZKptC7FHNvhBz7dN2LGjPVBz2sZJmc0/PkyDJOjmxWY= github.com/sony/sonyflake v0.0.0-20181109022403-6d5bd6181009 h1:3wBL/e/qjpSYaXacpbIV+Bsj/nwQ4UO1llG/av54zzw= github.com/sony/sonyflake v0.0.0-20181109022403-6d5bd6181009/go.mod h1:dVvZuWJd174umvm5g8CmZD6S2GWwHKtpK/0ZPHswuNo= github.com/soundcloud/go-runit v0.0.0-20150630195641-06ad41a06c4a/go.mod h1:LeFCbQYJ3KJlPs/FvPz2dy1tkpxyeNESVyCNNzRXFR0= +github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72 h1:qLC7fQah7D6K1B0ujays3HV9gkFtllcxhzImRR7ArPQ= github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/speps/go-hashids v2.0.0+incompatible h1:kSfxGfESueJKTx0mpER9Y/1XHl+FVQjtCqRyYcviFbw= github.com/speps/go-hashids v2.0.0+incompatible/go.mod h1:P7hqPzMdnZOfyIk+xrlG1QaSMw+gCBdHKsBDnhpaZvc= @@ -659,10 +675,13 @@ github.com/src-d/gcfg v1.4.0/go.mod h1:p/UMsR43ujA89BJY9duynAwIpvqEujIH/jFlfL7jW github.com/streadway/amqp v0.0.0-20190827072141-edfb9018d271/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= github.com/streadway/handy v0.0.0-20190108123426-d5acb3125c2a/go.mod h1:qNTQ5P5JnDBl6z3cMAg/SywNDC5ABu5ApDIw6lUbRmI= github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= +github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/thanos-io/thanos v0.13.1-0.20200910143741-e0b7f7b32e9c/go.mod h1:1IzeMKiS+pvxbG2M6ZJyi8ZHaAQKXNjDbP2gjhPbSXE= +github.com/tidwall/pretty v1.0.0 h1:HsD+QiTn7sK6flMKIvNmpqz1qrpP3Ps6jOKIKMooyg4= github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= github.com/tinylib/msgp v1.1.0/go.mod h1:+d+yLhGm8mzTaHzB+wgMYrodPfmZrzkirds8fDWklFE= +github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5 h1:LnC5Kc/wtumK+WB441p7ynQJzVuNRJiqddSIE3IlSEQ= github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM= github.com/uber/jaeger-client-go v2.23.0+incompatible h1:o2g11IUBdEsSZVzF3k7+bahLmxRP/dbOoW4zQ30UlKE= @@ -670,7 +689,6 @@ github.com/uber/jaeger-client-go v2.23.0+incompatible/go.mod h1:WVhlPFC8FDjOFMMW github.com/uber/jaeger-lib v2.2.0+incompatible h1:MxZXOiR2JuoANZ3J6DE/U0kSFv/eJ/GfSYVCjK7dyaw= github.com/uber/jaeger-lib v2.2.0+incompatible/go.mod h1:ComeNDZlWwrWnDv8aPp0Ba6+uUTzImX/AauajbLI56U= github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc= -github.com/ugorji/go/codec v0.0.0-20190128213124-ee1426cffec0/go.mod h1:iT03XoTwV7xq/+UGwKO3UbC1nNNlopQiY61beSdrtOA= github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= github.com/vektah/gqlparser v1.1.2/go.mod h1:1ycwN7Ij5njmMkPPAOaRFY4rET2Enx7IkVv3vaXspKw= github.com/weaveworks/common v0.0.0-20200820123129-280614068c5e/go.mod h1:hz10LOsAdzC3K/iXaKoFxOKTDRgxJl+BTGX1GY+TzO4= @@ -685,6 +703,7 @@ github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2 github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ= github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y= github.com/xenolf/lego v0.3.2-0.20160613233155-a9d8cec0e656/go.mod h1:fwiGnfsIjG7OHPfOvgK7Y/Qo6+2Ox0iozjNTkZICKbY= +github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2 h1:eY9dn8+vbi4tKz5Qo6v2eYzo7kUS51QINcR5jNpbZS8= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= github.com/xlab/handysort v0.0.0-20150421192137-fb3537ed64a1/go.mod h1:QcJo0QPSfTONNIgpN5RA8prR7fF8nkF6cTWTcNerRO8= github.com/xlab/treeprint v0.0.0-20180616005107-d6fb6747feb6/go.mod h1:ce1O1j6UtZfjr22oyGxGLbauSBp2YVXpARAosm7dHBg= @@ -700,6 +719,7 @@ go.elastic.co/apm v1.5.0/go.mod h1:OdB9sPtM6Vt7oz3VXt7+KR96i9li74qrxBGHTQygFvk= go.elastic.co/apm/module/apmhttp v1.5.0/go.mod h1:1FbmNuyD3ddauwzgVwFB0fqY6KbZt3JkV187tGCYYhY= go.elastic.co/apm/module/apmot v1.5.0/go.mod h1:d2KYwhJParTpyw2WnTNy8geNlHKKFX+4oK3YLlsesWE= go.elastic.co/fastjson v1.0.0/go.mod h1:PmeUOMMtLHQr9ZS9J9owrAVg0FkaZDRZJEFTTGHtchs= +go.etcd.io/bbolt v1.3.3 h1:MUGmc65QhB3pIlaQ5bB4LwqSj6GIonVJXpZiaKNyaKk= go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.etcd.io/etcd v0.0.0-20191023171146-3cf2f69b5738 h1:VcrIfasaLFkyjk6KNlXQSzO+B0fZcnECiDrKJsfxka0= go.etcd.io/etcd v0.0.0-20191023171146-3cf2f69b5738/go.mod h1:dnLIgRNXwCJa5e+c6mIZCrds/GIG4ncV9HhK5PX7jPg= @@ -712,6 +732,7 @@ go.uber.org/automaxprocs v1.2.0/go.mod h1:YfO3fm683kQpzETxlTGZhGIVmXAhaw3gxeBADb go.uber.org/goleak v1.1.0/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A= go.uber.org/multierr v1.3.0 h1:sFPn2GLc3poCkfrpIXGhBD2X0CMIo4Q/zSULXrj/+uc= go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= +go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee h1:0mgffUl7nfd+FpvXMVz4IDEaUSmT1ysygQC7qYo7sG4= go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= go.uber.org/zap v1.13.0 h1:nR6NoDBgAf67s68NhaXbsojM+2gxp3S1hWkHDl27pVU= go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= @@ -719,6 +740,7 @@ golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9 h1:psW17arqaxU48Z5kZ0CQnk golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/image v0.0.0-20180708004352-c73c2afc3b81/go.mod h1:ux5Hcp/YLpHSI86hEcLt0YII63i6oz57MZXIpbrjZUs= +golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f h1:hX65Cu3JDlGH3uEdK7I99Ii+9kjD6mvnnpfLdEAH0x4= golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/net v0.0.0-20190620200207-3b0461eec859 h1:R/3boaszxrf1GEUWTVDzSKVwLmSJpwZ1yqXm8j0v2QI= @@ -733,6 +755,7 @@ golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4 h1:SvFZT6jyqRaOeXpc5h/JSfZenJ2O330aBsf7JfSUXmQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/tools v0.0.0-20190710153321-831012c29e42 h1:4IOeC7p+OItq3+O5BWkcmVu2uBe3jekXau5S4QZX9DU= golang.org/x/tools v0.0.0-20190710153321-831012c29e42/go.mod h1:jcCCGcm9btYwXyDqrUWc6MKQKKGJCWEQ3AfLSRIbEuI= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7 h1:9zdDQZ7Thm29KFXgAX/+yaf3eVbP7djjWp/dXAppNCc= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -742,6 +765,7 @@ gonum.org/v1/gonum v0.6.0/go.mod h1:9mxDZsDKxgMAuccQkewq682L+0eCu4dCN2yonUJTCLU= gonum.org/v1/netlib v0.0.0-20190313105609-8cb42192e0e0/go.mod h1:wa6Ws7BG/ESfp6dHfk7C6KdzKA7wR7u/rKwOGE66zvw= gonum.org/v1/plot v0.0.0-20190515093506-e2840ee46a6b/go.mod h1:Wt8AAjI+ypCyYX3nZBvf6cAIx93T+c/OS2HFAYskSZc= google.golang.org/api v0.22.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/appengine v1.6.6 h1:lMO5rYAqUxkmaj76jAkRUvt5JZgFymx/+Q5Mzfivuhc= google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/genproto v0.0.0-20200420144010-e5e8543f8aeb h1:nAFaltAMbNVA0rixtwvdnqgSVLX3HFUUvMkEklmzbYM= google.golang.org/genproto v0.0.0-20200420144010-e5e8543f8aeb/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= @@ -752,7 +776,6 @@ google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2 gopkg.in/airbrake/gobrake.v2 v2.0.9/go.mod h1:/h5ZAUhDkGaJfjzjKLSjv6zCL6O0LLBxU4K+aSYdM/U= gopkg.in/alecthomas/kingpin.v2 v2.2.6 h1:jMFz6MfLP0/4fUyZle81rXUoxOBFi19VUFKVDOQfozc= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= -gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc/go.mod h1:m7x9LTH6d71AHyAX77c9yqWCCa3UKHcVEj9y7hAtKDk= gopkg.in/asn1-ber.v1 v1.0.0-20181015200546-f715ec2f112d h1:TxyelI5cVkbREznMhfzycHdkp5cLA7DpE+GKjSslYhM= gopkg.in/asn1-ber.v1 v1.0.0-20181015200546-f715ec2f112d/go.mod h1:cuepJuh7vyXfUyUwEgHQXw849cJrilpS5NeIjOWESAw= gopkg.in/cas.v2 v2.2.0 h1:P9mMBcXS1IH04uNio9M2VVJwrovGDf3D9trxXPXRoE8= @@ -766,14 +789,11 @@ gopkg.in/fsnotify/fsnotify.v1 v1.4.7/go.mod h1:Fyux9zXlo4rWoMSIzpn9fDAYjalPqJ/K1 gopkg.in/gcfg.v1 v1.2.3/go.mod h1:yesOnuUOFQAhST5vPY4nbZsb/huCgGGXlipJsBn0b3o= gopkg.in/gemnasium/logrus-airbrake-hook.v2 v2.1.2/go.mod h1:Xk6kEKp8OKb+X14hQBKWaSkCsqBpgog8nAV2xsGOxlo= gopkg.in/go-playground/assert.v1 v1.2.1/go.mod h1:9RXL0bg/zibRAgZUYszZSwO/z8Y/a8bDuhia5mkpMnE= -gopkg.in/go-playground/validator.v8 v8.18.2/go.mod h1:RX2a/7Ha8BgOhfk7j780h4/u/RRjR0eouCJSH80/M2Y= gopkg.in/go-playground/validator.v9 v9.27.0/go.mod h1:+c9/zcJMFNgbLvly1L1V+PpxWdVbfP1avr/N00E2vyQ= -gopkg.in/gomail.v2 v2.0.0-20160411212932-81ebce5c23df/go.mod h1:LRQQ+SO6ZHR7tOkpBDuZnXENFzX8qRjMDMyPD6BRkCw= gopkg.in/gorp.v1 v1.7.2/go.mod h1:Wo3h+DBQZIxATwftsglhdD/62zRFPhGhTiu5jUJmCaw= gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= gopkg.in/ini.v1 v1.57.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= -gopkg.in/mail.v2 v2.3.1/go.mod h1:htwXN1Qh09vZJ1NVKxQqHPBaCBbzKhp5GzuJEA4VJWw= gopkg.in/natefinch/lumberjack.v2 v2.0.0 h1:1Lc07Kr7qY4U2YPouBjpCLxpiyxIVoxqXgkXLknAOE8= gopkg.in/natefinch/lumberjack.v2 v2.0.0/go.mod h1:l0ndWWf7gzL7RNwBG7wST/UCcT4T24xpD6X8LsfU/+k= gopkg.in/square/go-jose.v1 v1.1.2/go.mod h1:QpYS+a4WhS+DTlyQIi6Ka7MS3SuR9a055rgXNEe6EiA= @@ -781,6 +801,7 @@ gopkg.in/square/go-jose.v2 v2.4.0 h1:0kXPskUMGAXXWJlP05ktEMOV0vmzFQUWw6d+aZJQU8A gopkg.in/square/go-jose.v2 v2.4.0/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= gopkg.in/src-d/go-billy.v4 v4.3.0 h1:KtlZ4c1OWbIs4jCv5ZXrTqG8EQocr0g/d4DjNg70aek= gopkg.in/src-d/go-billy.v4 v4.3.0/go.mod h1:tm33zBoOwxjYHZIE+OV8bxTWFMJLrconzFMd38aARFk= +gopkg.in/src-d/go-git-fixtures.v3 v3.1.1 h1:XWW/s5W18RaJpmo1l0IYGqXKuJITWRFuA45iOf1dKJs= gopkg.in/src-d/go-git-fixtures.v3 v3.1.1/go.mod h1:dLBcvytrw/TYZsNTWCnkNF2DSIlzWYqTe3rJR56Ac7g= gopkg.in/src-d/go-git.v4 v4.11.0 h1:cJwWgJ0DXifrNrXM6RGN1Y2yR60Rr1zQ9Q5DX5S9qgU= gopkg.in/src-d/go-git.v4 v4.11.0/go.mod h1:Vtut8izDyrM8BUVQnzJ+YvmNcem2J89EmfZYCkLokZk= @@ -793,9 +814,11 @@ gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gotest.tools v2.2.0+incompatible h1:VsBPFP1AI068pPrMxtb/S8Zkgf9xEmTLJjfM+P5UIEo= gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw= helm.sh/helm/v3 v3.3.0 h1:7BUpW5NI1pauKDnIh0ju53pNc3Ra/UyqqBr0b5OgBwY= helm.sh/helm/v3 v3.3.0/go.mod h1:cWRDbGk4EiIL0/+jN0GI8T7m96Cps81/ta1kcacl85g= +honnef.co/go/tools v0.0.1-2020.1.3 h1:sXmLre5bzIR6ypkjXCDI3jHPssRhc8KD/Ome589sc3U= honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= howett.net/plist v0.0.0-20181124034731-591f970eefbb/go.mod h1:vMygbs4qMhSZSc4lCUl2OEE+rDiIIJAIdR4m7MiMcm0= istio.io/api v0.0.0-20201113182140-d4b7e3fc2b44 h1:mfs4UJtpH8ElVEohFZw39qDGv9gg7TOkYVTwJZGQ5Yc= @@ -816,9 +839,11 @@ k8s.io/cli-runtime v0.18.6 h1:I8BkH5NyqMQ4zqUBmpXJ1LxIqpCH88H/1edPkPVWzjQ= k8s.io/cli-runtime v0.18.6/go.mod h1:+G/WTNqHgUv636e5y7rhOQ7epUbRXnwmPnhOhD6t9uM= k8s.io/client-go v0.18.6 h1:I+oWqJbibLSGsZj8Xs8F0aWVXJVIoUHWaaJV3kUN/Zw= k8s.io/client-go v0.18.6/go.mod h1:/fwtGLjYMS1MaM5oi+eXhKwG+1UHidUEXRh6cNsdO0Q= +k8s.io/code-generator v0.18.6 h1:QdfvGfs4gUCS1dru+rLbCKIFxYEV0IRfF8MXwY/ozLk= k8s.io/code-generator v0.18.6/go.mod h1:TgNEVx9hCyPGpdtCWA34olQYLkh3ok9ar7XfSsr8b6c= k8s.io/component-base v0.18.6 h1:Wd6cHGwJN2qpufnirVOB3oMhyhbioGsKEi5HeDBsV+s= k8s.io/component-base v0.18.6/go.mod h1:knSVsibPR5K6EW2XOjEHik6sdU5nCvKMrzMt2D4In14= +k8s.io/gengo v0.0.0-20200114144118-36b2048a9120 h1:RPscN6KhmG54S33L+lr3GS+oD1jmchIU0ll519K6FA4= k8s.io/gengo v0.0.0-20200114144118-36b2048a9120/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= k8s.io/klog v1.0.0 h1:Pt+yjF5aB1xDSVbau4VsWe+dQNzA0qv1LlXdC2dF6Q8= k8s.io/klog v1.0.0/go.mod h1:4Bi6QPql/J/LkTDqv7R/cd3hPo4k2DG6Ptcz060Ez5I= @@ -832,15 +857,9 @@ k8s.io/metrics v0.18.6 h1:IRMCn0KKNhbOSnxNZ+MhooRi8c67iIMjpGkKpm6oqOM= k8s.io/metrics v0.18.6/go.mod h1:iAwGeabusQNO3duHDM7BBExTUB8L+iq8PM7N9EtQw6g= k8s.io/utils v0.0.0-20200603063816-c1c6865ac451 h1:v8ud2Up6QK1lNOKFgiIVrZdMg7MpmSnvtrOieolJKoE= k8s.io/utils v0.0.0-20200603063816-c1c6865ac451/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= -kubesphere.io/im v0.1.0/go.mod h1:DHJj/JngMUFyaXecLjBPXj/zk5Oi7ifIixLRp0qJkyA= -openpitrix.io/iam v0.1.0/go.mod h1:EcZE8CPBg+1fEKCDEhpsIZ8isWWO7javpu84mSqoVn4= -openpitrix.io/libqueue v0.4.1/go.mod h1:qUuS2viIR86Fm1rLfLRFMMAyltUeGxNt8zoCNkmf/Gk= -openpitrix.io/logger v0.1.0/go.mod h1:SV8Btt2cTSmeL9H/1XCkYmQ+WQ2upVY4e0wlr07RP28= -openpitrix.io/notification v0.2.2/go.mod h1:2YRxpnrFk2Z3fXpRXWzbDY9j6Sztrd860Vm8qh5hZzY= -openpitrix.io/openpitrix v0.4.9-0.20200611125425-ae07f141e797 h1:zWzbsWTu2wKovmSXqFgsQTDN7Ckx9TBiD9SQ9qDWQpg= -openpitrix.io/openpitrix v0.4.9-0.20200611125425-ae07f141e797/go.mod h1:sLaDrxic8mrYWWJop4GkBSRwQ0AqVIy7TZzbCOynr8o= +kubesphere.io/monitoring-dashboard v0.1.1 h1:bqH9B3Yw4yRO0GjyUzx0NPvwdjq/K59eNBuRoLCviic= +kubesphere.io/monitoring-dashboard v0.1.1/go.mod h1:4mRqyjT3w8RRXaRJR3wjwfsufXRl6IrkF2tXJXuC6LQ= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= -rsc.io/goversion v1.0.0/go.mod h1:Eih9y/uIBS3ulggl7KNJ09xGSLcuNaLgmvvqa07sgfo= rsc.io/letsencrypt v0.0.1/go.mod h1:buyQKZ6IXrRnB7TdkHP0RyEybLx18HHyOSoTyoOLqNY= rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= @@ -851,6 +870,7 @@ sigs.k8s.io/application v0.8.4-0.20201016185654-c8e2959e57a0 h1:cH3Q4uNycL9Lgzly sigs.k8s.io/application v0.8.4-0.20201016185654-c8e2959e57a0/go.mod h1:wdTrELsIgKk8lnlRaoKWao9YpLelXpABdEgCM1aEEE4= sigs.k8s.io/controller-runtime v0.6.4 h1:4013CKsBs5bEqo+LevzDett+LLxag/FjQWG94nVZ/9g= sigs.k8s.io/controller-runtime v0.6.4/go.mod h1:WlZNXcM0++oyaQt4B7C2lEE5JYRs8vJUzRP4N4JpdAY= +sigs.k8s.io/controller-tools v0.4.0 h1:9zIdrc6q9RKke8+DnVPVBVZ+cfF9L0TwM01cxNnklYo= sigs.k8s.io/controller-tools v0.4.0/go.mod h1:G9rHdZMVlBDocIxGkK3jHLWqcTMNvveypYJwrvYKjWU= sigs.k8s.io/kind v0.8.1/go.mod h1:oNKTxUVPYkV9lWzY6CVMNluVq8cBsyq+UgPJdvA3uu4= sigs.k8s.io/kubefed v0.4.0 h1:eNZ5SpblUBQEzPHs8XtAjEwmkbs498IhrGvqzdynHOY= diff --git a/pkg/apis/addtoscheme_dashboard_v1alpha1.go b/pkg/apis/addtoscheme_dashboard_v1alpha1.go new file mode 100644 index 0000000000..d454e32cf9 --- /dev/null +++ b/pkg/apis/addtoscheme_dashboard_v1alpha1.go @@ -0,0 +1,7 @@ +package apis + +import monitoringdashboardv1alpha1 "kubesphere.io/monitoring-dashboard/api/v1alpha1" + +func init() { + AddToSchemes = append(AddToSchemes, monitoringdashboardv1alpha1.SchemeBuilder.AddToScheme) +} diff --git a/pkg/models/resources/v1alpha3/clusterdashboard/clusterdashboard.go b/pkg/models/resources/v1alpha3/clusterdashboard/clusterdashboard.go new file mode 100644 index 0000000000..d03d46ccd0 --- /dev/null +++ b/pkg/models/resources/v1alpha3/clusterdashboard/clusterdashboard.go @@ -0,0 +1,88 @@ +/* +Copyright 2021 The KubeSphere Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package clusterdashboard + +import ( + "context" + + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/types" + "k8s.io/klog" + "kubesphere.io/kubesphere/pkg/api" + "kubesphere.io/kubesphere/pkg/apiserver/query" + "kubesphere.io/kubesphere/pkg/models/resources/v1alpha3" + monitoringdashboardv1alpha1 "kubesphere.io/monitoring-dashboard/api/v1alpha1" + "sigs.k8s.io/controller-runtime/pkg/cache" + "sigs.k8s.io/controller-runtime/pkg/client" +) + +type dashboardGetter struct { + c cache.Cache +} + +func New(c cache.Cache) v1alpha3.Interface { + return &dashboardGetter{c} +} + +func (d *dashboardGetter) Get(_, name string) (runtime.Object, error) { + dashboard := monitoringdashboardv1alpha1.ClusterDashboard{} + err := d.c.Get(context.Background(), types.NamespacedName{Name: name}, &dashboard) + if err != nil { + klog.Error(err) + return nil, err + } + return &dashboard, nil +} + +func (d *dashboardGetter) List(_ string, query *query.Query) (*api.ListResult, error) { + dashboards := monitoringdashboardv1alpha1.ClusterDashboardList{} + err := d.c.List(context.Background(), &dashboards, &client.ListOptions{LabelSelector: query.Selector()}) + if err != nil { + klog.Error(err) + return nil, err + } + var result []runtime.Object + for i := range dashboards.Items { + result = append(result, &dashboards.Items[i]) + } + + return v1alpha3.DefaultList(result, query, d.compare, d.filter), nil +} + +func (d *dashboardGetter) compare(left runtime.Object, right runtime.Object, field query.Field) bool { + + leftClusterDashboard, ok := left.(*monitoringdashboardv1alpha1.ClusterDashboard) + if !ok { + return false + } + + rightClusterDashboard, ok := right.(*monitoringdashboardv1alpha1.ClusterDashboard) + if !ok { + return false + } + + return v1alpha3.DefaultObjectMetaCompare(leftClusterDashboard.ObjectMeta, rightClusterDashboard.ObjectMeta, field) +} + +func (d *dashboardGetter) filter(object runtime.Object, filter query.Filter) bool { + dashboard, ok := object.(*monitoringdashboardv1alpha1.ClusterDashboard) + if !ok { + return false + } + + return v1alpha3.DefaultObjectMetaFilter(dashboard.ObjectMeta, filter) +} diff --git a/pkg/models/resources/v1alpha3/clusterdashboard/clusterdashboard_test.go b/pkg/models/resources/v1alpha3/clusterdashboard/clusterdashboard_test.go new file mode 100644 index 0000000000..58dabb22fa --- /dev/null +++ b/pkg/models/resources/v1alpha3/clusterdashboard/clusterdashboard_test.go @@ -0,0 +1,126 @@ +/* +Copyright 2021 The KubeSphere Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package clusterdashboard + +import ( + "context" + "path/filepath" + "reflect" + "testing" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/client-go/kubernetes/scheme" + "kubesphere.io/kubesphere/pkg/apiserver/query" + monitoringdashboardv1alpha1 "kubesphere.io/monitoring-dashboard/api/v1alpha1" + "sigs.k8s.io/controller-runtime/pkg/cache" + "sigs.k8s.io/controller-runtime/pkg/client" + "sigs.k8s.io/controller-runtime/pkg/envtest" +) + +var c client.Client + +func compare(actual *monitoringdashboardv1alpha1.ClusterDashboard, + expects ...*monitoringdashboardv1alpha1.ClusterDashboard) bool { + for _, app := range expects { + if actual.Name == app.Name && reflect.DeepEqual(actual.Labels, app.Labels) { + return true + } + } + return false +} + +func TestGetListClusterDashboards(t *testing.T) { + e := &envtest.Environment{CRDDirectoryPaths: []string{filepath.Join("..", "..", "..", "..", "..", "config", "crds")}} + cfg, err := e.Start() + if err != nil { + t.Fatal(err) + } + + sch := scheme.Scheme + if err := monitoringdashboardv1alpha1.AddToScheme(sch); err != nil { + t.Fatalf("unable add APIs to scheme: %v", err) + } + + stopCh := make(chan struct{}) + + ce, _ := cache.New(cfg, cache.Options{Scheme: sch}) + go ce.Start(stopCh) + ce.WaitForCacheSync(stopCh) + + c, _ = client.New(cfg, client.Options{Scheme: sch}) + + var labelSet1 = map[string]string{"foo-1": "bar-1"} + var labelSet2 = map[string]string{"foo-2": "bar-2"} + + testCases := []*monitoringdashboardv1alpha1.ClusterDashboard{ + { + ObjectMeta: metav1.ObjectMeta{ + Name: "clusterdashboard-1", + Labels: labelSet1, + }, + }, + { + ObjectMeta: metav1.ObjectMeta{ + Name: "clusterdashboard-2", + Labels: labelSet2, + }, + }, + } + + ctx := context.TODO() + + for _, board := range testCases { + if err = c.Create(ctx, board); err != nil { + t.Fatal(err) + } + } + + getter := New(ce) + + results, err := getter.List("", &query.Query{}) + if err != nil { + t.Fatal(err) + } + + if results.TotalItems != len(testCases) { + t.Fatal("TotalItems is not match") + } + + if len(results.Items) != len(testCases) { + t.Fatal("Items numbers is not match mock data") + } + + for _, dashboard := range results.Items { + dashboard, err := dashboard.(*monitoringdashboardv1alpha1.ClusterDashboard) + if !err { + t.Fatal(err) + } + if !compare(dashboard, testCases...) { + t.Errorf("The results %v not match testcases %v", results.Items, testCases) + } + } + + result, err := getter.Get("", "clusterdashboard-1") + if err != nil { + t.Fatal(err) + } + + dashboard := result.(*monitoringdashboardv1alpha1.ClusterDashboard) + if !compare(dashboard, testCases...) { + t.Errorf("The results %v not match testcases %v", result, testCases) + } +} diff --git a/pkg/models/resources/v1alpha3/dashboard/dashboard.go b/pkg/models/resources/v1alpha3/dashboard/dashboard.go new file mode 100644 index 0000000000..2079196751 --- /dev/null +++ b/pkg/models/resources/v1alpha3/dashboard/dashboard.go @@ -0,0 +1,88 @@ +/* +Copyright 2021 The KubeSphere Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package dashboard + +import ( + "context" + + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/types" + "k8s.io/klog" + "kubesphere.io/kubesphere/pkg/api" + "kubesphere.io/kubesphere/pkg/apiserver/query" + "kubesphere.io/kubesphere/pkg/models/resources/v1alpha3" + monitoringdashboardv1alpha1 "kubesphere.io/monitoring-dashboard/api/v1alpha1" + "sigs.k8s.io/controller-runtime/pkg/cache" + "sigs.k8s.io/controller-runtime/pkg/client" +) + +type dashboardGetter struct { + c cache.Cache +} + +func New(c cache.Cache) v1alpha3.Interface { + return &dashboardGetter{c} +} + +func (d *dashboardGetter) Get(namespace, name string) (runtime.Object, error) { + dashboard := monitoringdashboardv1alpha1.Dashboard{} + err := d.c.Get(context.Background(), types.NamespacedName{Namespace: namespace, Name: name}, &dashboard) + if err != nil { + klog.Error(err) + return nil, err + } + return &dashboard, nil +} + +func (d *dashboardGetter) List(namespace string, query *query.Query) (*api.ListResult, error) { + dashboards := monitoringdashboardv1alpha1.DashboardList{} + err := d.c.List(context.Background(), &dashboards, &client.ListOptions{Namespace: namespace, LabelSelector: query.Selector()}) + if err != nil { + klog.Error(err) + return nil, err + } + var result []runtime.Object + for i := range dashboards.Items { + result = append(result, &dashboards.Items[i]) + } + + return v1alpha3.DefaultList(result, query, d.compare, d.filter), nil +} + +func (d *dashboardGetter) compare(left runtime.Object, right runtime.Object, field query.Field) bool { + + leftDashboard, ok := left.(*monitoringdashboardv1alpha1.Dashboard) + if !ok { + return false + } + + rightDashboard, ok := right.(*monitoringdashboardv1alpha1.Dashboard) + if !ok { + return false + } + + return v1alpha3.DefaultObjectMetaCompare(leftDashboard.ObjectMeta, rightDashboard.ObjectMeta, field) +} + +func (d *dashboardGetter) filter(object runtime.Object, filter query.Filter) bool { + dashboard, ok := object.(*monitoringdashboardv1alpha1.Dashboard) + if !ok { + return false + } + + return v1alpha3.DefaultObjectMetaFilter(dashboard.ObjectMeta, filter) +} diff --git a/pkg/models/resources/v1alpha3/dashboard/dashboard_test.go b/pkg/models/resources/v1alpha3/dashboard/dashboard_test.go new file mode 100644 index 0000000000..051aea32d2 --- /dev/null +++ b/pkg/models/resources/v1alpha3/dashboard/dashboard_test.go @@ -0,0 +1,143 @@ +/* +Copyright 2021 The KubeSphere Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package dashboard + +import ( + "context" + "path/filepath" + "reflect" + "testing" + + core "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/client-go/kubernetes/scheme" + "k8s.io/klog/v2" + "kubesphere.io/kubesphere/pkg/apiserver/query" + monitoringdashboardv1alpha1 "kubesphere.io/monitoring-dashboard/api/v1alpha1" + "sigs.k8s.io/controller-runtime/pkg/cache" + "sigs.k8s.io/controller-runtime/pkg/client" + "sigs.k8s.io/controller-runtime/pkg/envtest" +) + +var c client.Client + +func createNamespace(name string, ctx context.Context) { + namespace := &core.Namespace{ + ObjectMeta: metav1.ObjectMeta{ + Name: name, + }, + } + err := c.Create(ctx, namespace) + if err != nil { + klog.Error(err) + } +} + +func compare(actual *monitoringdashboardv1alpha1.Dashboard, expects ...*monitoringdashboardv1alpha1.Dashboard) bool { + for _, app := range expects { + if actual.Name == app.Name && actual.Namespace == app.Namespace && reflect.DeepEqual(actual.Labels, app.Labels) { + return true + } + } + return false +} + +func TestGetListDashboards(t *testing.T) { + e := &envtest.Environment{CRDDirectoryPaths: []string{filepath.Join("..", "..", "..", "..", "..", "config", "crds")}} + cfg, err := e.Start() + if err != nil { + t.Fatal(err) + } + + sch := scheme.Scheme + if err := monitoringdashboardv1alpha1.AddToScheme(sch); err != nil { + t.Fatalf("unable add APIs to scheme: %v", err) + } + + stopCh := make(chan struct{}) + + ce, _ := cache.New(cfg, cache.Options{Scheme: sch}) + go ce.Start(stopCh) + ce.WaitForCacheSync(stopCh) + + c, _ = client.New(cfg, client.Options{Scheme: sch}) + + var labelSet1 = map[string]string{"foo-1": "bar-1"} + var labelSet2 = map[string]string{"foo-2": "bar-2"} + + var ns = "ns-1" + testCases := []*monitoringdashboardv1alpha1.Dashboard{ + { + ObjectMeta: metav1.ObjectMeta{ + Name: "dashboard-1", + Namespace: ns, + Labels: labelSet1, + }, + }, + { + ObjectMeta: metav1.ObjectMeta{ + Name: "dashboard-2", + Namespace: ns, + Labels: labelSet2, + }, + }, + } + + ctx := context.TODO() + createNamespace(ns, ctx) + + for _, board := range testCases { + if err = c.Create(ctx, board); err != nil { + t.Fatal(err) + } + } + + getter := New(ce) + + results, err := getter.List(ns, &query.Query{}) + if err != nil { + t.Fatal(err) + } + + if results.TotalItems != len(testCases) { + t.Fatal("TotalItems is not match") + } + + if len(results.Items) != len(testCases) { + t.Fatal("Items numbers is not match mock data") + } + + for _, dashboard := range results.Items { + dashboard, err := dashboard.(*monitoringdashboardv1alpha1.Dashboard) + if !err { + t.Fatal(err) + } + if !compare(dashboard, testCases...) { + t.Errorf("The results %v not match testcases %v", results.Items, testCases) + } + } + + result, err := getter.Get(ns, "dashboard-1") + if err != nil { + t.Fatal(err) + } + + dashboard := result.(*monitoringdashboardv1alpha1.Dashboard) + if !compare(dashboard, testCases...) { + t.Errorf("The results %v not match testcases %v", result, testCases) + } +} diff --git a/pkg/models/resources/v1alpha3/resource/resource.go b/pkg/models/resources/v1alpha3/resource/resource.go index 8566c9d00c..1f34ceaa1e 100644 --- a/pkg/models/resources/v1alpha3/resource/resource.go +++ b/pkg/models/resources/v1alpha3/resource/resource.go @@ -36,11 +36,13 @@ import ( "kubesphere.io/kubesphere/pkg/models/resources/v1alpha3" "kubesphere.io/kubesphere/pkg/models/resources/v1alpha3/application" "kubesphere.io/kubesphere/pkg/models/resources/v1alpha3/cluster" + "kubesphere.io/kubesphere/pkg/models/resources/v1alpha3/clusterdashboard" "kubesphere.io/kubesphere/pkg/models/resources/v1alpha3/clusterrole" "kubesphere.io/kubesphere/pkg/models/resources/v1alpha3/clusterrolebinding" "kubesphere.io/kubesphere/pkg/models/resources/v1alpha3/configmap" "kubesphere.io/kubesphere/pkg/models/resources/v1alpha3/customresourcedefinition" "kubesphere.io/kubesphere/pkg/models/resources/v1alpha3/daemonset" + "kubesphere.io/kubesphere/pkg/models/resources/v1alpha3/dashboard" "kubesphere.io/kubesphere/pkg/models/resources/v1alpha3/deployment" "kubesphere.io/kubesphere/pkg/models/resources/v1alpha3/devops" "kubesphere.io/kubesphere/pkg/models/resources/v1alpha3/federatedapplication" @@ -130,6 +132,7 @@ func NewResourceGetter(factory informers.InformerFactory, cache cache.Cache) *Re clusterResourceGetters[clusterv1alpha1.SchemeGroupVersion.WithResource(clusterv1alpha1.ResourcesPluralCluster)] = cluster.New(factory.KubeSphereSharedInformerFactory()) clusterResourceGetters[notificationv2beta1.SchemeGroupVersion.WithResource(notificationv2beta1.ResourcesPluralConfig)] = notification.NewNotificationConfigGetter(factory.KubeSphereSharedInformerFactory()) clusterResourceGetters[notificationv2beta1.SchemeGroupVersion.WithResource(notificationv2beta1.ResourcesPluralReceiver)] = notification.NewNotificationReceiverGetter(factory.KubeSphereSharedInformerFactory()) + clusterResourceGetters[schema.GroupVersionResource{Group: "monitoring.kubesphere.io", Version: "v1alpha1", Resource: "clusterdashboards"}] = clusterdashboard.New(cache) // federated resources namespacedResourceGetters[typesv1beta1.SchemeGroupVersion.WithResource(typesv1beta1.ResourcePluralFederatedNamespace)] = federatednamespace.New(factory.KubeSphereSharedInformerFactory()) @@ -141,6 +144,7 @@ func NewResourceGetter(factory informers.InformerFactory, cache cache.Cache) *Re namespacedResourceGetters[typesv1beta1.SchemeGroupVersion.WithResource(typesv1beta1.ResourcePluralFederatedPersistentVolumeClaim)] = federatedpersistentvolumeclaim.New(factory.KubeSphereSharedInformerFactory()) namespacedResourceGetters[typesv1beta1.SchemeGroupVersion.WithResource(typesv1beta1.ResourcePluralFederatedStatefulSet)] = federatedstatefulset.New(factory.KubeSphereSharedInformerFactory()) namespacedResourceGetters[typesv1beta1.SchemeGroupVersion.WithResource(typesv1beta1.ResourcePluralFederatedIngress)] = federatedingress.New(factory.KubeSphereSharedInformerFactory()) + namespacedResourceGetters[schema.GroupVersionResource{Group: "monitoring.kubesphere.io", Version: "v1alpha1", Resource: "dashboards"}] = dashboard.New(cache) return &ResourceGetter{ namespacedResourceGetters: namespacedResourceGetters, From 0c1f994695f8f99b72c5205eefd04e41d5b15753 Mon Sep 17 00:00:00 2001 From: junotx Date: Fri, 12 Mar 2021 16:58:19 +0800 Subject: [PATCH 2/3] monitoring dashboard dependency vendor Signed-off-by: junotx --- vendor/github.com/MakeNowJust/heredoc/LICENSE | 21 + .../github.com/MakeNowJust/heredoc/README.md | 53 + .../github.com/MakeNowJust/heredoc/heredoc.go | 98 + .../Masterminds/semver/v3/.gitignore | 1 + .../Masterminds/semver/v3/.golangci.yml | 26 + .../Masterminds/semver/v3/.travis.yml | 27 + .../Masterminds/semver/v3/CHANGELOG.md | 166 + .../Masterminds/semver/v3/LICENSE.txt | 19 + .../github.com/Masterminds/semver/v3/Makefile | 37 + .../Masterminds/semver/v3/README.md | 242 + .../Masterminds/semver/v3/appveyor.yml | 17 + .../Masterminds/semver/v3/collection.go | 24 + .../Masterminds/semver/v3/constraints.go | 527 ++ .../github.com/Masterminds/semver/v3/doc.go | 184 + .../github.com/Masterminds/semver/v3/fuzz.go | 22 + .../github.com/Masterminds/semver/v3/go.mod | 3 + .../Masterminds/semver/v3/version.go | 583 ++ .../containerd/LICENSE} | 2 +- .../github.com/containerd/containerd/NOTICE | 16 + .../containerd/containerd/errdefs/errors.go | 93 + .../containerd/containerd/errdefs/grpc.go | 147 + vendor/github.com/docker/docker/AUTHORS | 61 +- vendor/github.com/docker/docker/NOTICE | 2 +- vendor/github.com/docker/docker/api/common.go | 2 +- .../github.com/docker/docker/api/swagger.yaml | 482 +- .../docker/docker/api/types/client.go | 8 +- .../api/types/container/container_changes.go | 3 +- .../api/types/container/container_create.go | 3 +- .../api/types/container/container_top.go | 3 +- .../api/types/container/container_update.go | 3 +- .../api/types/container/container_wait.go | 3 +- .../docker/api/types/container/host_config.go | 34 +- .../docker/api/types/error_response_ext.go | 6 + .../docker/docker/api/types/filters/parse.go | 17 +- .../docker/api/types/image/image_history.go | 3 +- .../docker/api/types/network/network.go | 2 +- .../docker/api/types/registry/registry.go | 2 +- .../docker/api/types/swarm/container.go | 13 +- .../api/types/swarm/runtime/plugin.pb.go | 110 +- .../api/types/swarm/runtime/plugin.proto | 1 + .../docker/docker/api/types/swarm/service.go | 82 +- .../docker/docker/api/types/swarm/task.go | 6 + .../docker/docker/api/types/types.go | 8 +- .../docker/api/types/volume/volume_create.go | 3 +- .../docker/api/types/volume/volume_list.go | 3 +- .../github.com/docker/docker/client/client.go | 3 +- .../docker/docker/client/client_unix.go | 2 +- .../docker/docker/client/container_list.go | 1 + .../github.com/docker/docker/client/events.go | 1 + .../github.com/docker/docker/client/hijack.go | 6 +- .../docker/docker/client/image_import.go | 2 +- .../docker/docker/client/image_list.go | 1 + .../docker/docker/client/image_push.go | 13 +- .../docker/docker/client/network_list.go | 1 + .../github.com/docker/docker/client/ping.go | 6 +- .../docker/docker/client/plugin_list.go | 1 + .../docker/docker/client/request.go | 31 +- .../docker/docker/client/service_create.go | 2 +- .../docker/docker/client/service_list.go | 4 + .../docker/docker/client/volume_list.go | 1 + .../docker/docker/errdefs/http_helpers.go | 33 +- .../docker/docker/pkg/term/term_windows.go | 2 +- .../docker/docker/pkg/term/windows/windows.go | 3 +- .../jsonpath}/.gitignore | 3 +- .../exponent-io/jsonpath/.travis.yml | 5 + .../jsonpath}/LICENSE | 2 +- .../github.com/exponent-io/jsonpath/README.md | 66 + .../exponent-io/jsonpath/decoder.go | 210 + .../github.com/exponent-io/jsonpath/path.go | 67 + .../exponent-io/jsonpath/pathaction.go | 61 + .../camelcase => google/btree}/.travis.yml | 2 - .../{golang/mock => google/btree}/LICENSE | 0 vendor/github.com/google/btree/README.md | 12 + vendor/github.com/google/btree/btree.go | 890 +++ .../gregjones/httpcache/.travis.yml | 19 + .../gregjones/httpcache/LICENSE.txt | 7 + .../github.com/gregjones/httpcache/README.md | 25 + .../httpcache/diskcache/diskcache.go | 61 + .../gregjones/httpcache/httpcache.go | 551 ++ vendor/github.com/jszwec/csvutil/.gitignore | 89 + vendor/github.com/jszwec/csvutil/LICENSE | 21 + vendor/github.com/jszwec/csvutil/README.md | 668 ++ vendor/github.com/jszwec/csvutil/_config.yml | 2 + vendor/github.com/jszwec/csvutil/cache.go | 178 + .../github.com/jszwec/csvutil/cache_go17.go | 30 + .../github.com/jszwec/csvutil/cache_go19.go | 18 + vendor/github.com/jszwec/csvutil/csvutil.go | 223 + .../github.com/jszwec/csvutil/csvutil_go17.go | 12 + .../github.com/jszwec/csvutil/csvutil_go19.go | 14 + vendor/github.com/jszwec/csvutil/decode.go | 247 + vendor/github.com/jszwec/csvutil/decoder.go | 487 ++ vendor/github.com/jszwec/csvutil/doc.go | 6 + vendor/github.com/jszwec/csvutil/encode.go | 245 + vendor/github.com/jszwec/csvutil/encoder.go | 356 + vendor/github.com/jszwec/csvutil/error.go | 156 + vendor/github.com/jszwec/csvutil/go.mod | 3 + vendor/github.com/jszwec/csvutil/interface.go | 29 + vendor/github.com/jszwec/csvutil/tag.go | 47 + .../mitchellh/go-wordwrap/LICENSE.md | 21 + .../mitchellh/go-wordwrap/README.md | 39 + .../github.com/mitchellh/go-wordwrap/go.mod | 1 + .../mitchellh/go-wordwrap/wordwrap.go | 73 + .../opencontainers/go-digest/.mailmap | 3 + .../opencontainers/go-digest/.pullapprove.yml | 38 +- .../opencontainers/go-digest/.travis.yml | 3 +- .../opencontainers/go-digest/LICENSE | 192 + .../opencontainers/go-digest/MAINTAINERS | 12 +- .../opencontainers/go-digest/README.md | 70 +- .../opencontainers/go-digest/algorithm.go | 1 + .../opencontainers/go-digest/digest.go | 1 + .../opencontainers/go-digest/digester.go | 1 + .../opencontainers/go-digest/doc.go | 10 +- .../opencontainers/go-digest/go.mod | 3 + .../opencontainers/go-digest/verifiers.go | 1 + vendor/github.com/peterbourgon/diskv/LICENSE | 19 + .../github.com/peterbourgon/diskv/README.md | 141 + .../peterbourgon/diskv/compression.go | 64 + vendor/github.com/peterbourgon/diskv/diskv.go | 624 ++ vendor/github.com/peterbourgon/diskv/index.go | 115 + .../russross/blackfriday/.gitignore | 8 + .../russross/blackfriday/.travis.yml | 17 + .../russross/blackfriday/LICENSE.txt | 29 + .../github.com/russross/blackfriday/README.md | 369 + .../github.com/russross/blackfriday/block.go | 1474 ++++ vendor/github.com/russross/blackfriday/doc.go | 32 + vendor/github.com/russross/blackfriday/go.mod | 1 + .../github.com/russross/blackfriday/html.go | 938 +++ .../github.com/russross/blackfriday/inline.go | 1154 +++ .../github.com/russross/blackfriday/latex.go | 334 + .../russross/blackfriday/markdown.go | 941 +++ .../russross/blackfriday/smartypants.go | 430 ++ .../x/crypto/chacha20/chacha_arm64.go | 16 + .../asm_arm64.s => chacha20/chacha_arm64.s} | 3 +- .../x/crypto/chacha20/chacha_generic.go | 398 + .../{internal => }/chacha20/chacha_noasm.go | 11 +- .../x/crypto/chacha20/chacha_ppc64le.go | 16 + .../x/crypto/chacha20/chacha_ppc64le.s | 449 ++ .../x/crypto/chacha20/chacha_s390x.go | 26 + .../{internal => }/chacha20/chacha_s390x.s | 40 +- .../x/crypto/{internal => }/chacha20/xor.go | 21 +- vendor/golang.org/x/crypto/cryptobyte/asn1.go | 11 +- .../golang.org/x/crypto/cryptobyte/string.go | 7 +- .../x/crypto/curve25519/curve25519.go | 881 +-- ...mont25519_amd64.go => curve25519_amd64.go} | 2 +- ...{ladderstep_amd64.s => curve25519_amd64.s} | 510 +- .../x/crypto/curve25519/curve25519_generic.go | 828 ++ .../x/crypto/curve25519/curve25519_noasm.go | 11 + vendor/golang.org/x/crypto/ed25519/ed25519.go | 5 + .../x/crypto/ed25519/ed25519_go113.go | 73 + .../x/crypto/openpgp/armor/armor.go | 21 +- .../x/crypto/openpgp/clearsign/clearsign.go | 418 + .../x/crypto/openpgp/elgamal/elgamal.go | 4 +- vendor/golang.org/x/crypto/openpgp/keys.go | 14 +- .../x/crypto/openpgp/packet/encrypted_key.go | 6 +- .../x/crypto/openpgp/packet/packet.go | 67 +- .../x/crypto/openpgp/packet/private_key.go | 28 +- .../x/crypto/poly1305/bits_compat.go | 39 + .../x/crypto/poly1305/bits_go1.13.go | 21 + .../golang.org/x/crypto/poly1305/mac_noasm.go | 4 +- .../golang.org/x/crypto/poly1305/poly1305.go | 34 +- .../golang.org/x/crypto/poly1305/sum_amd64.go | 65 +- .../golang.org/x/crypto/poly1305/sum_amd64.s | 42 +- .../x/crypto/poly1305/sum_generic.go | 398 +- .../x/crypto/poly1305/sum_ppc64le.go | 47 + .../x/crypto/poly1305/sum_ppc64le.s | 181 + .../golang.org/x/crypto/poly1305/sum_s390x.go | 77 +- .../golang.org/x/crypto/poly1305/sum_s390x.s | 667 +- .../x/crypto/salsa20/salsa/salsa20_amd64.go | 3 +- .../{salsa2020_amd64.s => salsa20_amd64.s} | 8 +- .../x/crypto/salsa20/salsa/salsa20_noasm.go | 14 + .../x/crypto/salsa20/salsa/salsa20_ref.go | 9 +- .../golang.org/x/crypto/ssh/agent/client.go | 28 +- vendor/golang.org/x/crypto/ssh/certs.go | 39 +- vendor/golang.org/x/crypto/ssh/cipher.go | 77 +- vendor/golang.org/x/crypto/ssh/client_auth.go | 136 +- vendor/golang.org/x/crypto/ssh/common.go | 37 +- vendor/golang.org/x/crypto/ssh/handshake.go | 5 +- .../ssh/internal/bcrypt_pbkdf/bcrypt_pbkdf.go | 93 + vendor/golang.org/x/crypto/ssh/kex.go | 251 +- vendor/golang.org/x/crypto/ssh/keys.go | 482 +- vendor/golang.org/x/crypto/ssh/messages.go | 100 + vendor/golang.org/x/crypto/ssh/mux.go | 23 +- vendor/golang.org/x/crypto/ssh/server.go | 128 +- vendor/golang.org/x/crypto/ssh/ssh_gss.go | 139 + .../x/crypto/ssh/terminal/terminal.go | 82 +- .../x/crypto/ssh/terminal/util_windows.go | 4 +- vendor/golang.org/x/crypto/ssh/transport.go | 12 +- vendor/k8s.io/api/imagepolicy/v1alpha1/doc.go | 23 + .../api/imagepolicy/v1alpha1/generated.pb.go | 1386 ++++ .../api/imagepolicy/v1alpha1/generated.proto | 86 + .../api/imagepolicy/v1alpha1/register.go | 51 + .../k8s.io/api/imagepolicy/v1alpha1/types.go | 80 + .../v1alpha1/types_swagger_doc_generated.go | 71 + .../v1alpha1/zz_generated.deepcopy.go | 120 + .../unstructured/unstructuredscheme/scheme.go | 133 + .../pkg/genericclioptions/builder_flags.go | 220 + .../genericclioptions/builder_flags_fake.go | 54 + .../pkg/genericclioptions/config_flags.go | 382 + .../genericclioptions/config_flags_fake.go | 110 + .../cli-runtime/pkg/genericclioptions/doc.go | 19 + .../pkg/genericclioptions/filename_flags.go | 79 + .../pkg/genericclioptions/io_options.go | 57 + .../pkg/genericclioptions/json_yaml_flags.go | 68 + .../pkg/genericclioptions/jsonpath_flags.go | 130 + .../genericclioptions/kube_template_flags.go | 89 + .../pkg/genericclioptions/name_flags.go | 81 + .../pkg/genericclioptions/print_flags.go | 158 + .../pkg/genericclioptions/record_flags.go | 199 + .../pkg/genericclioptions/template_flags.go | 135 + .../cli-runtime/pkg/kustomize/builder.go | 32 + .../configmapandsecret/configmapfactory.go | 125 + .../k8sdeps/configmapandsecret/kv.go | 107 + .../configmapandsecret/secretfactory.go | 106 + .../cli-runtime/pkg/kustomize/k8sdeps/doc.go | 76 + .../pkg/kustomize/k8sdeps/factory.go | 34 + .../kustomize/k8sdeps/kunstruct/factory.go | 118 + .../pkg/kustomize/k8sdeps/kunstruct/helper.go | 71 + .../kustomize/k8sdeps/kunstruct/kunstruct.go | 92 + .../pkg/kustomize/k8sdeps/kv/kv.go | 102 + .../kustomize/k8sdeps/transformer/factory.go | 43 + .../k8sdeps/transformer/hash/hash.go | 184 + .../k8sdeps/transformer/hash/namehash.go | 47 + .../k8sdeps/transformer/patch/patch.go | 174 + .../patch/patchconflictdetector.go | 137 + .../kustomize/k8sdeps/validator/validators.go | 61 + .../cli-runtime/pkg/resource/builder.go | 1193 +++ .../k8s.io/cli-runtime/pkg/resource/client.go | 58 + .../cli-runtime/pkg/resource/crd_finder.go | 110 + vendor/k8s.io/cli-runtime/pkg/resource/doc.go | 24 + .../pkg/resource/dry_run_verifier.go | 121 + .../k8s.io/cli-runtime/pkg/resource/fake.go | 40 + .../k8s.io/cli-runtime/pkg/resource/helper.go | 228 + .../cli-runtime/pkg/resource/interfaces.go | 103 + .../k8s.io/cli-runtime/pkg/resource/mapper.go | 161 + .../pkg/resource/metadata_decoder.go | 59 + .../k8s.io/cli-runtime/pkg/resource/result.go | 242 + .../k8s.io/cli-runtime/pkg/resource/scheme.go | 82 + .../cli-runtime/pkg/resource/selector.go | 118 + .../cli-runtime/pkg/resource/visitor.go | 764 ++ .../discovery/cached/disk/cached_discovery.go | 300 + .../discovery/cached/disk/round_tripper.go | 65 + vendor/k8s.io/client-go/scale/client.go | 238 + vendor/k8s.io/client-go/scale/doc.go | 21 + vendor/k8s.io/client-go/scale/interfaces.go | 47 + .../client-go/scale/scheme/appsint/doc.go | 22 + .../scale/scheme/appsint/register.go | 55 + .../scale/scheme/appsv1beta1/conversion.go | 73 + .../client-go/scale/scheme/appsv1beta1/doc.go | 20 + .../scale/scheme/appsv1beta1/register.go | 45 + .../appsv1beta1/zz_generated.conversion.go | 133 + .../scale/scheme/appsv1beta2/conversion.go | 73 + .../client-go/scale/scheme/appsv1beta2/doc.go | 20 + .../scale/scheme/appsv1beta2/register.go | 45 + .../appsv1beta2/zz_generated.conversion.go | 133 + .../scale/scheme/autoscalingv1/conversion.go | 54 + .../scale/scheme/autoscalingv1/doc.go | 20 + .../scale/scheme/autoscalingv1/register.go | 45 + .../autoscalingv1/zz_generated.conversion.go | 132 + vendor/k8s.io/client-go/scale/scheme/doc.go | 22 + .../scale/scheme/extensionsint/doc.go | 22 + .../scale/scheme/extensionsint/register.go | 55 + .../scheme/extensionsv1beta1/conversion.go | 73 + .../scale/scheme/extensionsv1beta1/doc.go | 20 + .../scheme/extensionsv1beta1/register.go | 45 + .../zz_generated.conversion.go | 133 + .../k8s.io/client-go/scale/scheme/register.go | 54 + vendor/k8s.io/client-go/scale/scheme/types.go | 60 + .../scale/scheme/zz_generated.deepcopy.go | 91 + vendor/k8s.io/client-go/scale/util.go | 197 + .../pkg/util/proto/validation/errors.go | 79 + .../pkg/util/proto/validation/types.go | 299 + .../pkg/util/proto/validation/validation.go | 30 + vendor/k8s.io/kubectl/pkg/cmd/util/factory.go | 66 + .../pkg/cmd/util/factory_client_access.go | 177 + vendor/k8s.io/kubectl/pkg/cmd/util/helpers.go | 728 ++ .../pkg/cmd/util/kubectl_match_version.go | 129 + .../k8s.io/kubectl/pkg/cmd/util/printing.go | 29 + vendor/k8s.io/kubectl/pkg/scheme/install.go | 83 + vendor/k8s.io/kubectl/pkg/scheme/scheme.go | 39 + .../kubectl/pkg/util/interrupt/interrupt.go | 104 + vendor/k8s.io/kubectl/pkg/util/openapi/OWNERS | 6 + vendor/k8s.io/kubectl/pkg/util/openapi/doc.go | 21 + .../kubectl/pkg/util/openapi/extensions.go | 27 + .../kubectl/pkg/util/openapi/openapi.go | 128 + .../pkg/util/openapi/openapi_getter.go | 65 + .../pkg/util/openapi/validation/validation.go | 140 + .../pkg/util/templates/command_groups.go | 59 + .../kubectl/pkg/util/templates/markdown.go | 147 + .../kubectl/pkg/util/templates/normalizers.go | 97 + .../kubectl/pkg/util/templates/templater.go | 298 + .../kubectl/pkg/util/templates/templates.go | 103 + vendor/k8s.io/kubectl/pkg/util/term/resize.go | 132 + .../kubectl/pkg/util/term/resizeevents.go | 61 + .../pkg/util/term/resizeevents_windows.go | 62 + vendor/k8s.io/kubectl/pkg/util/term/term.go | 110 + .../kubectl/pkg/util/term/term_writer.go | 124 + .../k8s.io/kubectl/pkg/validation/schema.go | 103 + vendor/k8s.io/utils/exec/README.md | 5 + vendor/k8s.io/utils/exec/doc.go | 18 + vendor/k8s.io/utils/exec/exec.go | 252 + vendor/k8s.io/utils/strings/escape.go | 36 + vendor/k8s.io/utils/strings/line_delimiter.go | 64 + vendor/k8s.io/utils/strings/strings.go | 46 + vendor/kubesphere.io/client-go | 1 - .../client-go}/LICENSE | 1 - .../client-go/client/clientCache.go | 158 + .../kubesphere.io/client-go/client/codec.go | 40 + .../client-go/client/generic/genericclient.go | 199 + .../client-go/client/generic/typedClient.go | 281 + .../client/generic/unstructuredClient.go | 274 + .../client-go/client/interface.go | 115 + .../kubesphere.io/client-go/client/options.go | 902 +++ .../monitoring-dashboard}/LICENSE | 4 +- .../api/v1alpha1/dashboard_types.go | 110 + .../api/v1alpha1/groupversion_info.go | 36 + .../api/v1alpha1/panels/common_types.go | 15 + .../api/v1alpha1/panels/graph_types.go | 34 + .../api/v1alpha1/panels/row_types.go | 13 + .../api/v1alpha1/panels/singlestat_types.go | 19 + .../v1alpha1/panels/zz_generated.deepcopy.go | 118 + .../api/v1alpha1/zz_generated.deepcopy.go | 217 + vendor/modules.txt | 31 +- vendor/openpitrix.io/openpitrix/AUTHORS | 13 - vendor/openpitrix.io/openpitrix/CONTRIBUTORS | 25 - .../openpitrix/pkg/config/config.go | 113 - .../openpitrix/pkg/config/env_loader.go | 263 - .../openpitrix/pkg/config/global_config.go | 201 - .../pkg/config/init_global_config.go | 43 - .../openpitrix/pkg/constants/column.go | 352 - .../openpitrix/pkg/constants/common.go | 276 - .../openpitrix/pkg/constants/dlock.go | 10 - .../pkg/constants/email_template.go | 448 -- .../openpitrix/pkg/constants/frontgate.go | 28 - .../pkg/constants/notify_message.go | 708 -- .../openpitrix/pkg/constants/table.go | 44 - .../openpitrix/pkg/constants/user.go | 11 - .../openpitrix/pkg/db/Dockerfile | 12 - .../openpitrix/pkg/db/condition.go | 107 - .../openpitrix/pkg/db/connection.go | 74 - vendor/openpitrix.io/openpitrix/pkg/db/db.go | 278 - .../openpitrix.io/openpitrix/pkg/db/errors.go | 22 - .../openpitrix.io/openpitrix/pkg/db/event.go | 49 - .../openpitrix.io/openpitrix/pkg/db/util.go | 31 - .../openpitrix/pkg/gerr/codes.go | 125 - .../openpitrix/pkg/gerr/error.go | 85 - .../openpitrix/pkg/gerr/message.go | 495 -- .../openpitrix/pkg/logger/logger.go | 201 - .../openpitrix/pkg/manager/checker.go | 132 - .../openpitrix/pkg/manager/common.go | 273 - .../openpitrix/pkg/manager/grpc_client.go | 64 - .../openpitrix/pkg/manager/grpc_server.go | 199 - .../openpitrix.io/openpitrix/pkg/pb/0.pb.go | 49 - .../openpitrix/pkg/pb/account.pb.go | 5269 ------------- .../openpitrix/pkg/pb/account.pb.gw.go | 2445 ------ .../openpitrix.io/openpitrix/pkg/pb/app.pb.go | 5322 ------------- .../openpitrix/pkg/pb/app.pb.gw.go | 2635 ------- .../openpitrix/pkg/pb/attachment.pb.go | 1036 --- .../openpitrix/pkg/pb/attachment.pb.gw.go | 162 - .../openpitrix/pkg/pb/category.pb.go | 884 --- .../openpitrix/pkg/pb/category.pb.gw.go | 396 - .../openpitrix/pkg/pb/cluster.pb.go | 6745 ----------------- .../openpitrix/pkg/pb/cluster.pb.gw.go | 2168 ------ .../openpitrix/pkg/pb/helm.pb.go | 926 --- .../openpitrix/pkg/pb/helm.pb.gw.go | 474 -- .../openpitrix.io/openpitrix/pkg/pb/isv.pb.go | 1283 ---- .../openpitrix/pkg/pb/isv.pb.gw.go | 550 -- .../openpitrix.io/openpitrix/pkg/pb/job.pb.go | 779 -- .../openpitrix/pkg/pb/job.pb.gw.go | 162 - .../openpitrix/pkg/pb/market.pb.go | 1377 ---- .../openpitrix/pkg/pb/market.pb.gw.go | 629 -- .../openpitrix/pkg/pb/repo.pb.go | 1460 ---- .../openpitrix/pkg/pb/repo.pb.gw.go | 473 -- .../openpitrix/pkg/pb/repo_indexer.pb.go | 528 -- .../openpitrix/pkg/pb/repo_indexer.pb.gw.go | 240 - .../openpitrix/pkg/pb/runtime.pb.go | 2490 ------ .../openpitrix/pkg/pb/runtime.pb.gw.go | 1234 --- .../openpitrix/pkg/pb/runtime_provider.pb.go | 1659 ---- .../openpitrix/pkg/pb/service_config.pb.go | 802 -- .../openpitrix/pkg/pb/service_config.pb.gw.go | 319 - .../openpitrix/pkg/pb/task.pb.go | 880 --- .../openpitrix/pkg/pb/task.pb.gw.go | 240 - .../openpitrix/pkg/pb/types.pb.go | 179 - .../openpitrix/pkg/sender/owner_path.go | 46 - .../openpitrix/pkg/sender/sender.go | 60 - .../openpitrix/pkg/util/ctxutil/ctx.go | 56 - .../openpitrix/pkg/util/ctxutil/locale.go | 25 - .../openpitrix/pkg/util/ctxutil/message.go | 35 - .../openpitrix/pkg/util/ctxutil/request.go | 29 - .../openpitrix/pkg/util/ctxutil/sender.go | 45 - .../openpitrix/pkg/util/pbutil/pb.go | 139 - .../pkg/util/reflectutil/reflect.go | 38 - .../openpitrix/pkg/util/stringutil/base64.go | 15 - .../openpitrix/pkg/util/stringutil/string.go | 68 - .../openpitrix/pkg/util/yamlutil/yaml.go | 20 - .../openpitrix/pkg/version/.gitignore | 1 - .../openpitrix/pkg/version/Makefile | 9 - .../openpitrix/pkg/version/version.go | 26 - vendor/sigs.k8s.io/kustomize/LICENSE | 201 + .../kustomize/pkg/commands/build/build.go | 129 + .../kustomize/pkg/constants/constants.go | 28 + .../kustomize/pkg/expansion/expand.go | 121 + .../kustomize/pkg/factory/factory.go | 39 + .../kustomize/pkg/fs/confirmeddir.go | 93 + .../sigs.k8s.io/kustomize/pkg/fs/fakefile.go | 69 + .../kustomize/pkg/fs/fakefileinfo.go | 47 + vendor/sigs.k8s.io/kustomize/pkg/fs/fakefs.go | 185 + vendor/sigs.k8s.io/kustomize/pkg/fs/fs.go | 44 + .../sigs.k8s.io/kustomize/pkg/fs/realfile.go | 40 + vendor/sigs.k8s.io/kustomize/pkg/fs/realfs.go | 122 + .../sigs.k8s.io/kustomize/pkg/git/cloner.go | 75 + .../sigs.k8s.io/kustomize/pkg/git/repospec.go | 214 + vendor/sigs.k8s.io/kustomize/pkg/gvk/gvk.go | 180 + vendor/sigs.k8s.io/kustomize/pkg/ifc/ifc.go | 73 + .../kustomize/pkg/ifc/transformer/factory.go | 29 + .../kustomize/pkg/image/deprecatedimage.go | 32 + .../sigs.k8s.io/kustomize/pkg/image/image.go | 36 + .../pkg/internal/error/configmaperror.go | 30 + .../pkg/internal/error/kustomizationerror.go | 61 + .../pkg/internal/error/patcherror.go | 32 + .../pkg/internal/error/resourceerror.go | 30 + .../pkg/internal/error/secreterror.go | 30 + .../pkg/internal/error/yamlformaterror.go | 48 + .../kustomize/pkg/loader/fileloader.go | 312 + .../kustomize/pkg/loader/loader.go | 39 + .../kustomize/pkg/patch/json6902.go | 40 + .../kustomize/pkg/patch/strategicmerge.go | 40 + .../pkg/patch/transformer/factory.go | 83 + .../patch/transformer/patchjson6902json.go | 108 + .../sigs.k8s.io/kustomize/pkg/resid/resid.go | 207 + .../kustomize/pkg/resmap/factory.go | 123 + .../kustomize/pkg/resmap/idslice.go | 37 + .../kustomize/pkg/resmap/resmap.go | 200 + .../kustomize/pkg/resource/factory.go | 148 + .../kustomize/pkg/resource/resource.go | 107 + .../kustomize/pkg/target/kusttarget.go | 315 + .../kustomize/pkg/target/resaccumulator.go | 161 + .../config/defaultconfig/commonannotations.go | 60 + .../config/defaultconfig/commonlabels.go | 162 + .../config/defaultconfig/defaultconfig.go | 49 + .../config/defaultconfig/nameprefix.go | 24 + .../config/defaultconfig/namereference.go | 317 + .../config/defaultconfig/namespace.go | 25 + .../config/defaultconfig/varreference.go | 162 + .../pkg/transformers/config/factory.go | 87 + .../pkg/transformers/config/factorycrd.go | 201 + .../pkg/transformers/config/fieldspec.go | 139 + .../transformers/config/namebackreferences.go | 105 + .../transformers/config/transformerconfig.go | 134 + .../kustomize/pkg/transformers/image.go | 171 + .../pkg/transformers/labelsandannotations.go | 86 + .../pkg/transformers/multitransformer.go | 95 + .../kustomize/pkg/transformers/mutatefield.go | 81 + .../pkg/transformers/namereference.go | 144 + .../kustomize/pkg/transformers/namespace.go | 121 + .../pkg/transformers/nooptransformer.go | 34 + .../pkg/transformers/prefixsuffixname.go | 109 + .../kustomize/pkg/transformers/refvars.go | 94 + .../kustomize/pkg/transformers/transformer.go | 26 + .../kustomize/pkg/types/genargs.go | 64 + .../kustomize/pkg/types/generationbehavior.go | 59 + .../kustomize/pkg/types/kustomization.go | 250 + vendor/sigs.k8s.io/kustomize/pkg/types/var.go | 145 + 462 files changed, 44484 insertions(+), 51111 deletions(-) create mode 100644 vendor/github.com/MakeNowJust/heredoc/LICENSE create mode 100644 vendor/github.com/MakeNowJust/heredoc/README.md create mode 100644 vendor/github.com/MakeNowJust/heredoc/heredoc.go create mode 100644 vendor/github.com/Masterminds/semver/v3/.gitignore create mode 100644 vendor/github.com/Masterminds/semver/v3/.golangci.yml create mode 100644 vendor/github.com/Masterminds/semver/v3/.travis.yml create mode 100644 vendor/github.com/Masterminds/semver/v3/CHANGELOG.md create mode 100644 vendor/github.com/Masterminds/semver/v3/LICENSE.txt create mode 100644 vendor/github.com/Masterminds/semver/v3/Makefile create mode 100644 vendor/github.com/Masterminds/semver/v3/README.md create mode 100644 vendor/github.com/Masterminds/semver/v3/appveyor.yml create mode 100644 vendor/github.com/Masterminds/semver/v3/collection.go create mode 100644 vendor/github.com/Masterminds/semver/v3/constraints.go create mode 100644 vendor/github.com/Masterminds/semver/v3/doc.go create mode 100644 vendor/github.com/Masterminds/semver/v3/fuzz.go create mode 100644 vendor/github.com/Masterminds/semver/v3/go.mod create mode 100644 vendor/github.com/Masterminds/semver/v3/version.go rename vendor/github.com/{opencontainers/go-digest/LICENSE.code => containerd/containerd/LICENSE} (99%) create mode 100644 vendor/github.com/containerd/containerd/NOTICE create mode 100644 vendor/github.com/containerd/containerd/errdefs/errors.go create mode 100644 vendor/github.com/containerd/containerd/errdefs/grpc.go create mode 100644 vendor/github.com/docker/docker/api/types/error_response_ext.go rename vendor/github.com/{koding/multiconfig => exponent-io/jsonpath}/.gitignore (97%) create mode 100644 vendor/github.com/exponent-io/jsonpath/.travis.yml rename vendor/github.com/{koding/multiconfig => exponent-io/jsonpath}/LICENSE (96%) create mode 100644 vendor/github.com/exponent-io/jsonpath/README.md create mode 100644 vendor/github.com/exponent-io/jsonpath/decoder.go create mode 100644 vendor/github.com/exponent-io/jsonpath/path.go create mode 100644 vendor/github.com/exponent-io/jsonpath/pathaction.go rename vendor/github.com/{fatih/camelcase => google/btree}/.travis.yml (59%) rename vendor/github.com/{golang/mock => google/btree}/LICENSE (100%) create mode 100644 vendor/github.com/google/btree/README.md create mode 100644 vendor/github.com/google/btree/btree.go create mode 100644 vendor/github.com/gregjones/httpcache/.travis.yml create mode 100644 vendor/github.com/gregjones/httpcache/LICENSE.txt create mode 100644 vendor/github.com/gregjones/httpcache/README.md create mode 100644 vendor/github.com/gregjones/httpcache/diskcache/diskcache.go create mode 100644 vendor/github.com/gregjones/httpcache/httpcache.go create mode 100644 vendor/github.com/jszwec/csvutil/.gitignore create mode 100644 vendor/github.com/jszwec/csvutil/LICENSE create mode 100644 vendor/github.com/jszwec/csvutil/README.md create mode 100644 vendor/github.com/jszwec/csvutil/_config.yml create mode 100644 vendor/github.com/jszwec/csvutil/cache.go create mode 100644 vendor/github.com/jszwec/csvutil/cache_go17.go create mode 100644 vendor/github.com/jszwec/csvutil/cache_go19.go create mode 100644 vendor/github.com/jszwec/csvutil/csvutil.go create mode 100644 vendor/github.com/jszwec/csvutil/csvutil_go17.go create mode 100644 vendor/github.com/jszwec/csvutil/csvutil_go19.go create mode 100644 vendor/github.com/jszwec/csvutil/decode.go create mode 100644 vendor/github.com/jszwec/csvutil/decoder.go create mode 100644 vendor/github.com/jszwec/csvutil/doc.go create mode 100644 vendor/github.com/jszwec/csvutil/encode.go create mode 100644 vendor/github.com/jszwec/csvutil/encoder.go create mode 100644 vendor/github.com/jszwec/csvutil/error.go create mode 100644 vendor/github.com/jszwec/csvutil/go.mod create mode 100644 vendor/github.com/jszwec/csvutil/interface.go create mode 100644 vendor/github.com/jszwec/csvutil/tag.go create mode 100644 vendor/github.com/mitchellh/go-wordwrap/LICENSE.md create mode 100644 vendor/github.com/mitchellh/go-wordwrap/README.md create mode 100644 vendor/github.com/mitchellh/go-wordwrap/go.mod create mode 100644 vendor/github.com/mitchellh/go-wordwrap/wordwrap.go create mode 100644 vendor/github.com/opencontainers/go-digest/LICENSE create mode 100644 vendor/github.com/opencontainers/go-digest/go.mod create mode 100644 vendor/github.com/peterbourgon/diskv/LICENSE create mode 100644 vendor/github.com/peterbourgon/diskv/README.md create mode 100644 vendor/github.com/peterbourgon/diskv/compression.go create mode 100644 vendor/github.com/peterbourgon/diskv/diskv.go create mode 100644 vendor/github.com/peterbourgon/diskv/index.go create mode 100644 vendor/github.com/russross/blackfriday/.gitignore create mode 100644 vendor/github.com/russross/blackfriday/.travis.yml create mode 100644 vendor/github.com/russross/blackfriday/LICENSE.txt create mode 100644 vendor/github.com/russross/blackfriday/README.md create mode 100644 vendor/github.com/russross/blackfriday/block.go create mode 100644 vendor/github.com/russross/blackfriday/doc.go create mode 100644 vendor/github.com/russross/blackfriday/go.mod create mode 100644 vendor/github.com/russross/blackfriday/html.go create mode 100644 vendor/github.com/russross/blackfriday/inline.go create mode 100644 vendor/github.com/russross/blackfriday/latex.go create mode 100644 vendor/github.com/russross/blackfriday/markdown.go create mode 100644 vendor/github.com/russross/blackfriday/smartypants.go create mode 100644 vendor/golang.org/x/crypto/chacha20/chacha_arm64.go rename vendor/golang.org/x/crypto/{internal/chacha20/asm_arm64.s => chacha20/chacha_arm64.s} (99%) create mode 100644 vendor/golang.org/x/crypto/chacha20/chacha_generic.go rename vendor/golang.org/x/crypto/{internal => }/chacha20/chacha_noasm.go (50%) create mode 100644 vendor/golang.org/x/crypto/chacha20/chacha_ppc64le.go create mode 100644 vendor/golang.org/x/crypto/chacha20/chacha_ppc64le.s create mode 100644 vendor/golang.org/x/crypto/chacha20/chacha_s390x.go rename vendor/golang.org/x/crypto/{internal => }/chacha20/chacha_s390x.s (87%) rename vendor/golang.org/x/crypto/{internal => }/chacha20/xor.go (73%) rename vendor/golang.org/x/crypto/curve25519/{mont25519_amd64.go => curve25519_amd64.go} (99%) rename vendor/golang.org/x/crypto/curve25519/{ladderstep_amd64.s => curve25519_amd64.s} (73%) create mode 100644 vendor/golang.org/x/crypto/curve25519/curve25519_generic.go create mode 100644 vendor/golang.org/x/crypto/curve25519/curve25519_noasm.go create mode 100644 vendor/golang.org/x/crypto/ed25519/ed25519_go113.go create mode 100644 vendor/golang.org/x/crypto/openpgp/clearsign/clearsign.go create mode 100644 vendor/golang.org/x/crypto/poly1305/bits_compat.go create mode 100644 vendor/golang.org/x/crypto/poly1305/bits_go1.13.go create mode 100644 vendor/golang.org/x/crypto/poly1305/sum_ppc64le.go create mode 100644 vendor/golang.org/x/crypto/poly1305/sum_ppc64le.s rename vendor/golang.org/x/crypto/salsa20/salsa/{salsa2020_amd64.s => salsa20_amd64.s} (99%) create mode 100644 vendor/golang.org/x/crypto/salsa20/salsa/salsa20_noasm.go create mode 100644 vendor/golang.org/x/crypto/ssh/internal/bcrypt_pbkdf/bcrypt_pbkdf.go create mode 100644 vendor/golang.org/x/crypto/ssh/ssh_gss.go create mode 100644 vendor/k8s.io/api/imagepolicy/v1alpha1/doc.go create mode 100644 vendor/k8s.io/api/imagepolicy/v1alpha1/generated.pb.go create mode 100644 vendor/k8s.io/api/imagepolicy/v1alpha1/generated.proto create mode 100644 vendor/k8s.io/api/imagepolicy/v1alpha1/register.go create mode 100644 vendor/k8s.io/api/imagepolicy/v1alpha1/types.go create mode 100644 vendor/k8s.io/api/imagepolicy/v1alpha1/types_swagger_doc_generated.go create mode 100644 vendor/k8s.io/api/imagepolicy/v1alpha1/zz_generated.deepcopy.go create mode 100644 vendor/k8s.io/apimachinery/pkg/apis/meta/v1/unstructured/unstructuredscheme/scheme.go create mode 100644 vendor/k8s.io/cli-runtime/pkg/genericclioptions/builder_flags.go create mode 100644 vendor/k8s.io/cli-runtime/pkg/genericclioptions/builder_flags_fake.go create mode 100644 vendor/k8s.io/cli-runtime/pkg/genericclioptions/config_flags.go create mode 100644 vendor/k8s.io/cli-runtime/pkg/genericclioptions/config_flags_fake.go create mode 100644 vendor/k8s.io/cli-runtime/pkg/genericclioptions/doc.go create mode 100644 vendor/k8s.io/cli-runtime/pkg/genericclioptions/filename_flags.go create mode 100644 vendor/k8s.io/cli-runtime/pkg/genericclioptions/io_options.go create mode 100644 vendor/k8s.io/cli-runtime/pkg/genericclioptions/json_yaml_flags.go create mode 100644 vendor/k8s.io/cli-runtime/pkg/genericclioptions/jsonpath_flags.go create mode 100644 vendor/k8s.io/cli-runtime/pkg/genericclioptions/kube_template_flags.go create mode 100644 vendor/k8s.io/cli-runtime/pkg/genericclioptions/name_flags.go create mode 100644 vendor/k8s.io/cli-runtime/pkg/genericclioptions/print_flags.go create mode 100644 vendor/k8s.io/cli-runtime/pkg/genericclioptions/record_flags.go create mode 100644 vendor/k8s.io/cli-runtime/pkg/genericclioptions/template_flags.go create mode 100644 vendor/k8s.io/cli-runtime/pkg/kustomize/builder.go create mode 100644 vendor/k8s.io/cli-runtime/pkg/kustomize/k8sdeps/configmapandsecret/configmapfactory.go create mode 100644 vendor/k8s.io/cli-runtime/pkg/kustomize/k8sdeps/configmapandsecret/kv.go create mode 100644 vendor/k8s.io/cli-runtime/pkg/kustomize/k8sdeps/configmapandsecret/secretfactory.go create mode 100644 vendor/k8s.io/cli-runtime/pkg/kustomize/k8sdeps/doc.go create mode 100644 vendor/k8s.io/cli-runtime/pkg/kustomize/k8sdeps/factory.go create mode 100644 vendor/k8s.io/cli-runtime/pkg/kustomize/k8sdeps/kunstruct/factory.go create mode 100644 vendor/k8s.io/cli-runtime/pkg/kustomize/k8sdeps/kunstruct/helper.go create mode 100644 vendor/k8s.io/cli-runtime/pkg/kustomize/k8sdeps/kunstruct/kunstruct.go create mode 100644 vendor/k8s.io/cli-runtime/pkg/kustomize/k8sdeps/kv/kv.go create mode 100644 vendor/k8s.io/cli-runtime/pkg/kustomize/k8sdeps/transformer/factory.go create mode 100644 vendor/k8s.io/cli-runtime/pkg/kustomize/k8sdeps/transformer/hash/hash.go create mode 100644 vendor/k8s.io/cli-runtime/pkg/kustomize/k8sdeps/transformer/hash/namehash.go create mode 100644 vendor/k8s.io/cli-runtime/pkg/kustomize/k8sdeps/transformer/patch/patch.go create mode 100644 vendor/k8s.io/cli-runtime/pkg/kustomize/k8sdeps/transformer/patch/patchconflictdetector.go create mode 100644 vendor/k8s.io/cli-runtime/pkg/kustomize/k8sdeps/validator/validators.go create mode 100644 vendor/k8s.io/cli-runtime/pkg/resource/builder.go create mode 100644 vendor/k8s.io/cli-runtime/pkg/resource/client.go create mode 100644 vendor/k8s.io/cli-runtime/pkg/resource/crd_finder.go create mode 100644 vendor/k8s.io/cli-runtime/pkg/resource/doc.go create mode 100644 vendor/k8s.io/cli-runtime/pkg/resource/dry_run_verifier.go create mode 100644 vendor/k8s.io/cli-runtime/pkg/resource/fake.go create mode 100644 vendor/k8s.io/cli-runtime/pkg/resource/helper.go create mode 100644 vendor/k8s.io/cli-runtime/pkg/resource/interfaces.go create mode 100644 vendor/k8s.io/cli-runtime/pkg/resource/mapper.go create mode 100644 vendor/k8s.io/cli-runtime/pkg/resource/metadata_decoder.go create mode 100644 vendor/k8s.io/cli-runtime/pkg/resource/result.go create mode 100644 vendor/k8s.io/cli-runtime/pkg/resource/scheme.go create mode 100644 vendor/k8s.io/cli-runtime/pkg/resource/selector.go create mode 100644 vendor/k8s.io/cli-runtime/pkg/resource/visitor.go create mode 100644 vendor/k8s.io/client-go/discovery/cached/disk/cached_discovery.go create mode 100644 vendor/k8s.io/client-go/discovery/cached/disk/round_tripper.go create mode 100644 vendor/k8s.io/client-go/scale/client.go create mode 100644 vendor/k8s.io/client-go/scale/doc.go create mode 100644 vendor/k8s.io/client-go/scale/interfaces.go create mode 100644 vendor/k8s.io/client-go/scale/scheme/appsint/doc.go create mode 100644 vendor/k8s.io/client-go/scale/scheme/appsint/register.go create mode 100644 vendor/k8s.io/client-go/scale/scheme/appsv1beta1/conversion.go create mode 100644 vendor/k8s.io/client-go/scale/scheme/appsv1beta1/doc.go create mode 100644 vendor/k8s.io/client-go/scale/scheme/appsv1beta1/register.go create mode 100644 vendor/k8s.io/client-go/scale/scheme/appsv1beta1/zz_generated.conversion.go create mode 100644 vendor/k8s.io/client-go/scale/scheme/appsv1beta2/conversion.go create mode 100644 vendor/k8s.io/client-go/scale/scheme/appsv1beta2/doc.go create mode 100644 vendor/k8s.io/client-go/scale/scheme/appsv1beta2/register.go create mode 100644 vendor/k8s.io/client-go/scale/scheme/appsv1beta2/zz_generated.conversion.go create mode 100644 vendor/k8s.io/client-go/scale/scheme/autoscalingv1/conversion.go create mode 100644 vendor/k8s.io/client-go/scale/scheme/autoscalingv1/doc.go create mode 100644 vendor/k8s.io/client-go/scale/scheme/autoscalingv1/register.go create mode 100644 vendor/k8s.io/client-go/scale/scheme/autoscalingv1/zz_generated.conversion.go create mode 100644 vendor/k8s.io/client-go/scale/scheme/doc.go create mode 100644 vendor/k8s.io/client-go/scale/scheme/extensionsint/doc.go create mode 100644 vendor/k8s.io/client-go/scale/scheme/extensionsint/register.go create mode 100644 vendor/k8s.io/client-go/scale/scheme/extensionsv1beta1/conversion.go create mode 100644 vendor/k8s.io/client-go/scale/scheme/extensionsv1beta1/doc.go create mode 100644 vendor/k8s.io/client-go/scale/scheme/extensionsv1beta1/register.go create mode 100644 vendor/k8s.io/client-go/scale/scheme/extensionsv1beta1/zz_generated.conversion.go create mode 100644 vendor/k8s.io/client-go/scale/scheme/register.go create mode 100644 vendor/k8s.io/client-go/scale/scheme/types.go create mode 100644 vendor/k8s.io/client-go/scale/scheme/zz_generated.deepcopy.go create mode 100644 vendor/k8s.io/client-go/scale/util.go create mode 100644 vendor/k8s.io/kube-openapi/pkg/util/proto/validation/errors.go create mode 100644 vendor/k8s.io/kube-openapi/pkg/util/proto/validation/types.go create mode 100644 vendor/k8s.io/kube-openapi/pkg/util/proto/validation/validation.go create mode 100644 vendor/k8s.io/kubectl/pkg/cmd/util/factory.go create mode 100644 vendor/k8s.io/kubectl/pkg/cmd/util/factory_client_access.go create mode 100644 vendor/k8s.io/kubectl/pkg/cmd/util/helpers.go create mode 100644 vendor/k8s.io/kubectl/pkg/cmd/util/kubectl_match_version.go create mode 100644 vendor/k8s.io/kubectl/pkg/cmd/util/printing.go create mode 100644 vendor/k8s.io/kubectl/pkg/scheme/install.go create mode 100644 vendor/k8s.io/kubectl/pkg/scheme/scheme.go create mode 100644 vendor/k8s.io/kubectl/pkg/util/interrupt/interrupt.go create mode 100644 vendor/k8s.io/kubectl/pkg/util/openapi/OWNERS create mode 100644 vendor/k8s.io/kubectl/pkg/util/openapi/doc.go create mode 100644 vendor/k8s.io/kubectl/pkg/util/openapi/extensions.go create mode 100644 vendor/k8s.io/kubectl/pkg/util/openapi/openapi.go create mode 100644 vendor/k8s.io/kubectl/pkg/util/openapi/openapi_getter.go create mode 100644 vendor/k8s.io/kubectl/pkg/util/openapi/validation/validation.go create mode 100644 vendor/k8s.io/kubectl/pkg/util/templates/command_groups.go create mode 100644 vendor/k8s.io/kubectl/pkg/util/templates/markdown.go create mode 100644 vendor/k8s.io/kubectl/pkg/util/templates/normalizers.go create mode 100644 vendor/k8s.io/kubectl/pkg/util/templates/templater.go create mode 100644 vendor/k8s.io/kubectl/pkg/util/templates/templates.go create mode 100644 vendor/k8s.io/kubectl/pkg/util/term/resize.go create mode 100644 vendor/k8s.io/kubectl/pkg/util/term/resizeevents.go create mode 100644 vendor/k8s.io/kubectl/pkg/util/term/resizeevents_windows.go create mode 100644 vendor/k8s.io/kubectl/pkg/util/term/term.go create mode 100644 vendor/k8s.io/kubectl/pkg/util/term/term_writer.go create mode 100644 vendor/k8s.io/kubectl/pkg/validation/schema.go create mode 100644 vendor/k8s.io/utils/exec/README.md create mode 100644 vendor/k8s.io/utils/exec/doc.go create mode 100644 vendor/k8s.io/utils/exec/exec.go create mode 100644 vendor/k8s.io/utils/strings/escape.go create mode 100644 vendor/k8s.io/utils/strings/line_delimiter.go create mode 100644 vendor/k8s.io/utils/strings/strings.go delete mode 120000 vendor/kubesphere.io/client-go rename vendor/{openpitrix.io/openpitrix => kubesphere.io/client-go}/LICENSE (99%) create mode 100644 vendor/kubesphere.io/client-go/client/clientCache.go create mode 100644 vendor/kubesphere.io/client-go/client/codec.go create mode 100644 vendor/kubesphere.io/client-go/client/generic/genericclient.go create mode 100644 vendor/kubesphere.io/client-go/client/generic/typedClient.go create mode 100644 vendor/kubesphere.io/client-go/client/generic/unstructuredClient.go create mode 100644 vendor/kubesphere.io/client-go/client/interface.go create mode 100644 vendor/kubesphere.io/client-go/client/options.go rename vendor/{github.com/grpc-ecosystem/go-grpc-middleware => kubesphere.io/monitoring-dashboard}/LICENSE (99%) create mode 100644 vendor/kubesphere.io/monitoring-dashboard/api/v1alpha1/dashboard_types.go create mode 100644 vendor/kubesphere.io/monitoring-dashboard/api/v1alpha1/groupversion_info.go create mode 100644 vendor/kubesphere.io/monitoring-dashboard/api/v1alpha1/panels/common_types.go create mode 100644 vendor/kubesphere.io/monitoring-dashboard/api/v1alpha1/panels/graph_types.go create mode 100644 vendor/kubesphere.io/monitoring-dashboard/api/v1alpha1/panels/row_types.go create mode 100644 vendor/kubesphere.io/monitoring-dashboard/api/v1alpha1/panels/singlestat_types.go create mode 100644 vendor/kubesphere.io/monitoring-dashboard/api/v1alpha1/panels/zz_generated.deepcopy.go create mode 100644 vendor/kubesphere.io/monitoring-dashboard/api/v1alpha1/zz_generated.deepcopy.go delete mode 100644 vendor/openpitrix.io/openpitrix/AUTHORS delete mode 100644 vendor/openpitrix.io/openpitrix/CONTRIBUTORS delete mode 100644 vendor/openpitrix.io/openpitrix/pkg/config/config.go delete mode 100644 vendor/openpitrix.io/openpitrix/pkg/config/env_loader.go delete mode 100644 vendor/openpitrix.io/openpitrix/pkg/config/global_config.go delete mode 100644 vendor/openpitrix.io/openpitrix/pkg/config/init_global_config.go delete mode 100644 vendor/openpitrix.io/openpitrix/pkg/constants/column.go delete mode 100644 vendor/openpitrix.io/openpitrix/pkg/constants/common.go delete mode 100644 vendor/openpitrix.io/openpitrix/pkg/constants/dlock.go delete mode 100644 vendor/openpitrix.io/openpitrix/pkg/constants/email_template.go delete mode 100644 vendor/openpitrix.io/openpitrix/pkg/constants/frontgate.go delete mode 100644 vendor/openpitrix.io/openpitrix/pkg/constants/notify_message.go delete mode 100644 vendor/openpitrix.io/openpitrix/pkg/constants/table.go delete mode 100644 vendor/openpitrix.io/openpitrix/pkg/constants/user.go delete mode 100644 vendor/openpitrix.io/openpitrix/pkg/db/Dockerfile delete mode 100644 vendor/openpitrix.io/openpitrix/pkg/db/condition.go delete mode 100644 vendor/openpitrix.io/openpitrix/pkg/db/connection.go delete mode 100644 vendor/openpitrix.io/openpitrix/pkg/db/db.go delete mode 100644 vendor/openpitrix.io/openpitrix/pkg/db/errors.go delete mode 100644 vendor/openpitrix.io/openpitrix/pkg/db/event.go delete mode 100644 vendor/openpitrix.io/openpitrix/pkg/db/util.go delete mode 100644 vendor/openpitrix.io/openpitrix/pkg/gerr/codes.go delete mode 100644 vendor/openpitrix.io/openpitrix/pkg/gerr/error.go delete mode 100644 vendor/openpitrix.io/openpitrix/pkg/gerr/message.go delete mode 100644 vendor/openpitrix.io/openpitrix/pkg/logger/logger.go delete mode 100644 vendor/openpitrix.io/openpitrix/pkg/manager/checker.go delete mode 100644 vendor/openpitrix.io/openpitrix/pkg/manager/common.go delete mode 100644 vendor/openpitrix.io/openpitrix/pkg/manager/grpc_client.go delete mode 100644 vendor/openpitrix.io/openpitrix/pkg/manager/grpc_server.go delete mode 100644 vendor/openpitrix.io/openpitrix/pkg/pb/0.pb.go delete mode 100644 vendor/openpitrix.io/openpitrix/pkg/pb/account.pb.go delete mode 100644 vendor/openpitrix.io/openpitrix/pkg/pb/account.pb.gw.go delete mode 100644 vendor/openpitrix.io/openpitrix/pkg/pb/app.pb.go delete mode 100644 vendor/openpitrix.io/openpitrix/pkg/pb/app.pb.gw.go delete mode 100644 vendor/openpitrix.io/openpitrix/pkg/pb/attachment.pb.go delete mode 100644 vendor/openpitrix.io/openpitrix/pkg/pb/attachment.pb.gw.go delete mode 100644 vendor/openpitrix.io/openpitrix/pkg/pb/category.pb.go delete mode 100644 vendor/openpitrix.io/openpitrix/pkg/pb/category.pb.gw.go delete mode 100644 vendor/openpitrix.io/openpitrix/pkg/pb/cluster.pb.go delete mode 100644 vendor/openpitrix.io/openpitrix/pkg/pb/cluster.pb.gw.go delete mode 100644 vendor/openpitrix.io/openpitrix/pkg/pb/helm.pb.go delete mode 100644 vendor/openpitrix.io/openpitrix/pkg/pb/helm.pb.gw.go delete mode 100644 vendor/openpitrix.io/openpitrix/pkg/pb/isv.pb.go delete mode 100644 vendor/openpitrix.io/openpitrix/pkg/pb/isv.pb.gw.go delete mode 100644 vendor/openpitrix.io/openpitrix/pkg/pb/job.pb.go delete mode 100644 vendor/openpitrix.io/openpitrix/pkg/pb/job.pb.gw.go delete mode 100644 vendor/openpitrix.io/openpitrix/pkg/pb/market.pb.go delete mode 100644 vendor/openpitrix.io/openpitrix/pkg/pb/market.pb.gw.go delete mode 100644 vendor/openpitrix.io/openpitrix/pkg/pb/repo.pb.go delete mode 100644 vendor/openpitrix.io/openpitrix/pkg/pb/repo.pb.gw.go delete mode 100644 vendor/openpitrix.io/openpitrix/pkg/pb/repo_indexer.pb.go delete mode 100644 vendor/openpitrix.io/openpitrix/pkg/pb/repo_indexer.pb.gw.go delete mode 100644 vendor/openpitrix.io/openpitrix/pkg/pb/runtime.pb.go delete mode 100644 vendor/openpitrix.io/openpitrix/pkg/pb/runtime.pb.gw.go delete mode 100644 vendor/openpitrix.io/openpitrix/pkg/pb/runtime_provider.pb.go delete mode 100644 vendor/openpitrix.io/openpitrix/pkg/pb/service_config.pb.go delete mode 100644 vendor/openpitrix.io/openpitrix/pkg/pb/service_config.pb.gw.go delete mode 100644 vendor/openpitrix.io/openpitrix/pkg/pb/task.pb.go delete mode 100644 vendor/openpitrix.io/openpitrix/pkg/pb/task.pb.gw.go delete mode 100644 vendor/openpitrix.io/openpitrix/pkg/pb/types.pb.go delete mode 100644 vendor/openpitrix.io/openpitrix/pkg/sender/owner_path.go delete mode 100644 vendor/openpitrix.io/openpitrix/pkg/sender/sender.go delete mode 100644 vendor/openpitrix.io/openpitrix/pkg/util/ctxutil/ctx.go delete mode 100644 vendor/openpitrix.io/openpitrix/pkg/util/ctxutil/locale.go delete mode 100644 vendor/openpitrix.io/openpitrix/pkg/util/ctxutil/message.go delete mode 100644 vendor/openpitrix.io/openpitrix/pkg/util/ctxutil/request.go delete mode 100644 vendor/openpitrix.io/openpitrix/pkg/util/ctxutil/sender.go delete mode 100644 vendor/openpitrix.io/openpitrix/pkg/util/pbutil/pb.go delete mode 100644 vendor/openpitrix.io/openpitrix/pkg/util/reflectutil/reflect.go delete mode 100644 vendor/openpitrix.io/openpitrix/pkg/util/stringutil/base64.go delete mode 100644 vendor/openpitrix.io/openpitrix/pkg/util/stringutil/string.go delete mode 100644 vendor/openpitrix.io/openpitrix/pkg/util/yamlutil/yaml.go delete mode 100644 vendor/openpitrix.io/openpitrix/pkg/version/.gitignore delete mode 100644 vendor/openpitrix.io/openpitrix/pkg/version/Makefile delete mode 100644 vendor/openpitrix.io/openpitrix/pkg/version/version.go create mode 100644 vendor/sigs.k8s.io/kustomize/LICENSE create mode 100644 vendor/sigs.k8s.io/kustomize/pkg/commands/build/build.go create mode 100644 vendor/sigs.k8s.io/kustomize/pkg/constants/constants.go create mode 100644 vendor/sigs.k8s.io/kustomize/pkg/expansion/expand.go create mode 100644 vendor/sigs.k8s.io/kustomize/pkg/factory/factory.go create mode 100644 vendor/sigs.k8s.io/kustomize/pkg/fs/confirmeddir.go create mode 100644 vendor/sigs.k8s.io/kustomize/pkg/fs/fakefile.go create mode 100644 vendor/sigs.k8s.io/kustomize/pkg/fs/fakefileinfo.go create mode 100644 vendor/sigs.k8s.io/kustomize/pkg/fs/fakefs.go create mode 100644 vendor/sigs.k8s.io/kustomize/pkg/fs/fs.go create mode 100644 vendor/sigs.k8s.io/kustomize/pkg/fs/realfile.go create mode 100644 vendor/sigs.k8s.io/kustomize/pkg/fs/realfs.go create mode 100644 vendor/sigs.k8s.io/kustomize/pkg/git/cloner.go create mode 100644 vendor/sigs.k8s.io/kustomize/pkg/git/repospec.go create mode 100644 vendor/sigs.k8s.io/kustomize/pkg/gvk/gvk.go create mode 100644 vendor/sigs.k8s.io/kustomize/pkg/ifc/ifc.go create mode 100644 vendor/sigs.k8s.io/kustomize/pkg/ifc/transformer/factory.go create mode 100644 vendor/sigs.k8s.io/kustomize/pkg/image/deprecatedimage.go create mode 100644 vendor/sigs.k8s.io/kustomize/pkg/image/image.go create mode 100644 vendor/sigs.k8s.io/kustomize/pkg/internal/error/configmaperror.go create mode 100644 vendor/sigs.k8s.io/kustomize/pkg/internal/error/kustomizationerror.go create mode 100644 vendor/sigs.k8s.io/kustomize/pkg/internal/error/patcherror.go create mode 100644 vendor/sigs.k8s.io/kustomize/pkg/internal/error/resourceerror.go create mode 100644 vendor/sigs.k8s.io/kustomize/pkg/internal/error/secreterror.go create mode 100644 vendor/sigs.k8s.io/kustomize/pkg/internal/error/yamlformaterror.go create mode 100644 vendor/sigs.k8s.io/kustomize/pkg/loader/fileloader.go create mode 100644 vendor/sigs.k8s.io/kustomize/pkg/loader/loader.go create mode 100644 vendor/sigs.k8s.io/kustomize/pkg/patch/json6902.go create mode 100644 vendor/sigs.k8s.io/kustomize/pkg/patch/strategicmerge.go create mode 100644 vendor/sigs.k8s.io/kustomize/pkg/patch/transformer/factory.go create mode 100644 vendor/sigs.k8s.io/kustomize/pkg/patch/transformer/patchjson6902json.go create mode 100644 vendor/sigs.k8s.io/kustomize/pkg/resid/resid.go create mode 100644 vendor/sigs.k8s.io/kustomize/pkg/resmap/factory.go create mode 100644 vendor/sigs.k8s.io/kustomize/pkg/resmap/idslice.go create mode 100644 vendor/sigs.k8s.io/kustomize/pkg/resmap/resmap.go create mode 100644 vendor/sigs.k8s.io/kustomize/pkg/resource/factory.go create mode 100644 vendor/sigs.k8s.io/kustomize/pkg/resource/resource.go create mode 100644 vendor/sigs.k8s.io/kustomize/pkg/target/kusttarget.go create mode 100644 vendor/sigs.k8s.io/kustomize/pkg/target/resaccumulator.go create mode 100644 vendor/sigs.k8s.io/kustomize/pkg/transformers/config/defaultconfig/commonannotations.go create mode 100644 vendor/sigs.k8s.io/kustomize/pkg/transformers/config/defaultconfig/commonlabels.go create mode 100644 vendor/sigs.k8s.io/kustomize/pkg/transformers/config/defaultconfig/defaultconfig.go create mode 100644 vendor/sigs.k8s.io/kustomize/pkg/transformers/config/defaultconfig/nameprefix.go create mode 100644 vendor/sigs.k8s.io/kustomize/pkg/transformers/config/defaultconfig/namereference.go create mode 100644 vendor/sigs.k8s.io/kustomize/pkg/transformers/config/defaultconfig/namespace.go create mode 100644 vendor/sigs.k8s.io/kustomize/pkg/transformers/config/defaultconfig/varreference.go create mode 100644 vendor/sigs.k8s.io/kustomize/pkg/transformers/config/factory.go create mode 100644 vendor/sigs.k8s.io/kustomize/pkg/transformers/config/factorycrd.go create mode 100644 vendor/sigs.k8s.io/kustomize/pkg/transformers/config/fieldspec.go create mode 100644 vendor/sigs.k8s.io/kustomize/pkg/transformers/config/namebackreferences.go create mode 100644 vendor/sigs.k8s.io/kustomize/pkg/transformers/config/transformerconfig.go create mode 100644 vendor/sigs.k8s.io/kustomize/pkg/transformers/image.go create mode 100644 vendor/sigs.k8s.io/kustomize/pkg/transformers/labelsandannotations.go create mode 100644 vendor/sigs.k8s.io/kustomize/pkg/transformers/multitransformer.go create mode 100644 vendor/sigs.k8s.io/kustomize/pkg/transformers/mutatefield.go create mode 100644 vendor/sigs.k8s.io/kustomize/pkg/transformers/namereference.go create mode 100644 vendor/sigs.k8s.io/kustomize/pkg/transformers/namespace.go create mode 100644 vendor/sigs.k8s.io/kustomize/pkg/transformers/nooptransformer.go create mode 100644 vendor/sigs.k8s.io/kustomize/pkg/transformers/prefixsuffixname.go create mode 100644 vendor/sigs.k8s.io/kustomize/pkg/transformers/refvars.go create mode 100644 vendor/sigs.k8s.io/kustomize/pkg/transformers/transformer.go create mode 100644 vendor/sigs.k8s.io/kustomize/pkg/types/genargs.go create mode 100644 vendor/sigs.k8s.io/kustomize/pkg/types/generationbehavior.go create mode 100644 vendor/sigs.k8s.io/kustomize/pkg/types/kustomization.go create mode 100644 vendor/sigs.k8s.io/kustomize/pkg/types/var.go diff --git a/vendor/github.com/MakeNowJust/heredoc/LICENSE b/vendor/github.com/MakeNowJust/heredoc/LICENSE new file mode 100644 index 0000000000..8a58c22208 --- /dev/null +++ b/vendor/github.com/MakeNowJust/heredoc/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014-2017 TSUYUSATO Kitsune + +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/MakeNowJust/heredoc/README.md b/vendor/github.com/MakeNowJust/heredoc/README.md new file mode 100644 index 0000000000..7523d204b2 --- /dev/null +++ b/vendor/github.com/MakeNowJust/heredoc/README.md @@ -0,0 +1,53 @@ +# heredoc [![CircleCI](https://circleci.com/gh/MakeNowJust/heredoc.svg?style=svg)](https://circleci.com/gh/MakeNowJust/heredoc) [![Go Walker](http://gowalker.org/api/v1/badge)](https://gowalker.org/github.com/MakeNowJust/heredoc) + +## About + +Package heredoc provides the here-document with keeping indent. + +## Install + +```console +$ go get github.com/MakeNowJust/heredoc +``` + +## Import + +```go +// usual +import "github.com/MakeNowJust/heredoc" +// shortcuts +import . "github.com/MakeNowJust/heredoc/dot" +``` + +## Example + +```go +package main + +import ( + "fmt" + . "github.com/MakeNowJust/heredoc/dot" +) + +func main() { + fmt.Println(D(` + Lorem ipsum dolor sit amet, consectetur adipisicing elit, + sed do eiusmod tempor incididunt ut labore et dolore magna + aliqua. Ut enim ad minim veniam, ... + `)) + // Output: + // Lorem ipsum dolor sit amet, consectetur adipisicing elit, + // sed do eiusmod tempor incididunt ut labore et dolore magna + // aliqua. Ut enim ad minim veniam, ... + // +} +``` + +## API Document + + - [Go Walker - github.com/MakeNowJust/heredoc](https://gowalker.org/github.com/MakeNowJust/heredoc) + - [Go Walker - github.com/MakeNowJust/heredoc/dot](https://gowalker.org/github.com/MakeNowJust/heredoc/dot) + +## License + +This software is released under the MIT License, see LICENSE. diff --git a/vendor/github.com/MakeNowJust/heredoc/heredoc.go b/vendor/github.com/MakeNowJust/heredoc/heredoc.go new file mode 100644 index 0000000000..63ce72adc4 --- /dev/null +++ b/vendor/github.com/MakeNowJust/heredoc/heredoc.go @@ -0,0 +1,98 @@ +// Copyright (c) 2014-2017 TSUYUSATO Kitsune +// This software is released under the MIT License. +// http://opensource.org/licenses/mit-license.php + +// Package heredoc provides creation of here-documents from raw strings. +// +// Golang supports raw-string syntax. +// doc := ` +// Foo +// Bar +// ` +// But raw-string cannot recognize indentation. Thus such content is an indented string, equivalent to +// "\n\tFoo\n\tBar\n" +// I dont't want this! +// +// However this problem is solved by package heredoc. +// doc := heredoc.Doc(` +// Foo +// Bar +// `) +// Is equivalent to +// "Foo\nBar\n" +package heredoc + +import ( + "fmt" + "strings" + "unicode" +) + +const maxInt = int(^uint(0) >> 1) + +// Doc returns un-indented string as here-document. +func Doc(raw string) string { + skipFirstLine := false + if len(raw) > 0 && raw[0] == '\n' { + raw = raw[1:] + } else { + skipFirstLine = true + } + + lines := strings.Split(raw, "\n") + + minIndentSize := getMinIndent(lines, skipFirstLine) + lines = removeIndentation(lines, minIndentSize, skipFirstLine) + + return strings.Join(lines, "\n") +} + +// getMinIndent calculates the minimum indentation in lines, excluding empty lines. +func getMinIndent(lines []string, skipFirstLine bool) int { + minIndentSize := maxInt + + for i, line := range lines { + if i == 0 && skipFirstLine { + continue + } + + indentSize := 0 + for _, r := range []rune(line) { + if unicode.IsSpace(r) { + indentSize += 1 + } else { + break + } + } + + if len(line) == indentSize { + if i == len(lines)-1 && indentSize < minIndentSize { + lines[i] = "" + } + } else if indentSize < minIndentSize { + minIndentSize = indentSize + } + } + return minIndentSize +} + +// removeIndentation removes n characters from the front of each line in lines. +// Skips first line if skipFirstLine is true, skips empty lines. +func removeIndentation(lines []string, n int, skipFirstLine bool) []string { + for i, line := range lines { + if i == 0 && skipFirstLine { + continue + } + + if len(lines[i]) >= n { + lines[i] = line[n:] + } + } + return lines +} + +// Docf returns unindented and formatted string as here-document. +// Formatting is done as for fmt.Printf(). +func Docf(raw string, args ...interface{}) string { + return fmt.Sprintf(Doc(raw), args...) +} diff --git a/vendor/github.com/Masterminds/semver/v3/.gitignore b/vendor/github.com/Masterminds/semver/v3/.gitignore new file mode 100644 index 0000000000..6b061e6174 --- /dev/null +++ b/vendor/github.com/Masterminds/semver/v3/.gitignore @@ -0,0 +1 @@ +_fuzz/ \ No newline at end of file diff --git a/vendor/github.com/Masterminds/semver/v3/.golangci.yml b/vendor/github.com/Masterminds/semver/v3/.golangci.yml new file mode 100644 index 0000000000..fdbdf1448c --- /dev/null +++ b/vendor/github.com/Masterminds/semver/v3/.golangci.yml @@ -0,0 +1,26 @@ +run: + deadline: 2m + +linters: + disable-all: true + enable: + - deadcode + - dupl + - errcheck + - gofmt + - goimports + - golint + - gosimple + - govet + - ineffassign + - misspell + - nakedret + - structcheck + - unused + - varcheck + +linters-settings: + gofmt: + simplify: true + dupl: + threshold: 400 diff --git a/vendor/github.com/Masterminds/semver/v3/.travis.yml b/vendor/github.com/Masterminds/semver/v3/.travis.yml new file mode 100644 index 0000000000..296b83c17b --- /dev/null +++ b/vendor/github.com/Masterminds/semver/v3/.travis.yml @@ -0,0 +1,27 @@ +language: go + +# Testing and linting occuring via go modules does not really work well prior +# to Go 1.12. This is what can happen with experiments. +go: + - 1.11.x + - 1.12.x + - 1.13.x + - tip + +# Setting sudo access to false will let Travis CI use containers rather than +# VMs to run the tests. For more details see: +# - http://docs.travis-ci.com/user/workers/container-based-infrastructure/ +# - http://docs.travis-ci.com/user/workers/standard-infrastructure/ +sudo: false + +script: + - make lint + - make test-cover + +notifications: + webhooks: + urls: + - https://webhooks.gitter.im/e/06e3328629952dabe3e0 + on_success: change # options: [always|never|change] default: always + on_failure: always # options: [always|never|change] default: always + on_start: never # options: [always|never|change] default: always diff --git a/vendor/github.com/Masterminds/semver/v3/CHANGELOG.md b/vendor/github.com/Masterminds/semver/v3/CHANGELOG.md new file mode 100644 index 0000000000..6b1788d1d2 --- /dev/null +++ b/vendor/github.com/Masterminds/semver/v3/CHANGELOG.md @@ -0,0 +1,166 @@ +# Changelog + +## 3.0.1 (2019-09-13) + +### Fixed + +- #125: Fixes issue with module path for v3 + +## 3.0.0 (2019-09-12) + +This is a major release of the semver package which includes API changes. The Go +API is compatible with ^1. The Go API was not changed because many people are using +`go get` without Go modules for their applications and API breaking changes cause +errors which we have or would need to support. + +The changes in this release are the handling based on the data passed into the +functions. These are described in the added and changed sections below. + +### Added + +- StrictNewVersion function. This is similar to NewVersion but will return an + error if the version passed in is not a strict semantic version. For example, + 1.2.3 would pass but v1.2.3 or 1.2 would fail because they are not strictly + speaking semantic versions. This function is faster, performs fewer operations, + and uses fewer allocations than NewVersion. +- Fuzzing has been performed on NewVersion, StrictNewVersion, and NewConstraint. + The Makefile contains the operations used. For more information on you can start + on Wikipedia at https://en.wikipedia.org/wiki/Fuzzing +- Now using Go modules + +### Changed + +- NewVersion has proper prerelease and metadata validation with error messages + to signal an issue with either of them +- ^ now operates using a similar set of rules to npm/js and Rust/Cargo. If the + version is >=1 the ^ ranges works the same as v1. For major versions of 0 the + rules have changed. The minor version is treated as the stable version unless + a patch is specified and then it is equivalent to =. One difference from npm/js + is that prereleases there are only to a specific version (e.g. 1.2.3). + Prereleases here look over multiple versions and follow semantic version + ordering rules. This pattern now follows along with the expected and requested + handling of this packaged by numerous users. + +## 1.5.0 (2019-09-11) + +### Added + +- #103: Add basic fuzzing for `NewVersion()` (thanks @jesse-c) + +### Changed + +- #82: Clarify wildcard meaning in range constraints and update tests for it (thanks @greysteil) +- #83: Clarify caret operator range for pre-1.0.0 dependencies (thanks @greysteil) +- #72: Adding docs comment pointing to vert for a cli +- #71: Update the docs on pre-release comparator handling +- #89: Test with new go versions (thanks @thedevsaddam) +- #87: Added $ to ValidPrerelease for better validation (thanks @jeremycarroll) + +### Fixed + +- #78: Fix unchecked error in example code (thanks @ravron) +- #70: Fix the handling of pre-releases and the 0.0.0 release edge case +- #97: Fixed copyright file for proper display on GitHub +- #107: Fix handling prerelease when sorting alphanum and num +- #109: Fixed where Validate sometimes returns wrong message on error + +## 1.4.2 (2018-04-10) + +### Changed + +- #72: Updated the docs to point to vert for a console appliaction +- #71: Update the docs on pre-release comparator handling + +### Fixed + +- #70: Fix the handling of pre-releases and the 0.0.0 release edge case + +## 1.4.1 (2018-04-02) + +### Fixed + +- Fixed #64: Fix pre-release precedence issue (thanks @uudashr) + +## 1.4.0 (2017-10-04) + +### Changed + +- #61: Update NewVersion to parse ints with a 64bit int size (thanks @zknill) + +## 1.3.1 (2017-07-10) + +### Fixed + +- Fixed #57: number comparisons in prerelease sometimes inaccurate + +## 1.3.0 (2017-05-02) + +### Added + +- #45: Added json (un)marshaling support (thanks @mh-cbon) +- Stability marker. See https://masterminds.github.io/stability/ + +### Fixed + +- #51: Fix handling of single digit tilde constraint (thanks @dgodd) + +### Changed + +- #55: The godoc icon moved from png to svg + +## 1.2.3 (2017-04-03) + +### Fixed + +- #46: Fixed 0.x.x and 0.0.x in constraints being treated as * + +## Release 1.2.2 (2016-12-13) + +### Fixed + +- #34: Fixed issue where hyphen range was not working with pre-release parsing. + +## Release 1.2.1 (2016-11-28) + +### Fixed + +- #24: Fixed edge case issue where constraint "> 0" does not handle "0.0.1-alpha" + properly. + +## Release 1.2.0 (2016-11-04) + +### Added + +- #20: Added MustParse function for versions (thanks @adamreese) +- #15: Added increment methods on versions (thanks @mh-cbon) + +### Fixed + +- Issue #21: Per the SemVer spec (section 9) a pre-release is unstable and + might not satisfy the intended compatibility. The change here ignores pre-releases + on constraint checks (e.g., ~ or ^) when a pre-release is not part of the + constraint. For example, `^1.2.3` will ignore pre-releases while + `^1.2.3-alpha` will include them. + +## Release 1.1.1 (2016-06-30) + +### Changed + +- Issue #9: Speed up version comparison performance (thanks @sdboyer) +- Issue #8: Added benchmarks (thanks @sdboyer) +- Updated Go Report Card URL to new location +- Updated Readme to add code snippet formatting (thanks @mh-cbon) +- Updating tagging to v[SemVer] structure for compatibility with other tools. + +## Release 1.1.0 (2016-03-11) + +- Issue #2: Implemented validation to provide reasons a versions failed a + constraint. + +## Release 1.0.1 (2015-12-31) + +- Fixed #1: * constraint failing on valid versions. + +## Release 1.0.0 (2015-10-20) + +- Initial release diff --git a/vendor/github.com/Masterminds/semver/v3/LICENSE.txt b/vendor/github.com/Masterminds/semver/v3/LICENSE.txt new file mode 100644 index 0000000000..9ff7da9c48 --- /dev/null +++ b/vendor/github.com/Masterminds/semver/v3/LICENSE.txt @@ -0,0 +1,19 @@ +Copyright (C) 2014-2019, Matt Butcher and Matt Farina + +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/Masterminds/semver/v3/Makefile b/vendor/github.com/Masterminds/semver/v3/Makefile new file mode 100644 index 0000000000..eac19178fb --- /dev/null +++ b/vendor/github.com/Masterminds/semver/v3/Makefile @@ -0,0 +1,37 @@ +GOPATH=$(shell go env GOPATH) +GOLANGCI_LINT=$(GOPATH)/bin/golangci-lint +GOFUZZBUILD = $(GOPATH)/bin/go-fuzz-build +GOFUZZ = $(GOPATH)/bin/go-fuzz + +.PHONY: lint +lint: $(GOLANGCI_LINT) + @echo "==> Linting codebase" + @$(GOLANGCI_LINT) run + +.PHONY: test +test: + @echo "==> Running tests" + GO111MODULE=on go test -v + +.PHONY: test-cover +test-cover: + @echo "==> Running Tests with coverage" + GO111MODULE=on go test -cover . + +.PHONY: fuzz +fuzz: $(GOFUZZBUILD) $(GOFUZZ) + @echo "==> Fuzz testing" + $(GOFUZZBUILD) + $(GOFUZZ) -workdir=_fuzz + +$(GOLANGCI_LINT): + # Install golangci-lint. The configuration for it is in the .golangci.yml + # file in the root of the repository + echo ${GOPATH} + curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $(GOPATH)/bin v1.17.1 + +$(GOFUZZBUILD): + cd / && go get -u github.com/dvyukov/go-fuzz/go-fuzz-build + +$(GOFUZZ): + cd / && go get -u github.com/dvyukov/go-fuzz/go-fuzz github.com/dvyukov/go-fuzz/go-fuzz-dep \ No newline at end of file diff --git a/vendor/github.com/Masterminds/semver/v3/README.md b/vendor/github.com/Masterminds/semver/v3/README.md new file mode 100644 index 0000000000..f1d0ac48e5 --- /dev/null +++ b/vendor/github.com/Masterminds/semver/v3/README.md @@ -0,0 +1,242 @@ +# SemVer + +The `semver` package provides the ability to work with [Semantic Versions](http://semver.org) in Go. Specifically it provides the ability to: + +* Parse semantic versions +* Sort semantic versions +* Check if a semantic version fits within a set of constraints +* Optionally work with a `v` prefix + +[![Stability: +Active](https://masterminds.github.io/stability/active.svg)](https://masterminds.github.io/stability/active.html) +[![Build Status](https://travis-ci.org/Masterminds/semver.svg)](https://travis-ci.org/Masterminds/semver) [![Build status](https://ci.appveyor.com/api/projects/status/jfk66lib7hb985k8/branch/master?svg=true&passingText=windows%20build%20passing&failingText=windows%20build%20failing)](https://ci.appveyor.com/project/mattfarina/semver/branch/master) [![GoDoc](https://godoc.org/github.com/Masterminds/semver?status.svg)](https://godoc.org/github.com/Masterminds/semver) [![Go Report Card](https://goreportcard.com/badge/github.com/Masterminds/semver)](https://goreportcard.com/report/github.com/Masterminds/semver) + +If you are looking for a command line tool for version comparisons please see +[vert](https://github.com/Masterminds/vert) which uses this library. + +## Package Versions + +There are three major versions fo the `semver` package. + +* 3.x.x is the new stable and active version. This version is focused on constraint + compatibility for range handling in other tools from other languages. It has + a similar API to the v1 releases. The development of this version is on the master + branch. The documentation for this version is below. +* 2.x was developed primarily for [dep](https://github.com/golang/dep). There are + no tagged releases and the development was performed by [@sdboyer](https://github.com/sdboyer). + There are API breaking changes from v1. This version lives on the [2.x branch](https://github.com/Masterminds/semver/tree/2.x). +* 1.x.x is the most widely used version with numerous tagged releases. This is the + previous stable and is still maintained for bug fixes. The development, to fix + bugs, occurs on the release-1 branch. You can read the documentation [here](https://github.com/Masterminds/semver/blob/release-1/README.md). + +## Parsing Semantic Versions + +There are two functions that can parse semantic versions. The `StrictNewVersion` +function only parses valid version 2 semantic versions as outlined in the +specification. The `NewVersion` function attempts to coerce a version into a +semantic version and parse it. For example, if there is a leading v or a version +listed without all 3 parts (e.g. `v1.2`) it will attempt to coerce it into a valid +semantic version (e.g., 1.2.0). In both cases a `Version` object is returned +that can be sorted, compared, and used in constraints. + +When parsing a version an error is returned if there is an issue parsing the +version. For example, + + v, err := semver.NewVersion("1.2.3-beta.1+build345") + +The version object has methods to get the parts of the version, compare it to +other versions, convert the version back into a string, and get the original +string. Getting the original string is useful if the semantic version was coerced +into a valid form. + +## Sorting Semantic Versions + +A set of versions can be sorted using the `sort` package from the standard library. +For example, + +```go +raw := []string{"1.2.3", "1.0", "1.3", "2", "0.4.2",} +vs := make([]*semver.Version, len(raw)) +for i, r := range raw { + v, err := semver.NewVersion(r) + if err != nil { + t.Errorf("Error parsing version: %s", err) + } + + vs[i] = v +} + +sort.Sort(semver.Collection(vs)) +``` + +## Checking Version Constraints + +There are two methods for comparing versions. One uses comparison methods on +`Version` instances and the other uses `Constraints`. There are some important +differences to notes between these two methods of comparison. + +1. When two versions are compared using functions such as `Compare`, `LessThan`, + and others it will follow the specification and always include prereleases + within the comparison. It will provide an answer that is valid with the + comparison section of the spec at https://semver.org/#spec-item-11 +2. When constraint checking is used for checks or validation it will follow a + different set of rules that are common for ranges with tools like npm/js + and Rust/Cargo. This includes considering prereleases to be invalid if the + ranges does not include one. If you want to have it include pre-releases a + simple solution is to include `-0` in your range. +3. Constraint ranges can have some complex rules including the shorthand use of + ~ and ^. For more details on those see the options below. + +There are differences between the two methods or checking versions because the +comparison methods on `Version` follow the specification while comparison ranges +are not part of the specification. Different packages and tools have taken it +upon themselves to come up with range rules. This has resulted in differences. +For example, npm/js and Cargo/Rust follow similar patterns while PHP has a +different pattern for ^. The comparison features in this package follow the +npm/js and Cargo/Rust lead because applications using it have followed similar +patters with their versions. + +Checking a version against version constraints is one of the most featureful +parts of the package. + +```go +c, err := semver.NewConstraint(">= 1.2.3") +if err != nil { + // Handle constraint not being parsable. +} + +v, err := semver.NewVersion("1.3") +if err != nil { + // Handle version not being parsable. +} +// Check if the version meets the constraints. The a variable will be true. +a := c.Check(v) +``` + +### Basic Comparisons + +There are two elements to the comparisons. First, a comparison string is a list +of space or comma separated AND comparisons. These are then separated by || (OR) +comparisons. For example, `">= 1.2 < 3.0.0 || >= 4.2.3"` is looking for a +comparison that's greater than or equal to 1.2 and less than 3.0.0 or is +greater than or equal to 4.2.3. + +The basic comparisons are: + +* `=`: equal (aliased to no operator) +* `!=`: not equal +* `>`: greater than +* `<`: less than +* `>=`: greater than or equal to +* `<=`: less than or equal to + +### Working With Prerelease Versions + +Pre-releases, for those not familiar with them, are used for software releases +prior to stable or generally available releases. Examples of prereleases include +development, alpha, beta, and release candidate releases. A prerelease may be +a version such as `1.2.3-beta.1` while the stable release would be `1.2.3`. In the +order of precedence, prereleases come before their associated releases. In this +example `1.2.3-beta.1 < 1.2.3`. + +According to the Semantic Version specification prereleases may not be +API compliant with their release counterpart. It says, + +> A pre-release version indicates that the version is unstable and might not satisfy the intended compatibility requirements as denoted by its associated normal version. + +SemVer comparisons using constraints without a prerelease comparator will skip +prerelease versions. For example, `>=1.2.3` will skip prereleases when looking +at a list of releases while `>=1.2.3-0` will evaluate and find prereleases. + +The reason for the `0` as a pre-release version in the example comparison is +because pre-releases can only contain ASCII alphanumerics and hyphens (along with +`.` separators), per the spec. Sorting happens in ASCII sort order, again per the +spec. The lowest character is a `0` in ASCII sort order +(see an [ASCII Table](http://www.asciitable.com/)) + +Understanding ASCII sort ordering is important because A-Z comes before a-z. That +means `>=1.2.3-BETA` will return `1.2.3-alpha`. What you might expect from case +sensitivity doesn't apply here. This is due to ASCII sort ordering which is what +the spec specifies. + +### Hyphen Range Comparisons + +There are multiple methods to handle ranges and the first is hyphens ranges. +These look like: + +* `1.2 - 1.4.5` which is equivalent to `>= 1.2 <= 1.4.5` +* `2.3.4 - 4.5` which is equivalent to `>= 2.3.4 <= 4.5` + +### Wildcards In Comparisons + +The `x`, `X`, and `*` characters can be used as a wildcard character. This works +for all comparison operators. When used on the `=` operator it falls +back to the patch level comparison (see tilde below). For example, + +* `1.2.x` is equivalent to `>= 1.2.0, < 1.3.0` +* `>= 1.2.x` is equivalent to `>= 1.2.0` +* `<= 2.x` is equivalent to `< 3` +* `*` is equivalent to `>= 0.0.0` + +### Tilde Range Comparisons (Patch) + +The tilde (`~`) comparison operator is for patch level ranges when a minor +version is specified and major level changes when the minor number is missing. +For example, + +* `~1.2.3` is equivalent to `>= 1.2.3, < 1.3.0` +* `~1` is equivalent to `>= 1, < 2` +* `~2.3` is equivalent to `>= 2.3, < 2.4` +* `~1.2.x` is equivalent to `>= 1.2.0, < 1.3.0` +* `~1.x` is equivalent to `>= 1, < 2` + +### Caret Range Comparisons (Major) + +The caret (`^`) comparison operator is for major level changes once a stable +(1.0.0) release has occurred. Prior to a 1.0.0 release the minor versions acts +as the API stability level. This is useful when comparisons of API versions as a +major change is API breaking. For example, + +* `^1.2.3` is equivalent to `>= 1.2.3, < 2.0.0` +* `^1.2.x` is equivalent to `>= 1.2.0, < 2.0.0` +* `^2.3` is equivalent to `>= 2.3, < 3` +* `^2.x` is equivalent to `>= 2.0.0, < 3` +* `^0.2.3` is equivalent to `>=0.2.3 <0.3.0` +* `^0.2` is equivalent to `>=0.2.0 <0.3.0` +* `^0.0.3` is equivalent to `>=0.0.3 <0.0.4` +* `^0.0` is equivalent to `>=0.0.0 <0.1.0` +* `^0` is equivalent to `>=0.0.0 <1.0.0` + +## Validation + +In addition to testing a version against a constraint, a version can be validated +against a constraint. When validation fails a slice of errors containing why a +version didn't meet the constraint is returned. For example, + +```go +c, err := semver.NewConstraint("<= 1.2.3, >= 1.4") +if err != nil { + // Handle constraint not being parseable. +} + +v, _ := semver.NewVersion("1.3") +if err != nil { + // Handle version not being parseable. +} + +// Validate a version against a constraint. +a, msgs := c.Validate(v) +// a is false +for _, m := range msgs { + fmt.Println(m) + + // Loops over the errors which would read + // "1.3 is greater than 1.2.3" + // "1.3 is less than 1.4" +} +``` + +## Contribute + +If you find an issue or want to contribute please file an [issue](https://github.com/Masterminds/semver/issues) +or [create a pull request](https://github.com/Masterminds/semver/pulls). diff --git a/vendor/github.com/Masterminds/semver/v3/appveyor.yml b/vendor/github.com/Masterminds/semver/v3/appveyor.yml new file mode 100644 index 0000000000..5ffa48732e --- /dev/null +++ b/vendor/github.com/Masterminds/semver/v3/appveyor.yml @@ -0,0 +1,17 @@ +version: build-{build}.{branch} + +shallow_clone: true + +environment: + GOPATH: C:\gopath + +platform: + - x64 + +build_script: + - go install -v ./... + +test_script: + - go test -v + +deploy: off diff --git a/vendor/github.com/Masterminds/semver/v3/collection.go b/vendor/github.com/Masterminds/semver/v3/collection.go new file mode 100644 index 0000000000..a78235895f --- /dev/null +++ b/vendor/github.com/Masterminds/semver/v3/collection.go @@ -0,0 +1,24 @@ +package semver + +// Collection is a collection of Version instances and implements the sort +// interface. See the sort package for more details. +// https://golang.org/pkg/sort/ +type Collection []*Version + +// Len returns the length of a collection. The number of Version instances +// on the slice. +func (c Collection) Len() int { + return len(c) +} + +// Less is needed for the sort interface to compare two Version objects on the +// slice. If checks if one is less than the other. +func (c Collection) Less(i, j int) bool { + return c[i].LessThan(c[j]) +} + +// Swap is needed for the sort interface to replace the Version objects +// at two different positions in the slice. +func (c Collection) Swap(i, j int) { + c[i], c[j] = c[j], c[i] +} diff --git a/vendor/github.com/Masterminds/semver/v3/constraints.go b/vendor/github.com/Masterminds/semver/v3/constraints.go new file mode 100644 index 0000000000..548e843898 --- /dev/null +++ b/vendor/github.com/Masterminds/semver/v3/constraints.go @@ -0,0 +1,527 @@ +package semver + +import ( + "bytes" + "errors" + "fmt" + "regexp" + "strings" +) + +// Constraints is one or more constraint that a semantic version can be +// checked against. +type Constraints struct { + constraints [][]*constraint +} + +// NewConstraint returns a Constraints instance that a Version instance can +// be checked against. If there is a parse error it will be returned. +func NewConstraint(c string) (*Constraints, error) { + + // Rewrite - ranges into a comparison operation. + c = rewriteRange(c) + + ors := strings.Split(c, "||") + or := make([][]*constraint, len(ors)) + for k, v := range ors { + + // TODO: Find a way to validate and fetch all the constraints in a simpler form + + // Validate the segment + if !validConstraintRegex.MatchString(v) { + return nil, fmt.Errorf("improper constraint: %s", v) + } + + cs := findConstraintRegex.FindAllString(v, -1) + if cs == nil { + cs = append(cs, v) + } + result := make([]*constraint, len(cs)) + for i, s := range cs { + pc, err := parseConstraint(s) + if err != nil { + return nil, err + } + + result[i] = pc + } + or[k] = result + } + + o := &Constraints{constraints: or} + return o, nil +} + +// Check tests if a version satisfies the constraints. +func (cs Constraints) Check(v *Version) bool { + // loop over the ORs and check the inner ANDs + for _, o := range cs.constraints { + joy := true + for _, c := range o { + if !c.check(v) { + joy = false + break + } + } + + if joy { + return true + } + } + + return false +} + +// Validate checks if a version satisfies a constraint. If not a slice of +// reasons for the failure are returned in addition to a bool. +func (cs Constraints) Validate(v *Version) (bool, []error) { + // loop over the ORs and check the inner ANDs + var e []error + + // Capture the prerelease message only once. When it happens the first time + // this var is marked + var prerelesase bool + for _, o := range cs.constraints { + joy := true + for _, c := range o { + // Before running the check handle the case there the version is + // a prerelease and the check is not searching for prereleases. + if c.con.pre == "" && v.pre != "" { + if !prerelesase { + em := fmt.Errorf("%s is a prerelease version and the constraint is only looking for release versions", v) + e = append(e, em) + prerelesase = true + } + joy = false + + } else { + + if !c.check(v) { + em := fmt.Errorf(constraintMsg[c.origfunc], v, c.orig) + e = append(e, em) + joy = false + } + } + } + + if joy { + return true, []error{} + } + } + + return false, e +} + +func (cs Constraints) String() string { + buf := make([]string, len(cs.constraints)) + var tmp bytes.Buffer + + for k, v := range cs.constraints { + tmp.Reset() + vlen := len(v) + for kk, c := range v { + tmp.WriteString(c.string()) + + // Space separate the AND conditions + if vlen > 1 && kk < vlen-1 { + tmp.WriteString(" ") + } + } + buf[k] = tmp.String() + } + + return strings.Join(buf, " || ") +} + +var constraintOps map[string]cfunc +var constraintMsg map[string]string +var constraintRegex *regexp.Regexp +var constraintRangeRegex *regexp.Regexp + +// Used to find individual constraints within a multi-constraint string +var findConstraintRegex *regexp.Regexp + +// Used to validate an segment of ANDs is valid +var validConstraintRegex *regexp.Regexp + +const cvRegex string = `v?([0-9|x|X|\*]+)(\.[0-9|x|X|\*]+)?(\.[0-9|x|X|\*]+)?` + + `(-([0-9A-Za-z\-]+(\.[0-9A-Za-z\-]+)*))?` + + `(\+([0-9A-Za-z\-]+(\.[0-9A-Za-z\-]+)*))?` + +func init() { + constraintOps = map[string]cfunc{ + "": constraintTildeOrEqual, + "=": constraintTildeOrEqual, + "!=": constraintNotEqual, + ">": constraintGreaterThan, + "<": constraintLessThan, + ">=": constraintGreaterThanEqual, + "=>": constraintGreaterThanEqual, + "<=": constraintLessThanEqual, + "=<": constraintLessThanEqual, + "~": constraintTilde, + "~>": constraintTilde, + "^": constraintCaret, + } + + constraintMsg = map[string]string{ + "": "%s is not equal to %s", + "=": "%s is not equal to %s", + "!=": "%s is equal to %s", + ">": "%s is less than or equal to %s", + "<": "%s is greater than or equal to %s", + ">=": "%s is less than %s", + "=>": "%s is less than %s", + "<=": "%s is greater than %s", + "=<": "%s is greater than %s", + "~": "%s does not have same major and minor version as %s", + "~>": "%s does not have same major and minor version as %s", + "^": "%s does not have same major version as %s", + } + + ops := make([]string, 0, len(constraintOps)) + for k := range constraintOps { + ops = append(ops, regexp.QuoteMeta(k)) + } + + constraintRegex = regexp.MustCompile(fmt.Sprintf( + `^\s*(%s)\s*(%s)\s*$`, + strings.Join(ops, "|"), + cvRegex)) + + constraintRangeRegex = regexp.MustCompile(fmt.Sprintf( + `\s*(%s)\s+-\s+(%s)\s*`, + cvRegex, cvRegex)) + + findConstraintRegex = regexp.MustCompile(fmt.Sprintf( + `(%s)\s*(%s)`, + strings.Join(ops, "|"), + cvRegex)) + + validConstraintRegex = regexp.MustCompile(fmt.Sprintf( + `^(\s*(%s)\s*(%s)\s*\,?)+$`, + strings.Join(ops, "|"), + cvRegex)) +} + +// An individual constraint +type constraint struct { + // The version used in the constraint check. For example, if a constraint + // is '<= 2.0.0' the con a version instance representing 2.0.0. + con *Version + + // The original parsed version (e.g., 4.x from != 4.x) + orig string + + // The original operator for the constraint + origfunc string + + // When an x is used as part of the version (e.g., 1.x) + minorDirty bool + dirty bool + patchDirty bool +} + +// Check if a version meets the constraint +func (c *constraint) check(v *Version) bool { + return constraintOps[c.origfunc](v, c) +} + +// String prints an individual constraint into a string +func (c *constraint) string() string { + return c.origfunc + c.orig +} + +type cfunc func(v *Version, c *constraint) bool + +func parseConstraint(c string) (*constraint, error) { + if len(c) > 0 { + m := constraintRegex.FindStringSubmatch(c) + if m == nil { + return nil, fmt.Errorf("improper constraint: %s", c) + } + + cs := &constraint{ + orig: m[2], + origfunc: m[1], + } + + ver := m[2] + minorDirty := false + patchDirty := false + dirty := false + if isX(m[3]) || m[3] == "" { + ver = "0.0.0" + dirty = true + } else if isX(strings.TrimPrefix(m[4], ".")) || m[4] == "" { + minorDirty = true + dirty = true + ver = fmt.Sprintf("%s.0.0%s", m[3], m[6]) + } else if isX(strings.TrimPrefix(m[5], ".")) || m[5] == "" { + dirty = true + patchDirty = true + ver = fmt.Sprintf("%s%s.0%s", m[3], m[4], m[6]) + } + + con, err := NewVersion(ver) + if err != nil { + + // The constraintRegex should catch any regex parsing errors. So, + // we should never get here. + return nil, errors.New("constraint Parser Error") + } + + cs.con = con + cs.minorDirty = minorDirty + cs.patchDirty = patchDirty + cs.dirty = dirty + + return cs, nil + } + + // The rest is the special case where an empty string was passed in which + // is equivalent to * or >=0.0.0 + con, err := StrictNewVersion("0.0.0") + if err != nil { + + // The constraintRegex should catch any regex parsing errors. So, + // we should never get here. + return nil, errors.New("constraint Parser Error") + } + + cs := &constraint{ + con: con, + orig: c, + origfunc: "", + minorDirty: false, + patchDirty: false, + dirty: true, + } + return cs, nil +} + +// Constraint functions +func constraintNotEqual(v *Version, c *constraint) bool { + if c.dirty { + + // If there is a pre-release on the version but the constraint isn't looking + // for them assume that pre-releases are not compatible. See issue 21 for + // more details. + if v.Prerelease() != "" && c.con.Prerelease() == "" { + return false + } + + if c.con.Major() != v.Major() { + return true + } + if c.con.Minor() != v.Minor() && !c.minorDirty { + return true + } else if c.minorDirty { + return false + } else if c.con.Patch() != v.Patch() && !c.patchDirty { + return true + } else if c.patchDirty { + // Need to handle prereleases if present + if v.Prerelease() != "" || c.con.Prerelease() != "" { + return comparePrerelease(v.Prerelease(), c.con.Prerelease()) != 0 + } + return false + } + } + + return !v.Equal(c.con) +} + +func constraintGreaterThan(v *Version, c *constraint) bool { + + // If there is a pre-release on the version but the constraint isn't looking + // for them assume that pre-releases are not compatible. See issue 21 for + // more details. + if v.Prerelease() != "" && c.con.Prerelease() == "" { + return false + } + + if !c.dirty { + return v.Compare(c.con) == 1 + } + + if v.Major() > c.con.Major() { + return true + } else if v.Major() < c.con.Major() { + return false + } else if c.minorDirty { + // This is a range case such as >11. When the version is something like + // 11.1.0 is it not > 11. For that we would need 12 or higher + return false + } else if c.patchDirty { + // This is for ranges such as >11.1. A version of 11.1.1 is not greater + // which one of 11.2.1 is greater + return v.Minor() > c.con.Minor() + } + + // If we have gotten here we are not comparing pre-preleases and can use the + // Compare function to accomplish that. + return v.Compare(c.con) == 1 +} + +func constraintLessThan(v *Version, c *constraint) bool { + // If there is a pre-release on the version but the constraint isn't looking + // for them assume that pre-releases are not compatible. See issue 21 for + // more details. + if v.Prerelease() != "" && c.con.Prerelease() == "" { + return false + } + + return v.Compare(c.con) < 0 +} + +func constraintGreaterThanEqual(v *Version, c *constraint) bool { + + // If there is a pre-release on the version but the constraint isn't looking + // for them assume that pre-releases are not compatible. See issue 21 for + // more details. + if v.Prerelease() != "" && c.con.Prerelease() == "" { + return false + } + + return v.Compare(c.con) >= 0 +} + +func constraintLessThanEqual(v *Version, c *constraint) bool { + // If there is a pre-release on the version but the constraint isn't looking + // for them assume that pre-releases are not compatible. See issue 21 for + // more details. + if v.Prerelease() != "" && c.con.Prerelease() == "" { + return false + } + + if !c.dirty { + return v.Compare(c.con) <= 0 + } + + if v.Major() > c.con.Major() { + return false + } else if v.Minor() > c.con.Minor() && !c.minorDirty { + return false + } + + return true +} + +// ~*, ~>* --> >= 0.0.0 (any) +// ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0, <3.0.0 +// ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0, <2.1.0 +// ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0, <1.3.0 +// ~1.2.3, ~>1.2.3 --> >=1.2.3, <1.3.0 +// ~1.2.0, ~>1.2.0 --> >=1.2.0, <1.3.0 +func constraintTilde(v *Version, c *constraint) bool { + // If there is a pre-release on the version but the constraint isn't looking + // for them assume that pre-releases are not compatible. See issue 21 for + // more details. + if v.Prerelease() != "" && c.con.Prerelease() == "" { + return false + } + + if v.LessThan(c.con) { + return false + } + + // ~0.0.0 is a special case where all constraints are accepted. It's + // equivalent to >= 0.0.0. + if c.con.Major() == 0 && c.con.Minor() == 0 && c.con.Patch() == 0 && + !c.minorDirty && !c.patchDirty { + return true + } + + if v.Major() != c.con.Major() { + return false + } + + if v.Minor() != c.con.Minor() && !c.minorDirty { + return false + } + + return true +} + +// When there is a .x (dirty) status it automatically opts in to ~. Otherwise +// it's a straight = +func constraintTildeOrEqual(v *Version, c *constraint) bool { + // If there is a pre-release on the version but the constraint isn't looking + // for them assume that pre-releases are not compatible. See issue 21 for + // more details. + if v.Prerelease() != "" && c.con.Prerelease() == "" { + return false + } + + if c.dirty { + return constraintTilde(v, c) + } + + return v.Equal(c.con) +} + +// ^* --> (any) +// ^1.2.3 --> >=1.2.3 <2.0.0 +// ^1.2 --> >=1.2.0 <2.0.0 +// ^1 --> >=1.0.0 <2.0.0 +// ^0.2.3 --> >=0.2.3 <0.3.0 +// ^0.2 --> >=0.2.0 <0.3.0 +// ^0.0.3 --> >=0.0.3 <0.0.4 +// ^0.0 --> >=0.0.0 <0.1.0 +// ^0 --> >=0.0.0 <1.0.0 +func constraintCaret(v *Version, c *constraint) bool { + // If there is a pre-release on the version but the constraint isn't looking + // for them assume that pre-releases are not compatible. See issue 21 for + // more details. + if v.Prerelease() != "" && c.con.Prerelease() == "" { + return false + } + + // This less than handles prereleases + if v.LessThan(c.con) { + return false + } + + // ^ when the major > 0 is >=x.y.z < x+1 + if c.con.Major() > 0 || c.minorDirty { + + // ^ has to be within a major range for > 0. Everything less than was + // filtered out with the LessThan call above. This filters out those + // that greater but not within the same major range. + return v.Major() == c.con.Major() + } + + // ^ when the major is 0 and minor > 0 is >=0.y.z < 0.y+1 + // If the con Minor is > 0 it is not dirty + if c.con.Minor() > 0 || c.patchDirty { + return v.Minor() == c.con.Minor() + } + + // At this point the major is 0 and the minor is 0 and not dirty. The patch + // is not dirty so we need to check if they are equal. If they are not equal + return c.con.Patch() == v.Patch() +} + +func isX(x string) bool { + switch x { + case "x", "*", "X": + return true + default: + return false + } +} + +func rewriteRange(i string) string { + m := constraintRangeRegex.FindAllStringSubmatch(i, -1) + if m == nil { + return i + } + o := i + for _, v := range m { + t := fmt.Sprintf(">= %s, <= %s", v[1], v[11]) + o = strings.Replace(o, v[0], t, 1) + } + + return o +} diff --git a/vendor/github.com/Masterminds/semver/v3/doc.go b/vendor/github.com/Masterminds/semver/v3/doc.go new file mode 100644 index 0000000000..34d78f220d --- /dev/null +++ b/vendor/github.com/Masterminds/semver/v3/doc.go @@ -0,0 +1,184 @@ +/* +Package semver provides the ability to work with Semantic Versions (http://semver.org) in Go. + +Specifically it provides the ability to: + + * Parse semantic versions + * Sort semantic versions + * Check if a semantic version fits within a set of constraints + * Optionally work with a `v` prefix + +Parsing Semantic Versions + +There are two functions that can parse semantic versions. The `StrictNewVersion` +function only parses valid version 2 semantic versions as outlined in the +specification. The `NewVersion` function attempts to coerce a version into a +semantic version and parse it. For example, if there is a leading v or a version +listed without all 3 parts (e.g. 1.2) it will attempt to coerce it into a valid +semantic version (e.g., 1.2.0). In both cases a `Version` object is returned +that can be sorted, compared, and used in constraints. + +When parsing a version an optional error can be returned if there is an issue +parsing the version. For example, + + v, err := semver.NewVersion("1.2.3-beta.1+build345") + +The version object has methods to get the parts of the version, compare it to +other versions, convert the version back into a string, and get the original +string. For more details please see the documentation +at https://godoc.org/github.com/Masterminds/semver. + +Sorting Semantic Versions + +A set of versions can be sorted using the `sort` package from the standard library. +For example, + + raw := []string{"1.2.3", "1.0", "1.3", "2", "0.4.2",} + vs := make([]*semver.Version, len(raw)) + for i, r := range raw { + v, err := semver.NewVersion(r) + if err != nil { + t.Errorf("Error parsing version: %s", err) + } + + vs[i] = v + } + + sort.Sort(semver.Collection(vs)) + +Checking Version Constraints and Comparing Versions + +There are two methods for comparing versions. One uses comparison methods on +`Version` instances and the other is using Constraints. There are some important +differences to notes between these two methods of comparison. + +1. When two versions are compared using functions such as `Compare`, `LessThan`, + and others it will follow the specification and always include prereleases + within the comparison. It will provide an answer valid with the comparison + spec section at https://semver.org/#spec-item-11 +2. When constraint checking is used for checks or validation it will follow a + different set of rules that are common for ranges with tools like npm/js + and Rust/Cargo. This includes considering prereleases to be invalid if the + ranges does not include on. If you want to have it include pre-releases a + simple solution is to include `-0` in your range. +3. Constraint ranges can have some complex rules including the shorthard use of + ~ and ^. For more details on those see the options below. + +There are differences between the two methods or checking versions because the +comparison methods on `Version` follow the specification while comparison ranges +are not part of the specification. Different packages and tools have taken it +upon themselves to come up with range rules. This has resulted in differences. +For example, npm/js and Cargo/Rust follow similar patterns which PHP has a +different pattern for ^. The comparison features in this package follow the +npm/js and Cargo/Rust lead because applications using it have followed similar +patters with their versions. + +Checking a version against version constraints is one of the most featureful +parts of the package. + + c, err := semver.NewConstraint(">= 1.2.3") + if err != nil { + // Handle constraint not being parsable. + } + + v, err := semver.NewVersion("1.3") + if err != nil { + // Handle version not being parsable. + } + // Check if the version meets the constraints. The a variable will be true. + a := c.Check(v) + +Basic Comparisons + +There are two elements to the comparisons. First, a comparison string is a list +of comma or space separated AND comparisons. These are then separated by || (OR) +comparisons. For example, `">= 1.2 < 3.0.0 || >= 4.2.3"` is looking for a +comparison that's greater than or equal to 1.2 and less than 3.0.0 or is +greater than or equal to 4.2.3. This can also be written as +`">= 1.2, < 3.0.0 || >= 4.2.3"` + +The basic comparisons are: + + * `=`: equal (aliased to no operator) + * `!=`: not equal + * `>`: greater than + * `<`: less than + * `>=`: greater than or equal to + * `<=`: less than or equal to + +Hyphen Range Comparisons + +There are multiple methods to handle ranges and the first is hyphens ranges. +These look like: + + * `1.2 - 1.4.5` which is equivalent to `>= 1.2, <= 1.4.5` + * `2.3.4 - 4.5` which is equivalent to `>= 2.3.4 <= 4.5` + +Wildcards In Comparisons + +The `x`, `X`, and `*` characters can be used as a wildcard character. This works +for all comparison operators. When used on the `=` operator it falls +back to the tilde operation. For example, + + * `1.2.x` is equivalent to `>= 1.2.0 < 1.3.0` + * `>= 1.2.x` is equivalent to `>= 1.2.0` + * `<= 2.x` is equivalent to `<= 3` + * `*` is equivalent to `>= 0.0.0` + +Tilde Range Comparisons (Patch) + +The tilde (`~`) comparison operator is for patch level ranges when a minor +version is specified and major level changes when the minor number is missing. +For example, + + * `~1.2.3` is equivalent to `>= 1.2.3 < 1.3.0` + * `~1` is equivalent to `>= 1, < 2` + * `~2.3` is equivalent to `>= 2.3 < 2.4` + * `~1.2.x` is equivalent to `>= 1.2.0 < 1.3.0` + * `~1.x` is equivalent to `>= 1 < 2` + +Caret Range Comparisons (Major) + +The caret (`^`) comparison operator is for major level changes once a stable +(1.0.0) release has occurred. Prior to a 1.0.0 release the minor versions acts +as the API stability level. This is useful when comparisons of API versions as a +major change is API breaking. For example, + + * `^1.2.3` is equivalent to `>= 1.2.3, < 2.0.0` + * `^1.2.x` is equivalent to `>= 1.2.0, < 2.0.0` + * `^2.3` is equivalent to `>= 2.3, < 3` + * `^2.x` is equivalent to `>= 2.0.0, < 3` + * `^0.2.3` is equivalent to `>=0.2.3 <0.3.0` + * `^0.2` is equivalent to `>=0.2.0 <0.3.0` + * `^0.0.3` is equivalent to `>=0.0.3 <0.0.4` + * `^0.0` is equivalent to `>=0.0.0 <0.1.0` + * `^0` is equivalent to `>=0.0.0 <1.0.0` + +Validation + +In addition to testing a version against a constraint, a version can be validated +against a constraint. When validation fails a slice of errors containing why a +version didn't meet the constraint is returned. For example, + + c, err := semver.NewConstraint("<= 1.2.3, >= 1.4") + if err != nil { + // Handle constraint not being parseable. + } + + v, _ := semver.NewVersion("1.3") + if err != nil { + // Handle version not being parseable. + } + + // Validate a version against a constraint. + a, msgs := c.Validate(v) + // a is false + for _, m := range msgs { + fmt.Println(m) + + // Loops over the errors which would read + // "1.3 is greater than 1.2.3" + // "1.3 is less than 1.4" + } +*/ +package semver diff --git a/vendor/github.com/Masterminds/semver/v3/fuzz.go b/vendor/github.com/Masterminds/semver/v3/fuzz.go new file mode 100644 index 0000000000..a242ad7058 --- /dev/null +++ b/vendor/github.com/Masterminds/semver/v3/fuzz.go @@ -0,0 +1,22 @@ +// +build gofuzz + +package semver + +func Fuzz(data []byte) int { + d := string(data) + + // Test NewVersion + _, _ = NewVersion(d) + + // Test StrictNewVersion + _, _ = StrictNewVersion(d) + + // Test NewConstraint + _, _ = NewConstraint(d) + + // The return value should be 0 normally, 1 if the priority in future tests + // should be increased, and -1 if future tests should skip passing in that + // data. We do not have a reason to change priority so 0 is always returned. + // There are example tests that do this. + return 0 +} diff --git a/vendor/github.com/Masterminds/semver/v3/go.mod b/vendor/github.com/Masterminds/semver/v3/go.mod new file mode 100644 index 0000000000..658233c8f0 --- /dev/null +++ b/vendor/github.com/Masterminds/semver/v3/go.mod @@ -0,0 +1,3 @@ +module github.com/Masterminds/semver/v3 + +go 1.12 diff --git a/vendor/github.com/Masterminds/semver/v3/version.go b/vendor/github.com/Masterminds/semver/v3/version.go new file mode 100644 index 0000000000..1bb95f2635 --- /dev/null +++ b/vendor/github.com/Masterminds/semver/v3/version.go @@ -0,0 +1,583 @@ +package semver + +import ( + "bytes" + "encoding/json" + "errors" + "fmt" + "regexp" + "strconv" + "strings" +) + +// The compiled version of the regex created at init() is cached here so it +// only needs to be created once. +var versionRegex *regexp.Regexp + +var ( + // ErrInvalidSemVer is returned a version is found to be invalid when + // being parsed. + ErrInvalidSemVer = errors.New("Invalid Semantic Version") + + // ErrEmptyString is returned when an empty string is passed in for parsing. + ErrEmptyString = errors.New("Version string empty") + + // ErrInvalidCharacters is returned when invalid characters are found as + // part of a version + ErrInvalidCharacters = errors.New("Invalid characters in version") + + // ErrSegmentStartsZero is returned when a version segment starts with 0. + // This is invalid in SemVer. + ErrSegmentStartsZero = errors.New("Version segment starts with 0") + + // ErrInvalidMetadata is returned when the metadata is an invalid format + ErrInvalidMetadata = errors.New("Invalid Metadata string") + + // ErrInvalidPrerelease is returned when the pre-release is an invalid format + ErrInvalidPrerelease = errors.New("Invalid Prerelease string") +) + +// semVerRegex is the regular expression used to parse a semantic version. +const semVerRegex string = `v?([0-9]+)(\.[0-9]+)?(\.[0-9]+)?` + + `(-([0-9A-Za-z\-]+(\.[0-9A-Za-z\-]+)*))?` + + `(\+([0-9A-Za-z\-]+(\.[0-9A-Za-z\-]+)*))?` + +// Version represents a single semantic version. +type Version struct { + major, minor, patch uint64 + pre string + metadata string + original string +} + +func init() { + versionRegex = regexp.MustCompile("^" + semVerRegex + "$") +} + +const num string = "0123456789" +const allowed string = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-" + num + +// StrictNewVersion parses a given version and returns an instance of Version or +// an error if unable to parse the version. Only parses valid semantic versions. +// Performs checking that can find errors within the version. +// If you want to coerce a version, such as 1 or 1.2, and perse that as the 1.x +// releases of semver provided use the NewSemver() function. +func StrictNewVersion(v string) (*Version, error) { + // Parsing here does not use RegEx in order to increase performance and reduce + // allocations. + + if len(v) == 0 { + return nil, ErrEmptyString + } + + // Split the parts into [0]major, [1]minor, and [2]patch,prerelease,build + parts := strings.SplitN(v, ".", 3) + if len(parts) != 3 { + return nil, ErrInvalidSemVer + } + + sv := &Version{ + original: v, + } + + // check for prerelease or build metadata + var extra []string + if strings.ContainsAny(parts[2], "-+") { + // Start with the build metadata first as it needs to be on the right + extra = strings.SplitN(parts[2], "+", 2) + if len(extra) > 1 { + // build metadata found + sv.metadata = extra[1] + parts[2] = extra[0] + } + + extra = strings.SplitN(parts[2], "-", 2) + if len(extra) > 1 { + // prerelease found + sv.pre = extra[1] + parts[2] = extra[0] + } + } + + // Validate the number segments are valid. This includes only having positive + // numbers and no leading 0's. + for _, p := range parts { + if !containsOnly(p, num) { + return nil, ErrInvalidCharacters + } + + if len(p) > 1 && p[0] == '0' { + return nil, ErrSegmentStartsZero + } + } + + // Extract the major, minor, and patch elements onto the returned Version + var err error + sv.major, err = strconv.ParseUint(parts[0], 10, 64) + if err != nil { + return nil, err + } + + sv.minor, err = strconv.ParseUint(parts[1], 10, 64) + if err != nil { + return nil, err + } + + sv.patch, err = strconv.ParseUint(parts[2], 10, 64) + if err != nil { + return nil, err + } + + // No prerelease or build metadata found so returning now as a fastpath. + if sv.pre == "" && sv.metadata == "" { + return sv, nil + } + + if sv.pre != "" { + if err = validatePrerelease(sv.pre); err != nil { + return nil, err + } + } + + if sv.metadata != "" { + if err = validateMetadata(sv.metadata); err != nil { + return nil, err + } + } + + return sv, nil +} + +// NewVersion parses a given version and returns an instance of Version or +// an error if unable to parse the version. If the version is SemVer-ish it +// attempts to convert it to SemVer. If you want to validate it was a strict +// semantic version at parse time see StrictNewVersion(). +func NewVersion(v string) (*Version, error) { + m := versionRegex.FindStringSubmatch(v) + if m == nil { + return nil, ErrInvalidSemVer + } + + sv := &Version{ + metadata: m[8], + pre: m[5], + original: v, + } + + var err error + sv.major, err = strconv.ParseUint(m[1], 10, 64) + if err != nil { + return nil, fmt.Errorf("Error parsing version segment: %s", err) + } + + if m[2] != "" { + sv.minor, err = strconv.ParseUint(strings.TrimPrefix(m[2], "."), 10, 64) + if err != nil { + return nil, fmt.Errorf("Error parsing version segment: %s", err) + } + } else { + sv.minor = 0 + } + + if m[3] != "" { + sv.patch, err = strconv.ParseUint(strings.TrimPrefix(m[3], "."), 10, 64) + if err != nil { + return nil, fmt.Errorf("Error parsing version segment: %s", err) + } + } else { + sv.patch = 0 + } + + // Perform some basic due diligence on the extra parts to ensure they are + // valid. + + if sv.pre != "" { + if err = validatePrerelease(sv.pre); err != nil { + return nil, err + } + } + + if sv.metadata != "" { + if err = validateMetadata(sv.metadata); err != nil { + return nil, err + } + } + + return sv, nil +} + +// MustParse parses a given version and panics on error. +func MustParse(v string) *Version { + sv, err := NewVersion(v) + if err != nil { + panic(err) + } + return sv +} + +// String converts a Version object to a string. +// Note, if the original version contained a leading v this version will not. +// See the Original() method to retrieve the original value. Semantic Versions +// don't contain a leading v per the spec. Instead it's optional on +// implementation. +func (v Version) String() string { + var buf bytes.Buffer + + fmt.Fprintf(&buf, "%d.%d.%d", v.major, v.minor, v.patch) + if v.pre != "" { + fmt.Fprintf(&buf, "-%s", v.pre) + } + if v.metadata != "" { + fmt.Fprintf(&buf, "+%s", v.metadata) + } + + return buf.String() +} + +// Original returns the original value passed in to be parsed. +func (v *Version) Original() string { + return v.original +} + +// Major returns the major version. +func (v Version) Major() uint64 { + return v.major +} + +// Minor returns the minor version. +func (v Version) Minor() uint64 { + return v.minor +} + +// Patch returns the patch version. +func (v Version) Patch() uint64 { + return v.patch +} + +// Prerelease returns the pre-release version. +func (v Version) Prerelease() string { + return v.pre +} + +// Metadata returns the metadata on the version. +func (v Version) Metadata() string { + return v.metadata +} + +// originalVPrefix returns the original 'v' prefix if any. +func (v Version) originalVPrefix() string { + + // Note, only lowercase v is supported as a prefix by the parser. + if v.original != "" && v.original[:1] == "v" { + return v.original[:1] + } + return "" +} + +// IncPatch produces the next patch version. +// If the current version does not have prerelease/metadata information, +// it unsets metadata and prerelease values, increments patch number. +// If the current version has any of prerelease or metadata information, +// it unsets both values and keeps current patch value +func (v Version) IncPatch() Version { + vNext := v + // according to http://semver.org/#spec-item-9 + // Pre-release versions have a lower precedence than the associated normal version. + // according to http://semver.org/#spec-item-10 + // Build metadata SHOULD be ignored when determining version precedence. + if v.pre != "" { + vNext.metadata = "" + vNext.pre = "" + } else { + vNext.metadata = "" + vNext.pre = "" + vNext.patch = v.patch + 1 + } + vNext.original = v.originalVPrefix() + "" + vNext.String() + return vNext +} + +// IncMinor produces the next minor version. +// Sets patch to 0. +// Increments minor number. +// Unsets metadata. +// Unsets prerelease status. +func (v Version) IncMinor() Version { + vNext := v + vNext.metadata = "" + vNext.pre = "" + vNext.patch = 0 + vNext.minor = v.minor + 1 + vNext.original = v.originalVPrefix() + "" + vNext.String() + return vNext +} + +// IncMajor produces the next major version. +// Sets patch to 0. +// Sets minor to 0. +// Increments major number. +// Unsets metadata. +// Unsets prerelease status. +func (v Version) IncMajor() Version { + vNext := v + vNext.metadata = "" + vNext.pre = "" + vNext.patch = 0 + vNext.minor = 0 + vNext.major = v.major + 1 + vNext.original = v.originalVPrefix() + "" + vNext.String() + return vNext +} + +// SetPrerelease defines the prerelease value. +// Value must not include the required 'hyphen' prefix. +func (v Version) SetPrerelease(prerelease string) (Version, error) { + vNext := v + if len(prerelease) > 0 { + if err := validatePrerelease(prerelease); err != nil { + return vNext, err + } + } + vNext.pre = prerelease + vNext.original = v.originalVPrefix() + "" + vNext.String() + return vNext, nil +} + +// SetMetadata defines metadata value. +// Value must not include the required 'plus' prefix. +func (v Version) SetMetadata(metadata string) (Version, error) { + vNext := v + if len(metadata) > 0 { + if err := validateMetadata(metadata); err != nil { + return vNext, err + } + } + vNext.metadata = metadata + vNext.original = v.originalVPrefix() + "" + vNext.String() + return vNext, nil +} + +// LessThan tests if one version is less than another one. +func (v *Version) LessThan(o *Version) bool { + return v.Compare(o) < 0 +} + +// GreaterThan tests if one version is greater than another one. +func (v *Version) GreaterThan(o *Version) bool { + return v.Compare(o) > 0 +} + +// Equal tests if two versions are equal to each other. +// Note, versions can be equal with different metadata since metadata +// is not considered part of the comparable version. +func (v *Version) Equal(o *Version) bool { + return v.Compare(o) == 0 +} + +// Compare compares this version to another one. It returns -1, 0, or 1 if +// the version smaller, equal, or larger than the other version. +// +// Versions are compared by X.Y.Z. Build metadata is ignored. Prerelease is +// lower than the version without a prerelease. Compare always takes into account +// prereleases. If you want to work with ranges using typical range syntaxes that +// skip prereleases if the range is not looking for them use constraints. +func (v *Version) Compare(o *Version) int { + // Compare the major, minor, and patch version for differences. If a + // difference is found return the comparison. + if d := compareSegment(v.Major(), o.Major()); d != 0 { + return d + } + if d := compareSegment(v.Minor(), o.Minor()); d != 0 { + return d + } + if d := compareSegment(v.Patch(), o.Patch()); d != 0 { + return d + } + + // At this point the major, minor, and patch versions are the same. + ps := v.pre + po := o.Prerelease() + + if ps == "" && po == "" { + return 0 + } + if ps == "" { + return 1 + } + if po == "" { + return -1 + } + + return comparePrerelease(ps, po) +} + +// UnmarshalJSON implements JSON.Unmarshaler interface. +func (v *Version) UnmarshalJSON(b []byte) error { + var s string + if err := json.Unmarshal(b, &s); err != nil { + return err + } + temp, err := NewVersion(s) + if err != nil { + return err + } + v.major = temp.major + v.minor = temp.minor + v.patch = temp.patch + v.pre = temp.pre + v.metadata = temp.metadata + v.original = temp.original + return nil +} + +// MarshalJSON implements JSON.Marshaler interface. +func (v Version) MarshalJSON() ([]byte, error) { + return json.Marshal(v.String()) +} + +func compareSegment(v, o uint64) int { + if v < o { + return -1 + } + if v > o { + return 1 + } + + return 0 +} + +func comparePrerelease(v, o string) int { + + // split the prelease versions by their part. The separator, per the spec, + // is a . + sparts := strings.Split(v, ".") + oparts := strings.Split(o, ".") + + // Find the longer length of the parts to know how many loop iterations to + // go through. + slen := len(sparts) + olen := len(oparts) + + l := slen + if olen > slen { + l = olen + } + + // Iterate over each part of the prereleases to compare the differences. + for i := 0; i < l; i++ { + // Since the lentgh of the parts can be different we need to create + // a placeholder. This is to avoid out of bounds issues. + stemp := "" + if i < slen { + stemp = sparts[i] + } + + otemp := "" + if i < olen { + otemp = oparts[i] + } + + d := comparePrePart(stemp, otemp) + if d != 0 { + return d + } + } + + // Reaching here means two versions are of equal value but have different + // metadata (the part following a +). They are not identical in string form + // but the version comparison finds them to be equal. + return 0 +} + +func comparePrePart(s, o string) int { + // Fastpath if they are equal + if s == o { + return 0 + } + + // When s or o are empty we can use the other in an attempt to determine + // the response. + if s == "" { + if o != "" { + return -1 + } + return 1 + } + + if o == "" { + if s != "" { + return 1 + } + return -1 + } + + // When comparing strings "99" is greater than "103". To handle + // cases like this we need to detect numbers and compare them. According + // to the semver spec, numbers are always positive. If there is a - at the + // start like -99 this is to be evaluated as an alphanum. numbers always + // have precedence over alphanum. Parsing as Uints because negative numbers + // are ignored. + + oi, n1 := strconv.ParseUint(o, 10, 64) + si, n2 := strconv.ParseUint(s, 10, 64) + + // The case where both are strings compare the strings + if n1 != nil && n2 != nil { + if s > o { + return 1 + } + return -1 + } else if n1 != nil { + // o is a string and s is a number + return -1 + } else if n2 != nil { + // s is a string and o is a number + return 1 + } + // Both are numbers + if si > oi { + return 1 + } + return -1 + +} + +// Like strings.ContainsAny but does an only instead of any. +func containsOnly(s string, comp string) bool { + return strings.IndexFunc(s, func(r rune) bool { + return !strings.ContainsRune(comp, r) + }) == -1 +} + +// From the spec, "Identifiers MUST comprise only +// ASCII alphanumerics and hyphen [0-9A-Za-z-]. Identifiers MUST NOT be empty. +// Numeric identifiers MUST NOT include leading zeroes.". These segments can +// be dot separated. +func validatePrerelease(p string) error { + eparts := strings.Split(p, ".") + for _, p := range eparts { + if containsOnly(p, num) { + if len(p) > 1 && p[0] == '0' { + return ErrSegmentStartsZero + } + } else if !containsOnly(p, allowed) { + return ErrInvalidPrerelease + } + } + + return nil +} + +// From the spec, "Build metadata MAY be denoted by +// appending a plus sign and a series of dot separated identifiers immediately +// following the patch or pre-release version. Identifiers MUST comprise only +// ASCII alphanumerics and hyphen [0-9A-Za-z-]. Identifiers MUST NOT be empty." +func validateMetadata(m string) error { + eparts := strings.Split(m, ".") + for _, p := range eparts { + if !containsOnly(p, allowed) { + return ErrInvalidMetadata + } + } + return nil +} diff --git a/vendor/github.com/opencontainers/go-digest/LICENSE.code b/vendor/github.com/containerd/containerd/LICENSE similarity index 99% rename from vendor/github.com/opencontainers/go-digest/LICENSE.code rename to vendor/github.com/containerd/containerd/LICENSE index 0ea3ff81e3..584149b6ee 100644 --- a/vendor/github.com/opencontainers/go-digest/LICENSE.code +++ b/vendor/github.com/containerd/containerd/LICENSE @@ -176,7 +176,7 @@ END OF TERMS AND CONDITIONS - Copyright 2016 Docker, Inc. + Copyright The containerd Authors Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/github.com/containerd/containerd/NOTICE b/vendor/github.com/containerd/containerd/NOTICE new file mode 100644 index 0000000000..8915f02773 --- /dev/null +++ b/vendor/github.com/containerd/containerd/NOTICE @@ -0,0 +1,16 @@ +Docker +Copyright 2012-2015 Docker, Inc. + +This product includes software developed at Docker, Inc. (https://www.docker.com). + +The following is courtesy of our legal counsel: + + +Use and transfer of Docker may be subject to certain restrictions by the +United States and other governments. +It is your responsibility to ensure that your use and/or transfer does not +violate applicable laws. + +For more information, please see https://www.bis.doc.gov + +See also https://www.apache.org/dev/crypto.html and/or seek legal counsel. diff --git a/vendor/github.com/containerd/containerd/errdefs/errors.go b/vendor/github.com/containerd/containerd/errdefs/errors.go new file mode 100644 index 0000000000..b5200afc0e --- /dev/null +++ b/vendor/github.com/containerd/containerd/errdefs/errors.go @@ -0,0 +1,93 @@ +/* + Copyright The containerd Authors. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +// Package errdefs defines the common errors used throughout containerd +// packages. +// +// Use with errors.Wrap and error.Wrapf to add context to an error. +// +// To detect an error class, use the IsXXX functions to tell whether an error +// is of a certain type. +// +// The functions ToGRPC and FromGRPC can be used to map server-side and +// client-side errors to the correct types. +package errdefs + +import ( + "context" + + "github.com/pkg/errors" +) + +// Definitions of common error types used throughout containerd. All containerd +// errors returned by most packages will map into one of these errors classes. +// Packages should return errors of these types when they want to instruct a +// client to take a particular action. +// +// For the most part, we just try to provide local grpc errors. Most conditions +// map very well to those defined by grpc. +var ( + ErrUnknown = errors.New("unknown") // used internally to represent a missed mapping. + ErrInvalidArgument = errors.New("invalid argument") + ErrNotFound = errors.New("not found") + ErrAlreadyExists = errors.New("already exists") + ErrFailedPrecondition = errors.New("failed precondition") + ErrUnavailable = errors.New("unavailable") + ErrNotImplemented = errors.New("not implemented") // represents not supported and unimplemented +) + +// IsInvalidArgument returns true if the error is due to an invalid argument +func IsInvalidArgument(err error) bool { + return errors.Cause(err) == ErrInvalidArgument +} + +// IsNotFound returns true if the error is due to a missing object +func IsNotFound(err error) bool { + return errors.Cause(err) == ErrNotFound +} + +// IsAlreadyExists returns true if the error is due to an already existing +// metadata item +func IsAlreadyExists(err error) bool { + return errors.Cause(err) == ErrAlreadyExists +} + +// IsFailedPrecondition returns true if an operation could not proceed to the +// lack of a particular condition +func IsFailedPrecondition(err error) bool { + return errors.Cause(err) == ErrFailedPrecondition +} + +// IsUnavailable returns true if the error is due to a resource being unavailable +func IsUnavailable(err error) bool { + return errors.Cause(err) == ErrUnavailable +} + +// IsNotImplemented returns true if the error is due to not being implemented +func IsNotImplemented(err error) bool { + return errors.Cause(err) == ErrNotImplemented +} + +// IsCanceled returns true if the error is due to `context.Canceled`. +func IsCanceled(err error) bool { + return errors.Cause(err) == context.Canceled +} + +// IsDeadlineExceeded returns true if the error is due to +// `context.DeadlineExceeded`. +func IsDeadlineExceeded(err error) bool { + return errors.Cause(err) == context.DeadlineExceeded +} diff --git a/vendor/github.com/containerd/containerd/errdefs/grpc.go b/vendor/github.com/containerd/containerd/errdefs/grpc.go new file mode 100644 index 0000000000..209f63bd0f --- /dev/null +++ b/vendor/github.com/containerd/containerd/errdefs/grpc.go @@ -0,0 +1,147 @@ +/* + Copyright The containerd Authors. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +package errdefs + +import ( + "context" + "strings" + + "github.com/pkg/errors" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +// ToGRPC will attempt to map the backend containerd error into a grpc error, +// using the original error message as a description. +// +// Further information may be extracted from certain errors depending on their +// type. +// +// If the error is unmapped, the original error will be returned to be handled +// by the regular grpc error handling stack. +func ToGRPC(err error) error { + if err == nil { + return nil + } + + if isGRPCError(err) { + // error has already been mapped to grpc + return err + } + + switch { + case IsInvalidArgument(err): + return status.Errorf(codes.InvalidArgument, err.Error()) + case IsNotFound(err): + return status.Errorf(codes.NotFound, err.Error()) + case IsAlreadyExists(err): + return status.Errorf(codes.AlreadyExists, err.Error()) + case IsFailedPrecondition(err): + return status.Errorf(codes.FailedPrecondition, err.Error()) + case IsUnavailable(err): + return status.Errorf(codes.Unavailable, err.Error()) + case IsNotImplemented(err): + return status.Errorf(codes.Unimplemented, err.Error()) + case IsCanceled(err): + return status.Errorf(codes.Canceled, err.Error()) + case IsDeadlineExceeded(err): + return status.Errorf(codes.DeadlineExceeded, err.Error()) + } + + return err +} + +// ToGRPCf maps the error to grpc error codes, assembling the formatting string +// and combining it with the target error string. +// +// This is equivalent to errors.ToGRPC(errors.Wrapf(err, format, args...)) +func ToGRPCf(err error, format string, args ...interface{}) error { + return ToGRPC(errors.Wrapf(err, format, args...)) +} + +// FromGRPC returns the underlying error from a grpc service based on the grpc error code +func FromGRPC(err error) error { + if err == nil { + return nil + } + + var cls error // divide these into error classes, becomes the cause + + switch code(err) { + case codes.InvalidArgument: + cls = ErrInvalidArgument + case codes.AlreadyExists: + cls = ErrAlreadyExists + case codes.NotFound: + cls = ErrNotFound + case codes.Unavailable: + cls = ErrUnavailable + case codes.FailedPrecondition: + cls = ErrFailedPrecondition + case codes.Unimplemented: + cls = ErrNotImplemented + case codes.Canceled: + cls = context.Canceled + case codes.DeadlineExceeded: + cls = context.DeadlineExceeded + default: + cls = ErrUnknown + } + + msg := rebaseMessage(cls, err) + if msg != "" { + err = errors.Wrap(cls, msg) + } else { + err = errors.WithStack(cls) + } + + return err +} + +// rebaseMessage removes the repeats for an error at the end of an error +// string. This will happen when taking an error over grpc then remapping it. +// +// Effectively, we just remove the string of cls from the end of err if it +// appears there. +func rebaseMessage(cls error, err error) string { + desc := errDesc(err) + clss := cls.Error() + if desc == clss { + return "" + } + + return strings.TrimSuffix(desc, ": "+clss) +} + +func isGRPCError(err error) bool { + _, ok := status.FromError(err) + return ok +} + +func code(err error) codes.Code { + if s, ok := status.FromError(err); ok { + return s.Code() + } + return codes.Unknown +} + +func errDesc(err error) string { + if s, ok := status.FromError(err); ok { + return s.Message() + } + return err.Error() +} diff --git a/vendor/github.com/docker/docker/AUTHORS b/vendor/github.com/docker/docker/AUTHORS index c5f725bc19..ad166ba8df 100644 --- a/vendor/github.com/docker/docker/AUTHORS +++ b/vendor/github.com/docker/docker/AUTHORS @@ -4,6 +4,7 @@ Aanand Prasad Aaron Davidson Aaron Feng +Aaron Hnatiw Aaron Huslage Aaron L. Xu Aaron Lehmann @@ -17,6 +18,7 @@ Abhishek Chanda Abhishek Sharma Abin Shahab Adam Avilla +Adam Dobrawy Adam Eijdenberg Adam Kunk Adam Miller @@ -112,6 +114,7 @@ Anda Xu Anders Janmyr Andre Dublin <81dublin@gmail.com> Andre Granovsky +Andrea Denisse Gómez Andrea Luzzardi Andrea Turli Andreas Elvers @@ -176,8 +179,10 @@ Anusha Ragunathan apocas Arash Deshmeh ArikaChen +Arko Dasgupta Arnaud Lefebvre Arnaud Porterie +Arnaud Rebillout Arthur Barr Arthur Gautier Artur Meyster @@ -279,6 +284,7 @@ Carl Loa Odin Carl X. Su Carlo Mion Carlos Alexandro Becker +Carlos de Paula Carlos Sanchez Carol Fager-Higgins Cary @@ -328,6 +334,7 @@ Chris Gibson Chris Khoo Chris McKinnel Chris McKinnel +Chris Price Chris Seto Chris Snow Chris St. Pierre @@ -417,12 +424,14 @@ Daniel Norberg Daniel Nordberg Daniel Robinson Daniel S +Daniel Sweet Daniel Von Fange Daniel Watkins Daniel X Moore Daniel YC Lin Daniel Zhang Danny Berger +Danny Milosavljevic Danny Yates Danyal Khaliq Darren Coxall @@ -516,6 +525,8 @@ Dmitry Smirnov Dmitry V. Krivenok Dmitry Vorobev Dolph Mathews +Dominic Tubach +Dominic Yin Dominik Dingel Dominik Finkbeiner Dominik Honnef @@ -584,6 +595,7 @@ Erik Weathers Erno Hopearuoho Erwin van der Koogh Ethan Bell +Ethan Mosbaugh Euan Kemp Eugen Krizo Eugene Yakubovich @@ -620,6 +632,7 @@ Fareed Dudhia Fathi Boudra Federico Gimenez Felipe Oliveira +Felipe Ruhland Felix Abecassis Felix Geisendörfer Felix Hupfeld @@ -654,6 +667,7 @@ Frank Groeneveld Frank Herrmann Frank Macreery Frank Rosquin +frankyang Fred Lifton Frederick F. Kautz IV Frederik Loeffert @@ -701,6 +715,7 @@ Gleb M Borisov Glyn Normington GoBella Goffert van Gool +Goldwyn Rodrigues Gopikannan Venugopalsamy Gosuke Miyashita Gou Rao @@ -724,6 +739,7 @@ Guruprasad Gustav Sinder gwx296173 Günter Zöchbauer +Haichao Yang haikuoliu Hakan Özler Hamish Hutchings @@ -732,6 +748,7 @@ Hans Rødtang Hao Shu Wei Hao Zhang <21521210@zju.edu.cn> Harald Albers +Harald Niesche Harley Laue Harold Cooper Harrison Turton @@ -751,9 +768,11 @@ Hobofan Hollie Teal Hong Xu Hongbin Lu +Hongxu Jia hsinko <21551195@zju.edu.cn> Hu Keping Hu Tao +HuanHuan Ye Huanzhong Zhang Huayi Zhang Hugo Duncan @@ -897,6 +916,7 @@ Jie Luo Jihyun Hwang Jilles Oldenbeuving Jim Alateras +Jim Ehrismann Jim Galasyn Jim Minter Jim Perrin @@ -934,7 +954,7 @@ John Feminella John Gardiner Myers John Gossman John Harris -John Howard (VM) +John Howard John Laswell John Maguire John Mulhausen @@ -948,6 +968,7 @@ John Willis Jon Johnson Jon Surrell Jon Wedaman +Jonas Dohse Jonas Pfenniger Jonathan A. Schweder Jonathan A. Sternberg @@ -1001,6 +1022,7 @@ Julio Montes Jun-Ru Chang Jussi Nummelin Justas Brazauskas +Justen Martin Justin Cormack Justin Force Justin Menga @@ -1009,6 +1031,7 @@ Justin Simonelis Justin Terry Justyn Temme Jyrki Puttonen +Jérémy Leherpeur Jérôme Petazzoni Jörg Thalheim K. Heller @@ -1046,6 +1069,7 @@ Ken Reese Kenfe-Mickaël Laventure Kenjiro Nakayama Kent Johnson +Kenta Tada Kevin "qwazerty" Houdebert Kevin Burke Kevin Clark @@ -1056,6 +1080,7 @@ Kevin Kern Kevin Menard Kevin Meredith Kevin P. Kucharczyk +Kevin Parsons Kevin Richardson Kevin Shi Kevin Wallace @@ -1146,6 +1171,7 @@ longliqiang88 <394564827@qq.com> Lorenz Leutgeb Lorenzo Fontana Lotus Fenn +Louis Delossantos Louis Opter Luca Favatella Luca Marturana @@ -1154,15 +1180,18 @@ Luca-Bogdan Grigorescu Lucas Chan Lucas Chi Lucas Molas +Lucas Silvestre Luciano Mores Luis Martínez de Bartolomé Izquierdo Luiz Svoboda +Lukas Heeren Lukas Waslowski lukaspustina Lukasz Zajaczkowski Luke Marsden Lyn Lynda O'Leary +lzhfromutsc Lénaïc Huard Ma Müller Ma Shimiao @@ -1296,6 +1325,7 @@ Michael Stapelberg Michael Steinert Michael Thies Michael West +Michael Zhao Michal Fojtik Michal Gebauer Michal Jemala @@ -1380,6 +1410,7 @@ Neyazul Haque Nghia Tran Niall O'Higgins Nicholas E. Rabenau +Nick Adcock Nick DeCoursin Nick Irvine Nick Neisen @@ -1418,6 +1449,7 @@ Nuutti Kotivuori nzwsch O.S. Tezer objectified +Odin Ugedal Oguz Bilgic Oh Jinkyun Ohad Schneider @@ -1428,6 +1460,7 @@ Oliver Reason Olivier Gambier Olle Jonsson Olli Janatuinen +Olly Pomeroy Omri Shiv Oriol Francès Oskar Niburski @@ -1437,6 +1470,7 @@ Ovidio Mallo Panagiotis Moustafellos Paolo G. Giarrusso Pascal +Pascal Bach Pascal Borreli Pascal Hartig Patrick Böänziger @@ -1461,6 +1495,7 @@ Paul Nasrat Paul Weaver Paulo Ribeiro Pavel Lobashov +Pavel Matěja Pavel Pletenev Pavel Pospisil Pavel Sutyrin @@ -1572,6 +1607,7 @@ Riku Voipio Riley Guerin Ritesh H Shukla Riyaz Faizullabhoy +Rob Gulewich Rob Vesse Robert Bachmann Robert Bittle @@ -1580,11 +1616,13 @@ Robert Schneider Robert Stern Robert Terhaar Robert Wallis +Robert Wang Roberto G. Hashioka Roberto Muñoz Fernández Robin Naundorf Robin Schneider Robin Speekenbrink +Robin Thoni robpc Rodolfo Carvalho Rodrigo Vaz @@ -1618,6 +1656,7 @@ Rozhnov Alexandr Rudolph Gottesheim Rui Cao Rui Lopes +Ruilin Li Runshen Zhu Russ Magee Ryan Abrams @@ -1656,6 +1695,7 @@ Sam J Sharpe Sam Neirinck Sam Reis Sam Rijs +Sam Whited Sambuddha Basu Sami Wagiaalla Samuel Andaya @@ -1670,6 +1710,7 @@ sapphiredev Sargun Dhillon Sascha Andres Sascha Grunert +SataQiu Satnam Singh Satoshi Amemiya Satoshi Tagomori @@ -1718,6 +1759,7 @@ Shijun Qin Shishir Mahajan Shoubhik Bose Shourya Sarcar +Shu-Wai Chow shuai-z Shukui Yang Shuwei Hao @@ -1728,6 +1770,7 @@ Silas Sewell Silvan Jegen Simão Reis Simei He +Simon Barendse Simon Eskildsen Simon Ferquel Simon Leinen @@ -1736,6 +1779,7 @@ Simon Taranto Simon Vikstrom Sindhu S Sjoerd Langkemper +skanehira Solganik Alexander Solomon Hykes Song Gao @@ -1747,16 +1791,18 @@ Sridatta Thatipamala Sridhar Ratnakumar Srini Brahmaroutu Srinivasan Srivatsan +Staf Wagemakers Stanislav Bondarenko Steeve Morin Stefan Berger Stefan J. Wernli Stefan Praszalowicz Stefan S. -Stefan Scherer +Stefan Scherer Stefan Staudenmeyer Stefan Weil Stephan Spindler +Stephen Benjamin Stephen Crosby Stephen Day Stephen Drake @@ -1773,10 +1819,12 @@ Steven Iveson Steven Merrill Steven Richards Steven Taylor +Stig Larsson Subhajit Ghosh Sujith Haridasan Sun Gengze <690388648@qq.com> Sun Jianbo +Sune Keller Sunny Gogoi Suryakumar Sudar Sven Dowideit @@ -1827,6 +1875,7 @@ Tianyi Wang Tibor Vass Tiffany Jernigan Tiffany Low +Tim Tim Bart Tim Bosse Tim Dettrick @@ -1912,6 +1961,7 @@ Victor Palma Victor Vieux Victoria Bialas Vijaya Kumar K +Vikram bir Singh Viktor Stanchev Viktor Vojnovski VinayRaghavanKS @@ -1969,6 +2019,7 @@ Wenyu You <21551128@zju.edu.cn> Wenzhi Liang Wes Morgan Wewang Xiaorenfine +Wiktor Kwapisiewicz Will Dietz Will Rouesnel Will Weaver @@ -1996,6 +2047,7 @@ xichengliudui <1693291525@qq.com> xiekeyang Ximo Guanter Gonzálbez Xinbo Weng +Xinfeng Liu Xinzi Zhou Xiuming Chen Xuecong Liao @@ -2010,6 +2062,7 @@ Yang Pengfei yangchenliang Yanqiang Miao Yao Zaiyong +Yash Murty Yassine Tijani Yasunori Mahata Yazhong Liu @@ -2024,6 +2077,7 @@ Yongxin Li Yongzhi Pan Yosef Fertel You-Sheng Yang (楊有勝) +youcai Youcef YEKHLEF Yu Changchun Yu Chengxia @@ -2060,6 +2114,7 @@ Zhoulin Xie Zhu Guihua Zhu Kunjia Zhuoyun Wei +Ziheng Liu Zilin Du zimbatm Ziming Dong @@ -2068,7 +2123,7 @@ zmarouf Zoltan Tombol Zou Yu zqh -Zuhayr Elahi +Zuhayr Elahi Zunayed Ali Álex González Álvaro Lázaro diff --git a/vendor/github.com/docker/docker/NOTICE b/vendor/github.com/docker/docker/NOTICE index 0c74e15b05..58b19b6d15 100644 --- a/vendor/github.com/docker/docker/NOTICE +++ b/vendor/github.com/docker/docker/NOTICE @@ -3,7 +3,7 @@ Copyright 2012-2017 Docker, Inc. This product includes software developed at Docker, Inc. (https://www.docker.com). -This product contains software (https://github.com/kr/pty) developed +This product contains software (https://github.com/creack/pty) developed by Keith Rarick, licensed under the MIT License. The following is courtesy of our legal counsel: diff --git a/vendor/github.com/docker/docker/api/common.go b/vendor/github.com/docker/docker/api/common.go index aa146cdaeb..1565e2af64 100644 --- a/vendor/github.com/docker/docker/api/common.go +++ b/vendor/github.com/docker/docker/api/common.go @@ -3,7 +3,7 @@ package api // import "github.com/docker/docker/api" // Common constants for daemon and client. const ( // DefaultVersion of Current REST API - DefaultVersion = "1.40" + DefaultVersion = "1.41" // NoBaseImageSpecifier is the symbol used by the FROM // command to specify that no base image is to be used. diff --git a/vendor/github.com/docker/docker/api/swagger.yaml b/vendor/github.com/docker/docker/api/swagger.yaml index 6e0bc25b52..b57184b28d 100644 --- a/vendor/github.com/docker/docker/api/swagger.yaml +++ b/vendor/github.com/docker/docker/api/swagger.yaml @@ -19,10 +19,10 @@ produces: consumes: - "application/json" - "text/plain" -basePath: "/v1.40" +basePath: "/v1.41" info: title: "Docker Engine API" - version: "1.40" + version: "1.41" x-logo: url: "https://docs.docker.com/images/logo-docker-main.png" description: | @@ -49,8 +49,8 @@ info: the URL is not supported by the daemon, a HTTP `400 Bad Request` error message is returned. - If you omit the version-prefix, the current version of the API (v1.40) is used. - For example, calling `/info` is the same as calling `/v1.40/info`. Using the + If you omit the version-prefix, the current version of the API (v1.41) is used. + For example, calling `/info` is the same as calling `/v1.41/info`. Using the API without a version-prefix is deprecated and will be removed in a future release. Engine releases in the near future should support this version of the API, @@ -618,6 +618,71 @@ definitions: description: "Start period for the container to initialize before starting health-retries countdown in nanoseconds. It should be 0 or at least 1000000 (1 ms). 0 means inherit." type: "integer" + Health: + description: | + Health stores information about the container's healthcheck results. + type: "object" + properties: + Status: + description: | + Status is one of `none`, `starting`, `healthy` or `unhealthy` + + - "none" Indicates there is no healthcheck + - "starting" Starting indicates that the container is not yet ready + - "healthy" Healthy indicates that the container is running correctly + - "unhealthy" Unhealthy indicates that the container has a problem + type: "string" + enum: + - "none" + - "starting" + - "healthy" + - "unhealthy" + example: "healthy" + FailingStreak: + description: "FailingStreak is the number of consecutive failures" + type: "integer" + example: 0 + Log: + type: "array" + description: | + Log contains the last few results (oldest first) + items: + x-nullable: true + $ref: "#/definitions/HealthcheckResult" + + HealthcheckResult: + description: | + HealthcheckResult stores information about a single run of a healthcheck probe + type: "object" + properties: + Start: + description: | + Date and time at which this check started in + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. + type: "string" + format: "date-time" + example: "2020-01-04T10:44:24.496525531Z" + End: + description: | + Date and time at which this check ended in + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. + type: "string" + format: "dateTime" + example: "2020-01-04T10:45:21.364524523Z" + ExitCode: + description: | + ExitCode meanings: + + - `0` healthy + - `1` unhealthy + - `2` reserved (considered unhealthy) + - other values: error running probe + type: "integer" + example: 0 + Output: + description: "Output from last check" + type: "string" + HostConfig: description: "Container configuration that depends on the host we are running on" allOf: @@ -628,12 +693,44 @@ definitions: Binds: type: "array" description: | - A list of volume bindings for this container. Each volume binding is a string in one of these forms: - - - `host-src:container-dest` to bind-mount a host path into the container. Both `host-src`, and `container-dest` must be an _absolute_ path. - - `host-src:container-dest:ro` to make the bind mount read-only inside the container. Both `host-src`, and `container-dest` must be an _absolute_ path. - - `volume-name:container-dest` to bind-mount a volume managed by a volume driver into the container. `container-dest` must be an _absolute_ path. - - `volume-name:container-dest:ro` to mount the volume read-only inside the container. `container-dest` must be an _absolute_ path. + A list of volume bindings for this container. Each volume binding + is a string in one of these forms: + + - `host-src:container-dest[:options]` to bind-mount a host path + into the container. Both `host-src`, and `container-dest` must + be an _absolute_ path. + - `volume-name:container-dest[:options]` to bind-mount a volume + managed by a volume driver into the container. `container-dest` + must be an _absolute_ path. + + `options` is an optional, comma-delimited list of: + + - `nocopy` disables automatic copying of data from the container + path to the volume. The `nocopy` flag only applies to named volumes. + - `[ro|rw]` mounts a volume read-only or read-write, respectively. + If omitted or set to `rw`, volumes are mounted read-write. + - `[z|Z]` applies SELinux labels to allow or deny multiple containers + to read and write to the same volume. + - `z`: a _shared_ content label is applied to the content. This + label indicates that multiple containers can share the volume + content, for both reading and writing. + - `Z`: a _private unshared_ label is applied to the content. + This label indicates that only the current container can use + a private volume. Labeling systems such as SELinux require + proper labels to be placed on volume content that is mounted + into a container. Without a label, the security system can + prevent a container's processes from using the content. By + default, the labels set by the host operating system are not + modified. + - `[[r]shared|[r]slave|[r]private]` specifies mount + [propagation behavior](https://www.kernel.org/doc/Documentation/filesystems/sharedsubtree.txt). + This only applies to bind-mounted volumes, not internal volumes + or named volumes. Mount propagation requires the source mount + point (the location where the source directory is mounted in the + host operating system) to have the correct propagation properties. + For shared volumes, the source mount point must be set to `shared`. + For slave volumes, the mount must be set to either `shared` or + `slave`. items: type: "string" ContainerIDFile: @@ -703,6 +800,19 @@ definitions: description: "A list of kernel capabilities to drop from the container. Conflicts with option 'Capabilities'" items: type: "string" + CgroupnsMode: + type: "string" + enum: + - "private" + - "host" + description: | + cgroup namespace mode for the container. Possible values are: + + - `"private"`: the container runs in its own private cgroup namespace + - `"host"`: use the host system's cgroup namespace + + If not specified, the daemon default is used, which can either be `"private"` + or `"host"`, depending on daemon version, kernel support and configuration. Dns: type: "array" description: "A list of DNS servers for the container to use." @@ -2869,6 +2979,18 @@ definitions: type: "object" additionalProperties: type: "string" + # This option is not used by Windows containers + Capabilities: + type: "array" + description: | + A list of kernel capabilities to be available for container (this overrides the default set). + items: + type: "string" + example: + - "CAP_NET_RAW" + - "CAP_SYS_ADMIN" + - "CAP_SYS_CHROOT" + - "CAP_SYSLOG" NetworkAttachmentSpec: description: | Read-only spec type for non-swarm containers attached to swarm overlay @@ -2970,16 +3092,10 @@ definitions: description: "Runtime is the type of runtime specified for the task executor." type: "string" Networks: + description: "Specifies which networks the service should attach to." type: "array" items: - type: "object" - properties: - Target: - type: "string" - Aliases: - type: "array" - items: - type: "string" + $ref: "#/definitions/NetworkAttachmentConfig" LogDriver: description: "Specifies the log driver to use for tasks created from this spec. If not present, the default one for the swarm will be used, finally falling back to the engine default if not specified." type: "object" @@ -3067,6 +3183,12 @@ definitions: type: "integer" DesiredState: $ref: "#/definitions/TaskState" + JobIteration: + description: | + If the Service this Task belongs to is a job-mode service, contains + the JobIteration of the Service this Task was created for. Absent if + the Task was created for a Replicated or Global Service. + $ref: "#/definitions/ObjectVersion" example: ID: "0kzzo1i0y4jz6027t0k7aezc7" Version: @@ -3159,6 +3281,22 @@ definitions: format: "int64" Global: type: "object" + ReplicatedJob: + description: "The mode used for services with a finite number of tasks that run to a completed state." + type: "object" + properties: + MaxConcurrent: + description: "The maximum number of replicas to run simultaneously." + type: "integer" + format: "int64" + default: 1 + TotalCompletions: + description: "The total number of replicas desired to reach the Completed state. If unset, will default to the value of MaxConcurrent" + type: "integer" + format: "int64" + GlobalJob: + description: "The mode used for services which run a task to the completed state on each valid node." + type: "object" UpdateConfig: description: "Specification for the update strategy of the service." type: "object" @@ -3225,17 +3363,11 @@ definitions: - "stop-first" - "start-first" Networks: - description: "Array of network names or IDs to attach the service to." + description: "Specifies which networks the service should attach to." type: "array" items: - type: "object" - properties: - Target: - type: "string" - Aliases: - type: "array" - items: - type: "string" + $ref: "#/definitions/NetworkAttachmentConfig" + EndpointSpec: $ref: "#/definitions/EndpointSpec" @@ -3262,7 +3394,7 @@ definitions:


- - "ingress" makes the target port accessible on on every node, + - "ingress" makes the target port accessible on every node, regardless of whether there is a task for the service running on that node or not. - "host" bypasses the routing mesh and publish the port directly on @@ -3280,8 +3412,8 @@ definitions: type: "object" properties: Mode: - description: "The mode of resolution to use for internal load balancing - between tasks." + description: | + The mode of resolution to use for internal load balancing between tasks. type: "string" enum: - "vip" @@ -3344,6 +3476,58 @@ definitions: format: "dateTime" Message: type: "string" + ServiceStatus: + description: | + The status of the service's tasks. Provided only when requested as + part of a ServiceList operation. + type: "object" + properties: + RunningTasks: + description: "The number of tasks for the service currently in the Running state" + type: "integer" + format: "uint64" + example: 7 + DesiredTasks: + description: | + The number of tasks for the service desired to be running. + For replicated services, this is the replica count from the + service spec. For global services, this is computed by taking + count of all tasks for the service with a Desired State other + than Shutdown. + type: "integer" + format: "uint64" + example: 10 + CompletedTasks: + description: | + The number of tasks for a job that are in the Completed state. + This field must be cross-referenced with the service type, as the + value of 0 may mean the service is not in a job mode, or it may + mean the job-mode service has no tasks yet Completed. + type: "integer" + format: "uint64" + JobStatus: + description: | + The status of the service when it is in one of ReplicatedJob or + GlobalJob modes. Absent on Replicated and Global mode services. The + JobIteration is an ObjectVersion, but unlike the Service's version, + does not need to be sent with an update request. + type: "object" + properties: + JobIteration: + description: | + JobIteration is a value increased each time a Job is executed, + successfully or otherwise. "Executed", in this case, means the + job as a whole has been started, not that an individual Task has + been launched. A job is "Executed" when its ServiceSpec is + updated. JobIteration can be used to disambiguate Tasks belonging + to different executions of a job. Though JobIteration will + increase with each subsequent execution, it may not necessarily + increase by 1, and so JobIteration should not be used to + $ref: "#/definitions/ObjectVersion" + LastExecution: + description: "The last time, as observed by the server, that this job was started" + type: "string" + format: "dateTime" example: ID: "9mnpnzenvg8p8tdbtq4wvbkcz" Version: @@ -3609,6 +3793,70 @@ definitions: Spec: $ref: "#/definitions/ConfigSpec" + ContainerState: + description: | + ContainerState stores container's running state. It's part of ContainerJSONBase + and will be returned by the "inspect" command. + type: "object" + properties: + Status: + description: | + String representation of the container state. Can be one of "created", + "running", "paused", "restarting", "removing", "exited", or "dead". + type: "string" + enum: ["created", "running", "paused", "restarting", "removing", "exited", "dead"] + example: "running" + Running: + description: | + Whether this container is running. + + Note that a running container can be _paused_. The `Running` and `Paused` + booleans are not mutually exclusive: + + When pausing a container (on Linux), the freezer cgroup is used to suspend + all processes in the container. Freezing the process requires the process to + be running. As a result, paused containers are both `Running` _and_ `Paused`. + + Use the `Status` field instead to determine if a container's state is "running". + type: "boolean" + example: true + Paused: + description: "Whether this container is paused." + type: "boolean" + example: false + Restarting: + description: "Whether this container is restarting." + type: "boolean" + example: false + OOMKilled: + description: "Whether this container has been killed because it ran out of memory." + type: "boolean" + example: false + Dead: + type: "boolean" + example: false + Pid: + description: "The process ID of this container" + type: "integer" + example: 1234 + ExitCode: + description: "The last exit code of this container" + type: "integer" + example: 0 + Error: + type: "string" + StartedAt: + description: "The time when this container was last started." + type: "string" + example: "2020-01-06T09:06:59.461876391Z" + FinishedAt: + description: "The time when this container last exited." + type: "string" + example: "2020-01-06T09:07:59.461876391Z" + Health: + x-nullable: true + $ref: "#/definitions/Health" + SystemInfo: type: "object" properties: @@ -3683,44 +3931,6 @@ definitions: on Windows. type: "string" example: "/var/lib/docker" - SystemStatus: - description: | - Status information about this node (standalone Swarm API). - -


- - > **Note**: The information returned in this field is only propagated - > by the Swarm standalone API, and is empty (`null`) when using - > built-in swarm mode. - type: "array" - items: - type: "array" - items: - type: "string" - example: - - ["Role", "primary"] - - ["State", "Healthy"] - - ["Strategy", "spread"] - - ["Filters", "health, port, containerslots, dependency, affinity, constraint, whitelist"] - - ["Nodes", "2"] - - [" swarm-agent-00", "192.168.99.102:2376"] - - [" └ ID", "5CT6:FBGO:RVGO:CZL4:PB2K:WCYN:2JSV:KSHH:GGFW:QOPG:6J5Q:IOZ2|192.168.99.102:2376"] - - [" └ Status", "Healthy"] - - [" └ Containers", "1 (1 Running, 0 Paused, 0 Stopped)"] - - [" └ Reserved CPUs", "0 / 1"] - - [" └ Reserved Memory", "0 B / 1.021 GiB"] - - [" └ Labels", "kernelversion=4.4.74-boot2docker, operatingsystem=Boot2Docker 17.06.0-ce (TCL 7.2); HEAD : 0672754 - Thu Jun 29 00:06:31 UTC 2017, ostype=linux, provider=virtualbox, storagedriver=aufs"] - - [" └ UpdatedAt", "2017-08-09T10:03:46Z"] - - [" └ ServerVersion", "17.06.0-ce"] - - [" swarm-manager", "192.168.99.101:2376"] - - [" └ ID", "TAMD:7LL3:SEF7:LW2W:4Q2X:WVFH:RTXX:JSYS:XY2P:JEHL:ZMJK:JGIW|192.168.99.101:2376"] - - [" └ Status", "Healthy"] - - [" └ Containers", "2 (2 Running, 0 Paused, 0 Stopped)"] - - [" └ Reserved CPUs", "0 / 1"] - - [" └ Reserved Memory", "0 B / 1.021 GiB"] - - [" └ Labels", "kernelversion=4.4.74-boot2docker, operatingsystem=Boot2Docker 17.06.0-ce (TCL 7.2); HEAD : 0672754 - Thu Jun 29 00:06:31 UTC 2017, ostype=linux, provider=virtualbox, storagedriver=aufs"] - - [" └ UpdatedAt", "2017-08-09T10:04:11Z"] - - [" └ ServerVersion", "17.06.0-ce"] Plugins: $ref: "#/definitions/PluginsInfo" MemoryLimit: @@ -3827,6 +4037,17 @@ definitions: or "Windows Server 2016 Datacenter" type: "string" example: "Alpine Linux v3.5" + OSVersion: + description: | + Version of the host's operating system + +


+ + > **Note**: The information returned in this field, including its + > very existence, and the formatting of values, should not be considered + > stable, and may change without notice. + type: "string" + example: "16.04" OSType: description: | Generic type of the operating system of the host, as returned by the @@ -4407,6 +4628,24 @@ definitions: IP address and ports at which this node can be reached. type: "string" + NetworkAttachmentConfig: + description: "Specifies how a service should be attached to a particular network." + type: "object" + properties: + Target: + description: "The target network for attachment. Must be a network name or ID." + type: "string" + Aliases: + description: "Discoverable alternate names for the service on this network." + type: "array" + items: + type: "string" + DriverOpts: + description: "Driver attachment options for the network target" + type: "object" + additionalProperties: + type: "string" + paths: /containers/json: get: @@ -4822,52 +5061,8 @@ paths: items: type: "string" State: - description: "The state of the container." - type: "object" - properties: - Status: - description: | - The status of the container. For example, `"running"` or `"exited"`. - type: "string" - enum: ["created", "running", "paused", "restarting", "removing", "exited", "dead"] - Running: - description: | - Whether this container is running. - - Note that a running container can be _paused_. The `Running` and `Paused` - booleans are not mutually exclusive: - - When pausing a container (on Linux), the cgroups freezer is used to suspend - all processes in the container. Freezing the process requires the process to - be running. As a result, paused containers are both `Running` _and_ `Paused`. - - Use the `Status` field instead to determine if a container's state is "running". - type: "boolean" - Paused: - description: "Whether this container is paused." - type: "boolean" - Restarting: - description: "Whether this container is restarting." - type: "boolean" - OOMKilled: - description: "Whether this container has been killed because it ran out of memory." - type: "boolean" - Dead: - type: "boolean" - Pid: - description: "The process ID of this container" - type: "integer" - ExitCode: - description: "The last exit code of this container" - type: "integer" - Error: - type: "string" - StartedAt: - description: "The time when this container was last started." - type: "string" - FinishedAt: - description: "The time when this container last exited." - type: "string" + x-nullable: true + $ref: "#/definitions/ContainerState" Image: description: "The container's image" type: "string" @@ -4879,15 +5074,14 @@ paths: type: "string" LogPath: type: "string" - Node: - description: "TODO" - type: "object" Name: type: "string" RestartCount: type: "integer" Driver: type: "string" + Platform: + type: "string" MountLabel: type: "string" ProcessLabel: @@ -4937,6 +5131,8 @@ paths: Domainname: "" Env: - "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" + Healthcheck: + Test: ["CMD-SHELL", "exit 0"] Hostname: "ba033ac44011" Image: "ubuntu" Labels: @@ -5048,6 +5244,14 @@ paths: Error: "" ExitCode: 9 FinishedAt: "2015-01-06T15:47:32.080254511Z" + Health: + Status: "healthy" + FailingStreak: 0 + Log: + - Start: "2019-12-22T10:59:05.6385933Z" + End: "2019-12-22T10:59:05.8078452Z" + ExitCode: 0 + Output: "" OOMKilled: false Dead: false Paused: false @@ -5507,8 +5711,6 @@ paths: description: "no error" 304: description: "container already started" - schema: - $ref: "#/definitions/ErrorResponse" 404: description: "no such container" schema: @@ -5540,8 +5742,6 @@ paths: description: "no error" 304: description: "container already stopped" - schema: - $ref: "#/definitions/ErrorResponse" 404: description: "no such container" schema: @@ -5732,9 +5932,9 @@ paths: post: summary: "Pause a container" description: | - Use the cgroups freezer to suspend all processes in a container. + Use the freezer cgroup to suspend all processes in a container. - Traditionally, when suspending a process the `SIGSTOP` signal is used, which is observable by the process being suspended. With the cgroups freezer the process is unaware, and unable to capture, that it is being suspended, and subsequently resumed. + Traditionally, when suspending a process the `SIGSTOP` signal is used, which is observable by the process being suspended. With the freezer cgroup the process is unaware, and unable to capture, that it is being suspended, and subsequently resumed. operationId: "ContainerPause" responses: 204: @@ -6457,10 +6657,11 @@ paths: type: "string" - name: "networkmode" in: "query" - description: "Sets the networking mode for the run commands during - build. Supported standard values are: `bridge`, `host`, `none`, and - `container:`. Any other value is taken as a custom network's - name to which this container should connect to." + description: | + Sets the networking mode for the run commands during build. Supported + standard values are: `bridge`, `host`, `none`, and `container:`. + Any other value is taken as a custom network's name or ID to which this + container should connect to. type: "string" - name: "Content-type" in: "header" @@ -6605,6 +6806,10 @@ paths: in: "query" description: "Tag or digest. If empty when pulling an image, this causes all tags for the given image to be pulled." type: "string" + - name: "message" + in: "query" + description: "Set commit message for imported image." + type: "string" - name: "inputImage" in: "body" description: "Image content if the value `-` has been specified in fromSrc query parameter" @@ -9283,6 +9488,10 @@ paths: - `label=` - `mode=["replicated"|"global"]` - `name=` + - name: "status" + in: "query" + type: "boolean" + description: "Include service status, with count of running and desired tasks" tags: ["Service"] /services/create: post: @@ -9549,17 +9758,19 @@ paths: type: "integer" - name: "registryAuthFrom" in: "query" + description: | + If the `X-Registry-Auth` header is not specified, this parameter + indicates where to find registry authorization credentials. type: "string" - description: "If the X-Registry-Auth header is not specified, this - parameter indicates where to find registry authorization credentials. The - valid values are `spec` and `previous-spec`." + enum: ["spec", "previous-spec"] default: "spec" - name: "rollback" in: "query" + description: | + Set to this parameter to `previous` to cause a server-side rollback + to the previous service spec. The supplied spec will be ignored in + this case. type: "string" - description: "Set to this parameter to `previous` to cause a - server-side rollback to the previous service spec. The supplied spec will be - ignored in this case." - name: "X-Registry-Auth" in: "header" description: "A base64-encoded auth configuration for pulling from private registries. [See the authentication section for details.](#section/Authentication)" @@ -10379,9 +10590,6 @@ paths: description: | Start a new interactive session with a server. Session allows server to call back to the client for advanced capabilities. - > **Note**: This endpoint is *experimental* and only available if the daemon is started with experimental - > features enabled. The specifications for this endpoint may still change in a future version of the API. - ### Hijacking This endpoint hijacks the HTTP connection to HTTP2 transport that allows the client to expose gPRC services on that connection. @@ -10415,4 +10623,4 @@ paths: description: "server error" schema: $ref: "#/definitions/ErrorResponse" - tags: ["Session (experimental)"] + tags: ["Session"] diff --git a/vendor/github.com/docker/docker/api/types/client.go b/vendor/github.com/docker/docker/api/types/client.go index 4b9f50282b..6616cbcd59 100644 --- a/vendor/github.com/docker/docker/api/types/client.go +++ b/vendor/github.com/docker/docker/api/types/client.go @@ -205,7 +205,7 @@ const ( // BuilderV1 is the first generation builder in docker daemon BuilderV1 BuilderVersion = "1" // BuilderBuildKit is builder based on moby/buildkit project - BuilderBuildKit = "2" + BuilderBuildKit BuilderVersion = "2" ) // ImageBuildResponse holds information @@ -265,7 +265,7 @@ type ImagePullOptions struct { // if the privilege request fails. type RequestPrivilegeFunc func() (string, error) -//ImagePushOptions holds information to push images. +// ImagePushOptions holds information to push images. type ImagePushOptions ImagePullOptions // ImageRemoveOptions holds parameters to remove images. @@ -363,6 +363,10 @@ type ServiceUpdateOptions struct { // ServiceListOptions holds parameters to list services with. type ServiceListOptions struct { Filters filters.Args + + // Status indicates whether the server should include the service task + // count of running and desired tasks. + Status bool } // ServiceInspectOptions holds parameters related to the "service inspect" diff --git a/vendor/github.com/docker/docker/api/types/container/container_changes.go b/vendor/github.com/docker/docker/api/types/container/container_changes.go index 222d141007..16dd5019ee 100644 --- a/vendor/github.com/docker/docker/api/types/container/container_changes.go +++ b/vendor/github.com/docker/docker/api/types/container/container_changes.go @@ -1,8 +1,7 @@ package container // import "github.com/docker/docker/api/types/container" // ---------------------------------------------------------------------------- -// DO NOT EDIT THIS FILE -// This file was generated by `swagger generate operation` +// Code generated by `swagger generate operation`. DO NOT EDIT. // // See hack/generate-swagger-api.sh // ---------------------------------------------------------------------------- diff --git a/vendor/github.com/docker/docker/api/types/container/container_create.go b/vendor/github.com/docker/docker/api/types/container/container_create.go index 1ec9c3728b..d0c852f84d 100644 --- a/vendor/github.com/docker/docker/api/types/container/container_create.go +++ b/vendor/github.com/docker/docker/api/types/container/container_create.go @@ -1,8 +1,7 @@ package container // import "github.com/docker/docker/api/types/container" // ---------------------------------------------------------------------------- -// DO NOT EDIT THIS FILE -// This file was generated by `swagger generate operation` +// Code generated by `swagger generate operation`. DO NOT EDIT. // // See hack/generate-swagger-api.sh // ---------------------------------------------------------------------------- diff --git a/vendor/github.com/docker/docker/api/types/container/container_top.go b/vendor/github.com/docker/docker/api/types/container/container_top.go index f8a606687c..f0ee9dde70 100644 --- a/vendor/github.com/docker/docker/api/types/container/container_top.go +++ b/vendor/github.com/docker/docker/api/types/container/container_top.go @@ -1,8 +1,7 @@ package container // import "github.com/docker/docker/api/types/container" // ---------------------------------------------------------------------------- -// DO NOT EDIT THIS FILE -// This file was generated by `swagger generate operation` +// Code generated by `swagger generate operation`. DO NOT EDIT. // // See hack/generate-swagger-api.sh // ---------------------------------------------------------------------------- diff --git a/vendor/github.com/docker/docker/api/types/container/container_update.go b/vendor/github.com/docker/docker/api/types/container/container_update.go index 33addedf77..c10f175ea8 100644 --- a/vendor/github.com/docker/docker/api/types/container/container_update.go +++ b/vendor/github.com/docker/docker/api/types/container/container_update.go @@ -1,8 +1,7 @@ package container // import "github.com/docker/docker/api/types/container" // ---------------------------------------------------------------------------- -// DO NOT EDIT THIS FILE -// This file was generated by `swagger generate operation` +// Code generated by `swagger generate operation`. DO NOT EDIT. // // See hack/generate-swagger-api.sh // ---------------------------------------------------------------------------- diff --git a/vendor/github.com/docker/docker/api/types/container/container_wait.go b/vendor/github.com/docker/docker/api/types/container/container_wait.go index 94b6a20e15..49e05ae669 100644 --- a/vendor/github.com/docker/docker/api/types/container/container_wait.go +++ b/vendor/github.com/docker/docker/api/types/container/container_wait.go @@ -1,8 +1,7 @@ package container // import "github.com/docker/docker/api/types/container" // ---------------------------------------------------------------------------- -// DO NOT EDIT THIS FILE -// This file was generated by `swagger generate operation` +// Code generated by `swagger generate operation`. DO NOT EDIT. // // See hack/generate-swagger-api.sh // ---------------------------------------------------------------------------- diff --git a/vendor/github.com/docker/docker/api/types/container/host_config.go b/vendor/github.com/docker/docker/api/types/container/host_config.go index c3de3d976a..b8a4b3aa62 100644 --- a/vendor/github.com/docker/docker/api/types/container/host_config.go +++ b/vendor/github.com/docker/docker/api/types/container/host_config.go @@ -7,9 +7,32 @@ import ( "github.com/docker/docker/api/types/mount" "github.com/docker/docker/api/types/strslice" "github.com/docker/go-connections/nat" - "github.com/docker/go-units" + units "github.com/docker/go-units" ) +// CgroupnsMode represents the cgroup namespace mode of the container +type CgroupnsMode string + +// IsPrivate indicates whether the container uses its own private cgroup namespace +func (c CgroupnsMode) IsPrivate() bool { + return c == "private" +} + +// IsHost indicates whether the container shares the host's cgroup namespace +func (c CgroupnsMode) IsHost() bool { + return c == "host" +} + +// IsEmpty indicates whether the container cgroup namespace mode is unset +func (c CgroupnsMode) IsEmpty() bool { + return c == "" +} + +// Valid indicates whether the cgroup namespace mode is valid +func (c CgroupnsMode) Valid() bool { + return c.IsEmpty() || c.IsPrivate() || c.IsHost() +} + // Isolation represents the isolation technology of a container. The supported // values are platform specific type Isolation string @@ -122,7 +145,7 @@ func (n NetworkMode) ConnectedContainer() string { return "" } -//UserDefined indicates user-created network +// UserDefined indicates user-created network func (n NetworkMode) UserDefined() string { if n.IsUserDefined() { return string(n) @@ -381,9 +404,10 @@ type HostConfig struct { CapAdd strslice.StrSlice // List of kernel capabilities to add to the container CapDrop strslice.StrSlice // List of kernel capabilities to remove from the container Capabilities []string `json:"Capabilities"` // List of kernel capabilities to be available for container (this overrides the default set) - DNS []string `json:"Dns"` // List of DNS server to lookup - DNSOptions []string `json:"DnsOptions"` // List of DNSOption to look for - DNSSearch []string `json:"DnsSearch"` // List of DNSSearch to look for + CgroupnsMode CgroupnsMode // Cgroup namespace mode to use for the container + DNS []string `json:"Dns"` // List of DNS server to lookup + DNSOptions []string `json:"DnsOptions"` // List of DNSOption to look for + DNSSearch []string `json:"DnsSearch"` // List of DNSSearch to look for ExtraHosts []string // List of extra hosts GroupAdd []string // List of additional groups that the container process will run as IpcMode IpcMode // IPC namespace to use for the container diff --git a/vendor/github.com/docker/docker/api/types/error_response_ext.go b/vendor/github.com/docker/docker/api/types/error_response_ext.go new file mode 100644 index 0000000000..f84f034cd5 --- /dev/null +++ b/vendor/github.com/docker/docker/api/types/error_response_ext.go @@ -0,0 +1,6 @@ +package types + +// Error returns the error message +func (e ErrorResponse) Error() string { + return e.Message +} diff --git a/vendor/github.com/docker/docker/api/types/filters/parse.go b/vendor/github.com/docker/docker/api/types/filters/parse.go index 1f75403f78..4bc91cffd6 100644 --- a/vendor/github.com/docker/docker/api/types/filters/parse.go +++ b/vendor/github.com/docker/docker/api/types/filters/parse.go @@ -36,6 +36,15 @@ func NewArgs(initialArgs ...KeyValuePair) Args { return args } +// Keys returns all the keys in list of Args +func (args Args) Keys() []string { + keys := make([]string, 0, len(args.fields)) + for k := range args.fields { + keys = append(keys, k) + } + return keys +} + // MarshalJSON returns a JSON byte representation of the Args func (args Args) MarshalJSON() ([]byte, error) { if len(args.fields) == 0 { @@ -57,7 +66,7 @@ func ToJSON(a Args) (string, error) { // then the encoded format will use an older legacy format where the values are a // list of strings, instead of a set. // -// Deprecated: Use ToJSON +// Deprecated: do not use in any new code; use ToJSON instead func ToParamWithVersion(version string, a Args) (string, error) { if a.Len() == 0 { return "", nil @@ -145,7 +154,7 @@ func (args Args) Len() int { func (args Args) MatchKVList(key string, sources map[string]string) bool { fieldValues := args.fields[key] - //do not filter if there is no filter set or cannot determine filter + // do not filter if there is no filter set or cannot determine filter if len(fieldValues) == 0 { return true } @@ -191,7 +200,7 @@ func (args Args) Match(field, source string) bool { // ExactMatch returns true if the source matches exactly one of the values. func (args Args) ExactMatch(key, source string) bool { fieldValues, ok := args.fields[key] - //do not filter if there is no filter set or cannot determine filter + // do not filter if there is no filter set or cannot determine filter if !ok || len(fieldValues) == 0 { return true } @@ -204,7 +213,7 @@ func (args Args) ExactMatch(key, source string) bool { // matches exactly the value. func (args Args) UniqueExactMatch(key, source string) bool { fieldValues := args.fields[key] - //do not filter if there is no filter set or cannot determine filter + // do not filter if there is no filter set or cannot determine filter if len(fieldValues) == 0 { return true } diff --git a/vendor/github.com/docker/docker/api/types/image/image_history.go b/vendor/github.com/docker/docker/api/types/image/image_history.go index b5a7a0c490..e302bb0aeb 100644 --- a/vendor/github.com/docker/docker/api/types/image/image_history.go +++ b/vendor/github.com/docker/docker/api/types/image/image_history.go @@ -1,8 +1,7 @@ package image // import "github.com/docker/docker/api/types/image" // ---------------------------------------------------------------------------- -// DO NOT EDIT THIS FILE -// This file was generated by `swagger generate operation` +// Code generated by `swagger generate operation`. DO NOT EDIT. // // See hack/generate-swagger-api.sh // ---------------------------------------------------------------------------- diff --git a/vendor/github.com/docker/docker/api/types/network/network.go b/vendor/github.com/docker/docker/api/types/network/network.go index 71e97338fd..7927dbfffb 100644 --- a/vendor/github.com/docker/docker/api/types/network/network.go +++ b/vendor/github.com/docker/docker/api/types/network/network.go @@ -13,7 +13,7 @@ type Address struct { // IPAM represents IP Address Management type IPAM struct { Driver string - Options map[string]string //Per network IPAM driver options + Options map[string]string // Per network IPAM driver options Config []IPAMConfig } diff --git a/vendor/github.com/docker/docker/api/types/registry/registry.go b/vendor/github.com/docker/docker/api/types/registry/registry.go index 8789ad3b32..53e47084c8 100644 --- a/vendor/github.com/docker/docker/api/types/registry/registry.go +++ b/vendor/github.com/docker/docker/api/types/registry/registry.go @@ -4,7 +4,7 @@ import ( "encoding/json" "net" - "github.com/opencontainers/image-spec/specs-go/v1" + v1 "github.com/opencontainers/image-spec/specs-go/v1" ) // ServiceConfig stores daemon registry services configuration. diff --git a/vendor/github.com/docker/docker/api/types/swarm/container.go b/vendor/github.com/docker/docker/api/types/swarm/container.go index 48190c1762..5bbedfcf68 100644 --- a/vendor/github.com/docker/docker/api/types/swarm/container.go +++ b/vendor/github.com/docker/docker/api/types/swarm/container.go @@ -67,10 +67,11 @@ type ContainerSpec struct { // The format of extra hosts on swarmkit is specified in: // http://man7.org/linux/man-pages/man5/hosts.5.html // IP_address canonical_hostname [aliases...] - Hosts []string `json:",omitempty"` - DNSConfig *DNSConfig `json:",omitempty"` - Secrets []*SecretReference `json:",omitempty"` - Configs []*ConfigReference `json:",omitempty"` - Isolation container.Isolation `json:",omitempty"` - Sysctls map[string]string `json:",omitempty"` + Hosts []string `json:",omitempty"` + DNSConfig *DNSConfig `json:",omitempty"` + Secrets []*SecretReference `json:",omitempty"` + Configs []*ConfigReference `json:",omitempty"` + Isolation container.Isolation `json:",omitempty"` + Sysctls map[string]string `json:",omitempty"` + Capabilities []string `json:",omitempty"` } diff --git a/vendor/github.com/docker/docker/api/types/swarm/runtime/plugin.pb.go b/vendor/github.com/docker/docker/api/types/swarm/runtime/plugin.pb.go index 1fdc9b0436..e45045866a 100644 --- a/vendor/github.com/docker/docker/api/types/swarm/runtime/plugin.pb.go +++ b/vendor/github.com/docker/docker/api/types/swarm/runtime/plugin.pb.go @@ -1,6 +1,5 @@ -// Code generated by protoc-gen-gogo. +// Code generated by protoc-gen-gogo. DO NOT EDIT. // source: plugin.proto -// DO NOT EDIT! /* Package runtime is a generated protocol buffer package. @@ -38,6 +37,7 @@ type PluginSpec struct { Remote string `protobuf:"bytes,2,opt,name=remote,proto3" json:"remote,omitempty"` Privileges []*PluginPrivilege `protobuf:"bytes,3,rep,name=privileges" json:"privileges,omitempty"` Disabled bool `protobuf:"varint,4,opt,name=disabled,proto3" json:"disabled,omitempty"` + Env []string `protobuf:"bytes,5,rep,name=env" json:"env,omitempty"` } func (m *PluginSpec) Reset() { *m = PluginSpec{} } @@ -73,6 +73,13 @@ func (m *PluginSpec) GetDisabled() bool { return false } +func (m *PluginSpec) GetEnv() []string { + if m != nil { + return m.Env + } + return nil +} + // PluginPrivilege describes a permission the user has to accept // upon installing a plugin. type PluginPrivilege struct { @@ -160,6 +167,21 @@ func (m *PluginSpec) MarshalTo(dAtA []byte) (int, error) { } i++ } + if len(m.Env) > 0 { + for _, s := range m.Env { + dAtA[i] = 0x2a + i++ + l = len(s) + for l >= 1<<7 { + dAtA[i] = uint8(uint64(l)&0x7f | 0x80) + l >>= 7 + i++ + } + dAtA[i] = uint8(l) + i++ + i += copy(dAtA[i:], s) + } + } return i, nil } @@ -208,24 +230,6 @@ func (m *PluginPrivilege) MarshalTo(dAtA []byte) (int, error) { return i, nil } -func encodeFixed64Plugin(dAtA []byte, offset int, v uint64) int { - dAtA[offset] = uint8(v) - dAtA[offset+1] = uint8(v >> 8) - dAtA[offset+2] = uint8(v >> 16) - dAtA[offset+3] = uint8(v >> 24) - dAtA[offset+4] = uint8(v >> 32) - dAtA[offset+5] = uint8(v >> 40) - dAtA[offset+6] = uint8(v >> 48) - dAtA[offset+7] = uint8(v >> 56) - return offset + 8 -} -func encodeFixed32Plugin(dAtA []byte, offset int, v uint32) int { - dAtA[offset] = uint8(v) - dAtA[offset+1] = uint8(v >> 8) - dAtA[offset+2] = uint8(v >> 16) - dAtA[offset+3] = uint8(v >> 24) - return offset + 4 -} func encodeVarintPlugin(dAtA []byte, offset int, v uint64) int { for v >= 1<<7 { dAtA[offset] = uint8(v&0x7f | 0x80) @@ -255,6 +259,12 @@ func (m *PluginSpec) Size() (n int) { if m.Disabled { n += 2 } + if len(m.Env) > 0 { + for _, s := range m.Env { + l = len(s) + n += 1 + l + sovPlugin(uint64(l)) + } + } return n } @@ -429,6 +439,35 @@ func (m *PluginSpec) Unmarshal(dAtA []byte) error { } } m.Disabled = bool(v != 0) + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Env", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPlugin + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthPlugin + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Env = append(m.Env, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipPlugin(dAtA[iNdEx:]) @@ -695,18 +734,21 @@ var ( func init() { proto.RegisterFile("plugin.proto", fileDescriptorPlugin) } var fileDescriptorPlugin = []byte{ - // 196 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xe2, 0xe2, 0x29, 0xc8, 0x29, 0x4d, - 0xcf, 0xcc, 0xd3, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x57, 0x6a, 0x63, 0xe4, 0xe2, 0x0a, 0x00, 0x0b, - 0x04, 0x17, 0xa4, 0x26, 0x0b, 0x09, 0x71, 0xb1, 0xe4, 0x25, 0xe6, 0xa6, 0x4a, 0x30, 0x2a, 0x30, - 0x6a, 0x70, 0x06, 0x81, 0xd9, 0x42, 0x62, 0x5c, 0x6c, 0x45, 0xa9, 0xb9, 0xf9, 0x25, 0xa9, 0x12, - 0x4c, 0x60, 0x51, 0x28, 0x4f, 0xc8, 0x80, 0x8b, 0xab, 0xa0, 0x28, 0xb3, 0x2c, 0x33, 0x27, 0x35, - 0x3d, 0xb5, 0x58, 0x82, 0x59, 0x81, 0x59, 0x83, 0xdb, 0x48, 0x40, 0x0f, 0x62, 0x58, 0x00, 0x4c, - 0x22, 0x08, 0x49, 0x8d, 0x90, 0x14, 0x17, 0x47, 0x4a, 0x66, 0x71, 0x62, 0x52, 0x4e, 0x6a, 0x8a, - 0x04, 0x8b, 0x02, 0xa3, 0x06, 0x47, 0x10, 0x9c, 0xaf, 0x14, 0xcb, 0xc5, 0x8f, 0xa6, 0x15, 0xab, - 0x63, 0x14, 0xb8, 0xb8, 0x53, 0x52, 0x8b, 0x93, 0x8b, 0x32, 0x0b, 0x4a, 0x32, 0xf3, 0xf3, 0xa0, - 0x2e, 0x42, 0x16, 0x12, 0x12, 0xe1, 0x62, 0x2d, 0x4b, 0xcc, 0x29, 0x4d, 0x05, 0xbb, 0x88, 0x33, - 0x08, 0xc2, 0x71, 0xe2, 0x39, 0xf1, 0x48, 0x8e, 0xf1, 0xc2, 0x23, 0x39, 0xc6, 0x07, 0x8f, 0xe4, - 0x18, 0x93, 0xd8, 0xc0, 0x9e, 0x37, 0x06, 0x04, 0x00, 0x00, 0xff, 0xff, 0xb8, 0x84, 0xad, 0x79, - 0x0c, 0x01, 0x00, 0x00, + // 256 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x90, 0x4d, 0x4b, 0xc3, 0x30, + 0x18, 0xc7, 0x89, 0xdd, 0xc6, 0xfa, 0x4c, 0x70, 0x04, 0x91, 0xe2, 0xa1, 0x94, 0x9d, 0x7a, 0x6a, + 0x45, 0x2f, 0x82, 0x37, 0x0f, 0x9e, 0x47, 0xbc, 0x09, 0x1e, 0xd2, 0xf6, 0xa1, 0x06, 0x9b, 0x17, + 0x92, 0xb4, 0xe2, 0x37, 0xf1, 0x23, 0x79, 0xf4, 0x23, 0x48, 0x3f, 0x89, 0x98, 0x75, 0x32, 0x64, + 0xa7, 0xff, 0x4b, 0xc2, 0x9f, 0x1f, 0x0f, 0x9c, 0x9a, 0xae, 0x6f, 0x85, 0x2a, 0x8c, 0xd5, 0x5e, + 0x6f, 0x3e, 0x08, 0xc0, 0x36, 0x14, 0x8f, 0x06, 0x6b, 0x4a, 0x61, 0xa6, 0xb8, 0xc4, 0x84, 0x64, + 0x24, 0x8f, 0x59, 0xf0, 0xf4, 0x02, 0x16, 0x16, 0xa5, 0xf6, 0x98, 0x9c, 0x84, 0x76, 0x4a, 0xf4, + 0x0a, 0xc0, 0x58, 0x31, 0x88, 0x0e, 0x5b, 0x74, 0x49, 0x94, 0x45, 0xf9, 0xea, 0x7a, 0x5d, 0xec, + 0xc6, 0xb6, 0xfb, 0x07, 0x76, 0xf0, 0x87, 0x5e, 0xc2, 0xb2, 0x11, 0x8e, 0x57, 0x1d, 0x36, 0xc9, + 0x2c, 0x23, 0xf9, 0x92, 0xfd, 0x65, 0xba, 0x86, 0x08, 0xd5, 0x90, 0xcc, 0xb3, 0x28, 0x8f, 0xd9, + 0xaf, 0xdd, 0x3c, 0xc3, 0xd9, 0xbf, 0xb1, 0xa3, 0x78, 0x19, 0xac, 0x1a, 0x74, 0xb5, 0x15, 0xc6, + 0x0b, 0xad, 0x26, 0xc6, 0xc3, 0x8a, 0x9e, 0xc3, 0x7c, 0xe0, 0x5d, 0x8f, 0x81, 0x31, 0x66, 0xbb, + 0x70, 0xff, 0xf0, 0x39, 0xa6, 0xe4, 0x6b, 0x4c, 0xc9, 0xf7, 0x98, 0x92, 0xa7, 0xdb, 0x56, 0xf8, + 0x97, 0xbe, 0x2a, 0x6a, 0x2d, 0xcb, 0x46, 0xd7, 0xaf, 0x68, 0xf7, 0xc2, 0x8d, 0x28, 0xfd, 0xbb, + 0x41, 0x57, 0xba, 0x37, 0x6e, 0x65, 0x69, 0x7b, 0xe5, 0x85, 0xc4, 0xbb, 0x49, 0xab, 0x45, 0x38, + 0xe4, 0xcd, 0x4f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x99, 0xa8, 0xd9, 0x9b, 0x58, 0x01, 0x00, 0x00, } diff --git a/vendor/github.com/docker/docker/api/types/swarm/runtime/plugin.proto b/vendor/github.com/docker/docker/api/types/swarm/runtime/plugin.proto index 6d63b7783f..9ef169046b 100644 --- a/vendor/github.com/docker/docker/api/types/swarm/runtime/plugin.proto +++ b/vendor/github.com/docker/docker/api/types/swarm/runtime/plugin.proto @@ -9,6 +9,7 @@ message PluginSpec { string remote = 2; repeated PluginPrivilege privileges = 3; bool disabled = 4; + repeated string env = 5; } // PluginPrivilege describes a permission the user has to accept diff --git a/vendor/github.com/docker/docker/api/types/swarm/service.go b/vendor/github.com/docker/docker/api/types/swarm/service.go index abf192e759..6eb452d24d 100644 --- a/vendor/github.com/docker/docker/api/types/swarm/service.go +++ b/vendor/github.com/docker/docker/api/types/swarm/service.go @@ -10,6 +10,17 @@ type Service struct { PreviousSpec *ServiceSpec `json:",omitempty"` Endpoint Endpoint `json:",omitempty"` UpdateStatus *UpdateStatus `json:",omitempty"` + + // ServiceStatus is an optional, extra field indicating the number of + // desired and running tasks. It is provided primarily as a shortcut to + // calculating these values client-side, which otherwise would require + // listing all tasks for a service, an operation that could be + // computation and network expensive. + ServiceStatus *ServiceStatus `json:",omitempty"` + + // JobStatus is the status of a Service which is in one of ReplicatedJob or + // GlobalJob modes. It is absent on Replicated and Global services. + JobStatus *JobStatus `json:",omitempty"` } // ServiceSpec represents the spec of a service. @@ -32,8 +43,10 @@ type ServiceSpec struct { // ServiceMode represents the mode of a service. type ServiceMode struct { - Replicated *ReplicatedService `json:",omitempty"` - Global *GlobalService `json:",omitempty"` + Replicated *ReplicatedService `json:",omitempty"` + Global *GlobalService `json:",omitempty"` + ReplicatedJob *ReplicatedJob `json:",omitempty"` + GlobalJob *GlobalJob `json:",omitempty"` } // UpdateState is the state of a service update. @@ -70,6 +83,32 @@ type ReplicatedService struct { // GlobalService is a kind of ServiceMode. type GlobalService struct{} +// ReplicatedJob is the a type of Service which executes a defined Tasks +// in parallel until the specified number of Tasks have succeeded. +type ReplicatedJob struct { + // MaxConcurrent indicates the maximum number of Tasks that should be + // executing simultaneously for this job at any given time. There may be + // fewer Tasks that MaxConcurrent executing simultaneously; for example, if + // there are fewer than MaxConcurrent tasks needed to reach + // TotalCompletions. + // + // If this field is empty, it will default to a max concurrency of 1. + MaxConcurrent *uint64 `json:",omitempty"` + + // TotalCompletions is the total number of Tasks desired to run to + // completion. + // + // If this field is empty, the value of MaxConcurrent will be used. + TotalCompletions *uint64 `json:",omitempty"` +} + +// GlobalJob is the type of a Service which executes a Task on every Node +// matching the Service's placement constraints. These tasks run to completion +// and then exit. +// +// This type is deliberately empty. +type GlobalJob struct{} + const ( // UpdateFailureActionPause PAUSE UpdateFailureActionPause = "pause" @@ -122,3 +161,42 @@ type UpdateConfig struct { // started, or the new task is started before the old task is shut down. Order string } + +// ServiceStatus represents the number of running tasks in a service and the +// number of tasks desired to be running. +type ServiceStatus struct { + // RunningTasks is the number of tasks for the service actually in the + // Running state + RunningTasks uint64 + + // DesiredTasks is the number of tasks desired to be running by the + // service. For replicated services, this is the replica count. For global + // services, this is computed by taking the number of tasks with desired + // state of not-Shutdown. + DesiredTasks uint64 + + // CompletedTasks is the number of tasks in the state Completed, if this + // service is in ReplicatedJob or GlobalJob mode. This field must be + // cross-referenced with the service type, because the default value of 0 + // may mean that a service is not in a job mode, or it may mean that the + // job has yet to complete any tasks. + CompletedTasks uint64 +} + +// JobStatus is the status of a job-type service. +type JobStatus struct { + // JobIteration is a value increased each time a Job is executed, + // successfully or otherwise. "Executed", in this case, means the job as a + // whole has been started, not that an individual Task has been launched. A + // job is "Executed" when its ServiceSpec is updated. JobIteration can be + // used to disambiguate Tasks belonging to different executions of a job. + // + // Though JobIteration will increase with each subsequent execution, it may + // not necessarily increase by 1, and so JobIteration should not be used to + // keep track of the number of times a job has been executed. + JobIteration Version + + // LastExecution is the time that the job was last executed, as observed by + // Swarm manager. + LastExecution time.Time `json:",omitempty"` +} diff --git a/vendor/github.com/docker/docker/api/types/swarm/task.go b/vendor/github.com/docker/docker/api/types/swarm/task.go index d5a57df5db..9f193df37c 100644 --- a/vendor/github.com/docker/docker/api/types/swarm/task.go +++ b/vendor/github.com/docker/docker/api/types/swarm/task.go @@ -56,6 +56,12 @@ type Task struct { DesiredState TaskState `json:",omitempty"` NetworksAttachments []NetworkAttachment `json:",omitempty"` GenericResources []GenericResource `json:",omitempty"` + + // JobIteration is the JobIteration of the Service that this Task was + // spawned from, if the Service is a ReplicatedJob or GlobalJob. This is + // used to determine which Tasks belong to which run of the job. This field + // is absent if the Service mode is Replicated or Global. + JobIteration *Version `json:",omitempty"` } // TaskSpec represents the spec of a task. diff --git a/vendor/github.com/docker/docker/api/types/types.go b/vendor/github.com/docker/docker/api/types/types.go index a39ffcb7be..7486eab4d8 100644 --- a/vendor/github.com/docker/docker/api/types/types.go +++ b/vendor/github.com/docker/docker/api/types/types.go @@ -39,6 +39,7 @@ type ImageInspect struct { Author string Config *container.Config Architecture string + Variant string `json:",omitempty"` Os string OsVersion string `json:",omitempty"` Size int64 @@ -153,7 +154,7 @@ type Info struct { Images int Driver string DriverStatus [][2]string - SystemStatus [][2]string + SystemStatus [][2]string `json:",omitempty"` // SystemStatus is only propagated by the Swarm standalone API Plugins PluginsInfo MemoryLimit bool SwapLimit bool @@ -177,6 +178,7 @@ type Info struct { NEventsListener int KernelVersion string OperatingSystem string + OSVersion string OSType string Architecture string IndexServerAddress string @@ -316,7 +318,7 @@ type ContainerState struct { } // ContainerNode stores information about the node that a container -// is running on. It's only available in Docker Swarm +// is running on. It's only used by the Docker Swarm standalone API type ContainerNode struct { ID string IPAddress string `json:"IP"` @@ -340,7 +342,7 @@ type ContainerJSONBase struct { HostnamePath string HostsPath string LogPath string - Node *ContainerNode `json:",omitempty"` + Node *ContainerNode `json:",omitempty"` // Node is only propagated by Docker Swarm standalone API Name string RestartCount int Driver string diff --git a/vendor/github.com/docker/docker/api/types/volume/volume_create.go b/vendor/github.com/docker/docker/api/types/volume/volume_create.go index 0c3772d3ad..0d4f46a846 100644 --- a/vendor/github.com/docker/docker/api/types/volume/volume_create.go +++ b/vendor/github.com/docker/docker/api/types/volume/volume_create.go @@ -1,8 +1,7 @@ package volume // import "github.com/docker/docker/api/types/volume" // ---------------------------------------------------------------------------- -// DO NOT EDIT THIS FILE -// This file was generated by `swagger generate operation` +// Code generated by `swagger generate operation`. DO NOT EDIT. // // See hack/generate-swagger-api.sh // ---------------------------------------------------------------------------- diff --git a/vendor/github.com/docker/docker/api/types/volume/volume_list.go b/vendor/github.com/docker/docker/api/types/volume/volume_list.go index 45c3c1c9ae..8e685d51c9 100644 --- a/vendor/github.com/docker/docker/api/types/volume/volume_list.go +++ b/vendor/github.com/docker/docker/api/types/volume/volume_list.go @@ -1,8 +1,7 @@ package volume // import "github.com/docker/docker/api/types/volume" // ---------------------------------------------------------------------------- -// DO NOT EDIT THIS FILE -// This file was generated by `swagger generate operation` +// Code generated by `swagger generate operation`. DO NOT EDIT. // // See hack/generate-swagger-api.sh // ---------------------------------------------------------------------------- diff --git a/vendor/github.com/docker/docker/client/client.go b/vendor/github.com/docker/docker/client/client.go index b63d4d6d49..0649a69cc7 100644 --- a/vendor/github.com/docker/docker/client/client.go +++ b/vendor/github.com/docker/docker/client/client.go @@ -252,7 +252,8 @@ func (cli *Client) DaemonHost() string { // HTTPClient returns a copy of the HTTP client bound to the server func (cli *Client) HTTPClient() *http.Client { - return &*cli.client + c := *cli.client + return &c } // ParseHostURL parses a url string, validates the string is a host url, and diff --git a/vendor/github.com/docker/docker/client/client_unix.go b/vendor/github.com/docker/docker/client/client_unix.go index 3d24470ba3..23c2e1e344 100644 --- a/vendor/github.com/docker/docker/client/client_unix.go +++ b/vendor/github.com/docker/docker/client/client_unix.go @@ -1,4 +1,4 @@ -// +build linux freebsd openbsd darwin +// +build linux freebsd openbsd darwin solaris illumos package client // import "github.com/docker/docker/client" diff --git a/vendor/github.com/docker/docker/client/container_list.go b/vendor/github.com/docker/docker/client/container_list.go index 1e7a63a9c0..a973de597f 100644 --- a/vendor/github.com/docker/docker/client/container_list.go +++ b/vendor/github.com/docker/docker/client/container_list.go @@ -35,6 +35,7 @@ func (cli *Client) ContainerList(ctx context.Context, options types.ContainerLis } if options.Filters.Len() > 0 { + //nolint:staticcheck // ignore SA1019 for old code filterJSON, err := filters.ToParamWithVersion(cli.version, options.Filters) if err != nil { diff --git a/vendor/github.com/docker/docker/client/events.go b/vendor/github.com/docker/docker/client/events.go index 6e56538955..f0dc9d9e12 100644 --- a/vendor/github.com/docker/docker/client/events.go +++ b/vendor/github.com/docker/docker/client/events.go @@ -90,6 +90,7 @@ func buildEventsQueryParams(cliVersion string, options types.EventsOptions) (url } if options.Filters.Len() > 0 { + //nolint:staticcheck // ignore SA1019 for old code filterJSON, err := filters.ToParamWithVersion(cliVersion, options.Filters) if err != nil { return nil, err diff --git a/vendor/github.com/docker/docker/client/hijack.go b/vendor/github.com/docker/docker/client/hijack.go index e9c9a752f8..e1dc49ef0f 100644 --- a/vendor/github.com/docker/docker/client/hijack.go +++ b/vendor/github.com/docker/docker/client/hijack.go @@ -24,7 +24,7 @@ func (cli *Client) postHijacked(ctx context.Context, path string, query url.Valu } apiPath := cli.getAPIPath(ctx, path, query) - req, err := http.NewRequest("POST", apiPath, bodyEncoded) + req, err := http.NewRequest(http.MethodPost, apiPath, bodyEncoded) if err != nil { return types.HijackedResponse{}, err } @@ -40,7 +40,7 @@ func (cli *Client) postHijacked(ctx context.Context, path string, query url.Valu // DialHijack returns a hijacked connection with negotiated protocol proto. func (cli *Client) DialHijack(ctx context.Context, url, proto string, meta map[string][]string) (net.Conn, error) { - req, err := http.NewRequest("POST", url, nil) + req, err := http.NewRequest(http.MethodPost, url, nil) if err != nil { return nil, err } @@ -87,6 +87,8 @@ func (cli *Client) setupHijackConn(ctx context.Context, req *http.Request, proto // Server hijacks the connection, error 'connection closed' expected resp, err := clientconn.Do(req) + + //nolint:staticcheck // ignore SA1019 for connecting to old (pre go1.8) daemons if err != httputil.ErrPersistEOF { if err != nil { return nil, err diff --git a/vendor/github.com/docker/docker/client/image_import.go b/vendor/github.com/docker/docker/client/image_import.go index c2972ea950..d3336d4106 100644 --- a/vendor/github.com/docker/docker/client/image_import.go +++ b/vendor/github.com/docker/docker/client/image_import.go @@ -14,7 +14,7 @@ import ( // It returns the JSON content in the response body. func (cli *Client) ImageImport(ctx context.Context, source types.ImageImportSource, ref string, options types.ImageImportOptions) (io.ReadCloser, error) { if ref != "" { - //Check if the given image name can be resolved + // Check if the given image name can be resolved if _, err := reference.ParseNormalizedNamed(ref); err != nil { return nil, err } diff --git a/vendor/github.com/docker/docker/client/image_list.go b/vendor/github.com/docker/docker/client/image_list.go index 4fa8c006b2..a4d7505094 100644 --- a/vendor/github.com/docker/docker/client/image_list.go +++ b/vendor/github.com/docker/docker/client/image_list.go @@ -24,6 +24,7 @@ func (cli *Client) ImageList(ctx context.Context, options types.ImageListOptions } } if optionFilters.Len() > 0 { + //nolint:staticcheck // ignore SA1019 for old code filterJSON, err := filters.ToParamWithVersion(cli.version, optionFilters) if err != nil { return images, err diff --git a/vendor/github.com/docker/docker/client/image_push.go b/vendor/github.com/docker/docker/client/image_push.go index 49d412ee37..845580d4a4 100644 --- a/vendor/github.com/docker/docker/client/image_push.go +++ b/vendor/github.com/docker/docker/client/image_push.go @@ -25,15 +25,14 @@ func (cli *Client) ImagePush(ctx context.Context, image string, options types.Im return nil, errors.New("cannot push a digest reference") } - tag := "" name := reference.FamiliarName(ref) - - if nameTaggedRef, isNamedTagged := ref.(reference.NamedTagged); isNamedTagged { - tag = nameTaggedRef.Tag() - } - query := url.Values{} - query.Set("tag", tag) + if !options.All { + ref = reference.TagNameOnly(ref) + if tagged, ok := ref.(reference.Tagged); ok { + query.Set("tag", tagged.Tag()) + } + } resp, err := cli.tryImagePush(ctx, name, query, options.RegistryAuth) if errdefs.IsUnauthorized(err) && options.PrivilegeFunc != nil { diff --git a/vendor/github.com/docker/docker/client/network_list.go b/vendor/github.com/docker/docker/client/network_list.go index 7130c1364e..ed2acb5571 100644 --- a/vendor/github.com/docker/docker/client/network_list.go +++ b/vendor/github.com/docker/docker/client/network_list.go @@ -13,6 +13,7 @@ import ( func (cli *Client) NetworkList(ctx context.Context, options types.NetworkListOptions) ([]types.NetworkResource, error) { query := url.Values{} if options.Filters.Len() > 0 { + //nolint:staticcheck // ignore SA1019 for old code filterJSON, err := filters.ToParamWithVersion(cli.version, options.Filters) if err != nil { return nil, err diff --git a/vendor/github.com/docker/docker/client/ping.go b/vendor/github.com/docker/docker/client/ping.go index 90f39ec14f..a9af001ef4 100644 --- a/vendor/github.com/docker/docker/client/ping.go +++ b/vendor/github.com/docker/docker/client/ping.go @@ -17,9 +17,9 @@ func (cli *Client) Ping(ctx context.Context) (types.Ping, error) { var ping types.Ping // Using cli.buildRequest() + cli.doRequest() instead of cli.sendRequest() - // because ping requests are used during API version negotiation, so we want + // because ping requests are used during API version negotiation, so we want // to hit the non-versioned /_ping endpoint, not /v1.xx/_ping - req, err := cli.buildRequest("HEAD", path.Join(cli.basePath, "/_ping"), nil, nil) + req, err := cli.buildRequest(http.MethodHead, path.Join(cli.basePath, "/_ping"), nil, nil) if err != nil { return ping, err } @@ -35,7 +35,7 @@ func (cli *Client) Ping(ctx context.Context) (types.Ping, error) { return ping, err } - req, err = cli.buildRequest("GET", path.Join(cli.basePath, "/_ping"), nil, nil) + req, err = cli.buildRequest(http.MethodGet, path.Join(cli.basePath, "/_ping"), nil, nil) if err != nil { return ping, err } diff --git a/vendor/github.com/docker/docker/client/plugin_list.go b/vendor/github.com/docker/docker/client/plugin_list.go index 8285cecd6e..cf1935e2f5 100644 --- a/vendor/github.com/docker/docker/client/plugin_list.go +++ b/vendor/github.com/docker/docker/client/plugin_list.go @@ -15,6 +15,7 @@ func (cli *Client) PluginList(ctx context.Context, filter filters.Args) (types.P query := url.Values{} if filter.Len() > 0 { + //nolint:staticcheck // ignore SA1019 for old code filterJSON, err := filters.ToParamWithVersion(cli.version, filter) if err != nil { return plugins, err diff --git a/vendor/github.com/docker/docker/client/request.go b/vendor/github.com/docker/docker/client/request.go index 3078335e2c..ee15a46ed0 100644 --- a/vendor/github.com/docker/docker/client/request.go +++ b/vendor/github.com/docker/docker/client/request.go @@ -29,12 +29,12 @@ type serverResponse struct { // head sends an http request to the docker API using the method HEAD. func (cli *Client) head(ctx context.Context, path string, query url.Values, headers map[string][]string) (serverResponse, error) { - return cli.sendRequest(ctx, "HEAD", path, query, nil, headers) + return cli.sendRequest(ctx, http.MethodHead, path, query, nil, headers) } // get sends an http request to the docker API using the method GET with a specific Go context. func (cli *Client) get(ctx context.Context, path string, query url.Values, headers map[string][]string) (serverResponse, error) { - return cli.sendRequest(ctx, "GET", path, query, nil, headers) + return cli.sendRequest(ctx, http.MethodGet, path, query, nil, headers) } // post sends an http request to the docker API using the method POST with a specific Go context. @@ -43,30 +43,21 @@ func (cli *Client) post(ctx context.Context, path string, query url.Values, obj if err != nil { return serverResponse{}, err } - return cli.sendRequest(ctx, "POST", path, query, body, headers) + return cli.sendRequest(ctx, http.MethodPost, path, query, body, headers) } func (cli *Client) postRaw(ctx context.Context, path string, query url.Values, body io.Reader, headers map[string][]string) (serverResponse, error) { - return cli.sendRequest(ctx, "POST", path, query, body, headers) -} - -// put sends an http request to the docker API using the method PUT. -func (cli *Client) put(ctx context.Context, path string, query url.Values, obj interface{}, headers map[string][]string) (serverResponse, error) { - body, headers, err := encodeBody(obj, headers) - if err != nil { - return serverResponse{}, err - } - return cli.sendRequest(ctx, "PUT", path, query, body, headers) + return cli.sendRequest(ctx, http.MethodPost, path, query, body, headers) } // putRaw sends an http request to the docker API using the method PUT. func (cli *Client) putRaw(ctx context.Context, path string, query url.Values, body io.Reader, headers map[string][]string) (serverResponse, error) { - return cli.sendRequest(ctx, "PUT", path, query, body, headers) + return cli.sendRequest(ctx, http.MethodPut, path, query, body, headers) } // delete sends an http request to the docker API using the method DELETE. func (cli *Client) delete(ctx context.Context, path string, query url.Values, headers map[string][]string) (serverResponse, error) { - return cli.sendRequest(ctx, "DELETE", path, query, nil, headers) + return cli.sendRequest(ctx, http.MethodDelete, path, query, nil, headers) } type headers map[string][]string @@ -88,7 +79,7 @@ func encodeBody(obj interface{}, headers headers) (io.Reader, headers, error) { } func (cli *Client) buildRequest(method, path string, body io.Reader, headers headers) (*http.Request, error) { - expectedPayload := (method == "POST" || method == "PUT") + expectedPayload := (method == http.MethodPost || method == http.MethodPut) if expectedPayload && body == nil { body = bytes.NewReader([]byte{}) } @@ -178,7 +169,13 @@ func (cli *Client) doRequest(ctx context.Context, req *http.Request) (serverResp // this is localised - for example in French the error would be // `open //./pipe/docker_engine: Le fichier spécifié est introuvable.` if strings.Contains(err.Error(), `open //./pipe/docker_engine`) { - err = errors.New(err.Error() + " In the default daemon configuration on Windows, the docker client must be run elevated to connect. This error may also indicate that the docker daemon is not running.") + // Checks if client is running with elevated privileges + if f, elevatedErr := os.Open("\\\\.\\PHYSICALDRIVE0"); elevatedErr == nil { + err = errors.Wrap(err, "In the default daemon configuration on Windows, the docker client must be run with elevated privileges to connect.") + } else { + f.Close() + err = errors.Wrap(err, "This error may indicate that the docker daemon is not running.") + } } return serverResp, errors.Wrap(err, "error during connect") diff --git a/vendor/github.com/docker/docker/client/service_create.go b/vendor/github.com/docker/docker/client/service_create.go index 620fc6cff7..56bfe55b71 100644 --- a/vendor/github.com/docker/docker/client/service_create.go +++ b/vendor/github.com/docker/docker/client/service_create.go @@ -9,7 +9,7 @@ import ( "github.com/docker/distribution/reference" "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/swarm" - "github.com/opencontainers/go-digest" + digest "github.com/opencontainers/go-digest" "github.com/pkg/errors" ) diff --git a/vendor/github.com/docker/docker/client/service_list.go b/vendor/github.com/docker/docker/client/service_list.go index 64d35e7159..f97ec75a5c 100644 --- a/vendor/github.com/docker/docker/client/service_list.go +++ b/vendor/github.com/docker/docker/client/service_list.go @@ -23,6 +23,10 @@ func (cli *Client) ServiceList(ctx context.Context, options types.ServiceListOpt query.Set("filters", filterJSON) } + if options.Status { + query.Set("status", "true") + } + resp, err := cli.get(ctx, "/services", query, nil) defer ensureReaderClosed(resp) if err != nil { diff --git a/vendor/github.com/docker/docker/client/volume_list.go b/vendor/github.com/docker/docker/client/volume_list.go index 2380d56382..942498dde2 100644 --- a/vendor/github.com/docker/docker/client/volume_list.go +++ b/vendor/github.com/docker/docker/client/volume_list.go @@ -15,6 +15,7 @@ func (cli *Client) VolumeList(ctx context.Context, filter filters.Args) (volumet query := url.Values{} if filter.Len() > 0 { + //nolint:staticcheck // ignore SA1019 for old code filterJSON, err := filters.ToParamWithVersion(cli.version, filter) if err != nil { return volumes, err diff --git a/vendor/github.com/docker/docker/errdefs/http_helpers.go b/vendor/github.com/docker/docker/errdefs/http_helpers.go index ac9bf6d33e..07552f1cc1 100644 --- a/vendor/github.com/docker/docker/errdefs/http_helpers.go +++ b/vendor/github.com/docker/docker/errdefs/http_helpers.go @@ -4,6 +4,7 @@ import ( "fmt" "net/http" + containerderrors "github.com/containerd/containerd/errdefs" "github.com/docker/distribution/registry/api/errcode" "github.com/sirupsen/logrus" "google.golang.org/grpc/codes" @@ -47,6 +48,10 @@ func GetHTTPErrorStatusCode(err error) int { if statusCode != http.StatusInternalServerError { return statusCode } + statusCode = statusCodeFromContainerdError(err) + if statusCode != http.StatusInternalServerError { + return statusCode + } statusCode = statusCodeFromDistributionError(err) if statusCode != http.StatusInternalServerError { return statusCode @@ -136,9 +141,6 @@ func statusCodeFromGRPCError(err error) int { case codes.Unavailable: // code 14 return http.StatusServiceUnavailable default: - if e, ok := err.(causer); ok { - return statusCodeFromGRPCError(e.Cause()) - } // codes.Canceled(1) // codes.Unknown(2) // codes.DeadlineExceeded(4) @@ -163,10 +165,27 @@ func statusCodeFromDistributionError(err error) int { } case errcode.ErrorCoder: return errs.ErrorCode().Descriptor().HTTPStatusCode - default: - if e, ok := err.(causer); ok { - return statusCodeFromDistributionError(e.Cause()) - } } return http.StatusInternalServerError } + +// statusCodeFromContainerdError returns status code for containerd errors when +// consumed directly (not through gRPC) +func statusCodeFromContainerdError(err error) int { + switch { + case containerderrors.IsInvalidArgument(err): + return http.StatusBadRequest + case containerderrors.IsNotFound(err): + return http.StatusNotFound + case containerderrors.IsAlreadyExists(err): + return http.StatusConflict + case containerderrors.IsFailedPrecondition(err): + return http.StatusPreconditionFailed + case containerderrors.IsUnavailable(err): + return http.StatusServiceUnavailable + case containerderrors.IsNotImplemented(err): + return http.StatusNotImplemented + default: + return http.StatusInternalServerError + } +} diff --git a/vendor/github.com/docker/docker/pkg/term/term_windows.go b/vendor/github.com/docker/docker/pkg/term/term_windows.go index a3c3db1315..6e83b59e90 100644 --- a/vendor/github.com/docker/docker/pkg/term/term_windows.go +++ b/vendor/github.com/docker/docker/pkg/term/term_windows.go @@ -7,7 +7,7 @@ import ( "syscall" // used for STD_INPUT_HANDLE, STD_OUTPUT_HANDLE and STD_ERROR_HANDLE "github.com/Azure/go-ansiterm/winterm" - "github.com/docker/docker/pkg/term/windows" + windowsconsole "github.com/docker/docker/pkg/term/windows" ) // State holds the console mode for the terminal. diff --git a/vendor/github.com/docker/docker/pkg/term/windows/windows.go b/vendor/github.com/docker/docker/pkg/term/windows/windows.go index 3e5593ca6a..7e8f265d47 100644 --- a/vendor/github.com/docker/docker/pkg/term/windows/windows.go +++ b/vendor/github.com/docker/docker/pkg/term/windows/windows.go @@ -1,3 +1,4 @@ +// +build windows // These files implement ANSI-aware input and output streams for use by the Docker Windows client. // When asked for the set of standard streams (e.g., stdin, stdout, stderr), the code will create // and return pseudo-streams that convert ANSI sequences to / from Windows Console API calls. @@ -9,7 +10,7 @@ import ( "os" "sync" - "github.com/Azure/go-ansiterm" + ansiterm "github.com/Azure/go-ansiterm" "github.com/sirupsen/logrus" ) diff --git a/vendor/github.com/koding/multiconfig/.gitignore b/vendor/github.com/exponent-io/jsonpath/.gitignore similarity index 97% rename from vendor/github.com/koding/multiconfig/.gitignore rename to vendor/github.com/exponent-io/jsonpath/.gitignore index 2824a98ab6..daf913b1b3 100644 --- a/vendor/github.com/koding/multiconfig/.gitignore +++ b/vendor/github.com/exponent-io/jsonpath/.gitignore @@ -21,5 +21,4 @@ _testmain.go *.exe *.test - -*~ +*.prof diff --git a/vendor/github.com/exponent-io/jsonpath/.travis.yml b/vendor/github.com/exponent-io/jsonpath/.travis.yml new file mode 100644 index 0000000000..f4f458a416 --- /dev/null +++ b/vendor/github.com/exponent-io/jsonpath/.travis.yml @@ -0,0 +1,5 @@ +language: go + +go: + - 1.5 + - tip diff --git a/vendor/github.com/koding/multiconfig/LICENSE b/vendor/github.com/exponent-io/jsonpath/LICENSE similarity index 96% rename from vendor/github.com/koding/multiconfig/LICENSE rename to vendor/github.com/exponent-io/jsonpath/LICENSE index eeefdaabe3..5419772507 100644 --- a/vendor/github.com/koding/multiconfig/LICENSE +++ b/vendor/github.com/exponent-io/jsonpath/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2014 Koding, Inc. +Copyright (c) 2015 Exponent Labs LLC 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/github.com/exponent-io/jsonpath/README.md b/vendor/github.com/exponent-io/jsonpath/README.md new file mode 100644 index 0000000000..382fb3138c --- /dev/null +++ b/vendor/github.com/exponent-io/jsonpath/README.md @@ -0,0 +1,66 @@ +[![GoDoc](https://godoc.org/github.com/exponent-io/jsonpath?status.svg)](https://godoc.org/github.com/exponent-io/jsonpath) +[![Build Status](https://travis-ci.org/exponent-io/jsonpath.svg?branch=master)](https://travis-ci.org/exponent-io/jsonpath) + +# jsonpath + +This package extends the [json.Decoder](https://golang.org/pkg/encoding/json/#Decoder) to support navigating a stream of JSON tokens. You should be able to use this extended Decoder places where a json.Decoder would have been used. + +This Decoder has the following enhancements... + * The [Scan](https://godoc.org/github.com/exponent-io/jsonpath/#Decoder.Scan) method supports scanning a JSON stream while extracting particular values along the way using [PathActions](https://godoc.org/github.com/exponent-io/jsonpath#PathActions). + * The [SeekTo](https://godoc.org/github.com/exponent-io/jsonpath#Decoder.SeekTo) method supports seeking forward in a JSON token stream to a particular path. + * The [Path](https://godoc.org/github.com/exponent-io/jsonpath#Decoder.Path) method returns the path of the most recently parsed token. + * The [Token](https://godoc.org/github.com/exponent-io/jsonpath#Decoder.Token) method has been modified to distinguish between strings that are object keys and strings that are values. Object key strings are returned as the [KeyString](https://godoc.org/github.com/exponent-io/jsonpath#KeyString) type rather than a native string. + +## Installation + + go get -u github.com/exponent-io/jsonpath + +## Example Usage + +#### SeekTo + +```go +import "github.com/exponent-io/jsonpath" + +var j = []byte(`[ + {"Space": "YCbCr", "Point": {"Y": 255, "Cb": 0, "Cr": -10}}, + {"Space": "RGB", "Point": {"R": 98, "G": 218, "B": 255}} +]`) + +w := json.NewDecoder(bytes.NewReader(j)) +var v interface{} + +w.SeekTo(1, "Point", "G") +w.Decode(&v) // v is 218 +``` + +#### Scan with PathActions + +```go +var j = []byte(`{"colors":[ + {"Space": "YCbCr", "Point": {"Y": 255, "Cb": 0, "Cr": -10, "A": 58}}, + {"Space": "RGB", "Point": {"R": 98, "G": 218, "B": 255, "A": 231}} +]}`) + +var actions PathActions + +// Extract the value at Point.A +actions.Add(func(d *Decoder) error { + var alpha int + err := d.Decode(&alpha) + fmt.Printf("Alpha: %v\n", alpha) + return err +}, "Point", "A") + +w := NewDecoder(bytes.NewReader(j)) +w.SeekTo("colors", 0) + +var ok = true +var err error +for ok { + ok, err = w.Scan(&actions) + if err != nil && err != io.EOF { + panic(err) + } +} +``` diff --git a/vendor/github.com/exponent-io/jsonpath/decoder.go b/vendor/github.com/exponent-io/jsonpath/decoder.go new file mode 100644 index 0000000000..31de46c738 --- /dev/null +++ b/vendor/github.com/exponent-io/jsonpath/decoder.go @@ -0,0 +1,210 @@ +package jsonpath + +import ( + "encoding/json" + "io" +) + +// KeyString is returned from Decoder.Token to represent each key in a JSON object value. +type KeyString string + +// Decoder extends the Go runtime's encoding/json.Decoder to support navigating in a stream of JSON tokens. +type Decoder struct { + json.Decoder + + path JsonPath + context jsonContext +} + +// NewDecoder creates a new instance of the extended JSON Decoder. +func NewDecoder(r io.Reader) *Decoder { + return &Decoder{Decoder: *json.NewDecoder(r)} +} + +// SeekTo causes the Decoder to move forward to a given path in the JSON structure. +// +// The path argument must consist of strings or integers. Each string specifies an JSON object key, and +// each integer specifies an index into a JSON array. +// +// Consider the JSON structure +// +// { "a": [0,"s",12e4,{"b":0,"v":35} ] } +// +// SeekTo("a",3,"v") will move to the value referenced by the "a" key in the current object, +// followed by a move to the 4th value (index 3) in the array, followed by a move to the value at key "v". +// In this example, a subsequent call to the decoder's Decode() would unmarshal the value 35. +// +// SeekTo returns a boolean value indicating whether a match was found. +// +// Decoder is intended to be used with a stream of tokens. As a result it navigates forward only. +func (d *Decoder) SeekTo(path ...interface{}) (bool, error) { + + if len(path) == 0 { + return len(d.path) == 0, nil + } + last := len(path) - 1 + if i, ok := path[last].(int); ok { + path[last] = i - 1 + } + + for { + if d.path.Equal(path) { + return true, nil + } + _, err := d.Token() + if err == io.EOF { + return false, nil + } else if err != nil { + return false, err + } + } +} + +// Decode reads the next JSON-encoded value from its input and stores it in the value pointed to by v. This is +// equivalent to encoding/json.Decode(). +func (d *Decoder) Decode(v interface{}) error { + switch d.context { + case objValue: + d.context = objKey + break + case arrValue: + d.path.incTop() + break + } + return d.Decoder.Decode(v) +} + +// Path returns a slice of string and/or int values representing the path from the root of the JSON object to the +// position of the most-recently parsed token. +func (d *Decoder) Path() JsonPath { + p := make(JsonPath, len(d.path)) + copy(p, d.path) + return p +} + +// Token is equivalent to the Token() method on json.Decoder. The primary difference is that it distinguishes +// between strings that are keys and and strings that are values. String tokens that are object keys are returned as a +// KeyString rather than as a native string. +func (d *Decoder) Token() (json.Token, error) { + t, err := d.Decoder.Token() + if err != nil { + return t, err + } + + if t == nil { + switch d.context { + case objValue: + d.context = objKey + break + case arrValue: + d.path.incTop() + break + } + return t, err + } + + switch t := t.(type) { + case json.Delim: + switch t { + case json.Delim('{'): + if d.context == arrValue { + d.path.incTop() + } + d.path.push("") + d.context = objKey + break + case json.Delim('}'): + d.path.pop() + d.context = d.path.inferContext() + break + case json.Delim('['): + if d.context == arrValue { + d.path.incTop() + } + d.path.push(-1) + d.context = arrValue + break + case json.Delim(']'): + d.path.pop() + d.context = d.path.inferContext() + break + } + case float64, json.Number, bool: + switch d.context { + case objValue: + d.context = objKey + break + case arrValue: + d.path.incTop() + break + } + break + case string: + switch d.context { + case objKey: + d.path.nameTop(t) + d.context = objValue + return KeyString(t), err + case objValue: + d.context = objKey + case arrValue: + d.path.incTop() + } + break + } + + return t, err +} + +// Scan moves forward over the JSON stream consuming all the tokens at the current level (current object, current array) +// invoking each matching PathAction along the way. +// +// Scan returns true if there are more contiguous values to scan (for example in an array). +func (d *Decoder) Scan(ext *PathActions) (bool, error) { + + rootPath := d.Path() + + // If this is an array path, increment the root path in our local copy. + if rootPath.inferContext() == arrValue { + rootPath.incTop() + } + + for { + // advance the token position + _, err := d.Token() + if err != nil { + return false, err + } + + match: + var relPath JsonPath + + // capture the new JSON path + path := d.Path() + + if len(path) > len(rootPath) { + // capture the path relative to where the scan started + relPath = path[len(rootPath):] + } else { + // if the path is not longer than the root, then we are done with this scan + // return boolean flag indicating if there are more items to scan at the same level + return d.Decoder.More(), nil + } + + // match the relative path against the path actions + if node := ext.node.match(relPath); node != nil { + if node.action != nil { + // we have a match so execute the action + err = node.action(d) + if err != nil { + return d.Decoder.More(), err + } + // The action may have advanced the decoder. If we are in an array, advancing it further would + // skip tokens. So, if we are scanning an array, jump to the top without advancing the token. + if d.path.inferContext() == arrValue && d.Decoder.More() { + goto match + } + } + } + } +} diff --git a/vendor/github.com/exponent-io/jsonpath/path.go b/vendor/github.com/exponent-io/jsonpath/path.go new file mode 100644 index 0000000000..d7db2ad336 --- /dev/null +++ b/vendor/github.com/exponent-io/jsonpath/path.go @@ -0,0 +1,67 @@ +// Extends the Go runtime's json.Decoder enabling navigation of a stream of json tokens. +package jsonpath + +import "fmt" + +type jsonContext int + +const ( + none jsonContext = iota + objKey + objValue + arrValue +) + +// AnyIndex can be used in a pattern to match any array index. +const AnyIndex = -2 + +// JsonPath is a slice of strings and/or integers. Each string specifies an JSON object key, and +// each integer specifies an index into a JSON array. +type JsonPath []interface{} + +func (p *JsonPath) push(n interface{}) { *p = append(*p, n) } +func (p *JsonPath) pop() { *p = (*p)[:len(*p)-1] } + +// increment the index at the top of the stack (must be an array index) +func (p *JsonPath) incTop() { (*p)[len(*p)-1] = (*p)[len(*p)-1].(int) + 1 } + +// name the key at the top of the stack (must be an object key) +func (p *JsonPath) nameTop(n string) { (*p)[len(*p)-1] = n } + +// infer the context from the item at the top of the stack +func (p *JsonPath) inferContext() jsonContext { + if len(*p) == 0 { + return none + } + t := (*p)[len(*p)-1] + switch t.(type) { + case string: + return objKey + case int: + return arrValue + default: + panic(fmt.Sprintf("Invalid stack type %T", t)) + } +} + +// Equal tests for equality between two JsonPath types. +func (p *JsonPath) Equal(o JsonPath) bool { + if len(*p) != len(o) { + return false + } + for i, v := range *p { + if v != o[i] { + return false + } + } + return true +} + +func (p *JsonPath) HasPrefix(o JsonPath) bool { + for i, v := range o { + if v != (*p)[i] { + return false + } + } + return true +} diff --git a/vendor/github.com/exponent-io/jsonpath/pathaction.go b/vendor/github.com/exponent-io/jsonpath/pathaction.go new file mode 100644 index 0000000000..497ed686ca --- /dev/null +++ b/vendor/github.com/exponent-io/jsonpath/pathaction.go @@ -0,0 +1,61 @@ +package jsonpath + +// pathNode is used to construct a trie of paths to be matched +type pathNode struct { + matchOn interface{} // string, or integer + childNodes []pathNode + action DecodeAction +} + +// match climbs the trie to find a node that matches the given JSON path. +func (n *pathNode) match(path JsonPath) *pathNode { + var node *pathNode = n + for _, ps := range path { + found := false + for i, n := range node.childNodes { + if n.matchOn == ps { + node = &node.childNodes[i] + found = true + break + } else if _, ok := ps.(int); ok && n.matchOn == AnyIndex { + node = &node.childNodes[i] + found = true + break + } + } + if !found { + return nil + } + } + return node +} + +// PathActions represents a collection of DecodeAction functions that should be called at certain path positions +// when scanning the JSON stream. PathActions can be created once and used many times in one or more JSON streams. +type PathActions struct { + node pathNode +} + +// DecodeAction handlers are called by the Decoder when scanning objects. See PathActions.Add for more detail. +type DecodeAction func(d *Decoder) error + +// Add specifies an action to call on the Decoder when the specified path is encountered. +func (je *PathActions) Add(action DecodeAction, path ...interface{}) { + + var node *pathNode = &je.node + for _, ps := range path { + found := false + for i, n := range node.childNodes { + if n.matchOn == ps { + node = &node.childNodes[i] + found = true + break + } + } + if !found { + node.childNodes = append(node.childNodes, pathNode{matchOn: ps}) + node = &node.childNodes[len(node.childNodes)-1] + } + } + node.action = action +} diff --git a/vendor/github.com/fatih/camelcase/.travis.yml b/vendor/github.com/google/btree/.travis.yml similarity index 59% rename from vendor/github.com/fatih/camelcase/.travis.yml rename to vendor/github.com/google/btree/.travis.yml index 3489e38713..4f2ee4d973 100644 --- a/vendor/github.com/fatih/camelcase/.travis.yml +++ b/vendor/github.com/google/btree/.travis.yml @@ -1,3 +1 @@ language: go -go: 1.x - diff --git a/vendor/github.com/golang/mock/LICENSE b/vendor/github.com/google/btree/LICENSE similarity index 100% rename from vendor/github.com/golang/mock/LICENSE rename to vendor/github.com/google/btree/LICENSE diff --git a/vendor/github.com/google/btree/README.md b/vendor/github.com/google/btree/README.md new file mode 100644 index 0000000000..6062a4dacd --- /dev/null +++ b/vendor/github.com/google/btree/README.md @@ -0,0 +1,12 @@ +# BTree implementation for Go + +![Travis CI Build Status](https://api.travis-ci.org/google/btree.svg?branch=master) + +This package provides an in-memory B-Tree implementation for Go, useful as +an ordered, mutable data structure. + +The API is based off of the wonderful +http://godoc.org/github.com/petar/GoLLRB/llrb, and is meant to allow btree to +act as a drop-in replacement for gollrb trees. + +See http://godoc.org/github.com/google/btree for documentation. diff --git a/vendor/github.com/google/btree/btree.go b/vendor/github.com/google/btree/btree.go new file mode 100644 index 0000000000..6ff062f9bb --- /dev/null +++ b/vendor/github.com/google/btree/btree.go @@ -0,0 +1,890 @@ +// Copyright 2014 Google Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Package btree implements in-memory B-Trees of arbitrary degree. +// +// btree implements an in-memory B-Tree for use as an ordered data structure. +// It is not meant for persistent storage solutions. +// +// It has a flatter structure than an equivalent red-black or other binary tree, +// which in some cases yields better memory usage and/or performance. +// See some discussion on the matter here: +// http://google-opensource.blogspot.com/2013/01/c-containers-that-save-memory-and-time.html +// Note, though, that this project is in no way related to the C++ B-Tree +// implementation written about there. +// +// Within this tree, each node contains a slice of items and a (possibly nil) +// slice of children. For basic numeric values or raw structs, this can cause +// efficiency differences when compared to equivalent C++ template code that +// stores values in arrays within the node: +// * Due to the overhead of storing values as interfaces (each +// value needs to be stored as the value itself, then 2 words for the +// interface pointing to that value and its type), resulting in higher +// memory use. +// * Since interfaces can point to values anywhere in memory, values are +// most likely not stored in contiguous blocks, resulting in a higher +// number of cache misses. +// These issues don't tend to matter, though, when working with strings or other +// heap-allocated structures, since C++-equivalent structures also must store +// pointers and also distribute their values across the heap. +// +// This implementation is designed to be a drop-in replacement to gollrb.LLRB +// trees, (http://github.com/petar/gollrb), an excellent and probably the most +// widely used ordered tree implementation in the Go ecosystem currently. +// Its functions, therefore, exactly mirror those of +// llrb.LLRB where possible. Unlike gollrb, though, we currently don't +// support storing multiple equivalent values. +package btree + +import ( + "fmt" + "io" + "sort" + "strings" + "sync" +) + +// Item represents a single object in the tree. +type Item interface { + // Less tests whether the current item is less than the given argument. + // + // This must provide a strict weak ordering. + // If !a.Less(b) && !b.Less(a), we treat this to mean a == b (i.e. we can only + // hold one of either a or b in the tree). + Less(than Item) bool +} + +const ( + DefaultFreeListSize = 32 +) + +var ( + nilItems = make(items, 16) + nilChildren = make(children, 16) +) + +// FreeList represents a free list of btree nodes. By default each +// BTree has its own FreeList, but multiple BTrees can share the same +// FreeList. +// Two Btrees using the same freelist are safe for concurrent write access. +type FreeList struct { + mu sync.Mutex + freelist []*node +} + +// NewFreeList creates a new free list. +// size is the maximum size of the returned free list. +func NewFreeList(size int) *FreeList { + return &FreeList{freelist: make([]*node, 0, size)} +} + +func (f *FreeList) newNode() (n *node) { + f.mu.Lock() + index := len(f.freelist) - 1 + if index < 0 { + f.mu.Unlock() + return new(node) + } + n = f.freelist[index] + f.freelist[index] = nil + f.freelist = f.freelist[:index] + f.mu.Unlock() + return +} + +// freeNode adds the given node to the list, returning true if it was added +// and false if it was discarded. +func (f *FreeList) freeNode(n *node) (out bool) { + f.mu.Lock() + if len(f.freelist) < cap(f.freelist) { + f.freelist = append(f.freelist, n) + out = true + } + f.mu.Unlock() + return +} + +// ItemIterator allows callers of Ascend* to iterate in-order over portions of +// the tree. When this function returns false, iteration will stop and the +// associated Ascend* function will immediately return. +type ItemIterator func(i Item) bool + +// New creates a new B-Tree with the given degree. +// +// New(2), for example, will create a 2-3-4 tree (each node contains 1-3 items +// and 2-4 children). +func New(degree int) *BTree { + return NewWithFreeList(degree, NewFreeList(DefaultFreeListSize)) +} + +// NewWithFreeList creates a new B-Tree that uses the given node free list. +func NewWithFreeList(degree int, f *FreeList) *BTree { + if degree <= 1 { + panic("bad degree") + } + return &BTree{ + degree: degree, + cow: ©OnWriteContext{freelist: f}, + } +} + +// items stores items in a node. +type items []Item + +// insertAt inserts a value into the given index, pushing all subsequent values +// forward. +func (s *items) insertAt(index int, item Item) { + *s = append(*s, nil) + if index < len(*s) { + copy((*s)[index+1:], (*s)[index:]) + } + (*s)[index] = item +} + +// removeAt removes a value at a given index, pulling all subsequent values +// back. +func (s *items) removeAt(index int) Item { + item := (*s)[index] + copy((*s)[index:], (*s)[index+1:]) + (*s)[len(*s)-1] = nil + *s = (*s)[:len(*s)-1] + return item +} + +// pop removes and returns the last element in the list. +func (s *items) pop() (out Item) { + index := len(*s) - 1 + out = (*s)[index] + (*s)[index] = nil + *s = (*s)[:index] + return +} + +// truncate truncates this instance at index so that it contains only the +// first index items. index must be less than or equal to length. +func (s *items) truncate(index int) { + var toClear items + *s, toClear = (*s)[:index], (*s)[index:] + for len(toClear) > 0 { + toClear = toClear[copy(toClear, nilItems):] + } +} + +// find returns the index where the given item should be inserted into this +// list. 'found' is true if the item already exists in the list at the given +// index. +func (s items) find(item Item) (index int, found bool) { + i := sort.Search(len(s), func(i int) bool { + return item.Less(s[i]) + }) + if i > 0 && !s[i-1].Less(item) { + return i - 1, true + } + return i, false +} + +// children stores child nodes in a node. +type children []*node + +// insertAt inserts a value into the given index, pushing all subsequent values +// forward. +func (s *children) insertAt(index int, n *node) { + *s = append(*s, nil) + if index < len(*s) { + copy((*s)[index+1:], (*s)[index:]) + } + (*s)[index] = n +} + +// removeAt removes a value at a given index, pulling all subsequent values +// back. +func (s *children) removeAt(index int) *node { + n := (*s)[index] + copy((*s)[index:], (*s)[index+1:]) + (*s)[len(*s)-1] = nil + *s = (*s)[:len(*s)-1] + return n +} + +// pop removes and returns the last element in the list. +func (s *children) pop() (out *node) { + index := len(*s) - 1 + out = (*s)[index] + (*s)[index] = nil + *s = (*s)[:index] + return +} + +// truncate truncates this instance at index so that it contains only the +// first index children. index must be less than or equal to length. +func (s *children) truncate(index int) { + var toClear children + *s, toClear = (*s)[:index], (*s)[index:] + for len(toClear) > 0 { + toClear = toClear[copy(toClear, nilChildren):] + } +} + +// node is an internal node in a tree. +// +// It must at all times maintain the invariant that either +// * len(children) == 0, len(items) unconstrained +// * len(children) == len(items) + 1 +type node struct { + items items + children children + cow *copyOnWriteContext +} + +func (n *node) mutableFor(cow *copyOnWriteContext) *node { + if n.cow == cow { + return n + } + out := cow.newNode() + if cap(out.items) >= len(n.items) { + out.items = out.items[:len(n.items)] + } else { + out.items = make(items, len(n.items), cap(n.items)) + } + copy(out.items, n.items) + // Copy children + if cap(out.children) >= len(n.children) { + out.children = out.children[:len(n.children)] + } else { + out.children = make(children, len(n.children), cap(n.children)) + } + copy(out.children, n.children) + return out +} + +func (n *node) mutableChild(i int) *node { + c := n.children[i].mutableFor(n.cow) + n.children[i] = c + return c +} + +// split splits the given node at the given index. The current node shrinks, +// and this function returns the item that existed at that index and a new node +// containing all items/children after it. +func (n *node) split(i int) (Item, *node) { + item := n.items[i] + next := n.cow.newNode() + next.items = append(next.items, n.items[i+1:]...) + n.items.truncate(i) + if len(n.children) > 0 { + next.children = append(next.children, n.children[i+1:]...) + n.children.truncate(i + 1) + } + return item, next +} + +// maybeSplitChild checks if a child should be split, and if so splits it. +// Returns whether or not a split occurred. +func (n *node) maybeSplitChild(i, maxItems int) bool { + if len(n.children[i].items) < maxItems { + return false + } + first := n.mutableChild(i) + item, second := first.split(maxItems / 2) + n.items.insertAt(i, item) + n.children.insertAt(i+1, second) + return true +} + +// insert inserts an item into the subtree rooted at this node, making sure +// no nodes in the subtree exceed maxItems items. Should an equivalent item be +// be found/replaced by insert, it will be returned. +func (n *node) insert(item Item, maxItems int) Item { + i, found := n.items.find(item) + if found { + out := n.items[i] + n.items[i] = item + return out + } + if len(n.children) == 0 { + n.items.insertAt(i, item) + return nil + } + if n.maybeSplitChild(i, maxItems) { + inTree := n.items[i] + switch { + case item.Less(inTree): + // no change, we want first split node + case inTree.Less(item): + i++ // we want second split node + default: + out := n.items[i] + n.items[i] = item + return out + } + } + return n.mutableChild(i).insert(item, maxItems) +} + +// get finds the given key in the subtree and returns it. +func (n *node) get(key Item) Item { + i, found := n.items.find(key) + if found { + return n.items[i] + } else if len(n.children) > 0 { + return n.children[i].get(key) + } + return nil +} + +// min returns the first item in the subtree. +func min(n *node) Item { + if n == nil { + return nil + } + for len(n.children) > 0 { + n = n.children[0] + } + if len(n.items) == 0 { + return nil + } + return n.items[0] +} + +// max returns the last item in the subtree. +func max(n *node) Item { + if n == nil { + return nil + } + for len(n.children) > 0 { + n = n.children[len(n.children)-1] + } + if len(n.items) == 0 { + return nil + } + return n.items[len(n.items)-1] +} + +// toRemove details what item to remove in a node.remove call. +type toRemove int + +const ( + removeItem toRemove = iota // removes the given item + removeMin // removes smallest item in the subtree + removeMax // removes largest item in the subtree +) + +// remove removes an item from the subtree rooted at this node. +func (n *node) remove(item Item, minItems int, typ toRemove) Item { + var i int + var found bool + switch typ { + case removeMax: + if len(n.children) == 0 { + return n.items.pop() + } + i = len(n.items) + case removeMin: + if len(n.children) == 0 { + return n.items.removeAt(0) + } + i = 0 + case removeItem: + i, found = n.items.find(item) + if len(n.children) == 0 { + if found { + return n.items.removeAt(i) + } + return nil + } + default: + panic("invalid type") + } + // If we get to here, we have children. + if len(n.children[i].items) <= minItems { + return n.growChildAndRemove(i, item, minItems, typ) + } + child := n.mutableChild(i) + // Either we had enough items to begin with, or we've done some + // merging/stealing, because we've got enough now and we're ready to return + // stuff. + if found { + // The item exists at index 'i', and the child we've selected can give us a + // predecessor, since if we've gotten here it's got > minItems items in it. + out := n.items[i] + // We use our special-case 'remove' call with typ=maxItem to pull the + // predecessor of item i (the rightmost leaf of our immediate left child) + // and set it into where we pulled the item from. + n.items[i] = child.remove(nil, minItems, removeMax) + return out + } + // Final recursive call. Once we're here, we know that the item isn't in this + // node and that the child is big enough to remove from. + return child.remove(item, minItems, typ) +} + +// growChildAndRemove grows child 'i' to make sure it's possible to remove an +// item from it while keeping it at minItems, then calls remove to actually +// remove it. +// +// Most documentation says we have to do two sets of special casing: +// 1) item is in this node +// 2) item is in child +// In both cases, we need to handle the two subcases: +// A) node has enough values that it can spare one +// B) node doesn't have enough values +// For the latter, we have to check: +// a) left sibling has node to spare +// b) right sibling has node to spare +// c) we must merge +// To simplify our code here, we handle cases #1 and #2 the same: +// If a node doesn't have enough items, we make sure it does (using a,b,c). +// We then simply redo our remove call, and the second time (regardless of +// whether we're in case 1 or 2), we'll have enough items and can guarantee +// that we hit case A. +func (n *node) growChildAndRemove(i int, item Item, minItems int, typ toRemove) Item { + if i > 0 && len(n.children[i-1].items) > minItems { + // Steal from left child + child := n.mutableChild(i) + stealFrom := n.mutableChild(i - 1) + stolenItem := stealFrom.items.pop() + child.items.insertAt(0, n.items[i-1]) + n.items[i-1] = stolenItem + if len(stealFrom.children) > 0 { + child.children.insertAt(0, stealFrom.children.pop()) + } + } else if i < len(n.items) && len(n.children[i+1].items) > minItems { + // steal from right child + child := n.mutableChild(i) + stealFrom := n.mutableChild(i + 1) + stolenItem := stealFrom.items.removeAt(0) + child.items = append(child.items, n.items[i]) + n.items[i] = stolenItem + if len(stealFrom.children) > 0 { + child.children = append(child.children, stealFrom.children.removeAt(0)) + } + } else { + if i >= len(n.items) { + i-- + } + child := n.mutableChild(i) + // merge with right child + mergeItem := n.items.removeAt(i) + mergeChild := n.children.removeAt(i + 1) + child.items = append(child.items, mergeItem) + child.items = append(child.items, mergeChild.items...) + child.children = append(child.children, mergeChild.children...) + n.cow.freeNode(mergeChild) + } + return n.remove(item, minItems, typ) +} + +type direction int + +const ( + descend = direction(-1) + ascend = direction(+1) +) + +// iterate provides a simple method for iterating over elements in the tree. +// +// When ascending, the 'start' should be less than 'stop' and when descending, +// the 'start' should be greater than 'stop'. Setting 'includeStart' to true +// will force the iterator to include the first item when it equals 'start', +// thus creating a "greaterOrEqual" or "lessThanEqual" rather than just a +// "greaterThan" or "lessThan" queries. +func (n *node) iterate(dir direction, start, stop Item, includeStart bool, hit bool, iter ItemIterator) (bool, bool) { + var ok, found bool + var index int + switch dir { + case ascend: + if start != nil { + index, _ = n.items.find(start) + } + for i := index; i < len(n.items); i++ { + if len(n.children) > 0 { + if hit, ok = n.children[i].iterate(dir, start, stop, includeStart, hit, iter); !ok { + return hit, false + } + } + if !includeStart && !hit && start != nil && !start.Less(n.items[i]) { + hit = true + continue + } + hit = true + if stop != nil && !n.items[i].Less(stop) { + return hit, false + } + if !iter(n.items[i]) { + return hit, false + } + } + if len(n.children) > 0 { + if hit, ok = n.children[len(n.children)-1].iterate(dir, start, stop, includeStart, hit, iter); !ok { + return hit, false + } + } + case descend: + if start != nil { + index, found = n.items.find(start) + if !found { + index = index - 1 + } + } else { + index = len(n.items) - 1 + } + for i := index; i >= 0; i-- { + if start != nil && !n.items[i].Less(start) { + if !includeStart || hit || start.Less(n.items[i]) { + continue + } + } + if len(n.children) > 0 { + if hit, ok = n.children[i+1].iterate(dir, start, stop, includeStart, hit, iter); !ok { + return hit, false + } + } + if stop != nil && !stop.Less(n.items[i]) { + return hit, false // continue + } + hit = true + if !iter(n.items[i]) { + return hit, false + } + } + if len(n.children) > 0 { + if hit, ok = n.children[0].iterate(dir, start, stop, includeStart, hit, iter); !ok { + return hit, false + } + } + } + return hit, true +} + +// Used for testing/debugging purposes. +func (n *node) print(w io.Writer, level int) { + fmt.Fprintf(w, "%sNODE:%v\n", strings.Repeat(" ", level), n.items) + for _, c := range n.children { + c.print(w, level+1) + } +} + +// BTree is an implementation of a B-Tree. +// +// BTree stores Item instances in an ordered structure, allowing easy insertion, +// removal, and iteration. +// +// Write operations are not safe for concurrent mutation by multiple +// goroutines, but Read operations are. +type BTree struct { + degree int + length int + root *node + cow *copyOnWriteContext +} + +// copyOnWriteContext pointers determine node ownership... a tree with a write +// context equivalent to a node's write context is allowed to modify that node. +// A tree whose write context does not match a node's is not allowed to modify +// it, and must create a new, writable copy (IE: it's a Clone). +// +// When doing any write operation, we maintain the invariant that the current +// node's context is equal to the context of the tree that requested the write. +// We do this by, before we descend into any node, creating a copy with the +// correct context if the contexts don't match. +// +// Since the node we're currently visiting on any write has the requesting +// tree's context, that node is modifiable in place. Children of that node may +// not share context, but before we descend into them, we'll make a mutable +// copy. +type copyOnWriteContext struct { + freelist *FreeList +} + +// Clone clones the btree, lazily. Clone should not be called concurrently, +// but the original tree (t) and the new tree (t2) can be used concurrently +// once the Clone call completes. +// +// The internal tree structure of b is marked read-only and shared between t and +// t2. Writes to both t and t2 use copy-on-write logic, creating new nodes +// whenever one of b's original nodes would have been modified. Read operations +// should have no performance degredation. Write operations for both t and t2 +// will initially experience minor slow-downs caused by additional allocs and +// copies due to the aforementioned copy-on-write logic, but should converge to +// the original performance characteristics of the original tree. +func (t *BTree) Clone() (t2 *BTree) { + // Create two entirely new copy-on-write contexts. + // This operation effectively creates three trees: + // the original, shared nodes (old b.cow) + // the new b.cow nodes + // the new out.cow nodes + cow1, cow2 := *t.cow, *t.cow + out := *t + t.cow = &cow1 + out.cow = &cow2 + return &out +} + +// maxItems returns the max number of items to allow per node. +func (t *BTree) maxItems() int { + return t.degree*2 - 1 +} + +// minItems returns the min number of items to allow per node (ignored for the +// root node). +func (t *BTree) minItems() int { + return t.degree - 1 +} + +func (c *copyOnWriteContext) newNode() (n *node) { + n = c.freelist.newNode() + n.cow = c + return +} + +type freeType int + +const ( + ftFreelistFull freeType = iota // node was freed (available for GC, not stored in freelist) + ftStored // node was stored in the freelist for later use + ftNotOwned // node was ignored by COW, since it's owned by another one +) + +// freeNode frees a node within a given COW context, if it's owned by that +// context. It returns what happened to the node (see freeType const +// documentation). +func (c *copyOnWriteContext) freeNode(n *node) freeType { + if n.cow == c { + // clear to allow GC + n.items.truncate(0) + n.children.truncate(0) + n.cow = nil + if c.freelist.freeNode(n) { + return ftStored + } else { + return ftFreelistFull + } + } else { + return ftNotOwned + } +} + +// ReplaceOrInsert adds the given item to the tree. If an item in the tree +// already equals the given one, it is removed from the tree and returned. +// Otherwise, nil is returned. +// +// nil cannot be added to the tree (will panic). +func (t *BTree) ReplaceOrInsert(item Item) Item { + if item == nil { + panic("nil item being added to BTree") + } + if t.root == nil { + t.root = t.cow.newNode() + t.root.items = append(t.root.items, item) + t.length++ + return nil + } else { + t.root = t.root.mutableFor(t.cow) + if len(t.root.items) >= t.maxItems() { + item2, second := t.root.split(t.maxItems() / 2) + oldroot := t.root + t.root = t.cow.newNode() + t.root.items = append(t.root.items, item2) + t.root.children = append(t.root.children, oldroot, second) + } + } + out := t.root.insert(item, t.maxItems()) + if out == nil { + t.length++ + } + return out +} + +// Delete removes an item equal to the passed in item from the tree, returning +// it. If no such item exists, returns nil. +func (t *BTree) Delete(item Item) Item { + return t.deleteItem(item, removeItem) +} + +// DeleteMin removes the smallest item in the tree and returns it. +// If no such item exists, returns nil. +func (t *BTree) DeleteMin() Item { + return t.deleteItem(nil, removeMin) +} + +// DeleteMax removes the largest item in the tree and returns it. +// If no such item exists, returns nil. +func (t *BTree) DeleteMax() Item { + return t.deleteItem(nil, removeMax) +} + +func (t *BTree) deleteItem(item Item, typ toRemove) Item { + if t.root == nil || len(t.root.items) == 0 { + return nil + } + t.root = t.root.mutableFor(t.cow) + out := t.root.remove(item, t.minItems(), typ) + if len(t.root.items) == 0 && len(t.root.children) > 0 { + oldroot := t.root + t.root = t.root.children[0] + t.cow.freeNode(oldroot) + } + if out != nil { + t.length-- + } + return out +} + +// AscendRange calls the iterator for every value in the tree within the range +// [greaterOrEqual, lessThan), until iterator returns false. +func (t *BTree) AscendRange(greaterOrEqual, lessThan Item, iterator ItemIterator) { + if t.root == nil { + return + } + t.root.iterate(ascend, greaterOrEqual, lessThan, true, false, iterator) +} + +// AscendLessThan calls the iterator for every value in the tree within the range +// [first, pivot), until iterator returns false. +func (t *BTree) AscendLessThan(pivot Item, iterator ItemIterator) { + if t.root == nil { + return + } + t.root.iterate(ascend, nil, pivot, false, false, iterator) +} + +// AscendGreaterOrEqual calls the iterator for every value in the tree within +// the range [pivot, last], until iterator returns false. +func (t *BTree) AscendGreaterOrEqual(pivot Item, iterator ItemIterator) { + if t.root == nil { + return + } + t.root.iterate(ascend, pivot, nil, true, false, iterator) +} + +// Ascend calls the iterator for every value in the tree within the range +// [first, last], until iterator returns false. +func (t *BTree) Ascend(iterator ItemIterator) { + if t.root == nil { + return + } + t.root.iterate(ascend, nil, nil, false, false, iterator) +} + +// DescendRange calls the iterator for every value in the tree within the range +// [lessOrEqual, greaterThan), until iterator returns false. +func (t *BTree) DescendRange(lessOrEqual, greaterThan Item, iterator ItemIterator) { + if t.root == nil { + return + } + t.root.iterate(descend, lessOrEqual, greaterThan, true, false, iterator) +} + +// DescendLessOrEqual calls the iterator for every value in the tree within the range +// [pivot, first], until iterator returns false. +func (t *BTree) DescendLessOrEqual(pivot Item, iterator ItemIterator) { + if t.root == nil { + return + } + t.root.iterate(descend, pivot, nil, true, false, iterator) +} + +// DescendGreaterThan calls the iterator for every value in the tree within +// the range (pivot, last], until iterator returns false. +func (t *BTree) DescendGreaterThan(pivot Item, iterator ItemIterator) { + if t.root == nil { + return + } + t.root.iterate(descend, nil, pivot, false, false, iterator) +} + +// Descend calls the iterator for every value in the tree within the range +// [last, first], until iterator returns false. +func (t *BTree) Descend(iterator ItemIterator) { + if t.root == nil { + return + } + t.root.iterate(descend, nil, nil, false, false, iterator) +} + +// Get looks for the key item in the tree, returning it. It returns nil if +// unable to find that item. +func (t *BTree) Get(key Item) Item { + if t.root == nil { + return nil + } + return t.root.get(key) +} + +// Min returns the smallest item in the tree, or nil if the tree is empty. +func (t *BTree) Min() Item { + return min(t.root) +} + +// Max returns the largest item in the tree, or nil if the tree is empty. +func (t *BTree) Max() Item { + return max(t.root) +} + +// Has returns true if the given key is in the tree. +func (t *BTree) Has(key Item) bool { + return t.Get(key) != nil +} + +// Len returns the number of items currently in the tree. +func (t *BTree) Len() int { + return t.length +} + +// Clear removes all items from the btree. If addNodesToFreelist is true, +// t's nodes are added to its freelist as part of this call, until the freelist +// is full. Otherwise, the root node is simply dereferenced and the subtree +// left to Go's normal GC processes. +// +// This can be much faster +// than calling Delete on all elements, because that requires finding/removing +// each element in the tree and updating the tree accordingly. It also is +// somewhat faster than creating a new tree to replace the old one, because +// nodes from the old tree are reclaimed into the freelist for use by the new +// one, instead of being lost to the garbage collector. +// +// This call takes: +// O(1): when addNodesToFreelist is false, this is a single operation. +// O(1): when the freelist is already full, it breaks out immediately +// O(freelist size): when the freelist is empty and the nodes are all owned +// by this tree, nodes are added to the freelist until full. +// O(tree size): when all nodes are owned by another tree, all nodes are +// iterated over looking for nodes to add to the freelist, and due to +// ownership, none are. +func (t *BTree) Clear(addNodesToFreelist bool) { + if t.root != nil && addNodesToFreelist { + t.root.reset(t.cow) + } + t.root, t.length = nil, 0 +} + +// reset returns a subtree to the freelist. It breaks out immediately if the +// freelist is full, since the only benefit of iterating is to fill that +// freelist up. Returns true if parent reset call should continue. +func (n *node) reset(c *copyOnWriteContext) bool { + for _, child := range n.children { + if !child.reset(c) { + return false + } + } + return c.freeNode(n) != ftFreelistFull +} + +// Int implements the Item interface for integers. +type Int int + +// Less returns true if int(a) < int(b). +func (a Int) Less(b Item) bool { + return a < b.(Int) +} diff --git a/vendor/github.com/gregjones/httpcache/.travis.yml b/vendor/github.com/gregjones/httpcache/.travis.yml new file mode 100644 index 0000000000..b5ffbe03d8 --- /dev/null +++ b/vendor/github.com/gregjones/httpcache/.travis.yml @@ -0,0 +1,19 @@ +sudo: false +language: go +go: + - 1.6.x + - 1.7.x + - 1.8.x + - 1.9.x + - master +matrix: + allow_failures: + - go: master + fast_finish: true +install: + - # Do nothing. This is needed to prevent default install action "go get -t -v ./..." from happening here (we want it to happen inside script step). +script: + - go get -t -v ./... + - diff -u <(echo -n) <(gofmt -d .) + - go tool vet . + - go test -v -race ./... diff --git a/vendor/github.com/gregjones/httpcache/LICENSE.txt b/vendor/github.com/gregjones/httpcache/LICENSE.txt new file mode 100644 index 0000000000..81316beb0c --- /dev/null +++ b/vendor/github.com/gregjones/httpcache/LICENSE.txt @@ -0,0 +1,7 @@ +Copyright © 2012 Greg Jones (greg.jones@gmail.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/vendor/github.com/gregjones/httpcache/README.md b/vendor/github.com/gregjones/httpcache/README.md new file mode 100644 index 0000000000..09c9e7c173 --- /dev/null +++ b/vendor/github.com/gregjones/httpcache/README.md @@ -0,0 +1,25 @@ +httpcache +========= + +[![Build Status](https://travis-ci.org/gregjones/httpcache.svg?branch=master)](https://travis-ci.org/gregjones/httpcache) [![GoDoc](https://godoc.org/github.com/gregjones/httpcache?status.svg)](https://godoc.org/github.com/gregjones/httpcache) + +Package httpcache provides a http.RoundTripper implementation that works as a mostly [RFC 7234](https://tools.ietf.org/html/rfc7234) compliant cache for http responses. + +It is only suitable for use as a 'private' cache (i.e. for a web-browser or an API-client and not for a shared proxy). + +Cache Backends +-------------- + +- The built-in 'memory' cache stores responses in an in-memory map. +- [`github.com/gregjones/httpcache/diskcache`](https://github.com/gregjones/httpcache/tree/master/diskcache) provides a filesystem-backed cache using the [diskv](https://github.com/peterbourgon/diskv) library. +- [`github.com/gregjones/httpcache/memcache`](https://github.com/gregjones/httpcache/tree/master/memcache) provides memcache implementations, for both App Engine and 'normal' memcache servers. +- [`sourcegraph.com/sourcegraph/s3cache`](https://sourcegraph.com/github.com/sourcegraph/s3cache) uses Amazon S3 for storage. +- [`github.com/gregjones/httpcache/leveldbcache`](https://github.com/gregjones/httpcache/tree/master/leveldbcache) provides a filesystem-backed cache using [leveldb](https://github.com/syndtr/goleveldb/leveldb). +- [`github.com/die-net/lrucache`](https://github.com/die-net/lrucache) provides an in-memory cache that will evict least-recently used entries. +- [`github.com/die-net/lrucache/twotier`](https://github.com/die-net/lrucache/tree/master/twotier) allows caches to be combined, for example to use lrucache above with a persistent disk-cache. +- [`github.com/birkelund/boltdbcache`](https://github.com/birkelund/boltdbcache) provides a BoltDB implementation (based on the [bbolt](https://github.com/coreos/bbolt) fork). + +License +------- + +- [MIT License](LICENSE.txt) diff --git a/vendor/github.com/gregjones/httpcache/diskcache/diskcache.go b/vendor/github.com/gregjones/httpcache/diskcache/diskcache.go new file mode 100644 index 0000000000..42e3129d82 --- /dev/null +++ b/vendor/github.com/gregjones/httpcache/diskcache/diskcache.go @@ -0,0 +1,61 @@ +// Package diskcache provides an implementation of httpcache.Cache that uses the diskv package +// to supplement an in-memory map with persistent storage +// +package diskcache + +import ( + "bytes" + "crypto/md5" + "encoding/hex" + "github.com/peterbourgon/diskv" + "io" +) + +// Cache is an implementation of httpcache.Cache that supplements the in-memory map with persistent storage +type Cache struct { + d *diskv.Diskv +} + +// Get returns the response corresponding to key if present +func (c *Cache) Get(key string) (resp []byte, ok bool) { + key = keyToFilename(key) + resp, err := c.d.Read(key) + if err != nil { + return []byte{}, false + } + return resp, true +} + +// Set saves a response to the cache as key +func (c *Cache) Set(key string, resp []byte) { + key = keyToFilename(key) + c.d.WriteStream(key, bytes.NewReader(resp), true) +} + +// Delete removes the response with key from the cache +func (c *Cache) Delete(key string) { + key = keyToFilename(key) + c.d.Erase(key) +} + +func keyToFilename(key string) string { + h := md5.New() + io.WriteString(h, key) + return hex.EncodeToString(h.Sum(nil)) +} + +// New returns a new Cache that will store files in basePath +func New(basePath string) *Cache { + return &Cache{ + d: diskv.New(diskv.Options{ + BasePath: basePath, + CacheSizeMax: 100 * 1024 * 1024, // 100MB + }), + } +} + +// NewWithDiskv returns a new Cache using the provided Diskv as underlying +// storage. +func NewWithDiskv(d *diskv.Diskv) *Cache { + return &Cache{d} +} diff --git a/vendor/github.com/gregjones/httpcache/httpcache.go b/vendor/github.com/gregjones/httpcache/httpcache.go new file mode 100644 index 0000000000..f6a2ec4a53 --- /dev/null +++ b/vendor/github.com/gregjones/httpcache/httpcache.go @@ -0,0 +1,551 @@ +// Package httpcache provides a http.RoundTripper implementation that works as a +// mostly RFC-compliant cache for http responses. +// +// It is only suitable for use as a 'private' cache (i.e. for a web-browser or an API-client +// and not for a shared proxy). +// +package httpcache + +import ( + "bufio" + "bytes" + "errors" + "io" + "io/ioutil" + "net/http" + "net/http/httputil" + "strings" + "sync" + "time" +) + +const ( + stale = iota + fresh + transparent + // XFromCache is the header added to responses that are returned from the cache + XFromCache = "X-From-Cache" +) + +// A Cache interface is used by the Transport to store and retrieve responses. +type Cache interface { + // Get returns the []byte representation of a cached response and a bool + // set to true if the value isn't empty + Get(key string) (responseBytes []byte, ok bool) + // Set stores the []byte representation of a response against a key + Set(key string, responseBytes []byte) + // Delete removes the value associated with the key + Delete(key string) +} + +// cacheKey returns the cache key for req. +func cacheKey(req *http.Request) string { + if req.Method == http.MethodGet { + return req.URL.String() + } else { + return req.Method + " " + req.URL.String() + } +} + +// CachedResponse returns the cached http.Response for req if present, and nil +// otherwise. +func CachedResponse(c Cache, req *http.Request) (resp *http.Response, err error) { + cachedVal, ok := c.Get(cacheKey(req)) + if !ok { + return + } + + b := bytes.NewBuffer(cachedVal) + return http.ReadResponse(bufio.NewReader(b), req) +} + +// MemoryCache is an implemtation of Cache that stores responses in an in-memory map. +type MemoryCache struct { + mu sync.RWMutex + items map[string][]byte +} + +// Get returns the []byte representation of the response and true if present, false if not +func (c *MemoryCache) Get(key string) (resp []byte, ok bool) { + c.mu.RLock() + resp, ok = c.items[key] + c.mu.RUnlock() + return resp, ok +} + +// Set saves response resp to the cache with key +func (c *MemoryCache) Set(key string, resp []byte) { + c.mu.Lock() + c.items[key] = resp + c.mu.Unlock() +} + +// Delete removes key from the cache +func (c *MemoryCache) Delete(key string) { + c.mu.Lock() + delete(c.items, key) + c.mu.Unlock() +} + +// NewMemoryCache returns a new Cache that will store items in an in-memory map +func NewMemoryCache() *MemoryCache { + c := &MemoryCache{items: map[string][]byte{}} + return c +} + +// Transport is an implementation of http.RoundTripper that will return values from a cache +// where possible (avoiding a network request) and will additionally add validators (etag/if-modified-since) +// to repeated requests allowing servers to return 304 / Not Modified +type Transport struct { + // The RoundTripper interface actually used to make requests + // If nil, http.DefaultTransport is used + Transport http.RoundTripper + Cache Cache + // If true, responses returned from the cache will be given an extra header, X-From-Cache + MarkCachedResponses bool +} + +// NewTransport returns a new Transport with the +// provided Cache implementation and MarkCachedResponses set to true +func NewTransport(c Cache) *Transport { + return &Transport{Cache: c, MarkCachedResponses: true} +} + +// Client returns an *http.Client that caches responses. +func (t *Transport) Client() *http.Client { + return &http.Client{Transport: t} +} + +// varyMatches will return false unless all of the cached values for the headers listed in Vary +// match the new request +func varyMatches(cachedResp *http.Response, req *http.Request) bool { + for _, header := range headerAllCommaSepValues(cachedResp.Header, "vary") { + header = http.CanonicalHeaderKey(header) + if header != "" && req.Header.Get(header) != cachedResp.Header.Get("X-Varied-"+header) { + return false + } + } + return true +} + +// RoundTrip takes a Request and returns a Response +// +// If there is a fresh Response already in cache, then it will be returned without connecting to +// the server. +// +// If there is a stale Response, then any validators it contains will be set on the new request +// to give the server a chance to respond with NotModified. If this happens, then the cached Response +// will be returned. +func (t *Transport) RoundTrip(req *http.Request) (resp *http.Response, err error) { + cacheKey := cacheKey(req) + cacheable := (req.Method == "GET" || req.Method == "HEAD") && req.Header.Get("range") == "" + var cachedResp *http.Response + if cacheable { + cachedResp, err = CachedResponse(t.Cache, req) + } else { + // Need to invalidate an existing value + t.Cache.Delete(cacheKey) + } + + transport := t.Transport + if transport == nil { + transport = http.DefaultTransport + } + + if cacheable && cachedResp != nil && err == nil { + if t.MarkCachedResponses { + cachedResp.Header.Set(XFromCache, "1") + } + + if varyMatches(cachedResp, req) { + // Can only use cached value if the new request doesn't Vary significantly + freshness := getFreshness(cachedResp.Header, req.Header) + if freshness == fresh { + return cachedResp, nil + } + + if freshness == stale { + var req2 *http.Request + // Add validators if caller hasn't already done so + etag := cachedResp.Header.Get("etag") + if etag != "" && req.Header.Get("etag") == "" { + req2 = cloneRequest(req) + req2.Header.Set("if-none-match", etag) + } + lastModified := cachedResp.Header.Get("last-modified") + if lastModified != "" && req.Header.Get("last-modified") == "" { + if req2 == nil { + req2 = cloneRequest(req) + } + req2.Header.Set("if-modified-since", lastModified) + } + if req2 != nil { + req = req2 + } + } + } + + resp, err = transport.RoundTrip(req) + if err == nil && req.Method == "GET" && resp.StatusCode == http.StatusNotModified { + // Replace the 304 response with the one from cache, but update with some new headers + endToEndHeaders := getEndToEndHeaders(resp.Header) + for _, header := range endToEndHeaders { + cachedResp.Header[header] = resp.Header[header] + } + resp = cachedResp + } else if (err != nil || (cachedResp != nil && resp.StatusCode >= 500)) && + req.Method == "GET" && canStaleOnError(cachedResp.Header, req.Header) { + // In case of transport failure and stale-if-error activated, returns cached content + // when available + return cachedResp, nil + } else { + if err != nil || resp.StatusCode != http.StatusOK { + t.Cache.Delete(cacheKey) + } + if err != nil { + return nil, err + } + } + } else { + reqCacheControl := parseCacheControl(req.Header) + if _, ok := reqCacheControl["only-if-cached"]; ok { + resp = newGatewayTimeoutResponse(req) + } else { + resp, err = transport.RoundTrip(req) + if err != nil { + return nil, err + } + } + } + + if cacheable && canStore(parseCacheControl(req.Header), parseCacheControl(resp.Header)) { + for _, varyKey := range headerAllCommaSepValues(resp.Header, "vary") { + varyKey = http.CanonicalHeaderKey(varyKey) + fakeHeader := "X-Varied-" + varyKey + reqValue := req.Header.Get(varyKey) + if reqValue != "" { + resp.Header.Set(fakeHeader, reqValue) + } + } + switch req.Method { + case "GET": + // Delay caching until EOF is reached. + resp.Body = &cachingReadCloser{ + R: resp.Body, + OnEOF: func(r io.Reader) { + resp := *resp + resp.Body = ioutil.NopCloser(r) + respBytes, err := httputil.DumpResponse(&resp, true) + if err == nil { + t.Cache.Set(cacheKey, respBytes) + } + }, + } + default: + respBytes, err := httputil.DumpResponse(resp, true) + if err == nil { + t.Cache.Set(cacheKey, respBytes) + } + } + } else { + t.Cache.Delete(cacheKey) + } + return resp, nil +} + +// ErrNoDateHeader indicates that the HTTP headers contained no Date header. +var ErrNoDateHeader = errors.New("no Date header") + +// Date parses and returns the value of the Date header. +func Date(respHeaders http.Header) (date time.Time, err error) { + dateHeader := respHeaders.Get("date") + if dateHeader == "" { + err = ErrNoDateHeader + return + } + + return time.Parse(time.RFC1123, dateHeader) +} + +type realClock struct{} + +func (c *realClock) since(d time.Time) time.Duration { + return time.Since(d) +} + +type timer interface { + since(d time.Time) time.Duration +} + +var clock timer = &realClock{} + +// getFreshness will return one of fresh/stale/transparent based on the cache-control +// values of the request and the response +// +// fresh indicates the response can be returned +// stale indicates that the response needs validating before it is returned +// transparent indicates the response should not be used to fulfil the request +// +// Because this is only a private cache, 'public' and 'private' in cache-control aren't +// signficant. Similarly, smax-age isn't used. +func getFreshness(respHeaders, reqHeaders http.Header) (freshness int) { + respCacheControl := parseCacheControl(respHeaders) + reqCacheControl := parseCacheControl(reqHeaders) + if _, ok := reqCacheControl["no-cache"]; ok { + return transparent + } + if _, ok := respCacheControl["no-cache"]; ok { + return stale + } + if _, ok := reqCacheControl["only-if-cached"]; ok { + return fresh + } + + date, err := Date(respHeaders) + if err != nil { + return stale + } + currentAge := clock.since(date) + + var lifetime time.Duration + var zeroDuration time.Duration + + // If a response includes both an Expires header and a max-age directive, + // the max-age directive overrides the Expires header, even if the Expires header is more restrictive. + if maxAge, ok := respCacheControl["max-age"]; ok { + lifetime, err = time.ParseDuration(maxAge + "s") + if err != nil { + lifetime = zeroDuration + } + } else { + expiresHeader := respHeaders.Get("Expires") + if expiresHeader != "" { + expires, err := time.Parse(time.RFC1123, expiresHeader) + if err != nil { + lifetime = zeroDuration + } else { + lifetime = expires.Sub(date) + } + } + } + + if maxAge, ok := reqCacheControl["max-age"]; ok { + // the client is willing to accept a response whose age is no greater than the specified time in seconds + lifetime, err = time.ParseDuration(maxAge + "s") + if err != nil { + lifetime = zeroDuration + } + } + if minfresh, ok := reqCacheControl["min-fresh"]; ok { + // the client wants a response that will still be fresh for at least the specified number of seconds. + minfreshDuration, err := time.ParseDuration(minfresh + "s") + if err == nil { + currentAge = time.Duration(currentAge + minfreshDuration) + } + } + + if maxstale, ok := reqCacheControl["max-stale"]; ok { + // Indicates that the client is willing to accept a response that has exceeded its expiration time. + // If max-stale is assigned a value, then the client is willing to accept a response that has exceeded + // its expiration time by no more than the specified number of seconds. + // If no value is assigned to max-stale, then the client is willing to accept a stale response of any age. + // + // Responses served only because of a max-stale value are supposed to have a Warning header added to them, + // but that seems like a hassle, and is it actually useful? If so, then there needs to be a different + // return-value available here. + if maxstale == "" { + return fresh + } + maxstaleDuration, err := time.ParseDuration(maxstale + "s") + if err == nil { + currentAge = time.Duration(currentAge - maxstaleDuration) + } + } + + if lifetime > currentAge { + return fresh + } + + return stale +} + +// Returns true if either the request or the response includes the stale-if-error +// cache control extension: https://tools.ietf.org/html/rfc5861 +func canStaleOnError(respHeaders, reqHeaders http.Header) bool { + respCacheControl := parseCacheControl(respHeaders) + reqCacheControl := parseCacheControl(reqHeaders) + + var err error + lifetime := time.Duration(-1) + + if staleMaxAge, ok := respCacheControl["stale-if-error"]; ok { + if staleMaxAge != "" { + lifetime, err = time.ParseDuration(staleMaxAge + "s") + if err != nil { + return false + } + } else { + return true + } + } + if staleMaxAge, ok := reqCacheControl["stale-if-error"]; ok { + if staleMaxAge != "" { + lifetime, err = time.ParseDuration(staleMaxAge + "s") + if err != nil { + return false + } + } else { + return true + } + } + + if lifetime >= 0 { + date, err := Date(respHeaders) + if err != nil { + return false + } + currentAge := clock.since(date) + if lifetime > currentAge { + return true + } + } + + return false +} + +func getEndToEndHeaders(respHeaders http.Header) []string { + // These headers are always hop-by-hop + hopByHopHeaders := map[string]struct{}{ + "Connection": struct{}{}, + "Keep-Alive": struct{}{}, + "Proxy-Authenticate": struct{}{}, + "Proxy-Authorization": struct{}{}, + "Te": struct{}{}, + "Trailers": struct{}{}, + "Transfer-Encoding": struct{}{}, + "Upgrade": struct{}{}, + } + + for _, extra := range strings.Split(respHeaders.Get("connection"), ",") { + // any header listed in connection, if present, is also considered hop-by-hop + if strings.Trim(extra, " ") != "" { + hopByHopHeaders[http.CanonicalHeaderKey(extra)] = struct{}{} + } + } + endToEndHeaders := []string{} + for respHeader, _ := range respHeaders { + if _, ok := hopByHopHeaders[respHeader]; !ok { + endToEndHeaders = append(endToEndHeaders, respHeader) + } + } + return endToEndHeaders +} + +func canStore(reqCacheControl, respCacheControl cacheControl) (canStore bool) { + if _, ok := respCacheControl["no-store"]; ok { + return false + } + if _, ok := reqCacheControl["no-store"]; ok { + return false + } + return true +} + +func newGatewayTimeoutResponse(req *http.Request) *http.Response { + var braw bytes.Buffer + braw.WriteString("HTTP/1.1 504 Gateway Timeout\r\n\r\n") + resp, err := http.ReadResponse(bufio.NewReader(&braw), req) + if err != nil { + panic(err) + } + return resp +} + +// cloneRequest returns a clone of the provided *http.Request. +// The clone is a shallow copy of the struct and its Header map. +// (This function copyright goauth2 authors: https://code.google.com/p/goauth2) +func cloneRequest(r *http.Request) *http.Request { + // shallow copy of the struct + r2 := new(http.Request) + *r2 = *r + // deep copy of the Header + r2.Header = make(http.Header) + for k, s := range r.Header { + r2.Header[k] = s + } + return r2 +} + +type cacheControl map[string]string + +func parseCacheControl(headers http.Header) cacheControl { + cc := cacheControl{} + ccHeader := headers.Get("Cache-Control") + for _, part := range strings.Split(ccHeader, ",") { + part = strings.Trim(part, " ") + if part == "" { + continue + } + if strings.ContainsRune(part, '=') { + keyval := strings.Split(part, "=") + cc[strings.Trim(keyval[0], " ")] = strings.Trim(keyval[1], ",") + } else { + cc[part] = "" + } + } + return cc +} + +// headerAllCommaSepValues returns all comma-separated values (each +// with whitespace trimmed) for header name in headers. According to +// Section 4.2 of the HTTP/1.1 spec +// (http://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.2), +// values from multiple occurrences of a header should be concatenated, if +// the header's value is a comma-separated list. +func headerAllCommaSepValues(headers http.Header, name string) []string { + var vals []string + for _, val := range headers[http.CanonicalHeaderKey(name)] { + fields := strings.Split(val, ",") + for i, f := range fields { + fields[i] = strings.TrimSpace(f) + } + vals = append(vals, fields...) + } + return vals +} + +// cachingReadCloser is a wrapper around ReadCloser R that calls OnEOF +// handler with a full copy of the content read from R when EOF is +// reached. +type cachingReadCloser struct { + // Underlying ReadCloser. + R io.ReadCloser + // OnEOF is called with a copy of the content of R when EOF is reached. + OnEOF func(io.Reader) + + buf bytes.Buffer // buf stores a copy of the content of R. +} + +// Read reads the next len(p) bytes from R or until R is drained. The +// return value n is the number of bytes read. If R has no data to +// return, err is io.EOF and OnEOF is called with a full copy of what +// has been read so far. +func (r *cachingReadCloser) Read(p []byte) (n int, err error) { + n, err = r.R.Read(p) + r.buf.Write(p[:n]) + if err == io.EOF { + r.OnEOF(bytes.NewReader(r.buf.Bytes())) + } + return n, err +} + +func (r *cachingReadCloser) Close() error { + return r.R.Close() +} + +// NewMemoryCacheTransport returns a new Transport using the in-memory cache implementation +func NewMemoryCacheTransport() *Transport { + c := NewMemoryCache() + t := NewTransport(c) + return t +} diff --git a/vendor/github.com/jszwec/csvutil/.gitignore b/vendor/github.com/jszwec/csvutil/.gitignore new file mode 100644 index 0000000000..87ba7fb8b9 --- /dev/null +++ b/vendor/github.com/jszwec/csvutil/.gitignore @@ -0,0 +1,89 @@ +# Created by https://www.gitignore.io/api/osx,go,windows,linux + +### OSX ### +.DS_Store +.AppleDouble +.LSOverride + +# Icon must end with two \r +Icon + + +# Thumbnails +._* + +# Files that might appear in the root of a volume +.DocumentRevisions-V100 +.fseventsd +.Spotlight-V100 +.TemporaryItems +.Trashes +.VolumeIcon.icns + +# Directories potentially created on remote AFP share +.AppleDB +.AppleDesktop +Network Trash Folder +Temporary Items +.apdisk + + +### 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 + + +### Windows ### +# Windows image file caches +Thumbs.db +ehthumbs.db + +# Folder config file +Desktop.ini + +# Recycle Bin used on file shares +$RECYCLE.BIN/ + +# Windows Installer files +*.cab +*.msi +*.msm +*.msp + +# Windows shortcuts +*.lnk + + +### Linux ### +*~ + +# temporary files which can be created if a process still has a handle open of a deleted file +.fuse_hidden* + +# KDE directory preferences +.directory + +# Linux trash folder which might appear on any partition or disk +.Trash-* diff --git a/vendor/github.com/jszwec/csvutil/LICENSE b/vendor/github.com/jszwec/csvutil/LICENSE new file mode 100644 index 0000000000..308ea2b717 --- /dev/null +++ b/vendor/github.com/jszwec/csvutil/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2017 Jacek Szwec + +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/jszwec/csvutil/README.md b/vendor/github.com/jszwec/csvutil/README.md new file mode 100644 index 0000000000..9120714ba7 --- /dev/null +++ b/vendor/github.com/jszwec/csvutil/README.md @@ -0,0 +1,668 @@ +csvutil [![PkgGoDev](https://pkg.go.dev/badge/github.com/jszwec/csvutil@v1.4.0?tab=doc)](https://pkg.go.dev/github.com/jszwec/csvutil?tab=doc) ![Go](https://github.com/jszwec/csvutil/workflows/Go/badge.svg) [![Go Report Card](https://goreportcard.com/badge/github.com/jszwec/csvutil)](https://goreportcard.com/report/github.com/jszwec/csvutil) [![codecov](https://codecov.io/gh/jszwec/csvutil/branch/master/graph/badge.svg)](https://codecov.io/gh/jszwec/csvutil) +================= + +

+ +

+ +Package csvutil provides fast, idiomatic, and dependency free mapping between CSV and Go (golang) values. + +This package is not a CSV parser, it is based on the [Reader](https://godoc.org/github.com/jszwec/csvutil#Reader) and [Writer](https://godoc.org/github.com/jszwec/csvutil#Writer) +interfaces which are implemented by eg. std Go (golang) [csv package](https://golang.org/pkg/encoding/csv). This gives a possibility +of choosing any other CSV writer or reader which may be more performant. + +Installation +------------ + + go get github.com/jszwec/csvutil + +Requirements +------------- + +* Go1.7+ + +Index +------ + +1. [Examples](#examples) + 1. [Unmarshal](#examples_unmarshal) + 2. [Marshal](#examples_marshal) + 3. [Unmarshal and metadata](#examples_unmarshal_and_metadata) + 4. [But my CSV file has no header...](#examples_but_my_csv_has_no_header) + 5. [Decoder.Map - data normalization](#examples_decoder_map) + 6. [Different separator/delimiter](#examples_different_separator) + 7. [Custom Types](#examples_custom_types) + 8. [Custom time.Time format](#examples_time_format) + 9. [Custom struct tags](#examples_struct_tags) + 10. [Slice and Map fields](#examples_slice_and_map_field) + 11. [Nested/Embedded structs](#examples_nested_structs) + 12. [Inline tag](#examples_inlined_structs) +2. [Performance](#performance) + 1. [Unmarshal](#performance_unmarshal) + 2. [Marshal](#performance_marshal) + +Example +-------- + +### Unmarshal + +Nice and easy Unmarshal is using the Go std [csv.Reader](https://golang.org/pkg/encoding/csv/#Reader) with its default options. Use [Decoder](https://godoc.org/github.com/jszwec/csvutil#Decoder) for streaming and more advanced use cases. + +```go + var csvInput = []byte(` +name,age,CreatedAt +jacek,26,2012-04-01T15:00:00Z +john,,0001-01-01T00:00:00Z`, + ) + + type User struct { + Name string `csv:"name"` + Age int `csv:"age,omitempty"` + CreatedAt time.Time + } + + var users []User + if err := csvutil.Unmarshal(csvInput, &users); err != nil { + fmt.Println("error:", err) + } + + for _, u := range users { + fmt.Printf("%+v\n", u) + } + + // Output: + // {Name:jacek Age:26 CreatedAt:2012-04-01 15:00:00 +0000 UTC} + // {Name:john Age:0 CreatedAt:0001-01-01 00:00:00 +0000 UTC} +``` + +### Marshal + +Marshal is using the Go std [csv.Writer](https://golang.org/pkg/encoding/csv/#Writer) with its default options. Use [Encoder](https://godoc.org/github.com/jszwec/csvutil#Encoder) for streaming or to use a different Writer. + +```go + type Address struct { + City string + Country string + } + + type User struct { + Name string + Address + Age int `csv:"age,omitempty"` + CreatedAt time.Time + } + + users := []User{ + { + Name: "John", + Address: Address{"Boston", "USA"}, + Age: 26, + CreatedAt: time.Date(2010, 6, 2, 12, 0, 0, 0, time.UTC), + }, + { + Name: "Alice", + Address: Address{"SF", "USA"}, + }, + } + + b, err := csvutil.Marshal(users) + if err != nil { + fmt.Println("error:", err) + } + fmt.Println(string(b)) + + // Output: + // Name,City,Country,age,CreatedAt + // John,Boston,USA,26,2010-06-02T12:00:00Z + // Alice,SF,USA,,0001-01-01T00:00:00Z +``` + +### Unmarshal and metadata + +It may happen that your CSV input will not always have the same header. In addition +to your base fields you may get extra metadata that you would still like to store. +[Decoder](https://godoc.org/github.com/jszwec/csvutil#Decoder) provides +[Unused](https://godoc.org/github.com/jszwec/csvutil#Decoder.Unused) method, which after each call to +[Decode](https://godoc.org/github.com/jszwec/csvutil#Decoder.Decode) can report which header indexes +were not used during decoding. Based on that, it is possible to handle and store all these extra values. + +```go + type User struct { + Name string `csv:"name"` + City string `csv:"city"` + Age int `csv:"age"` + OtherData map[string]string `csv:"-"` + } + + csvReader := csv.NewReader(strings.NewReader(` +name,age,city,zip +alice,25,la,90005 +bob,30,ny,10005`)) + + dec, err := csvutil.NewDecoder(csvReader) + if err != nil { + log.Fatal(err) + } + + header := dec.Header() + var users []User + for { + u := User{OtherData: make(map[string]string)} + + if err := dec.Decode(&u); err == io.EOF { + break + } else if err != nil { + log.Fatal(err) + } + + for _, i := range dec.Unused() { + u.OtherData[header[i]] = dec.Record()[i] + } + users = append(users, u) + } + + fmt.Println(users) + + // Output: + // [{alice la 25 map[zip:90005]} {bob ny 30 map[zip:10005]}] +``` + +### But my CSV file has no header... + +Some CSV files have no header, but if you know how it should look like, it is +possible to define a struct and generate it. All that is left to do, is to pass +it to a decoder. + +```go + type User struct { + ID int + Name string + Age int `csv:",omitempty"` + City string + } + + csvReader := csv.NewReader(strings.NewReader(` +1,John,27,la +2,Bob,,ny`)) + + // in real application this should be done once in init function. + userHeader, err := csvutil.Header(User{}, "csv") + if err != nil { + log.Fatal(err) + } + + dec, err := csvutil.NewDecoder(csvReader, userHeader...) + if err != nil { + log.Fatal(err) + } + + var users []User + for { + var u User + if err := dec.Decode(&u); err == io.EOF { + break + } else if err != nil { + log.Fatal(err) + } + users = append(users, u) + } + + fmt.Printf("%+v", users) + + // Output: + // [{ID:1 Name:John Age:27 City:la} {ID:2 Name:Bob Age:0 City:ny}] +``` + +### Decoder.Map - data normalization + +The Decoder's [Map](https://godoc.org/github.com/jszwec/csvutil#Decoder.Map) function is a powerful tool that can help clean up or normalize +the incoming data before the actual decoding takes place. + +Lets say we want to decode some floats and the csv input contains some NaN values, but these values are represented by the 'n/a' string. An attempt to decode 'n/a' into float will end up with error, because strconv.ParseFloat expects 'NaN'. Knowing that, we can implement a Map function that will normalize our 'n/a' string and turn it to 'NaN' only for float types. + +```go + dec, err := NewDecoder(r) + if err != nil { + log.Fatal(err) + } + + dec.Map = func(field, column string, v interface{}) string { + if _, ok := v.(float64); ok && field == "n/a" { + return "NaN" + } + return field + } +``` + +Now our float64 fields will be decoded properly into NaN. What about float32, float type aliases and other NaN formats? Look at the full example [here](https://gist.github.com/jszwec/2bb94f8f3612e0162eb16003701f727e). + +### Different separator/delimiter + +Some files may use different value separators, for example TSV files would use `\t`. The following examples show how to set up a Decoder and Encoder for such use case. + +#### Decoder: +```go + csvReader := csv.NewReader(r) + csvReader.Comma = '\t' + + dec, err := NewDecoder(csvReader) + if err != nil { + log.Fatal(err) + } + + var users []User + for { + var u User + if err := dec.Decode(&u); err == io.EOF { + break + } else if err != nil { + log.Fatal(err) + } + users = append(users, u) + } + +``` + +#### Encoder: +```go + var buf bytes.Buffer + + w := csv.NewWriter(&buf) + w.Comma = '\t' + enc := csvutil.NewEncoder(w) + + for _, u := range users { + if err := enc.Encode(u); err != nil { + log.Fatal(err) + } + } + + w.Flush() + if err := w.Error(); err != nil { + log.Fatal(err) + } +``` + +### Custom Types and Overrides + +There are multiple ways to customize or override your type's behavior. + +1. a type implements [csvutil.Marshaler](https://pkg.go.dev/github.com/jszwec/csvutil#Marshaler) and/or [csvutil.Unmarshaler](https://pkg.go.dev/github.com/jszwec/csvutil#Unmarshaler) +```go +type Foo int64 + +func (f Foo) MarshalCSV() ([]byte, error) { + return strconv.AppendInt(nil, int64(f), 16), nil +} + +func (f *Foo) UnmarshalCSV(data []byte) error { + i, err := strconv.ParseInt(string(data), 16, 64) + if err != nil { + return err + } + *f = Foo(i) + return nil +} +``` +2. a type implements [encoding.TextUnmarshaler](https://golang.org/pkg/encoding/#TextUnmarshaler) and/or [encoding.TextMarshaler](https://golang.org/pkg/encoding/#TextMarshaler) +```go +type Foo int64 + +func (f Foo) MarshalText() ([]byte, error) { + return strconv.AppendInt(nil, int64(f), 16), nil +} + +func (f *Foo) UnmarshalText(data []byte) error { + i, err := strconv.ParseInt(string(data), 16, 64) + if err != nil { + return err + } + *f = Foo(i) + return nil +} +``` +3. a type is registered using [Encoder.Register](https://pkg.go.dev/github.com/jszwec/csvutil#Encoder.Register) and/or [Decoder.Register](https://pkg.go.dev/github.com/jszwec/csvutil#Decoder.Register) +```go +type Foo int64 + +enc.Register(func(f Foo) ([]byte, error) { + return strconv.AppendInt(nil, int64(f), 16), nil +}) + +dec.Register(func(data []byte, f *Foo) error { + v, err := strconv.ParseInt(string(data), 16, 64) + if err != nil { + return err + } + *f = Foo(v) + return nil +}) +``` +4. a type implements an interface that was registered using [Encoder.Register](https://pkg.go.dev/github.com/jszwec/csvutil#Encoder.Register) and/or [Decoder.Register](https://pkg.go.dev/github.com/jszwec/csvutil#Decoder.Register) +```go +type Foo int64 + +func (f Foo) String() string { + return strconv.FormatInt(int64(f), 16) +} + +func (f *Foo) Scan(state fmt.ScanState, verb rune) error { + // too long; look here: https://github.com/jszwec/csvutil/blob/master/example_decoder_register_test.go#L19 +} + +enc.Register(func(s fmt.Stringer) ([]byte, error) { + return []byte(s.String()), nil +}) + +dec.Register(func(data []byte, s fmt.Scanner) error { + _, err := fmt.Sscan(string(data), s) + return err +}) +``` + +The order of precedence for both Encoder and Decoder is: +1. type is registered +2. type implements an interface that was registered +3. csvutil.{Un,M}arshaler +4. encoding.Text{Un,M}arshaler + +For more examples look [here](https://pkg.go.dev/github.com/jszwec/csvutil?readme=expanded#pkg-examples) + +### Custom time.Time format + +Type [time.Time](https://golang.org/pkg/time/#Time) can be used as is in the struct fields by both Decoder and Encoder +due to the fact that both have builtin support for [encoding.TextUnmarshaler](https://golang.org/pkg/encoding/#TextUnmarshaler) and [encoding.TextMarshaler](https://golang.org/pkg/encoding/#TextMarshaler). This means that by default +Time has a specific format; look at [MarshalText](https://golang.org/pkg/time/#Time.MarshalText) and [UnmarshalText](https://golang.org/pkg/time/#Time.UnmarshalText). There are two ways to override it, which one you choose depends on your use case: + +1. Via Register func (based on encoding/json) +```go +const format = "2006/01/02 15:04:05" + +marshalTime := func(t time.Time) ([]byte, error) { + return t.AppendFormat(nil, format), nil +} + +unmarshalTime := func(data []byte, t *time.Time) error { + tt, err := time.Parse(format, string(data)) + if err != nil { + return err + } + *t = tt + return nil +} + +enc := csvutil.NewEncoder(w) +enc.Register(marshalTime) + +dec, err := csvutil.NewDecoder(r) +if err != nil { + return err +} +dec.Register(unmarshalTime) +``` + +2. With custom type: +```go +type Time struct { + time.Time +} + +const format = "2006/01/02 15:04:05" + +func (t Time) MarshalCSV() ([]byte, error) { + var b [len(format)]byte + return t.AppendFormat(b[:0], format), nil +} + +func (t *Time) UnmarshalCSV(data []byte) error { + tt, err := time.Parse(format, string(data)) + if err != nil { + return err + } + *t = Time{Time: tt} + return nil +} +``` + +### Custom struct tags + +Like in other Go encoding packages struct field tags can be used to set +custom names or options. By default encoders and decoders are looking at `csv` tag. +However, this can be overriden by manually setting the Tag field. + +```go + type Foo struct { + Bar int `custom:"bar"` + } +``` + +```go + dec, err := csvutil.NewDecoder(r) + if err != nil { + log.Fatal(err) + } + dec.Tag = "custom" +``` + +```go + enc := csvutil.NewEncoder(w) + enc.Tag = "custom" +``` + +### Slice and Map fields + +There is no default encoding/decoding support for slice and map fields because there is no CSV spec for such values. +In such case, it is recommended to create a custom type alias and implement Marshaler and Unmarshaler interfaces. +Please note that slice and map aliases behave differently than aliases of other types - there is no need for type casting. + +```go + type Strings []string + + func (s Strings) MarshalCSV() ([]byte, error) { + return []byte(strings.Join(s, ",")), nil // strings.Join takes []string but it will also accept Strings + } + + type StringMap map[string]string + + func (sm StringMap) MarshalCSV() ([]byte, error) { + return []byte(fmt.Sprint(sm)), nil + } + + func main() { + b, err := csvutil.Marshal([]struct { + Strings Strings `csv:"strings"` + Map StringMap `csv:"map"` + }{ + {[]string{"a", "b"}, map[string]string{"a": "1"}}, // no type casting is required for slice and map aliases + {Strings{"c", "d"}, StringMap{"b": "1"}}, + }) + + if err != nil { + log.Fatal(err) + } + + fmt.Printf("%s\n", b) + + // Output: + // strings,map + // "a,b",map[a:1] + // "c,d",map[b:1] + } +``` + +### Nested/Embedded structs + +Both Encoder and Decoder support nested or embedded structs. + +Playground: https://play.golang.org/p/ZySjdVkovbf + +```go +package main + +import ( + "fmt" + + "github.com/jszwec/csvutil" +) + +type Address struct { + Street string `csv:"street"` + City string `csv:"city"` +} + +type User struct { + Name string `csv:"name"` + Address +} + +func main() { + users := []User{ + { + Name: "John", + Address: Address{ + Street: "Boylston", + City: "Boston", + }, + }, + } + + b, err := csvutil.Marshal(users) + if err != nil { + panic(err) + } + + fmt.Printf("%s\n", b) + + var out []User + if err := csvutil.Unmarshal(b, &out); err != nil { + panic(err) + } + + fmt.Printf("%+v\n", out) + + // Output: + // + // name,street,city + // John,Boylston,Boston + // + // [{Name:John Address:{Street:Boylston City:Boston}}] +} +``` + +### Inline tag + +Fields with inline tag behave similarly to embedded struct fields. However, +it gives a possibility to specify the prefix for all underlying fields. This +can be useful when one structure can define multiple CSV columns because they +are different from each other only by a certain prefix. Look at the example below. + +Playground: https://play.golang.org/p/jyEzeskSnj7 + +```go +package main + +import ( + "fmt" + + "github.com/jszwec/csvutil" +) + +func main() { + type Address struct { + Street string `csv:"street"` + City string `csv:"city"` + } + + type User struct { + Name string `csv:"name"` + Address Address `csv:",inline"` + HomeAddress Address `csv:"home_address_,inline"` + WorkAddress Address `csv:"work_address_,inline"` + Age int `csv:"age,omitempty"` + } + + users := []User{ + { + Name: "John", + Address: Address{"Washington", "Boston"}, + HomeAddress: Address{"Boylston", "Boston"}, + WorkAddress: Address{"River St", "Cambridge"}, + Age: 26, + }, + } + + b, err := csvutil.Marshal(users) + if err != nil { + fmt.Println("error:", err) + } + + fmt.Printf("%s\n", b) + + // Output: + // name,street,city,home_address_street,home_address_city,work_address_street,work_address_city,age + // John,Washington,Boston,Boylston,Boston,River St,Cambridge,26 +} +``` + +Performance +------------ + +csvutil provides the best encoding and decoding performance with small memory usage. + +### Unmarshal + +[benchmark code](https://gist.github.com/jszwec/e8515e741190454fa3494bcd3e1f100f) + +#### csvutil: +``` +BenchmarkUnmarshal/csvutil.Unmarshal/1_record-12 280696 4516 ns/op 7332 B/op 26 allocs/op +BenchmarkUnmarshal/csvutil.Unmarshal/10_records-12 95750 11517 ns/op 8356 B/op 35 allocs/op +BenchmarkUnmarshal/csvutil.Unmarshal/100_records-12 14997 83146 ns/op 18532 B/op 125 allocs/op +BenchmarkUnmarshal/csvutil.Unmarshal/1000_records-12 1485 750143 ns/op 121094 B/op 1025 allocs/op +BenchmarkUnmarshal/csvutil.Unmarshal/10000_records-12 154 7587205 ns/op 1136662 B/op 10025 allocs/op +BenchmarkUnmarshal/csvutil.Unmarshal/100000_records-12 14 76126616 ns/op 11808744 B/op 100025 allocs/op +``` + +#### gocsv: +``` +BenchmarkUnmarshal/gocsv.Unmarshal/1_record-12 141330 7499 ns/op 7795 B/op 97 allocs/op +BenchmarkUnmarshal/gocsv.Unmarshal/10_records-12 54252 21664 ns/op 13891 B/op 307 allocs/op +BenchmarkUnmarshal/gocsv.Unmarshal/100_records-12 6920 159662 ns/op 72644 B/op 2380 allocs/op +BenchmarkUnmarshal/gocsv.Unmarshal/1000_records-12 752 1556083 ns/op 650248 B/op 23083 allocs/op +BenchmarkUnmarshal/gocsv.Unmarshal/10000_records-12 72 17086623 ns/op 7017469 B/op 230092 allocs/op +BenchmarkUnmarshal/gocsv.Unmarshal/100000_records-12 7 163610749 ns/op 75004923 B/op 2300105 allocs/op +``` + +#### easycsv: +``` +BenchmarkUnmarshal/easycsv.ReadAll/1_record-12 101527 10662 ns/op 8855 B/op 81 allocs/op +BenchmarkUnmarshal/easycsv.ReadAll/10_records-12 23325 51437 ns/op 24072 B/op 391 allocs/op +BenchmarkUnmarshal/easycsv.ReadAll/100_records-12 2402 447296 ns/op 170538 B/op 3454 allocs/op +BenchmarkUnmarshal/easycsv.ReadAll/1000_records-12 272 4370854 ns/op 1595683 B/op 34057 allocs/op +BenchmarkUnmarshal/easycsv.ReadAll/10000_records-12 24 47502457 ns/op 18861808 B/op 340068 allocs/op +BenchmarkUnmarshal/easycsv.ReadAll/100000_records-12 3 468974170 ns/op 189427066 B/op 3400082 allocs/op +``` + +### Marshal + +[benchmark code](https://gist.github.com/jszwec/31980321e1852ebb5615a44ccf374f17) + +#### csvutil: +``` +BenchmarkMarshal/csvutil.Marshal/1_record-12 279558 4390 ns/op 9952 B/op 12 allocs/op +BenchmarkMarshal/csvutil.Marshal/10_records-12 82478 15608 ns/op 10800 B/op 21 allocs/op +BenchmarkMarshal/csvutil.Marshal/100_records-12 10275 117288 ns/op 28208 B/op 112 allocs/op +BenchmarkMarshal/csvutil.Marshal/1000_records-12 1075 1147473 ns/op 168508 B/op 1014 allocs/op +BenchmarkMarshal/csvutil.Marshal/10000_records-12 100 11985382 ns/op 1525973 B/op 10017 allocs/op +BenchmarkMarshal/csvutil.Marshal/100000_records-12 9 113640813 ns/op 22455873 B/op 100021 allocs/op +``` + +#### gocsv: +``` +BenchmarkMarshal/gocsv.Marshal/1_record-12 203052 6077 ns/op 5914 B/op 81 allocs/op +BenchmarkMarshal/gocsv.Marshal/10_records-12 50132 24585 ns/op 9284 B/op 360 allocs/op +BenchmarkMarshal/gocsv.Marshal/100_records-12 5480 212008 ns/op 51916 B/op 3151 allocs/op +BenchmarkMarshal/gocsv.Marshal/1000_records-12 514 2053919 ns/op 444506 B/op 31053 allocs/op +BenchmarkMarshal/gocsv.Marshal/10000_records-12 52 21066666 ns/op 4332377 B/op 310064 allocs/op +BenchmarkMarshal/gocsv.Marshal/100000_records-12 5 207408929 ns/op 51169419 B/op 3100077 allocs/op +``` diff --git a/vendor/github.com/jszwec/csvutil/_config.yml b/vendor/github.com/jszwec/csvutil/_config.yml new file mode 100644 index 0000000000..f4b41887d6 --- /dev/null +++ b/vendor/github.com/jszwec/csvutil/_config.yml @@ -0,0 +1,2 @@ +theme: jekyll-theme-cayman +markdown: GFM diff --git a/vendor/github.com/jszwec/csvutil/cache.go b/vendor/github.com/jszwec/csvutil/cache.go new file mode 100644 index 0000000000..7c5edd01d0 --- /dev/null +++ b/vendor/github.com/jszwec/csvutil/cache.go @@ -0,0 +1,178 @@ +package csvutil + +import ( + "reflect" + "sort" +) + +type field struct { + name string + baseType reflect.Type + typ reflect.Type + tag tag + index []int +} + +type fields []field + +func (fs fields) Len() int { return len(fs) } + +func (fs fields) Swap(i, j int) { fs[i], fs[j] = fs[j], fs[i] } + +func (fs fields) Less(i, j int) bool { + for k, n := range fs[i].index { + if n != fs[j].index[k] { + return n < fs[j].index[k] + } + } + return len(fs[i].index) < len(fs[j].index) +} + +type typeKey struct { + tag string + reflect.Type +} + +type fieldMap map[string]fields + +func (m fieldMap) insert(f field) { + fs, ok := m[f.name] + if !ok { + m[f.name] = append(fs, f) + return + } + + // insert only fields with the shortest path. + if len(fs[0].index) != len(f.index) { + return + } + + // fields that are tagged have priority. + if !f.tag.empty { + m[f.name] = append([]field{f}, fs...) + return + } + + m[f.name] = append(fs, f) +} + +func (m fieldMap) fields() fields { + out := make(fields, 0, len(m)) + for _, v := range m { + for i, f := range v { + if f.tag.empty != v[0].tag.empty { + v = v[:i] + break + } + } + if len(v) > 1 { + continue + } + out = append(out, v[0]) + } + sort.Sort(out) + return out +} + +func buildFields(k typeKey) fields { + type key struct { + reflect.Type + tag + } + + q := fields{{typ: k.Type}} + visited := make(map[key]struct{}) + fm := make(fieldMap) + + for len(q) > 0 { + f := q[0] + q = q[1:] + + key := key{f.typ, f.tag} + if _, ok := visited[key]; ok { + continue + } + visited[key] = struct{}{} + + depth := len(f.index) + + numField := f.typ.NumField() + for i := 0; i < numField; i++ { + sf := f.typ.Field(i) + + if sf.PkgPath != "" && !sf.Anonymous { + // unexported field + continue + } + + if sf.Anonymous { + t := sf.Type + if t.Kind() == reflect.Ptr { + t = t.Elem() + } + if sf.PkgPath != "" && t.Kind() != reflect.Struct { + // ignore embedded unexported non-struct fields. + continue + } + } + + tag := parseTag(k.tag, sf) + if tag.ignore { + continue + } + if f.tag.prefix != "" { + tag.prefix += f.tag.prefix + } + + ft := sf.Type + if ft.Kind() == reflect.Ptr { + ft = ft.Elem() + } + + newf := field{ + name: tag.prefix + tag.name, + baseType: sf.Type, + typ: ft, + tag: tag, + index: makeIndex(f.index, i), + } + + if sf.Anonymous && ft.Kind() == reflect.Struct && tag.empty { + q = append(q, newf) + continue + } + + if tag.inline && ft.Kind() == reflect.Struct { + q = append(q, newf) + continue + } + + fm.insert(newf) + + // look for duplicate nodes on the same level. Nodes won't be + // revisited, so write all fields for the current type now. + for _, v := range q { + if len(v.index) != depth { + break + } + if v.typ == f.typ && v.tag.prefix == tag.prefix { + // other nodes can have different path. + fm.insert(field{ + name: tag.prefix + tag.name, + baseType: sf.Type, + typ: ft, + tag: tag, + index: makeIndex(v.index, i), + }) + } + } + } + } + return fm.fields() +} + +func makeIndex(index []int, v int) []int { + out := make([]int, len(index), len(index)+1) + copy(out, index) + return append(out, v) +} diff --git a/vendor/github.com/jszwec/csvutil/cache_go17.go b/vendor/github.com/jszwec/csvutil/cache_go17.go new file mode 100644 index 0000000000..1c79bb9b93 --- /dev/null +++ b/vendor/github.com/jszwec/csvutil/cache_go17.go @@ -0,0 +1,30 @@ +// +build !go1.9 + +package csvutil + +import ( + "sync" +) + +var fieldCache = struct { + mtx sync.RWMutex + m map[typeKey][]field +}{m: make(map[typeKey][]field)} + +func cachedFields(k typeKey) fields { + fieldCache.mtx.RLock() + fields, ok := fieldCache.m[k] + fieldCache.mtx.RUnlock() + + if ok { + return fields + } + + fields = buildFields(k) + + fieldCache.mtx.Lock() + fieldCache.m[k] = fields + fieldCache.mtx.Unlock() + + return fields +} diff --git a/vendor/github.com/jszwec/csvutil/cache_go19.go b/vendor/github.com/jszwec/csvutil/cache_go19.go new file mode 100644 index 0000000000..81799f1d1b --- /dev/null +++ b/vendor/github.com/jszwec/csvutil/cache_go19.go @@ -0,0 +1,18 @@ +// +build go1.9 + +package csvutil + +import ( + "sync" +) + +var fieldCache sync.Map // map[typeKey][]field + +func cachedFields(k typeKey) fields { + if v, ok := fieldCache.Load(k); ok { + return v.(fields) + } + + v, _ := fieldCache.LoadOrStore(k, buildFields(k)) + return v.(fields) +} diff --git a/vendor/github.com/jszwec/csvutil/csvutil.go b/vendor/github.com/jszwec/csvutil/csvutil.go new file mode 100644 index 0000000000..655105c048 --- /dev/null +++ b/vendor/github.com/jszwec/csvutil/csvutil.go @@ -0,0 +1,223 @@ +package csvutil + +import ( + "bytes" + "encoding/csv" + "io" + "reflect" +) + +const defaultTag = "csv" + +var ( + _bytes = reflect.TypeOf(([]byte)(nil)) + _error = reflect.TypeOf((*error)(nil)).Elem() +) + +// Unmarshal parses the CSV-encoded data and stores the result in the slice or +// the array pointed to by v. If v is nil or not a pointer to a struct slice or +// struct array, Unmarshal returns an InvalidUnmarshalError. +// +// Unmarshal uses the std encoding/csv.Reader for parsing and csvutil.Decoder +// for populating the struct elements in the provided slice. For exact decoding +// rules look at the Decoder's documentation. +// +// The first line in data is treated as a header. Decoder will use it to map +// csv columns to struct's fields. +// +// In case of success the provided slice will be reinitialized and its content +// fully replaced with decoded data. +func Unmarshal(data []byte, v interface{}) error { + val := reflect.ValueOf(v) + + if val.Kind() != reflect.Ptr || val.IsNil() { + return &InvalidUnmarshalError{Type: reflect.TypeOf(v)} + } + + switch val.Type().Elem().Kind() { + case reflect.Slice, reflect.Array: + default: + return &InvalidUnmarshalError{Type: val.Type()} + } + + typ := val.Type().Elem() + + if walkType(typ.Elem()).Kind() != reflect.Struct { + return &InvalidUnmarshalError{Type: val.Type()} + } + + dec, err := NewDecoder(newCSVReader(bytes.NewReader(data))) + if err == io.EOF { + return nil + } else if err != nil { + return err + } + + // for the array just call decodeArray directly; for slice values call the + // optimized code for better performance. + + if typ.Kind() == reflect.Array { + return dec.decodeArray(val.Elem()) + } + + c := countRecords(data) + slice := reflect.MakeSlice(typ, c, c) + + var i int + for ; ; i++ { + // just in case countRecords counts it wrong. + if i >= c && i >= slice.Len() { + slice = reflect.Append(slice, reflect.New(typ.Elem()).Elem()) + } + + if err := dec.Decode(slice.Index(i).Addr().Interface()); err == io.EOF { + break + } else if err != nil { + return err + } + } + + val.Elem().Set(slice.Slice3(0, i, i)) + return nil +} + +// Marshal returns the CSV encoding of slice or array v. If v is not a slice or +// elements are not structs then Marshal returns InvalidMarshalError. +// +// Marshal uses the std encoding/csv.Writer with its default settings for csv +// encoding. +// +// Marshal will always encode the CSV header even for the empty slice. +// +// For the exact encoding rules look at Encoder.Encode method. +func Marshal(v interface{}) ([]byte, error) { + val := walkValue(reflect.ValueOf(v)) + + if !val.IsValid() { + return nil, &InvalidMarshalError{} + } + + switch val.Kind() { + case reflect.Array, reflect.Slice: + default: + return nil, &InvalidMarshalError{Type: reflect.ValueOf(v).Type()} + } + + typ := walkType(val.Type().Elem()) + if typ.Kind() != reflect.Struct { + return nil, &InvalidMarshalError{Type: reflect.ValueOf(v).Type()} + } + + var buf bytes.Buffer + w := csv.NewWriter(&buf) + enc := NewEncoder(w) + + if err := enc.encodeHeader(typ); err != nil { + return nil, err + } + + if err := enc.encodeArray(val); err != nil { + return nil, err + } + + w.Flush() + if err := w.Error(); err != nil { + return nil, err + } + return buf.Bytes(), nil +} + +func countRecords(s []byte) (n int) { + var prev byte + inQuote := false + for { + if len(s) == 0 && prev != '"' { + return n + } + + i := bytes.IndexAny(s, "\n\"") + if i == -1 { + return n + 1 + } + + switch s[i] { + case '\n': + if !inQuote && (i > 0 || prev == '"') { + n++ + } + case '"': + inQuote = !inQuote + } + + prev = s[i] + s = s[i+1:] + } +} + +// Header scans the provided struct type and generates a CSV header for it. +// +// Field names are written in the same order as struct fields are defined. +// Embedded struct's fields are treated as if they were part of the outer struct. +// Fields that are embedded types and that are tagged are treated like any +// other field. +// +// Unexported fields and fields with tag "-" are ignored. +// +// Tagged fields have the priority over non tagged fields with the same name. +// +// Following the Go visibility rules if there are multiple fields with the same +// name (tagged or not tagged) on the same level and choice between them is +// ambiguous, then all these fields will be ignored. +// +// It is a good practice to call Header once for each type. The suitable place +// for calling it is init function. Look at Decoder.DecodingDataWithNoHeader +// example. +// +// If tag is left empty the default "csv" will be used. +// +// Header will return UnsupportedTypeError if the provided value is nil or is +// not a struct. +func Header(v interface{}, tag string) ([]string, error) { + typ, err := valueType(v) + if err != nil { + return nil, err + } + + if tag == "" { + tag = defaultTag + } + + fields := cachedFields(typeKey{tag, typ}) + h := make([]string, len(fields)) + for i, f := range fields { + h[i] = f.name + } + return h, nil +} + +func valueType(v interface{}) (reflect.Type, error) { + val := reflect.ValueOf(v) + if !val.IsValid() { + return nil, &UnsupportedTypeError{} + } + +loop: + for { + switch val.Kind() { + case reflect.Ptr, reflect.Interface: + el := val.Elem() + if !el.IsValid() { + break loop + } + val = el + default: + break loop + } + } + + typ := walkType(val.Type()) + if typ.Kind() != reflect.Struct { + return nil, &UnsupportedTypeError{Type: typ} + } + return typ, nil +} diff --git a/vendor/github.com/jszwec/csvutil/csvutil_go17.go b/vendor/github.com/jszwec/csvutil/csvutil_go17.go new file mode 100644 index 0000000000..d19ef4e636 --- /dev/null +++ b/vendor/github.com/jszwec/csvutil/csvutil_go17.go @@ -0,0 +1,12 @@ +// +build !go1.9 + +package csvutil + +import ( + "encoding/csv" + "io" +) + +func newCSVReader(r io.Reader) *csv.Reader { + return csv.NewReader(r) +} diff --git a/vendor/github.com/jszwec/csvutil/csvutil_go19.go b/vendor/github.com/jszwec/csvutil/csvutil_go19.go new file mode 100644 index 0000000000..2bfaa1ed56 --- /dev/null +++ b/vendor/github.com/jszwec/csvutil/csvutil_go19.go @@ -0,0 +1,14 @@ +// +build go1.9 + +package csvutil + +import ( + "encoding/csv" + "io" +) + +func newCSVReader(r io.Reader) *csv.Reader { + rr := csv.NewReader(r) + rr.ReuseRecord = true + return rr +} diff --git a/vendor/github.com/jszwec/csvutil/decode.go b/vendor/github.com/jszwec/csvutil/decode.go new file mode 100644 index 0000000000..0f3f6ac2bd --- /dev/null +++ b/vendor/github.com/jszwec/csvutil/decode.go @@ -0,0 +1,247 @@ +package csvutil + +import ( + "encoding" + "encoding/base64" + "reflect" + "strconv" +) + +var ( + textUnmarshaler = reflect.TypeOf((*encoding.TextUnmarshaler)(nil)).Elem() + csvUnmarshaler = reflect.TypeOf((*Unmarshaler)(nil)).Elem() +) + +var intDecoders = map[int]decodeFunc{ + 8: decodeIntN(8), + 16: decodeIntN(16), + 32: decodeIntN(32), + 64: decodeIntN(64), +} + +var uintDecoders = map[int]decodeFunc{ + 8: decodeUintN(8), + 16: decodeUintN(16), + 32: decodeUintN(32), + 64: decodeUintN(64), +} + +var ( + decodeFloat32 = decodeFloatN(32) + decodeFloat64 = decodeFloatN(64) +) + +type decodeFunc func(s string, v reflect.Value) error + +func decodeFuncValue(f reflect.Value) decodeFunc { + isIface := f.Type().In(1).Kind() == reflect.Interface + + return func(s string, v reflect.Value) error { + if isIface && v.Type().Kind() == reflect.Interface && v.IsNil() { + return &UnmarshalTypeError{Value: s, Type: v.Type()} + } + + out := f.Call([]reflect.Value{ + reflect.ValueOf([]byte(s)), + v, + }) + err, _ := out[0].Interface().(error) + return err + } +} + +func decodeFuncValuePtr(f reflect.Value) decodeFunc { + return func(s string, v reflect.Value) error { + out := f.Call([]reflect.Value{ + reflect.ValueOf([]byte(s)), + v.Addr(), + }) + err, _ := out[0].Interface().(error) + return err + } +} + +func decodeString(s string, v reflect.Value) error { + v.SetString(s) + return nil +} + +func decodeIntN(bits int) decodeFunc { + return func(s string, v reflect.Value) error { + n, err := strconv.ParseInt(s, 10, bits) + if err != nil { + return &UnmarshalTypeError{Value: s, Type: v.Type()} + } + v.SetInt(n) + return nil + } +} + +func decodeUintN(bits int) decodeFunc { + return func(s string, v reflect.Value) error { + n, err := strconv.ParseUint(s, 10, bits) + if err != nil { + return &UnmarshalTypeError{Value: s, Type: v.Type()} + } + v.SetUint(n) + return nil + } +} + +func decodeFloatN(bits int) decodeFunc { + return func(s string, v reflect.Value) error { + n, err := strconv.ParseFloat(s, bits) + if err != nil { + return &UnmarshalTypeError{Value: s, Type: v.Type()} + } + v.SetFloat(n) + return nil + } +} + +func decodeBool(s string, v reflect.Value) error { + b, err := strconv.ParseBool(s) + if err != nil { + return &UnmarshalTypeError{Value: s, Type: v.Type()} + } + v.SetBool(b) + return nil +} + +func decodePtrTextUnmarshaler(s string, v reflect.Value) error { + return decodeTextUnmarshaler(s, v.Addr()) +} + +func decodeTextUnmarshaler(s string, v reflect.Value) error { + return v.Interface().(encoding.TextUnmarshaler).UnmarshalText([]byte(s)) +} + +func decodePtrFieldUnmarshaler(s string, v reflect.Value) error { + return decodeFieldUnmarshaler(s, v.Addr()) +} + +func decodeFieldUnmarshaler(s string, v reflect.Value) error { + return v.Interface().(Unmarshaler).UnmarshalCSV([]byte(s)) +} + +func decodePtr(typ reflect.Type, funcMap map[reflect.Type]reflect.Value, ifaceFuncs []reflect.Value) (decodeFunc, error) { + next, err := decodeFn(typ.Elem(), funcMap, ifaceFuncs) + if err != nil { + return nil, err + } + + return func(s string, v reflect.Value) error { + if v.IsNil() { + v.Set(reflect.New(v.Type().Elem())) + } + return next(s, v.Elem()) + }, nil +} + +func decodeInterface(funcMap map[reflect.Type]reflect.Value, ifaceFuncs []reflect.Value) decodeFunc { + return func(s string, v reflect.Value) error { + if v.NumMethod() != 0 { + return &UnmarshalTypeError{ + Value: s, + Type: v.Type(), + } + } + + if v.IsNil() { + v.Set(reflect.ValueOf(s)) + return nil + } + + el := walkValue(v) + if !el.CanSet() { + if el.IsValid() { + // we may get a value receiver unmarshalers or registered funcs + // underneath the interface in which case we should call + // Unmarshal/Registered func. + typ := el.Type() + if f, ok := funcMap[typ]; ok { + return decodeFuncValue(f)(s, el) + } + for _, f := range ifaceFuncs { + if typ.AssignableTo(f.Type().In(1)) { + return decodeFuncValue(f)(s, el) + } + } + if typ.Implements(csvUnmarshaler) { + return decodeFieldUnmarshaler(s, el) + } + if typ.Implements(textUnmarshaler) { + return decodeTextUnmarshaler(s, el) + } + } + v.Set(reflect.ValueOf(s)) + return nil + } + + fn, err := decodeFn(el.Type(), funcMap, ifaceFuncs) + if err != nil { + return err + } + return fn(s, el) + } +} + +func decodeBytes(s string, v reflect.Value) error { + b, err := base64.StdEncoding.DecodeString(s) + if err != nil { + return err + } + v.SetBytes(b) + return nil +} + +func decodeFn(typ reflect.Type, funcMap map[reflect.Type]reflect.Value, ifaceFuncs []reflect.Value) (decodeFunc, error) { + if f, ok := funcMap[typ]; ok { + return decodeFuncValue(f), nil + } + if f, ok := funcMap[reflect.PtrTo(typ)]; ok { + return decodeFuncValuePtr(f), nil + } + + for _, f := range ifaceFuncs { + argType := f.Type().In(1) + if typ.AssignableTo(argType) { + return decodeFuncValue(f), nil + } + if reflect.PtrTo(typ).AssignableTo(argType) { + return decodeFuncValuePtr(f), nil + } + } + + if reflect.PtrTo(typ).Implements(csvUnmarshaler) { + return decodePtrFieldUnmarshaler, nil + } + if reflect.PtrTo(typ).Implements(textUnmarshaler) { + return decodePtrTextUnmarshaler, nil + } + + switch typ.Kind() { + case reflect.Ptr: + return decodePtr(typ, funcMap, ifaceFuncs) + case reflect.Interface: + return decodeInterface(funcMap, ifaceFuncs), nil + case reflect.String: + return decodeString, nil + case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: + return intDecoders[typ.Bits()], nil + case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64: + return uintDecoders[typ.Bits()], nil + case reflect.Float32: + return decodeFloat32, nil + case reflect.Float64: + return decodeFloat64, nil + case reflect.Bool: + return decodeBool, nil + case reflect.Slice: + if typ.Elem().Kind() == reflect.Uint8 { + return decodeBytes, nil + } + } + + return nil, &UnsupportedTypeError{Type: typ} +} diff --git a/vendor/github.com/jszwec/csvutil/decoder.go b/vendor/github.com/jszwec/csvutil/decoder.go new file mode 100644 index 0000000000..ab949dfda1 --- /dev/null +++ b/vendor/github.com/jszwec/csvutil/decoder.go @@ -0,0 +1,487 @@ +package csvutil + +import ( + "io" + "reflect" +) + +type decField struct { + columnIndex int + field + decodeFunc + zero interface{} +} + +// A Decoder reads and decodes string records into structs. +type Decoder struct { + // Tag defines which key in the struct field's tag to scan for names and + // options (Default: 'csv'). + Tag string + + // If true, Decoder will return a MissingColumnsError if it discovers + // that any of the columns are missing. This means that a CSV input + // will be required to contain all columns that were defined in the + // provided struct. + DisallowMissingColumns bool + + // If not nil, Map is a function that is called for each field in the csv + // record before decoding the data. It allows mapping certain string values + // for specific columns or types to a known format. Decoder calls Map with + // the current column name (taken from header) and a zero non-pointer value + // of a type to which it is going to decode data into. Implementations + // should use type assertions to recognize the type. + // + // The good example of use case for Map is if NaN values are represented by + // eg 'n/a' string, implementing a specific Map function for all floats + // could map 'n/a' back into 'NaN' to allow successful decoding. + // + // Use Map with caution. If the requirements of column or type are not met + // Map should return 'field', since it is the original value that was + // read from the csv input, this would indicate no change. + // + // If struct field is an interface v will be of type string, unless the + // struct field contains a settable pointer value - then v will be a zero + // value of that type. + // + // Map must be set before the first call to Decode and not changed after it. + Map func(field, col string, v interface{}) string + + r Reader + typeKey typeKey + hmap map[string]int + header []string + record []string + cache []decField + unused []int + funcMap map[reflect.Type]reflect.Value + ifaceFuncs []reflect.Value +} + +// NewDecoder returns a new decoder that reads from r. +// +// Decoder will match struct fields according to the given header. +// +// If header is empty NewDecoder will read one line and treat it as a header. +// +// Records coming from r must be of the same length as the header. +// +// NewDecoder may return io.EOF if there is no data in r and no header was +// provided by the caller. +func NewDecoder(r Reader, header ...string) (dec *Decoder, err error) { + if len(header) == 0 { + header, err = r.Read() + if err != nil { + return nil, err + } + } + + h := make([]string, len(header)) + copy(h, header) + header = h + + m := make(map[string]int, len(header)) + for i, h := range header { + m[h] = i + } + + return &Decoder{ + r: r, + header: header, + hmap: m, + unused: make([]int, 0, len(header)), + }, nil +} + +// Decode reads the next string record or records from its input and stores it +// in the value pointed to by v which must be a pointer to a struct, struct slice +// or struct array. +// +// Decode matches all exported struct fields based on the header. Struct fields +// can be adjusted by using tags. +// +// The "omitempty" option specifies that the field should be omitted from +// the decoding if record's field is an empty string. +// +// Examples of struct field tags and their meanings: +// // Decode matches this field with "myName" header column. +// Field int `csv:"myName"` +// +// // Decode matches this field with "Field" header column. +// Field int +// +// // Decode matches this field with "myName" header column and decoding is not +// // called if record's field is an empty string. +// Field int `csv:"myName,omitempty"` +// +// // Decode matches this field with "Field" header column and decoding is not +// // called if record's field is an empty string. +// Field int `csv:",omitempty"` +// +// // Decode ignores this field. +// Field int `csv:"-"` +// +// // Decode treats this field exactly as if it was an embedded field and +// // matches header columns that start with "my_prefix_" to all fields of this +// // type. +// Field Struct `csv:"my_prefix_,inline"` +// +// // Decode treats this field exactly as if it was an embedded field. +// Field Struct `csv:",inline"` +// +// By default decode looks for "csv" tag, but this can be changed by setting +// Decoder.Tag field. +// +// To Decode into a custom type v must implement csvutil.Unmarshaler or +// encoding.TextUnmarshaler. +// +// Anonymous struct fields with tags are treated like normal fields and they +// must implement csvutil.Unmarshaler or encoding.TextUnmarshaler unless inline +// tag is specified. +// +// Anonymous struct fields without tags are populated just as if they were +// part of the main struct. However, fields in the main struct have bigger +// priority and they are populated first. If main struct and anonymous struct +// field have the same fields, the main struct's fields will be populated. +// +// Fields of type []byte expect the data to be base64 encoded strings. +// +// Float fields are decoded to NaN if a string value is 'NaN'. This check +// is case insensitive. +// +// Interface fields are decoded to strings unless they contain settable pointer +// value. +// +// Pointer fields are decoded to nil if a string value is empty. +// +// If v is a slice, Decode resets it and reads the input until EOF, storing all +// decoded values in the given slice. Decode returns nil on EOF. +// +// If v is an array, Decode reads the input until EOF or until it decodes all +// corresponding array elements. If the input contains less elements than the +// array, the additional Go array elements are set to zero values. Decode +// returns nil on EOF unless there were no records decoded. +// +// Fields with inline tags that have a non-empty prefix must not be cyclic +// structures. Passing such values to Decode will result in an infinite loop. +func (d *Decoder) Decode(v interface{}) (err error) { + val := reflect.ValueOf(v) + if val.Kind() != reflect.Ptr || val.IsNil() { + return &InvalidDecodeError{Type: reflect.TypeOf(v)} + } + + elem := indirect(val.Elem()) + switch elem.Kind() { + case reflect.Struct: + return d.decodeStruct(elem) + case reflect.Slice: + return d.decodeSlice(elem) + case reflect.Array: + return d.decodeArray(elem) + case reflect.Interface, reflect.Invalid: + elem = walkValue(elem) + if elem.Kind() != reflect.Invalid { + return &InvalidDecodeError{Type: elem.Type()} + } + return &InvalidDecodeError{Type: val.Type()} + default: + return &InvalidDecodeError{Type: reflect.PtrTo(elem.Type())} + } +} + +// Record returns the most recently read record. The slice is valid until the +// next call to Decode. +func (d *Decoder) Record() []string { + return d.record +} + +// Header returns the first line that came from the reader, or returns the +// defined header by the caller. +func (d *Decoder) Header() []string { + header := make([]string, len(d.header)) + copy(header, d.header) + return header +} + +// Unused returns a list of column indexes that were not used during decoding +// due to lack of matching struct field. +func (d *Decoder) Unused() []int { + if len(d.unused) == 0 { + return nil + } + + indices := make([]int, len(d.unused)) + copy(indices, d.unused) + return indices +} + +// Register registers a custom decoding function for a concrete type or interface. +// The argument f must be of type: +// func([]byte, T) error +// +// T must be a concrete type such as *time.Time, or interface that has at least one +// method. +// +// During decoding, fields are matched by the concrete type first. If match is not +// found then Decoder looks if field implements any of the registered interfaces +// in order they were registered. +// +// Register panics if: +// - f does not match the right signature +// - f is an empty interface +// - f was already registered +// +// Register is based on the encoding/json proposal: +// https://github.com/golang/go/issues/5901. +func (d *Decoder) Register(f interface{}) { + v := reflect.ValueOf(f) + typ := v.Type() + + if typ.Kind() != reflect.Func || + typ.NumIn() != 2 || typ.NumOut() != 1 || + typ.In(0) != _bytes || typ.Out(0) != _error { + panic("csvutil: func must be of type func([]byte, T) error") + } + + argType := typ.In(1) + + if argType.Kind() == reflect.Interface && argType.NumMethod() == 0 { + panic("csvutil: func argument type must not be an empty interface") + } + + if d.funcMap == nil { + d.funcMap = make(map[reflect.Type]reflect.Value) + } + + if _, ok := d.funcMap[argType]; ok { + panic("csvutil: func " + typ.String() + " already registered") + } + + d.funcMap[argType] = v + + if argType.Kind() == reflect.Interface { + d.ifaceFuncs = append(d.ifaceFuncs, v) + } +} + +func (d *Decoder) decodeSlice(slice reflect.Value) error { + typ := slice.Type().Elem() + if walkType(typ).Kind() != reflect.Struct { + return &InvalidDecodeError{Type: reflect.PtrTo(slice.Type())} + } + + slice.SetLen(0) + + var c int + for ; ; c++ { + v := reflect.New(typ) + + err := d.decodeStruct(indirect(v)) + if err == io.EOF { + if c == 0 { + return io.EOF + } + break + } + + // we want to ensure that we append this element to the slice even if it + // was partially decoded due to error. This is how JSON pkg does it. + slice.Set(reflect.Append(slice, v.Elem())) + if err != nil { + return err + } + } + + slice.Set(slice.Slice3(0, c, c)) + return nil +} + +func (d *Decoder) decodeArray(v reflect.Value) error { + if walkType(v.Type().Elem()).Kind() != reflect.Struct { + return &InvalidDecodeError{Type: reflect.PtrTo(v.Type())} + } + + l := v.Len() + + var i int + for ; i < l; i++ { + if err := d.decodeStruct(indirect(v.Index(i))); err == io.EOF { + if i == 0 { + return io.EOF + } + break + } else if err != nil { + return err + } + } + + zero := reflect.Zero(v.Type().Elem()) + for i := i; i < l; i++ { + v.Index(i).Set(zero) + } + return nil +} + +func (d *Decoder) decodeStruct(v reflect.Value) (err error) { + d.record, err = d.r.Read() + if err != nil { + return err + } + + if len(d.record) != len(d.header) { + return ErrFieldCount + } + + return d.unmarshal(d.record, v) +} + +func (d *Decoder) unmarshal(record []string, v reflect.Value) error { + fields, err := d.fields(typeKey{d.tag(), v.Type()}) + if err != nil { + return err + } + +fieldLoop: + for _, f := range fields { + isBlank := record[f.columnIndex] == "" + if f.tag.omitEmpty && isBlank { + continue + } + + fv := v + for n, i := range f.index { + fv = fv.Field(i) + if fv.Kind() == reflect.Ptr { + if fv.IsNil() { + if isBlank && n == len(f.index)-1 { // ensure we are on the leaf. + continue fieldLoop + } + // this can happen if a field is an unexported embedded + // pointer type. In Go prior to 1.10 it was possible to + // set such value because of a bug in the reflect package + // https://github.com/golang/go/issues/21353 + if !fv.CanSet() { + return errPtrUnexportedStruct(fv.Type()) + } + fv.Set(reflect.New(fv.Type().Elem())) + } + + if isBlank && n == len(f.index)-1 { // ensure we are on the leaf. + fv.Set(reflect.Zero(fv.Type())) + continue fieldLoop + } + + if n != len(f.index)-1 { + fv = fv.Elem() // walk pointer until we are on the the leaf. + } + } + } + + s := record[f.columnIndex] + if d.Map != nil && f.zero != nil { + zero := f.zero + if fv := walkPtr(fv); fv.Kind() == reflect.Interface && !fv.IsNil() { + if v := walkValue(fv); v.CanSet() { + zero = reflect.Zero(v.Type()).Interface() + } + } + s = d.Map(s, d.header[f.columnIndex], zero) + } + + if err := f.decodeFunc(s, fv); err != nil { + return err + } + } + return nil +} + +func (d *Decoder) fields(k typeKey) ([]decField, error) { + if k == d.typeKey { + return d.cache, nil + } + + var ( + fields = cachedFields(k) + decFields = make([]decField, 0, len(fields)) + used = make([]bool, len(d.header)) + missingCols []string + ) + for _, f := range fields { + i, ok := d.hmap[f.name] + if !ok { + if d.DisallowMissingColumns { + missingCols = append(missingCols, f.name) + } + continue + } + + fn, err := decodeFn(f.baseType, d.funcMap, d.ifaceFuncs) + if err != nil { + return nil, err + } + + df := decField{ + columnIndex: i, + field: f, + decodeFunc: fn, + } + + if d.Map != nil { + switch f.typ.Kind() { + case reflect.Interface: + df.zero = "" // interface values are decoded to strings + default: + df.zero = reflect.Zero(walkType(f.typ)).Interface() + } + } + + decFields = append(decFields, df) + used[i] = true + } + + if len(missingCols) > 0 { + return nil, &MissingColumnsError{ + Columns: missingCols, + } + } + + d.unused = d.unused[:0] + for i, b := range used { + if !b { + d.unused = append(d.unused, i) + } + } + + d.cache, d.typeKey = decFields, k + return d.cache, nil +} + +func (d *Decoder) tag() string { + if d.Tag == "" { + return defaultTag + } + return d.Tag +} + +func indirect(v reflect.Value) reflect.Value { + for { + switch v.Kind() { + case reflect.Interface: + if v.IsNil() { + return v + } + e := v.Elem() + if e.Kind() == reflect.Ptr && !e.IsNil() { + v = e + continue + } + return v + case reflect.Ptr: + if v.IsNil() { + v.Set(reflect.New(v.Type().Elem())) + } + v = v.Elem() + default: + return v + } + } +} diff --git a/vendor/github.com/jszwec/csvutil/doc.go b/vendor/github.com/jszwec/csvutil/doc.go new file mode 100644 index 0000000000..5cc26748c9 --- /dev/null +++ b/vendor/github.com/jszwec/csvutil/doc.go @@ -0,0 +1,6 @@ +// Package csvutil provides fast and idiomatic mapping between CSV and Go values. +// +// This package does not provide a CSV parser itself, it is based on the Reader and Writer +// interfaces which are implemented by eg. std csv package. This gives a possibility +// of choosing any other CSV writer or reader which may be more performant. +package csvutil diff --git a/vendor/github.com/jszwec/csvutil/encode.go b/vendor/github.com/jszwec/csvutil/encode.go new file mode 100644 index 0000000000..ce5a181347 --- /dev/null +++ b/vendor/github.com/jszwec/csvutil/encode.go @@ -0,0 +1,245 @@ +package csvutil + +import ( + "encoding" + "encoding/base64" + "reflect" + "strconv" +) + +var ( + textMarshaler = reflect.TypeOf((*encoding.TextMarshaler)(nil)).Elem() + csvMarshaler = reflect.TypeOf((*Marshaler)(nil)).Elem() +) + +var ( + encodeFloat32 = encodeFloatN(32) + encodeFloat64 = encodeFloatN(64) +) + +type encodeFunc func(buf []byte, v reflect.Value, omitempty bool) ([]byte, error) + +func encodeFuncValue(fn reflect.Value) encodeFunc { + return func(buf []byte, v reflect.Value, omitempty bool) ([]byte, error) { + out := fn.Call([]reflect.Value{v}) + err, _ := out[1].Interface().(error) + if err != nil { + return nil, err + } + return append(buf, out[0].Bytes()...), nil + } +} + +func encodeFuncValuePtr(fn reflect.Value) encodeFunc { + return func(buf []byte, v reflect.Value, omitempty bool) ([]byte, error) { + if !v.CanAddr() { + fallback, err := encodeFn(v.Type(), false, nil, nil) + if err != nil { + return nil, err + } + return fallback(buf, v, omitempty) + } + + out := fn.Call([]reflect.Value{v.Addr()}) + err, _ := out[1].Interface().(error) + if err != nil { + return nil, err + } + return append(buf, out[0].Bytes()...), nil + } +} + +func encodeString(buf []byte, v reflect.Value, omitempty bool) ([]byte, error) { + return append(buf, v.String()...), nil +} + +func encodeInt(buf []byte, v reflect.Value, omitempty bool) ([]byte, error) { + n := v.Int() + if n == 0 && omitempty { + return buf, nil + } + return strconv.AppendInt(buf, n, 10), nil +} + +func encodeUint(buf []byte, v reflect.Value, omitempty bool) ([]byte, error) { + n := v.Uint() + if n == 0 && omitempty { + return buf, nil + } + return strconv.AppendUint(buf, n, 10), nil +} + +func encodeFloatN(bits int) encodeFunc { + return func(buf []byte, v reflect.Value, omitempty bool) ([]byte, error) { + f := v.Float() + if f == 0 && omitempty { + return buf, nil + } + return strconv.AppendFloat(buf, f, 'G', -1, bits), nil + } +} + +func encodeBool(buf []byte, v reflect.Value, omitempty bool) ([]byte, error) { + t := v.Bool() + if !t && omitempty { + return buf, nil + } + return strconv.AppendBool(buf, t), nil +} + +func encodeInterface(funcMap map[reflect.Type]reflect.Value, funcs []reflect.Value) encodeFunc { + return func(buf []byte, v reflect.Value, omitempty bool) ([]byte, error) { + if !v.IsValid() || v.IsNil() || !v.Elem().IsValid() { + return buf, nil + } + + v = v.Elem() + canAddr := v.Kind() == reflect.Ptr + + switch v.Kind() { + case reflect.Ptr, reflect.Interface: + if v.IsNil() { + return buf, nil + } + default: + } + + enc, err := encodeFn(v.Type(), canAddr, funcMap, funcs) + if err != nil { + return nil, err + } + return enc(buf, v, omitempty) + } +} + +func encodePtrMarshaler(buf []byte, v reflect.Value, omitempty bool) ([]byte, error) { + if v.CanAddr() { + return encodeMarshaler(buf, v.Addr(), omitempty) + } + + fallback, err := encodeFn(v.Type(), false, nil, nil) + if err != nil { + return nil, err + } + return fallback(buf, v, omitempty) +} + +func encodeTextMarshaler(buf []byte, v reflect.Value, _ bool) ([]byte, error) { + if v.Kind() == reflect.Ptr && v.IsNil() { + return buf, nil + } + + b, err := v.Interface().(encoding.TextMarshaler).MarshalText() + if err != nil { + return nil, &MarshalerError{Type: v.Type(), MarshalerType: "MarshalText", Err: err} + } + return append(buf, b...), nil +} + +func encodePtrTextMarshaler(buf []byte, v reflect.Value, omitempty bool) ([]byte, error) { + if v.CanAddr() { + return encodeTextMarshaler(buf, v.Addr(), omitempty) + } + + fallback, err := encodeFn(v.Type(), false, nil, nil) + if err != nil { + return nil, err + } + return fallback(buf, v, omitempty) +} + +func encodeMarshaler(buf []byte, v reflect.Value, _ bool) ([]byte, error) { + if v.Kind() == reflect.Ptr && v.IsNil() { + return buf, nil + } + + b, err := v.Interface().(Marshaler).MarshalCSV() + if err != nil { + return nil, &MarshalerError{Type: v.Type(), MarshalerType: "MarshalCSV", Err: err} + } + return append(buf, b...), nil +} + +func encodePtr(typ reflect.Type, canAddr bool, funcMap map[reflect.Type]reflect.Value, funcs []reflect.Value) (encodeFunc, error) { + next, err := encodeFn(typ.Elem(), canAddr, funcMap, funcs) + if err != nil { + return nil, err + } + return func(buf []byte, v reflect.Value, omitempty bool) ([]byte, error) { + if v.IsNil() { + return buf, nil + } + return next(buf, v.Elem(), omitempty) + }, nil +} + +func encodeBytes(buf []byte, v reflect.Value, _ bool) ([]byte, error) { + data := v.Bytes() + + l := len(buf) + buf = append(buf, make([]byte, base64.StdEncoding.EncodedLen(len(data)))...) + base64.StdEncoding.Encode(buf[l:], data) + return buf, nil +} + +func encodeFn(typ reflect.Type, canAddr bool, funcMap map[reflect.Type]reflect.Value, funcs []reflect.Value) (encodeFunc, error) { + if v, ok := funcMap[typ]; ok { + return encodeFuncValue(v), nil + } + + if v, ok := funcMap[reflect.PtrTo(typ)]; ok && canAddr { + return encodeFuncValuePtr(v), nil + } + + for _, v := range funcs { + argType := v.Type().In(0) + if typ.AssignableTo(argType) { + return encodeFuncValue(v), nil + } + + if canAddr && reflect.PtrTo(typ).AssignableTo(argType) { + return encodeFuncValuePtr(v), nil + } + } + + if typ.Implements(csvMarshaler) { + return encodeMarshaler, nil + } + + if canAddr && reflect.PtrTo(typ).Implements(csvMarshaler) { + return encodePtrMarshaler, nil + } + + if typ.Implements(textMarshaler) { + return encodeTextMarshaler, nil + } + + if canAddr && reflect.PtrTo(typ).Implements(textMarshaler) { + return encodePtrTextMarshaler, nil + } + + switch typ.Kind() { + case reflect.String: + return encodeString, nil + case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: + return encodeInt, nil + case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64: + return encodeUint, nil + case reflect.Float32: + return encodeFloat32, nil + case reflect.Float64: + return encodeFloat64, nil + case reflect.Bool: + return encodeBool, nil + case reflect.Interface: + return encodeInterface(funcMap, funcs), nil + case reflect.Ptr: + return encodePtr(typ, canAddr, funcMap, funcs) + case reflect.Slice: + if typ.Elem().Kind() == reflect.Uint8 { + return encodeBytes, nil + } + } + + return nil, &UnsupportedTypeError{Type: typ} +} diff --git a/vendor/github.com/jszwec/csvutil/encoder.go b/vendor/github.com/jszwec/csvutil/encoder.go new file mode 100644 index 0000000000..74034fa2c0 --- /dev/null +++ b/vendor/github.com/jszwec/csvutil/encoder.go @@ -0,0 +1,356 @@ +package csvutil + +import ( + "reflect" +) + +const defaultBufSize = 4096 + +type encField struct { + field + encodeFunc +} + +type encCache struct { + fields []encField + buf []byte + index []int + record []string +} + +func newEncCache(k typeKey, funcMap map[reflect.Type]reflect.Value, funcs []reflect.Value) (_ *encCache, err error) { + fields := cachedFields(k) + encFields := make([]encField, len(fields)) + + for i, f := range fields { + fn, err := encodeFn(f.baseType, true, funcMap, funcs) + if err != nil { + return nil, err + } + + encFields[i] = encField{ + field: f, + encodeFunc: fn, + } + } + return &encCache{ + fields: encFields, + buf: make([]byte, 0, defaultBufSize), + index: make([]int, len(encFields)), + record: make([]string, len(encFields)), + }, nil +} + +// Encoder writes structs CSV representations to the output stream. +type Encoder struct { + // Tag defines which key in the struct field's tag to scan for names and + // options (Default: 'csv'). + Tag string + + // If AutoHeader is true, a struct header is encoded during the first call + // to Encode automatically (Default: true). + AutoHeader bool + + w Writer + c *encCache + noHeader bool + typeKey typeKey + funcMap map[reflect.Type]reflect.Value + ifaceFuncs []reflect.Value +} + +// NewEncoder returns a new encoder that writes to w. +func NewEncoder(w Writer) *Encoder { + return &Encoder{ + w: w, + noHeader: true, + AutoHeader: true, + } +} + +// Register registers a custom encoding function for a concrete type or interface. +// The argument f must be of type: +// func(T) ([]byte, error) +// +// T must be a concrete type such as Foo or *Foo, or interface that has at +// least one method. +// +// During encoding, fields are matched by the concrete type first. If match is not +// found then Encoder looks if field implements any of the registered interfaces +// in order they were registered. +// +// Register panics if: +// - f does not match the right signature +// - f is an empty interface +// - f was already registered +// +// Register is based on the encoding/json proposal: +// https://github.com/golang/go/issues/5901. +func (e *Encoder) Register(f interface{}) { + v := reflect.ValueOf(f) + typ := v.Type() + + if typ.Kind() != reflect.Func || + typ.NumIn() != 1 || typ.NumOut() != 2 || + typ.Out(0) != _bytes || typ.Out(1) != _error { + panic("csvutil: func must be of type func(T) ([]byte, error)") + } + + argType := typ.In(0) + + if argType.Kind() == reflect.Interface && argType.NumMethod() == 0 { + panic("csvutil: func argument type must not be an empty interface") + } + + if e.funcMap == nil { + e.funcMap = make(map[reflect.Type]reflect.Value) + } + + if _, ok := e.funcMap[argType]; ok { + panic("csvutil: func " + typ.String() + " already registered") + } + + e.funcMap[argType] = v + + if argType.Kind() == reflect.Interface { + e.ifaceFuncs = append(e.ifaceFuncs, v) + } +} + +// Encode writes the CSV encoding of v to the output stream. The provided +// argument v must be a struct, struct slice or struct array. +// +// Only the exported fields will be encoded. +// +// First call to Encode will write a header unless EncodeHeader was called first +// or AutoHeader is false. Header names can be customized by using tags +// ('csv' by default), otherwise original Field names are used. +// +// Header and fields are written in the same order as struct fields are defined. +// Embedded struct's fields are treated as if they were part of the outer struct. +// Fields that are embedded types and that are tagged are treated like any +// other field, but they have to implement Marshaler or encoding.TextMarshaler +// interfaces. +// +// Marshaler interface has the priority over encoding.TextMarshaler. +// +// Tagged fields have the priority over non tagged fields with the same name. +// +// Following the Go visibility rules if there are multiple fields with the same +// name (tagged or not tagged) on the same level and choice between them is +// ambiguous, then all these fields will be ignored. +// +// Nil values will be encoded as empty strings. Same will happen if 'omitempty' +// tag is set, and the value is a default value like 0, false or nil interface. +// +// Bool types are encoded as 'true' or 'false'. +// +// Float types are encoded using strconv.FormatFloat with precision -1 and 'G' +// format. NaN values are encoded as 'NaN' string. +// +// Fields of type []byte are being encoded as base64-encoded strings. +// +// Fields can be excluded from encoding by using '-' tag option. +// +// Examples of struct tags: +// +// // Field appears as 'myName' header in CSV encoding. +// Field int `csv:"myName"` +// +// // Field appears as 'Field' header in CSV encoding. +// Field int +// +// // Field appears as 'myName' header in CSV encoding and is an empty string +// // if Field is 0. +// Field int `csv:"myName,omitempty"` +// +// // Field appears as 'Field' header in CSV encoding and is an empty string +// // if Field is 0. +// Field int `csv:",omitempty"` +// +// // Encode ignores this field. +// Field int `csv:"-"` +// +// // Encode treats this field exactly as if it was an embedded field and adds +// // "my_prefix_" to each field's name. +// Field Struct `csv:"my_prefix_,inline"` +// +// // Encode treats this field exactly as if it was an embedded field. +// Field Struct `csv:",inline"` +// +// Fields with inline tags that have a non-empty prefix must not be cyclic +// structures. Passing such values to Encode will result in an infinite loop. +// +// Encode doesn't flush data. The caller is responsible for calling Flush() if +// the used Writer supports it. +func (e *Encoder) Encode(v interface{}) error { + return e.encode(reflect.ValueOf(v)) +} + +// EncodeHeader writes the CSV header of the provided struct value to the output +// stream. The provided argument v must be a struct value. +// +// The first Encode method call will not write header if EncodeHeader was called +// before it. This method can be called in cases when a data set could be +// empty, but header is desired. +// +// EncodeHeader is like Header function, but it works with the Encoder and writes +// directly to the output stream. Look at Header documentation for the exact +// header encoding rules. +func (e *Encoder) EncodeHeader(v interface{}) error { + typ, err := valueType(v) + if err != nil { + return err + } + return e.encodeHeader(typ) +} + +func (e *Encoder) encode(v reflect.Value) error { + val := walkValue(v) + + if !val.IsValid() { + return &InvalidEncodeError{} + } + + switch val.Kind() { + case reflect.Struct: + return e.encodeStruct(val) + case reflect.Array, reflect.Slice: + if walkType(val.Type().Elem()).Kind() != reflect.Struct { + return &InvalidEncodeError{v.Type()} + } + return e.encodeArray(val) + default: + return &InvalidEncodeError{v.Type()} + } +} + +func (e *Encoder) encodeStruct(v reflect.Value) error { + if e.AutoHeader && e.noHeader { + if err := e.encodeHeader(v.Type()); err != nil { + return err + } + } + return e.marshal(v) +} + +func (e *Encoder) encodeArray(v reflect.Value) error { + l := v.Len() + for i := 0; i < l; i++ { + if err := e.encodeStruct(walkValue(v.Index(i))); err != nil { + return err + } + } + return nil +} + +func (e *Encoder) encodeHeader(typ reflect.Type) error { + fields, _, _, record, err := e.cache(typ) + if err != nil { + return err + } + + for i, f := range fields { + record[i] = f.name + } + + if err := e.w.Write(record); err != nil { + return err + } + + e.noHeader = false + return nil +} + +func (e *Encoder) marshal(v reflect.Value) error { + fields, buf, index, record, err := e.cache(v.Type()) + if err != nil { + return err + } + + for i, f := range fields { + v := walkIndex(v, f.index) + + omitempty := f.tag.omitEmpty + if v.Kind() == reflect.Ptr || v.Kind() == reflect.Interface { + // We should disable omitempty for pointer and interface values, + // because if it's nil we will automatically encode it as an empty + // string. However, the initialized pointer should not be affected, + // even if it's a default value. + omitempty = false + } + + if !v.IsValid() { + index[i] = 0 + continue + } + + b, err := f.encodeFunc(buf, v, omitempty) + if err != nil { + return err + } + index[i], buf = len(b)-len(buf), b + } + + out := string(buf) + for i, n := range index { + record[i], out = out[:n], out[n:] + } + e.c.buf = buf[:0] + + return e.w.Write(record) +} + +func (e *Encoder) tag() string { + if e.Tag == "" { + return defaultTag + } + return e.Tag +} + +func (e *Encoder) cache(typ reflect.Type) ([]encField, []byte, []int, []string, error) { + if k := (typeKey{e.tag(), typ}); k != e.typeKey { + c, err := newEncCache(k, e.funcMap, e.ifaceFuncs) + if err != nil { + return nil, nil, nil, nil, err + } + e.c, e.typeKey = c, k + } + return e.c.fields, e.c.buf[:0], e.c.index, e.c.record, nil +} + +func walkIndex(v reflect.Value, index []int) reflect.Value { + for _, i := range index { + v = walkPtr(v) + if !v.IsValid() { + return reflect.Value{} + } + v = v.Field(i) + } + return v +} + +func walkPtr(v reflect.Value) reflect.Value { + for v.Kind() == reflect.Ptr { + v = v.Elem() + } + return v +} + +func walkValue(v reflect.Value) reflect.Value { + for { + switch v.Kind() { + case reflect.Ptr, reflect.Interface: + v = v.Elem() + default: + return v + } + } +} + +func walkType(typ reflect.Type) reflect.Type { + for typ.Kind() == reflect.Ptr { + typ = typ.Elem() + } + return typ +} diff --git a/vendor/github.com/jszwec/csvutil/error.go b/vendor/github.com/jszwec/csvutil/error.go new file mode 100644 index 0000000000..7e2b452284 --- /dev/null +++ b/vendor/github.com/jszwec/csvutil/error.go @@ -0,0 +1,156 @@ +package csvutil + +import ( + "bytes" + "errors" + "fmt" + "reflect" + "strconv" +) + +// ErrFieldCount is returned when header's length doesn't match the length of +// the read record. +var ErrFieldCount = errors.New("wrong number of fields in record") + +// An UnmarshalTypeError describes a string value that was not appropriate for +// a value of a specific Go type. +type UnmarshalTypeError struct { + Value string // string value + Type reflect.Type // type of Go value it could not be assigned to +} + +func (e *UnmarshalTypeError) Error() string { + return "csvutil: cannot unmarshal " + strconv.Quote(e.Value) + " into Go value of type " + e.Type.String() +} + +// An UnsupportedTypeError is returned when attempting to encode or decode +// a value of an unsupported type. +type UnsupportedTypeError struct { + Type reflect.Type +} + +func (e *UnsupportedTypeError) Error() string { + if e.Type == nil { + return "csvutil: unsupported type: nil" + } + return "csvutil: unsupported type: " + e.Type.String() +} + +// An InvalidDecodeError describes an invalid argument passed to Decode. +// (The argument to Decode must be a non-nil struct pointer) +type InvalidDecodeError struct { + Type reflect.Type +} + +func (e *InvalidDecodeError) Error() string { + if e.Type == nil { + return "csvutil: Decode(nil)" + } + + if e.Type.Kind() != reflect.Ptr { + return "csvutil: Decode(non-pointer " + e.Type.String() + ")" + } + + typ := walkType(e.Type) + switch typ.Kind() { + case reflect.Struct: + case reflect.Slice, reflect.Array: + if typ.Elem().Kind() != reflect.Struct { + return "csvutil: Decode(invalid type " + e.Type.String() + ")" + } + default: + return "csvutil: Decode(invalid type " + e.Type.String() + ")" + } + + return "csvutil: Decode(nil " + e.Type.String() + ")" +} + +// An InvalidUnmarshalError describes an invalid argument passed to Unmarshal. +// (The argument to Unmarshal must be a non-nil slice of structs pointer) +type InvalidUnmarshalError struct { + Type reflect.Type +} + +func (e *InvalidUnmarshalError) Error() string { + if e.Type == nil { + return "csvutil: Unmarshal(nil)" + } + + if e.Type.Kind() != reflect.Ptr { + return "csvutil: Unmarshal(non-pointer " + e.Type.String() + ")" + } + + return "csvutil: Unmarshal(invalid type " + e.Type.String() + ")" +} + +// InvalidEncodeError is returned by Encode when the provided value was invalid. +type InvalidEncodeError struct { + Type reflect.Type +} + +func (e *InvalidEncodeError) Error() string { + if e.Type == nil { + return "csvutil: Encode(nil)" + } + return "csvutil: Encode(" + e.Type.String() + ")" +} + +// InvalidMarshalError is returned by Marshal when the provided value was invalid. +type InvalidMarshalError struct { + Type reflect.Type +} + +func (e *InvalidMarshalError) Error() string { + if e.Type == nil { + return "csvutil: Marshal(nil)" + } + + if walkType(e.Type).Kind() == reflect.Slice { + return "csvutil: Marshal(non struct slice " + e.Type.String() + ")" + } + + if walkType(e.Type).Kind() == reflect.Array { + return "csvutil: Marshal(non struct array " + e.Type.String() + ")" + } + + return "csvutil: Marshal(invalid type " + e.Type.String() + ")" +} + +// MarshalerError is returned by Encoder when MarshalCSV or MarshalText returned +// an error. +type MarshalerError struct { + Type reflect.Type + MarshalerType string + Err error +} + +func (e *MarshalerError) Error() string { + return "csvutil: error calling " + e.MarshalerType + " for type " + e.Type.String() + ": " + e.Err.Error() +} + +// Unwrap implements Unwrap interface for errors package in Go1.13+. +func (e *MarshalerError) Unwrap() error { + return e.Err +} + +func errPtrUnexportedStruct(typ reflect.Type) error { + return fmt.Errorf("csvutil: cannot decode into a pointer to unexported struct: %s", typ) +} + +// MissingColumnsError is returned by Decoder only when DisallowMissingColumns +// option was set to true. It contains a list of all missing columns. +type MissingColumnsError struct { + Columns []string +} + +func (e *MissingColumnsError) Error() string { + var b bytes.Buffer + b.WriteString("csvutil: missing columns: ") + for i, c := range e.Columns { + if i > 0 { + b.WriteString(", ") + } + fmt.Fprintf(&b, "%q", c) + } + return b.String() +} diff --git a/vendor/github.com/jszwec/csvutil/go.mod b/vendor/github.com/jszwec/csvutil/go.mod new file mode 100644 index 0000000000..68349b4513 --- /dev/null +++ b/vendor/github.com/jszwec/csvutil/go.mod @@ -0,0 +1,3 @@ +module github.com/jszwec/csvutil + +go 1.13 diff --git a/vendor/github.com/jszwec/csvutil/interface.go b/vendor/github.com/jszwec/csvutil/interface.go new file mode 100644 index 0000000000..b0b45aa05d --- /dev/null +++ b/vendor/github.com/jszwec/csvutil/interface.go @@ -0,0 +1,29 @@ +package csvutil + +// Reader provides the interface for reading a single CSV record. +// +// If there is no data left to be read, Read returns (nil, io.EOF). +// +// It is implemented by csv.Reader. +type Reader interface { + Read() ([]string, error) +} + +// Writer provides the interface for writing a single CSV record. +// +// It is implemented by csv.Writer. +type Writer interface { + Write([]string) error +} + +// Unmarshaler is the interface implemented by types that can unmarshal +// a single record's field description of themselves. +type Unmarshaler interface { + UnmarshalCSV([]byte) error +} + +// Marshaler is the interface implemented by types that can marshal themselves +// into valid string. +type Marshaler interface { + MarshalCSV() ([]byte, error) +} diff --git a/vendor/github.com/jszwec/csvutil/tag.go b/vendor/github.com/jszwec/csvutil/tag.go new file mode 100644 index 0000000000..3c32e97327 --- /dev/null +++ b/vendor/github.com/jszwec/csvutil/tag.go @@ -0,0 +1,47 @@ +package csvutil + +import ( + "reflect" + "strings" +) + +type tag struct { + name string + prefix string + empty bool + omitEmpty bool + ignore bool + inline bool +} + +func parseTag(tagname string, field reflect.StructField) (t tag) { + tags := strings.Split(field.Tag.Get(tagname), ",") + if len(tags) == 1 && tags[0] == "" { + t.name = field.Name + t.empty = true + return + } + + switch tags[0] { + case "-": + t.ignore = true + return + case "": + t.name = field.Name + default: + t.name = tags[0] + } + + for _, tagOpt := range tags[1:] { + switch tagOpt { + case "omitempty": + t.omitEmpty = true + case "inline": + if walkType(field.Type).Kind() == reflect.Struct { + t.inline = true + t.prefix = tags[0] + } + } + } + return +} diff --git a/vendor/github.com/mitchellh/go-wordwrap/LICENSE.md b/vendor/github.com/mitchellh/go-wordwrap/LICENSE.md new file mode 100644 index 0000000000..2298515904 --- /dev/null +++ b/vendor/github.com/mitchellh/go-wordwrap/LICENSE.md @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014 Mitchell Hashimoto + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/vendor/github.com/mitchellh/go-wordwrap/README.md b/vendor/github.com/mitchellh/go-wordwrap/README.md new file mode 100644 index 0000000000..60ae311700 --- /dev/null +++ b/vendor/github.com/mitchellh/go-wordwrap/README.md @@ -0,0 +1,39 @@ +# go-wordwrap + +`go-wordwrap` (Golang package: `wordwrap`) is a package for Go that +automatically wraps words into multiple lines. The primary use case for this +is in formatting CLI output, but of course word wrapping is a generally useful +thing to do. + +## Installation and Usage + +Install using `go get github.com/mitchellh/go-wordwrap`. + +Full documentation is available at +http://godoc.org/github.com/mitchellh/go-wordwrap + +Below is an example of its usage ignoring errors: + +```go +wrapped := wordwrap.WrapString("foo bar baz", 3) +fmt.Println(wrapped) +``` + +Would output: + +``` +foo +bar +baz +``` + +## Word Wrap Algorithm + +This library doesn't use any clever algorithm for word wrapping. The wrapping +is actually very naive: whenever there is whitespace or an explicit linebreak. +The goal of this library is for word wrapping CLI output, so the input is +typically pretty well controlled human language. Because of this, the naive +approach typically works just fine. + +In the future, we'd like to make the algorithm more advanced. We would do +so without breaking the API. diff --git a/vendor/github.com/mitchellh/go-wordwrap/go.mod b/vendor/github.com/mitchellh/go-wordwrap/go.mod new file mode 100644 index 0000000000..2ae411b201 --- /dev/null +++ b/vendor/github.com/mitchellh/go-wordwrap/go.mod @@ -0,0 +1 @@ +module github.com/mitchellh/go-wordwrap diff --git a/vendor/github.com/mitchellh/go-wordwrap/wordwrap.go b/vendor/github.com/mitchellh/go-wordwrap/wordwrap.go new file mode 100644 index 0000000000..ac67205bc2 --- /dev/null +++ b/vendor/github.com/mitchellh/go-wordwrap/wordwrap.go @@ -0,0 +1,73 @@ +package wordwrap + +import ( + "bytes" + "unicode" +) + +// WrapString wraps the given string within lim width in characters. +// +// Wrapping is currently naive and only happens at white-space. A future +// version of the library will implement smarter wrapping. This means that +// pathological cases can dramatically reach past the limit, such as a very +// long word. +func WrapString(s string, lim uint) string { + // Initialize a buffer with a slightly larger size to account for breaks + init := make([]byte, 0, len(s)) + buf := bytes.NewBuffer(init) + + var current uint + var wordBuf, spaceBuf bytes.Buffer + + for _, char := range s { + if char == '\n' { + if wordBuf.Len() == 0 { + if current+uint(spaceBuf.Len()) > lim { + current = 0 + } else { + current += uint(spaceBuf.Len()) + spaceBuf.WriteTo(buf) + } + spaceBuf.Reset() + } else { + current += uint(spaceBuf.Len() + wordBuf.Len()) + spaceBuf.WriteTo(buf) + spaceBuf.Reset() + wordBuf.WriteTo(buf) + wordBuf.Reset() + } + buf.WriteRune(char) + current = 0 + } else if unicode.IsSpace(char) { + if spaceBuf.Len() == 0 || wordBuf.Len() > 0 { + current += uint(spaceBuf.Len() + wordBuf.Len()) + spaceBuf.WriteTo(buf) + spaceBuf.Reset() + wordBuf.WriteTo(buf) + wordBuf.Reset() + } + + spaceBuf.WriteRune(char) + } else { + + wordBuf.WriteRune(char) + + if current+uint(spaceBuf.Len()+wordBuf.Len()) > lim && uint(wordBuf.Len()) < lim { + buf.WriteRune('\n') + current = 0 + spaceBuf.Reset() + } + } + } + + if wordBuf.Len() == 0 { + if current+uint(spaceBuf.Len()) <= lim { + spaceBuf.WriteTo(buf) + } + } else { + spaceBuf.WriteTo(buf) + wordBuf.WriteTo(buf) + } + + return buf.String() +} diff --git a/vendor/github.com/opencontainers/go-digest/.mailmap b/vendor/github.com/opencontainers/go-digest/.mailmap index ba611cb21c..eaf8b2f9e6 100644 --- a/vendor/github.com/opencontainers/go-digest/.mailmap +++ b/vendor/github.com/opencontainers/go-digest/.mailmap @@ -1 +1,4 @@ +Aaron Lehmann +Derek McGowan Stephen J Day +Haibing Zhou diff --git a/vendor/github.com/opencontainers/go-digest/.pullapprove.yml b/vendor/github.com/opencontainers/go-digest/.pullapprove.yml index 45fa4b9ec5..b6165f83ca 100644 --- a/vendor/github.com/opencontainers/go-digest/.pullapprove.yml +++ b/vendor/github.com/opencontainers/go-digest/.pullapprove.yml @@ -1,12 +1,28 @@ -approve_by_comment: true -approve_regex: '^(Approved|lgtm|LGTM|:shipit:|:star:|:\+1:|:ship:)' -reject_regex: ^Rejected -reset_on_push: true -author_approval: ignored -signed_off_by: - required: true -reviewers: - teams: - - go-digest-maintainers - name: default +version: 2 + +requirements: + signed_off_by: + required: true + +always_pending: + title_regex: '^WIP' + explanation: 'Work in progress...' + +group_defaults: required: 2 + approve_by_comment: + enabled: true + approve_regex: '^LGTM' + reject_regex: '^Rejected' + reset_on_push: + enabled: true + author_approval: + ignored: true + conditions: + branches: + - master + +groups: + go-digest: + teams: + - go-digest-maintainers diff --git a/vendor/github.com/opencontainers/go-digest/.travis.yml b/vendor/github.com/opencontainers/go-digest/.travis.yml index 7ea4ed1d2c..5775f885c1 100644 --- a/vendor/github.com/opencontainers/go-digest/.travis.yml +++ b/vendor/github.com/opencontainers/go-digest/.travis.yml @@ -1,4 +1,5 @@ language: go go: - - 1.7 + - 1.12.x + - 1.13.x - master diff --git a/vendor/github.com/opencontainers/go-digest/LICENSE b/vendor/github.com/opencontainers/go-digest/LICENSE new file mode 100644 index 0000000000..3ac8ab6487 --- /dev/null +++ b/vendor/github.com/opencontainers/go-digest/LICENSE @@ -0,0 +1,192 @@ + + Apache License + Version 2.0, January 2004 + https://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 + + Copyright 2019, 2020 OCI Contributors + Copyright 2016 Docker, Inc. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT 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/opencontainers/go-digest/MAINTAINERS b/vendor/github.com/opencontainers/go-digest/MAINTAINERS index 42a29795d7..843b1b2061 100644 --- a/vendor/github.com/opencontainers/go-digest/MAINTAINERS +++ b/vendor/github.com/opencontainers/go-digest/MAINTAINERS @@ -1,9 +1,5 @@ -Aaron Lehmann (@aaronlehmann) -Brandon Philips (@philips) -Brendan Burns (@brendandburns) Derek McGowan (@dmcgowan) -Jason Bouzane (@jbouzane) -John Starks (@jstarks) -Jonathan Boulle (@jonboulle) -Stephen Day (@stevvooe) -Vincent Batts (@vbatts) +Stephen Day (@stevvooe) +Vincent Batts (@vbatts) +Akihiro Suda (@AkihiroSuda) +Sebastiaan van Stijn (@thaJeztah) diff --git a/vendor/github.com/opencontainers/go-digest/README.md b/vendor/github.com/opencontainers/go-digest/README.md index 0f5a04092c..a11287207e 100644 --- a/vendor/github.com/opencontainers/go-digest/README.md +++ b/vendor/github.com/opencontainers/go-digest/README.md @@ -8,20 +8,16 @@ Please see the [godoc](https://godoc.org/github.com/opencontainers/go-digest) fo # What is a digest? -A digest is just a hash. +A digest is just a [hash](https://en.wikipedia.org/wiki/Hash_function). -The most common use case for a digest is to create a content -identifier for use in [Content Addressable Storage](https://en.wikipedia.org/wiki/Content-addressable_storage) -systems: +The most common use case for a digest is to create a content identifier for use in [Content Addressable Storage](https://en.wikipedia.org/wiki/Content-addressable_storage) systems: ```go id := digest.FromBytes([]byte("my content")) ``` -In the example above, the id can be used to uniquely identify -the byte slice "my content". This allows two disparate applications -to agree on a verifiable identifier without having to trust one -another. +In the example above, the id can be used to uniquely identify the byte slice "my content". +This allows two disparate applications to agree on a verifiable identifier without having to trust one another. An identifying digest can be verified, as follows: @@ -31,8 +27,7 @@ if id != digest.FromBytes([]byte("my content")) { } ``` -A `Verifier` type can be used to handle cases where an `io.Reader` -makes more sense: +A `Verifier` type can be used to handle cases where an `io.Reader` makes more sense: ```go rd := getContent() @@ -44,33 +39,28 @@ if !verifier.Verified() { } ``` -Using [Merkle DAGs](https://en.wikipedia.org/wiki/Merkle_tree), this -can power a rich, safe, content distribution system. +Using [Merkle DAGs](https://en.wikipedia.org/wiki/Merkle_tree), this can power a rich, safe, content distribution system. # Usage -While the [godoc](https://godoc.org/github.com/opencontainers/go-digest) is -considered the best resource, a few important items need to be called -out when using this package. +While the [godoc](https://godoc.org/github.com/opencontainers/go-digest) is considered the best resource, a few important items need to be called out when using this package. -1. Make sure to import the hash implementations into your application - or the package will panic. You should have something like the - following in the main (or other entrypoint) of your application: +1. Make sure to import the hash implementations into your application or the package will panic. + You should have something like the following in the main (or other entrypoint) of your application: ```go import ( _ "crypto/sha256" - _ "crypto/sha512" + _ "crypto/sha512" ) ``` This may seem inconvenient but it allows you replace the hash implementations with others, such as https://github.com/stevvooe/resumable. -2. Even though `digest.Digest` may be assemable as a string, _always_ - verify your input with `digest.Parse` or use `Digest.Validate` - when accepting untrusted input. While there are measures to - avoid common problems, this will ensure you have valid digests - in the rest of your application. +2. Even though `digest.Digest` may be assemblable as a string, _always_ verify your input with `digest.Parse` or use `Digest.Validate` when accepting untrusted input. + While there are measures to avoid common problems, this will ensure you have valid digests in the rest of your application. + +3. While alternative encodings of hash values (digests) are possible (for example, base64), this package deals exclusively with hex-encoded digests. # Stability @@ -80,25 +70,27 @@ As always, before using a package export, read the [godoc](https://godoc.org/git # Contributing -This package is considered fairly complete. It has been in production -in thousands (millions?) of deployments and is fairly battle-hardened. -New additions will be met with skepticism. If you think there is a -missing feature, please file a bug clearly describing the problem and -the alternatives you tried before submitting a PR. +This package is considered fairly complete. +It has been in production in thousands (millions?) of deployments and is fairly battle-hardened. +New additions will be met with skepticism. +If you think there is a missing feature, please file a bug clearly describing the problem and the alternatives you tried before submitting a PR. -# Reporting security issues +## Code of Conduct -Please DO NOT file a public issue, instead send your report privately to -security@opencontainers.org. +Participation in the OpenContainers community is governed by [OpenContainer's Code of Conduct][code-of-conduct]. -The maintainers take security seriously. If you discover a security issue, -please bring it to their attention right away! +## Security -If you are reporting a security issue, do not create an issue or file a pull -request on GitHub. Instead, disclose the issue responsibly by sending an email -to security@opencontainers.org (which is inhabited only by the maintainers of -the various OCI projects). +If you find an issue, please follow the [security][security] protocol to report it. # Copyright and license -Copyright © 2016 Docker, Inc. All rights reserved, except as follows. Code is released under the [Apache 2.0 license](LICENSE.code). This `README.md` file and the [`CONTRIBUTING.md`](CONTRIBUTING.md) file are licensed under the Creative Commons Attribution 4.0 International License under the terms and conditions set forth in the file [`LICENSE.docs`](LICENSE.docs). You may obtain a duplicate copy of the same license, titled CC BY-SA 4.0, at http://creativecommons.org/licenses/by-sa/4.0/. +Copyright © 2019, 2020 OCI Contributors +Copyright © 2016 Docker, Inc. +All rights reserved, except as follows. +Code is released under the [Apache 2.0 license](LICENSE). +This `README.md` file and the [`CONTRIBUTING.md`](CONTRIBUTING.md) file are licensed under the Creative Commons Attribution 4.0 International License under the terms and conditions set forth in the file [`LICENSE.docs`](LICENSE.docs). +You may obtain a duplicate copy of the same license, titled CC BY-SA 4.0, at http://creativecommons.org/licenses/by-sa/4.0/. + +[security]: https://github.com/opencontainers/org/blob/master/security +[code-of-conduct]: https://github.com/opencontainers/org/blob/master/CODE_OF_CONDUCT.md diff --git a/vendor/github.com/opencontainers/go-digest/algorithm.go b/vendor/github.com/opencontainers/go-digest/algorithm.go index 8813bd26f1..490951dc3f 100644 --- a/vendor/github.com/opencontainers/go-digest/algorithm.go +++ b/vendor/github.com/opencontainers/go-digest/algorithm.go @@ -1,3 +1,4 @@ +// Copyright 2019, 2020 OCI Contributors // Copyright 2017 Docker, Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/vendor/github.com/opencontainers/go-digest/digest.go b/vendor/github.com/opencontainers/go-digest/digest.go index ad398cba2f..518b5e7154 100644 --- a/vendor/github.com/opencontainers/go-digest/digest.go +++ b/vendor/github.com/opencontainers/go-digest/digest.go @@ -1,3 +1,4 @@ +// Copyright 2019, 2020 OCI Contributors // Copyright 2017 Docker, Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/vendor/github.com/opencontainers/go-digest/digester.go b/vendor/github.com/opencontainers/go-digest/digester.go index 36fa2728ef..ede9077571 100644 --- a/vendor/github.com/opencontainers/go-digest/digester.go +++ b/vendor/github.com/opencontainers/go-digest/digester.go @@ -1,3 +1,4 @@ +// Copyright 2019, 2020 OCI Contributors // Copyright 2017 Docker, Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/vendor/github.com/opencontainers/go-digest/doc.go b/vendor/github.com/opencontainers/go-digest/doc.go index 491ea1ef1f..83d3a936ca 100644 --- a/vendor/github.com/opencontainers/go-digest/doc.go +++ b/vendor/github.com/opencontainers/go-digest/doc.go @@ -1,3 +1,4 @@ +// Copyright 2019, 2020 OCI Contributors // Copyright 2017 Docker, Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -29,8 +30,13 @@ // // sha256:7173b809ca12ec5dee4506cd86be934c4596dd234ee82c0662eac04a8c2c71dc // -// In this case, the string "sha256" is the algorithm and the hex bytes are -// the "digest". +// The "algorithm" portion defines both the hashing algorithm used to calculate +// the digest and the encoding of the resulting digest, which defaults to "hex" +// if not otherwise specified. Currently, all supported algorithms have their +// digests encoded in hex strings. +// +// In the example above, the string "sha256" is the algorithm and the hex bytes +// are the "digest". // // Because the Digest type is simply a string, once a valid Digest is // obtained, comparisons are cheap, quick and simple to express with the diff --git a/vendor/github.com/opencontainers/go-digest/go.mod b/vendor/github.com/opencontainers/go-digest/go.mod new file mode 100644 index 0000000000..cf5d7b1d2d --- /dev/null +++ b/vendor/github.com/opencontainers/go-digest/go.mod @@ -0,0 +1,3 @@ +module github.com/opencontainers/go-digest + +go 1.13 diff --git a/vendor/github.com/opencontainers/go-digest/verifiers.go b/vendor/github.com/opencontainers/go-digest/verifiers.go index 32125e9187..afef506f46 100644 --- a/vendor/github.com/opencontainers/go-digest/verifiers.go +++ b/vendor/github.com/opencontainers/go-digest/verifiers.go @@ -1,3 +1,4 @@ +// Copyright 2019, 2020 OCI Contributors // Copyright 2017 Docker, Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/vendor/github.com/peterbourgon/diskv/LICENSE b/vendor/github.com/peterbourgon/diskv/LICENSE new file mode 100644 index 0000000000..41ce7f16e1 --- /dev/null +++ b/vendor/github.com/peterbourgon/diskv/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2011-2012 Peter Bourgon + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/vendor/github.com/peterbourgon/diskv/README.md b/vendor/github.com/peterbourgon/diskv/README.md new file mode 100644 index 0000000000..3474739edc --- /dev/null +++ b/vendor/github.com/peterbourgon/diskv/README.md @@ -0,0 +1,141 @@ +# What is diskv? + +Diskv (disk-vee) is a simple, persistent key-value store written in the Go +language. It starts with an incredibly simple API for storing arbitrary data on +a filesystem by key, and builds several layers of performance-enhancing +abstraction on top. The end result is a conceptually simple, but highly +performant, disk-backed storage system. + +[![Build Status][1]][2] + +[1]: https://drone.io/github.com/peterbourgon/diskv/status.png +[2]: https://drone.io/github.com/peterbourgon/diskv/latest + + +# Installing + +Install [Go 1][3], either [from source][4] or [with a prepackaged binary][5]. +Then, + +```bash +$ go get github.com/peterbourgon/diskv +``` + +[3]: http://golang.org +[4]: http://golang.org/doc/install/source +[5]: http://golang.org/doc/install + + +# Usage + +```go +package main + +import ( + "fmt" + "github.com/peterbourgon/diskv" +) + +func main() { + // Simplest transform function: put all the data files into the base dir. + flatTransform := func(s string) []string { return []string{} } + + // Initialize a new diskv store, rooted at "my-data-dir", with a 1MB cache. + d := diskv.New(diskv.Options{ + BasePath: "my-data-dir", + Transform: flatTransform, + CacheSizeMax: 1024 * 1024, + }) + + // Write three bytes to the key "alpha". + key := "alpha" + d.Write(key, []byte{'1', '2', '3'}) + + // Read the value back out of the store. + value, _ := d.Read(key) + fmt.Printf("%v\n", value) + + // Erase the key+value from the store (and the disk). + d.Erase(key) +} +``` + +More complex examples can be found in the "examples" subdirectory. + + +# Theory + +## Basic idea + +At its core, diskv is a map of a key (`string`) to arbitrary data (`[]byte`). +The data is written to a single file on disk, with the same name as the key. +The key determines where that file will be stored, via a user-provided +`TransformFunc`, which takes a key and returns a slice (`[]string`) +corresponding to a path list where the key file will be stored. The simplest +TransformFunc, + +```go +func SimpleTransform (key string) []string { + return []string{} +} +``` + +will place all keys in the same, base directory. The design is inspired by +[Redis diskstore][6]; a TransformFunc which emulates the default diskstore +behavior is available in the content-addressable-storage example. + +[6]: http://groups.google.com/group/redis-db/browse_thread/thread/d444bc786689bde9?pli=1 + +**Note** that your TransformFunc should ensure that one valid key doesn't +transform to a subset of another valid key. That is, it shouldn't be possible +to construct valid keys that resolve to directory names. As a concrete example, +if your TransformFunc splits on every 3 characters, then + +```go +d.Write("abcabc", val) // OK: written to /abc/abc/abcabc +d.Write("abc", val) // Error: attempted write to /abc/abc, but it's a directory +``` + +This will be addressed in an upcoming version of diskv. + +Probably the most important design principle behind diskv is that your data is +always flatly available on the disk. diskv will never do anything that would +prevent you from accessing, copying, backing up, or otherwise interacting with +your data via common UNIX commandline tools. + +## Adding a cache + +An in-memory caching layer is provided by combining the BasicStore +functionality with a simple map structure, and keeping it up-to-date as +appropriate. Since the map structure in Go is not threadsafe, it's combined +with a RWMutex to provide safe concurrent access. + +## Adding order + +diskv is a key-value store and therefore inherently unordered. An ordering +system can be injected into the store by passing something which satisfies the +diskv.Index interface. (A default implementation, using Google's +[btree][7] package, is provided.) Basically, diskv keeps an ordered (by a +user-provided Less function) index of the keys, which can be queried. + +[7]: https://github.com/google/btree + +## Adding compression + +Something which implements the diskv.Compression interface may be passed +during store creation, so that all Writes and Reads are filtered through +a compression/decompression pipeline. Several default implementations, +using stdlib compression algorithms, are provided. Note that data is cached +compressed; the cost of decompression is borne with each Read. + +## Streaming + +diskv also now provides ReadStream and WriteStream methods, to allow very large +data to be handled efficiently. + + +# Future plans + + * Needs plenty of robust testing: huge datasets, etc... + * More thorough benchmarking + * Your suggestions for use-cases I haven't thought of diff --git a/vendor/github.com/peterbourgon/diskv/compression.go b/vendor/github.com/peterbourgon/diskv/compression.go new file mode 100644 index 0000000000..5192b02733 --- /dev/null +++ b/vendor/github.com/peterbourgon/diskv/compression.go @@ -0,0 +1,64 @@ +package diskv + +import ( + "compress/flate" + "compress/gzip" + "compress/zlib" + "io" +) + +// Compression is an interface that Diskv uses to implement compression of +// data. Writer takes a destination io.Writer and returns a WriteCloser that +// compresses all data written through it. Reader takes a source io.Reader and +// returns a ReadCloser that decompresses all data read through it. You may +// define these methods on your own type, or use one of the NewCompression +// helpers. +type Compression interface { + Writer(dst io.Writer) (io.WriteCloser, error) + Reader(src io.Reader) (io.ReadCloser, error) +} + +// NewGzipCompression returns a Gzip-based Compression. +func NewGzipCompression() Compression { + return NewGzipCompressionLevel(flate.DefaultCompression) +} + +// NewGzipCompressionLevel returns a Gzip-based Compression with the given level. +func NewGzipCompressionLevel(level int) Compression { + return &genericCompression{ + wf: func(w io.Writer) (io.WriteCloser, error) { return gzip.NewWriterLevel(w, level) }, + rf: func(r io.Reader) (io.ReadCloser, error) { return gzip.NewReader(r) }, + } +} + +// NewZlibCompression returns a Zlib-based Compression. +func NewZlibCompression() Compression { + return NewZlibCompressionLevel(flate.DefaultCompression) +} + +// NewZlibCompressionLevel returns a Zlib-based Compression with the given level. +func NewZlibCompressionLevel(level int) Compression { + return NewZlibCompressionLevelDict(level, nil) +} + +// NewZlibCompressionLevelDict returns a Zlib-based Compression with the given +// level, based on the given dictionary. +func NewZlibCompressionLevelDict(level int, dict []byte) Compression { + return &genericCompression{ + func(w io.Writer) (io.WriteCloser, error) { return zlib.NewWriterLevelDict(w, level, dict) }, + func(r io.Reader) (io.ReadCloser, error) { return zlib.NewReaderDict(r, dict) }, + } +} + +type genericCompression struct { + wf func(w io.Writer) (io.WriteCloser, error) + rf func(r io.Reader) (io.ReadCloser, error) +} + +func (g *genericCompression) Writer(dst io.Writer) (io.WriteCloser, error) { + return g.wf(dst) +} + +func (g *genericCompression) Reader(src io.Reader) (io.ReadCloser, error) { + return g.rf(src) +} diff --git a/vendor/github.com/peterbourgon/diskv/diskv.go b/vendor/github.com/peterbourgon/diskv/diskv.go new file mode 100644 index 0000000000..524dc0a6e3 --- /dev/null +++ b/vendor/github.com/peterbourgon/diskv/diskv.go @@ -0,0 +1,624 @@ +// Diskv (disk-vee) is a simple, persistent, key-value store. +// It stores all data flatly on the filesystem. + +package diskv + +import ( + "bytes" + "errors" + "fmt" + "io" + "io/ioutil" + "os" + "path/filepath" + "strings" + "sync" + "syscall" +) + +const ( + defaultBasePath = "diskv" + defaultFilePerm os.FileMode = 0666 + defaultPathPerm os.FileMode = 0777 +) + +var ( + defaultTransform = func(s string) []string { return []string{} } + errCanceled = errors.New("canceled") + errEmptyKey = errors.New("empty key") + errBadKey = errors.New("bad key") + errImportDirectory = errors.New("can't import a directory") +) + +// TransformFunction transforms a key into a slice of strings, with each +// element in the slice representing a directory in the file path where the +// key's entry will eventually be stored. +// +// For example, if TransformFunc transforms "abcdef" to ["ab", "cde", "f"], +// the final location of the data file will be /ab/cde/f/abcdef +type TransformFunction func(s string) []string + +// Options define a set of properties that dictate Diskv behavior. +// All values are optional. +type Options struct { + BasePath string + Transform TransformFunction + CacheSizeMax uint64 // bytes + PathPerm os.FileMode + FilePerm os.FileMode + // If TempDir is set, it will enable filesystem atomic writes by + // writing temporary files to that location before being moved + // to BasePath. + // Note that TempDir MUST be on the same device/partition as + // BasePath. + TempDir string + + Index Index + IndexLess LessFunction + + Compression Compression +} + +// Diskv implements the Diskv interface. You shouldn't construct Diskv +// structures directly; instead, use the New constructor. +type Diskv struct { + Options + mu sync.RWMutex + cache map[string][]byte + cacheSize uint64 +} + +// New returns an initialized Diskv structure, ready to use. +// If the path identified by baseDir already contains data, +// it will be accessible, but not yet cached. +func New(o Options) *Diskv { + if o.BasePath == "" { + o.BasePath = defaultBasePath + } + if o.Transform == nil { + o.Transform = defaultTransform + } + if o.PathPerm == 0 { + o.PathPerm = defaultPathPerm + } + if o.FilePerm == 0 { + o.FilePerm = defaultFilePerm + } + + d := &Diskv{ + Options: o, + cache: map[string][]byte{}, + cacheSize: 0, + } + + if d.Index != nil && d.IndexLess != nil { + d.Index.Initialize(d.IndexLess, d.Keys(nil)) + } + + return d +} + +// Write synchronously writes the key-value pair to disk, making it immediately +// available for reads. Write relies on the filesystem to perform an eventual +// sync to physical media. If you need stronger guarantees, see WriteStream. +func (d *Diskv) Write(key string, val []byte) error { + return d.WriteStream(key, bytes.NewBuffer(val), false) +} + +// WriteStream writes the data represented by the io.Reader to the disk, under +// the provided key. If sync is true, WriteStream performs an explicit sync on +// the file as soon as it's written. +// +// bytes.Buffer provides io.Reader semantics for basic data types. +func (d *Diskv) WriteStream(key string, r io.Reader, sync bool) error { + if len(key) <= 0 { + return errEmptyKey + } + + d.mu.Lock() + defer d.mu.Unlock() + + return d.writeStreamWithLock(key, r, sync) +} + +// createKeyFileWithLock either creates the key file directly, or +// creates a temporary file in TempDir if it is set. +func (d *Diskv) createKeyFileWithLock(key string) (*os.File, error) { + if d.TempDir != "" { + if err := os.MkdirAll(d.TempDir, d.PathPerm); err != nil { + return nil, fmt.Errorf("temp mkdir: %s", err) + } + f, err := ioutil.TempFile(d.TempDir, "") + if err != nil { + return nil, fmt.Errorf("temp file: %s", err) + } + + if err := f.Chmod(d.FilePerm); err != nil { + f.Close() // error deliberately ignored + os.Remove(f.Name()) // error deliberately ignored + return nil, fmt.Errorf("chmod: %s", err) + } + return f, nil + } + + mode := os.O_WRONLY | os.O_CREATE | os.O_TRUNC // overwrite if exists + f, err := os.OpenFile(d.completeFilename(key), mode, d.FilePerm) + if err != nil { + return nil, fmt.Errorf("open file: %s", err) + } + return f, nil +} + +// writeStream does no input validation checking. +func (d *Diskv) writeStreamWithLock(key string, r io.Reader, sync bool) error { + if err := d.ensurePathWithLock(key); err != nil { + return fmt.Errorf("ensure path: %s", err) + } + + f, err := d.createKeyFileWithLock(key) + if err != nil { + return fmt.Errorf("create key file: %s", err) + } + + wc := io.WriteCloser(&nopWriteCloser{f}) + if d.Compression != nil { + wc, err = d.Compression.Writer(f) + if err != nil { + f.Close() // error deliberately ignored + os.Remove(f.Name()) // error deliberately ignored + return fmt.Errorf("compression writer: %s", err) + } + } + + if _, err := io.Copy(wc, r); err != nil { + f.Close() // error deliberately ignored + os.Remove(f.Name()) // error deliberately ignored + return fmt.Errorf("i/o copy: %s", err) + } + + if err := wc.Close(); err != nil { + f.Close() // error deliberately ignored + os.Remove(f.Name()) // error deliberately ignored + return fmt.Errorf("compression close: %s", err) + } + + if sync { + if err := f.Sync(); err != nil { + f.Close() // error deliberately ignored + os.Remove(f.Name()) // error deliberately ignored + return fmt.Errorf("file sync: %s", err) + } + } + + if err := f.Close(); err != nil { + return fmt.Errorf("file close: %s", err) + } + + if f.Name() != d.completeFilename(key) { + if err := os.Rename(f.Name(), d.completeFilename(key)); err != nil { + os.Remove(f.Name()) // error deliberately ignored + return fmt.Errorf("rename: %s", err) + } + } + + if d.Index != nil { + d.Index.Insert(key) + } + + d.bustCacheWithLock(key) // cache only on read + + return nil +} + +// Import imports the source file into diskv under the destination key. If the +// destination key already exists, it's overwritten. If move is true, the +// source file is removed after a successful import. +func (d *Diskv) Import(srcFilename, dstKey string, move bool) (err error) { + if dstKey == "" { + return errEmptyKey + } + + if fi, err := os.Stat(srcFilename); err != nil { + return err + } else if fi.IsDir() { + return errImportDirectory + } + + d.mu.Lock() + defer d.mu.Unlock() + + if err := d.ensurePathWithLock(dstKey); err != nil { + return fmt.Errorf("ensure path: %s", err) + } + + if move { + if err := syscall.Rename(srcFilename, d.completeFilename(dstKey)); err == nil { + d.bustCacheWithLock(dstKey) + return nil + } else if err != syscall.EXDEV { + // If it failed due to being on a different device, fall back to copying + return err + } + } + + f, err := os.Open(srcFilename) + if err != nil { + return err + } + defer f.Close() + err = d.writeStreamWithLock(dstKey, f, false) + if err == nil && move { + err = os.Remove(srcFilename) + } + return err +} + +// Read reads the key and returns the value. +// If the key is available in the cache, Read won't touch the disk. +// If the key is not in the cache, Read will have the side-effect of +// lazily caching the value. +func (d *Diskv) Read(key string) ([]byte, error) { + rc, err := d.ReadStream(key, false) + if err != nil { + return []byte{}, err + } + defer rc.Close() + return ioutil.ReadAll(rc) +} + +// ReadStream reads the key and returns the value (data) as an io.ReadCloser. +// If the value is cached from a previous read, and direct is false, +// ReadStream will use the cached value. Otherwise, it will return a handle to +// the file on disk, and cache the data on read. +// +// If direct is true, ReadStream will lazily delete any cached value for the +// key, and return a direct handle to the file on disk. +// +// If compression is enabled, ReadStream taps into the io.Reader stream prior +// to decompression, and caches the compressed data. +func (d *Diskv) ReadStream(key string, direct bool) (io.ReadCloser, error) { + d.mu.RLock() + defer d.mu.RUnlock() + + if val, ok := d.cache[key]; ok { + if !direct { + buf := bytes.NewBuffer(val) + if d.Compression != nil { + return d.Compression.Reader(buf) + } + return ioutil.NopCloser(buf), nil + } + + go func() { + d.mu.Lock() + defer d.mu.Unlock() + d.uncacheWithLock(key, uint64(len(val))) + }() + } + + return d.readWithRLock(key) +} + +// read ignores the cache, and returns an io.ReadCloser representing the +// decompressed data for the given key, streamed from the disk. Clients should +// acquire a read lock on the Diskv and check the cache themselves before +// calling read. +func (d *Diskv) readWithRLock(key string) (io.ReadCloser, error) { + filename := d.completeFilename(key) + + fi, err := os.Stat(filename) + if err != nil { + return nil, err + } + if fi.IsDir() { + return nil, os.ErrNotExist + } + + f, err := os.Open(filename) + if err != nil { + return nil, err + } + + var r io.Reader + if d.CacheSizeMax > 0 { + r = newSiphon(f, d, key) + } else { + r = &closingReader{f} + } + + var rc = io.ReadCloser(ioutil.NopCloser(r)) + if d.Compression != nil { + rc, err = d.Compression.Reader(r) + if err != nil { + return nil, err + } + } + + return rc, nil +} + +// closingReader provides a Reader that automatically closes the +// embedded ReadCloser when it reaches EOF +type closingReader struct { + rc io.ReadCloser +} + +func (cr closingReader) Read(p []byte) (int, error) { + n, err := cr.rc.Read(p) + if err == io.EOF { + if closeErr := cr.rc.Close(); closeErr != nil { + return n, closeErr // close must succeed for Read to succeed + } + } + return n, err +} + +// siphon is like a TeeReader: it copies all data read through it to an +// internal buffer, and moves that buffer to the cache at EOF. +type siphon struct { + f *os.File + d *Diskv + key string + buf *bytes.Buffer +} + +// newSiphon constructs a siphoning reader that represents the passed file. +// When a successful series of reads ends in an EOF, the siphon will write +// the buffered data to Diskv's cache under the given key. +func newSiphon(f *os.File, d *Diskv, key string) io.Reader { + return &siphon{ + f: f, + d: d, + key: key, + buf: &bytes.Buffer{}, + } +} + +// Read implements the io.Reader interface for siphon. +func (s *siphon) Read(p []byte) (int, error) { + n, err := s.f.Read(p) + + if err == nil { + return s.buf.Write(p[0:n]) // Write must succeed for Read to succeed + } + + if err == io.EOF { + s.d.cacheWithoutLock(s.key, s.buf.Bytes()) // cache may fail + if closeErr := s.f.Close(); closeErr != nil { + return n, closeErr // close must succeed for Read to succeed + } + return n, err + } + + return n, err +} + +// Erase synchronously erases the given key from the disk and the cache. +func (d *Diskv) Erase(key string) error { + d.mu.Lock() + defer d.mu.Unlock() + + d.bustCacheWithLock(key) + + // erase from index + if d.Index != nil { + d.Index.Delete(key) + } + + // erase from disk + filename := d.completeFilename(key) + if s, err := os.Stat(filename); err == nil { + if s.IsDir() { + return errBadKey + } + if err = os.Remove(filename); err != nil { + return err + } + } else { + // Return err as-is so caller can do os.IsNotExist(err). + return err + } + + // clean up and return + d.pruneDirsWithLock(key) + return nil +} + +// EraseAll will delete all of the data from the store, both in the cache and on +// the disk. Note that EraseAll doesn't distinguish diskv-related data from non- +// diskv-related data. Care should be taken to always specify a diskv base +// directory that is exclusively for diskv data. +func (d *Diskv) EraseAll() error { + d.mu.Lock() + defer d.mu.Unlock() + d.cache = make(map[string][]byte) + d.cacheSize = 0 + if d.TempDir != "" { + os.RemoveAll(d.TempDir) // errors ignored + } + return os.RemoveAll(d.BasePath) +} + +// Has returns true if the given key exists. +func (d *Diskv) Has(key string) bool { + d.mu.Lock() + defer d.mu.Unlock() + + if _, ok := d.cache[key]; ok { + return true + } + + filename := d.completeFilename(key) + s, err := os.Stat(filename) + if err != nil { + return false + } + if s.IsDir() { + return false + } + + return true +} + +// Keys returns a channel that will yield every key accessible by the store, +// in undefined order. If a cancel channel is provided, closing it will +// terminate and close the keys channel. +func (d *Diskv) Keys(cancel <-chan struct{}) <-chan string { + return d.KeysPrefix("", cancel) +} + +// KeysPrefix returns a channel that will yield every key accessible by the +// store with the given prefix, in undefined order. If a cancel channel is +// provided, closing it will terminate and close the keys channel. If the +// provided prefix is the empty string, all keys will be yielded. +func (d *Diskv) KeysPrefix(prefix string, cancel <-chan struct{}) <-chan string { + var prepath string + if prefix == "" { + prepath = d.BasePath + } else { + prepath = d.pathFor(prefix) + } + c := make(chan string) + go func() { + filepath.Walk(prepath, walker(c, prefix, cancel)) + close(c) + }() + return c +} + +// walker returns a function which satisfies the filepath.WalkFunc interface. +// It sends every non-directory file entry down the channel c. +func walker(c chan<- string, prefix string, cancel <-chan struct{}) filepath.WalkFunc { + return func(path string, info os.FileInfo, err error) error { + if err != nil { + return err + } + + if info.IsDir() || !strings.HasPrefix(info.Name(), prefix) { + return nil // "pass" + } + + select { + case c <- info.Name(): + case <-cancel: + return errCanceled + } + + return nil + } +} + +// pathFor returns the absolute path for location on the filesystem where the +// data for the given key will be stored. +func (d *Diskv) pathFor(key string) string { + return filepath.Join(d.BasePath, filepath.Join(d.Transform(key)...)) +} + +// ensurePathWithLock is a helper function that generates all necessary +// directories on the filesystem for the given key. +func (d *Diskv) ensurePathWithLock(key string) error { + return os.MkdirAll(d.pathFor(key), d.PathPerm) +} + +// completeFilename returns the absolute path to the file for the given key. +func (d *Diskv) completeFilename(key string) string { + return filepath.Join(d.pathFor(key), key) +} + +// cacheWithLock attempts to cache the given key-value pair in the store's +// cache. It can fail if the value is larger than the cache's maximum size. +func (d *Diskv) cacheWithLock(key string, val []byte) error { + valueSize := uint64(len(val)) + if err := d.ensureCacheSpaceWithLock(valueSize); err != nil { + return fmt.Errorf("%s; not caching", err) + } + + // be very strict about memory guarantees + if (d.cacheSize + valueSize) > d.CacheSizeMax { + panic(fmt.Sprintf("failed to make room for value (%d/%d)", valueSize, d.CacheSizeMax)) + } + + d.cache[key] = val + d.cacheSize += valueSize + return nil +} + +// cacheWithoutLock acquires the store's (write) mutex and calls cacheWithLock. +func (d *Diskv) cacheWithoutLock(key string, val []byte) error { + d.mu.Lock() + defer d.mu.Unlock() + return d.cacheWithLock(key, val) +} + +func (d *Diskv) bustCacheWithLock(key string) { + if val, ok := d.cache[key]; ok { + d.uncacheWithLock(key, uint64(len(val))) + } +} + +func (d *Diskv) uncacheWithLock(key string, sz uint64) { + d.cacheSize -= sz + delete(d.cache, key) +} + +// pruneDirsWithLock deletes empty directories in the path walk leading to the +// key k. Typically this function is called after an Erase is made. +func (d *Diskv) pruneDirsWithLock(key string) error { + pathlist := d.Transform(key) + for i := range pathlist { + dir := filepath.Join(d.BasePath, filepath.Join(pathlist[:len(pathlist)-i]...)) + + // thanks to Steven Blenkinsop for this snippet + switch fi, err := os.Stat(dir); true { + case err != nil: + return err + case !fi.IsDir(): + panic(fmt.Sprintf("corrupt dirstate at %s", dir)) + } + + nlinks, err := filepath.Glob(filepath.Join(dir, "*")) + if err != nil { + return err + } else if len(nlinks) > 0 { + return nil // has subdirs -- do not prune + } + if err = os.Remove(dir); err != nil { + return err + } + } + + return nil +} + +// ensureCacheSpaceWithLock deletes entries from the cache in arbitrary order +// until the cache has at least valueSize bytes available. +func (d *Diskv) ensureCacheSpaceWithLock(valueSize uint64) error { + if valueSize > d.CacheSizeMax { + return fmt.Errorf("value size (%d bytes) too large for cache (%d bytes)", valueSize, d.CacheSizeMax) + } + + safe := func() bool { return (d.cacheSize + valueSize) <= d.CacheSizeMax } + + for key, val := range d.cache { + if safe() { + break + } + + d.uncacheWithLock(key, uint64(len(val))) + } + + if !safe() { + panic(fmt.Sprintf("%d bytes still won't fit in the cache! (max %d bytes)", valueSize, d.CacheSizeMax)) + } + + return nil +} + +// nopWriteCloser wraps an io.Writer and provides a no-op Close method to +// satisfy the io.WriteCloser interface. +type nopWriteCloser struct { + io.Writer +} + +func (wc *nopWriteCloser) Write(p []byte) (int, error) { return wc.Writer.Write(p) } +func (wc *nopWriteCloser) Close() error { return nil } diff --git a/vendor/github.com/peterbourgon/diskv/index.go b/vendor/github.com/peterbourgon/diskv/index.go new file mode 100644 index 0000000000..96fee5152b --- /dev/null +++ b/vendor/github.com/peterbourgon/diskv/index.go @@ -0,0 +1,115 @@ +package diskv + +import ( + "sync" + + "github.com/google/btree" +) + +// Index is a generic interface for things that can +// provide an ordered list of keys. +type Index interface { + Initialize(less LessFunction, keys <-chan string) + Insert(key string) + Delete(key string) + Keys(from string, n int) []string +} + +// LessFunction is used to initialize an Index of keys in a specific order. +type LessFunction func(string, string) bool + +// btreeString is a custom data type that satisfies the BTree Less interface, +// making the strings it wraps sortable by the BTree package. +type btreeString struct { + s string + l LessFunction +} + +// Less satisfies the BTree.Less interface using the btreeString's LessFunction. +func (s btreeString) Less(i btree.Item) bool { + return s.l(s.s, i.(btreeString).s) +} + +// BTreeIndex is an implementation of the Index interface using google/btree. +type BTreeIndex struct { + sync.RWMutex + LessFunction + *btree.BTree +} + +// Initialize populates the BTree tree with data from the keys channel, +// according to the passed less function. It's destructive to the BTreeIndex. +func (i *BTreeIndex) Initialize(less LessFunction, keys <-chan string) { + i.Lock() + defer i.Unlock() + i.LessFunction = less + i.BTree = rebuild(less, keys) +} + +// Insert inserts the given key (only) into the BTree tree. +func (i *BTreeIndex) Insert(key string) { + i.Lock() + defer i.Unlock() + if i.BTree == nil || i.LessFunction == nil { + panic("uninitialized index") + } + i.BTree.ReplaceOrInsert(btreeString{s: key, l: i.LessFunction}) +} + +// Delete removes the given key (only) from the BTree tree. +func (i *BTreeIndex) Delete(key string) { + i.Lock() + defer i.Unlock() + if i.BTree == nil || i.LessFunction == nil { + panic("uninitialized index") + } + i.BTree.Delete(btreeString{s: key, l: i.LessFunction}) +} + +// Keys yields a maximum of n keys in order. If the passed 'from' key is empty, +// Keys will return the first n keys. If the passed 'from' key is non-empty, the +// first key in the returned slice will be the key that immediately follows the +// passed key, in key order. +func (i *BTreeIndex) Keys(from string, n int) []string { + i.RLock() + defer i.RUnlock() + + if i.BTree == nil || i.LessFunction == nil { + panic("uninitialized index") + } + + if i.BTree.Len() <= 0 { + return []string{} + } + + btreeFrom := btreeString{s: from, l: i.LessFunction} + skipFirst := true + if len(from) <= 0 || !i.BTree.Has(btreeFrom) { + // no such key, so fabricate an always-smallest item + btreeFrom = btreeString{s: "", l: func(string, string) bool { return true }} + skipFirst = false + } + + keys := []string{} + iterator := func(i btree.Item) bool { + keys = append(keys, i.(btreeString).s) + return len(keys) < n + } + i.BTree.AscendGreaterOrEqual(btreeFrom, iterator) + + if skipFirst && len(keys) > 0 { + keys = keys[1:] + } + + return keys +} + +// rebuildIndex does the work of regenerating the index +// with the given keys. +func rebuild(less LessFunction, keys <-chan string) *btree.BTree { + tree := btree.New(2) + for key := range keys { + tree.ReplaceOrInsert(btreeString{s: key, l: less}) + } + return tree +} diff --git a/vendor/github.com/russross/blackfriday/.gitignore b/vendor/github.com/russross/blackfriday/.gitignore new file mode 100644 index 0000000000..75623dcccb --- /dev/null +++ b/vendor/github.com/russross/blackfriday/.gitignore @@ -0,0 +1,8 @@ +*.out +*.swp +*.8 +*.6 +_obj +_test* +markdown +tags diff --git a/vendor/github.com/russross/blackfriday/.travis.yml b/vendor/github.com/russross/blackfriday/.travis.yml new file mode 100644 index 0000000000..2f3351d7ae --- /dev/null +++ b/vendor/github.com/russross/blackfriday/.travis.yml @@ -0,0 +1,17 @@ +sudo: false +language: go +go: + - "1.9.x" + - "1.10.x" + - tip +matrix: + fast_finish: true + allow_failures: + - go: tip +install: + - # Do nothing. This is needed to prevent default install action "go get -t -v ./..." from happening here (we want it to happen inside script step). +script: + - go get -t -v ./... + - diff -u <(echo -n) <(gofmt -d -s .) + - go tool vet . + - go test -v -race ./... diff --git a/vendor/github.com/russross/blackfriday/LICENSE.txt b/vendor/github.com/russross/blackfriday/LICENSE.txt new file mode 100644 index 0000000000..2885af3602 --- /dev/null +++ b/vendor/github.com/russross/blackfriday/LICENSE.txt @@ -0,0 +1,29 @@ +Blackfriday is distributed under the Simplified BSD License: + +> Copyright © 2011 Russ Ross +> All rights reserved. +> +> Redistribution and use in source and binary forms, with or without +> modification, are permitted provided that the following conditions +> are met: +> +> 1. Redistributions of source code must retain the above copyright +> notice, this list of conditions and the following disclaimer. +> +> 2. Redistributions in binary form must reproduce the above +> copyright notice, this list of conditions and the following +> disclaimer in the documentation and/or other materials provided with +> the distribution. +> +> THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +> "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +> LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +> FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +> COPYRIGHT 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/russross/blackfriday/README.md b/vendor/github.com/russross/blackfriday/README.md new file mode 100644 index 0000000000..3c62e13753 --- /dev/null +++ b/vendor/github.com/russross/blackfriday/README.md @@ -0,0 +1,369 @@ +Blackfriday +[![Build Status][BuildSVG]][BuildURL] +[![Godoc][GodocV2SVG]][GodocV2URL] +=========== + +Blackfriday is a [Markdown][1] processor implemented in [Go][2]. It +is paranoid about its input (so you can safely feed it user-supplied +data), it is fast, it supports common extensions (tables, smart +punctuation substitutions, etc.), and it is safe for all utf-8 +(unicode) input. + +HTML output is currently supported, along with Smartypants +extensions. + +It started as a translation from C of [Sundown][3]. + + +Installation +------------ + +Blackfriday is compatible with any modern Go release. With Go and git installed: + + go get -u gopkg.in/russross/blackfriday.v2 + +will download, compile, and install the package into your `$GOPATH` directory +hierarchy. + + +Versions +-------- + +Currently maintained and recommended version of Blackfriday is `v2`. It's being +developed on its own branch: https://github.com/russross/blackfriday/tree/v2 and the +documentation is available at +https://godoc.org/gopkg.in/russross/blackfriday.v2. + +It is `go get`-able via [gopkg.in][6] at `gopkg.in/russross/blackfriday.v2`, +but we highly recommend using package management tool like [dep][7] or +[Glide][8] and make use of semantic versioning. With package management you +should import `github.com/russross/blackfriday` and specify that you're using +version 2.0.0. + +Version 2 offers a number of improvements over v1: + +* Cleaned up API +* A separate call to [`Parse`][4], which produces an abstract syntax tree for + the document +* Latest bug fixes +* Flexibility to easily add your own rendering extensions + +Potential drawbacks: + +* Our benchmarks show v2 to be slightly slower than v1. Currently in the + ballpark of around 15%. +* API breakage. If you can't afford modifying your code to adhere to the new API + and don't care too much about the new features, v2 is probably not for you. +* Several bug fixes are trailing behind and still need to be forward-ported to + v2. See issue [#348](https://github.com/russross/blackfriday/issues/348) for + tracking. + +If you are still interested in the legacy `v1`, you can import it from +`github.com/russross/blackfriday`. Documentation for the legacy v1 can be found +here: https://godoc.org/github.com/russross/blackfriday + +### Known issue with `dep` + +There is a known problem with using Blackfriday v1 _transitively_ and `dep`. +Currently `dep` prioritizes semver versions over anything else, and picks the +latest one, plus it does not apply a `[[constraint]]` specifier to transitively +pulled in packages. So if you're using something that uses Blackfriday v1, but +that something does not use `dep` yet, you will get Blackfriday v2 pulled in and +your first dependency will fail to build. + +There are couple of fixes for it, documented here: +https://github.com/golang/dep/blob/master/docs/FAQ.md#how-do-i-constrain-a-transitive-dependencys-version + +Meanwhile, `dep` team is working on a more general solution to the constraints +on transitive dependencies problem: https://github.com/golang/dep/issues/1124. + + +Usage +----- + +### v1 + +For basic usage, it is as simple as getting your input into a byte +slice and calling: + + output := blackfriday.MarkdownBasic(input) + +This renders it with no extensions enabled. To get a more useful +feature set, use this instead: + + output := blackfriday.MarkdownCommon(input) + +### v2 + +For the most sensible markdown processing, it is as simple as getting your input +into a byte slice and calling: + +```go +output := blackfriday.Run(input) +``` + +Your input will be parsed and the output rendered with a set of most popular +extensions enabled. If you want the most basic feature set, corresponding with +the bare Markdown specification, use: + +```go +output := blackfriday.Run(input, blackfriday.WithNoExtensions()) +``` + +### Sanitize untrusted content + +Blackfriday itself does nothing to protect against malicious content. If you are +dealing with user-supplied markdown, we recommend running Blackfriday's output +through HTML sanitizer such as [Bluemonday][5]. + +Here's an example of simple usage of Blackfriday together with Bluemonday: + +```go +import ( + "github.com/microcosm-cc/bluemonday" + "gopkg.in/russross/blackfriday.v2" +) + +// ... +unsafe := blackfriday.Run(input) +html := bluemonday.UGCPolicy().SanitizeBytes(unsafe) +``` + +### Custom options, v1 + +If you want to customize the set of options, first get a renderer +(currently only the HTML output engine), then use it to +call the more general `Markdown` function. For examples, see the +implementations of `MarkdownBasic` and `MarkdownCommon` in +`markdown.go`. + +### Custom options, v2 + +If you want to customize the set of options, use `blackfriday.WithExtensions`, +`blackfriday.WithRenderer` and `blackfriday.WithRefOverride`. + +### `blackfriday-tool` + +You can also check out `blackfriday-tool` for a more complete example +of how to use it. Download and install it using: + + go get github.com/russross/blackfriday-tool + +This is a simple command-line tool that allows you to process a +markdown file using a standalone program. You can also browse the +source directly on github if you are just looking for some example +code: + +* + +Note that if you have not already done so, installing +`blackfriday-tool` will be sufficient to download and install +blackfriday in addition to the tool itself. The tool binary will be +installed in `$GOPATH/bin`. This is a statically-linked binary that +can be copied to wherever you need it without worrying about +dependencies and library versions. + +### Sanitized anchor names + +Blackfriday includes an algorithm for creating sanitized anchor names +corresponding to a given input text. This algorithm is used to create +anchors for headings when `EXTENSION_AUTO_HEADER_IDS` is enabled. The +algorithm has a specification, so that other packages can create +compatible anchor names and links to those anchors. + +The specification is located at https://godoc.org/github.com/russross/blackfriday#hdr-Sanitized_Anchor_Names. + +[`SanitizedAnchorName`](https://godoc.org/github.com/russross/blackfriday#SanitizedAnchorName) exposes this functionality, and can be used to +create compatible links to the anchor names generated by blackfriday. +This algorithm is also implemented in a small standalone package at +[`github.com/shurcooL/sanitized_anchor_name`](https://godoc.org/github.com/shurcooL/sanitized_anchor_name). It can be useful for clients +that want a small package and don't need full functionality of blackfriday. + + +Features +-------- + +All features of Sundown are supported, including: + +* **Compatibility**. The Markdown v1.0.3 test suite passes with + the `--tidy` option. Without `--tidy`, the differences are + mostly in whitespace and entity escaping, where blackfriday is + more consistent and cleaner. + +* **Common extensions**, including table support, fenced code + blocks, autolinks, strikethroughs, non-strict emphasis, etc. + +* **Safety**. Blackfriday is paranoid when parsing, making it safe + to feed untrusted user input without fear of bad things + happening. The test suite stress tests this and there are no + known inputs that make it crash. If you find one, please let me + know and send me the input that does it. + + NOTE: "safety" in this context means *runtime safety only*. In order to + protect yourself against JavaScript injection in untrusted content, see + [this example](https://github.com/russross/blackfriday#sanitize-untrusted-content). + +* **Fast processing**. It is fast enough to render on-demand in + most web applications without having to cache the output. + +* **Thread safety**. You can run multiple parsers in different + goroutines without ill effect. There is no dependence on global + shared state. + +* **Minimal dependencies**. Blackfriday only depends on standard + library packages in Go. The source code is pretty + self-contained, so it is easy to add to any project, including + Google App Engine projects. + +* **Standards compliant**. Output successfully validates using the + W3C validation tool for HTML 4.01 and XHTML 1.0 Transitional. + + +Extensions +---------- + +In addition to the standard markdown syntax, this package +implements the following extensions: + +* **Intra-word emphasis supression**. The `_` character is + commonly used inside words when discussing code, so having + markdown interpret it as an emphasis command is usually the + wrong thing. Blackfriday lets you treat all emphasis markers as + normal characters when they occur inside a word. + +* **Tables**. Tables can be created by drawing them in the input + using a simple syntax: + + ``` + Name | Age + --------|------ + Bob | 27 + Alice | 23 + ``` + +* **Fenced code blocks**. In addition to the normal 4-space + indentation to mark code blocks, you can explicitly mark them + and supply a language (to make syntax highlighting simple). Just + mark it like this: + + ``` go + func getTrue() bool { + return true + } + ``` + + You can use 3 or more backticks to mark the beginning of the + block, and the same number to mark the end of the block. + + To preserve classes of fenced code blocks while using the bluemonday + HTML sanitizer, use the following policy: + + ``` go + p := bluemonday.UGCPolicy() + p.AllowAttrs("class").Matching(regexp.MustCompile("^language-[a-zA-Z0-9]+$")).OnElements("code") + html := p.SanitizeBytes(unsafe) + ``` + +* **Definition lists**. A simple definition list is made of a single-line + term followed by a colon and the definition for that term. + + Cat + : Fluffy animal everyone likes + + Internet + : Vector of transmission for pictures of cats + + Terms must be separated from the previous definition by a blank line. + +* **Footnotes**. A marker in the text that will become a superscript number; + a footnote definition that will be placed in a list of footnotes at the + end of the document. A footnote looks like this: + + This is a footnote.[^1] + + [^1]: the footnote text. + +* **Autolinking**. Blackfriday can find URLs that have not been + explicitly marked as links and turn them into links. + +* **Strikethrough**. Use two tildes (`~~`) to mark text that + should be crossed out. + +* **Hard line breaks**. With this extension enabled (it is off by + default in the `MarkdownBasic` and `MarkdownCommon` convenience + functions), newlines in the input translate into line breaks in + the output. + +* **Smart quotes**. Smartypants-style punctuation substitution is + supported, turning normal double- and single-quote marks into + curly quotes, etc. + +* **LaTeX-style dash parsing** is an additional option, where `--` + is translated into `–`, and `---` is translated into + `—`. This differs from most smartypants processors, which + turn a single hyphen into an ndash and a double hyphen into an + mdash. + +* **Smart fractions**, where anything that looks like a fraction + is translated into suitable HTML (instead of just a few special + cases like most smartypant processors). For example, `4/5` + becomes `45`, which renders as + 45. + + +Other renderers +--------------- + +Blackfriday is structured to allow alternative rendering engines. Here +are a few of note: + +* [github_flavored_markdown](https://godoc.org/github.com/shurcooL/github_flavored_markdown): + provides a GitHub Flavored Markdown renderer with fenced code block + highlighting, clickable heading anchor links. + + It's not customizable, and its goal is to produce HTML output + equivalent to the [GitHub Markdown API endpoint](https://developer.github.com/v3/markdown/#render-a-markdown-document-in-raw-mode), + except the rendering is performed locally. + +* [markdownfmt](https://github.com/shurcooL/markdownfmt): like gofmt, + but for markdown. + +* [LaTeX output](https://bitbucket.org/ambrevar/blackfriday-latex): + renders output as LaTeX. + +* [bfchroma](https://github.com/Depado/bfchroma/): provides convenience + integration with the [Chroma](https://github.com/alecthomas/chroma) code + highlighting library. bfchroma is only compatible with v2 of Blackfriday and + provides a drop-in renderer ready to use with Blackfriday, as well as + options and means for further customization. + + +TODO +---- + +* More unit testing +* Improve Unicode support. It does not understand all Unicode + rules (about what constitutes a letter, a punctuation symbol, + etc.), so it may fail to detect word boundaries correctly in + some instances. It is safe on all UTF-8 input. + + +License +------- + +[Blackfriday is distributed under the Simplified BSD License](LICENSE.txt) + + + [1]: https://daringfireball.net/projects/markdown/ "Markdown" + [2]: https://golang.org/ "Go Language" + [3]: https://github.com/vmg/sundown "Sundown" + [4]: https://godoc.org/gopkg.in/russross/blackfriday.v2#Parse "Parse func" + [5]: https://github.com/microcosm-cc/bluemonday "Bluemonday" + [6]: https://labix.org/gopkg.in "gopkg.in" + [7]: https://github.com/golang/dep/ "dep" + [8]: https://github.com/Masterminds/glide "Glide" + + [BuildSVG]: https://travis-ci.org/russross/blackfriday.svg?branch=master + [BuildURL]: https://travis-ci.org/russross/blackfriday + [GodocV2SVG]: https://godoc.org/gopkg.in/russross/blackfriday.v2?status.svg + [GodocV2URL]: https://godoc.org/gopkg.in/russross/blackfriday.v2 diff --git a/vendor/github.com/russross/blackfriday/block.go b/vendor/github.com/russross/blackfriday/block.go new file mode 100644 index 0000000000..45c21a6c26 --- /dev/null +++ b/vendor/github.com/russross/blackfriday/block.go @@ -0,0 +1,1474 @@ +// +// Blackfriday Markdown Processor +// Available at http://github.com/russross/blackfriday +// +// Copyright © 2011 Russ Ross . +// Distributed under the Simplified BSD License. +// See README.md for details. +// + +// +// Functions to parse block-level elements. +// + +package blackfriday + +import ( + "bytes" + "strings" + "unicode" +) + +// Parse block-level data. +// Note: this function and many that it calls assume that +// the input buffer ends with a newline. +func (p *parser) block(out *bytes.Buffer, data []byte) { + if len(data) == 0 || data[len(data)-1] != '\n' { + panic("block input is missing terminating newline") + } + + // this is called recursively: enforce a maximum depth + if p.nesting >= p.maxNesting { + return + } + p.nesting++ + + // parse out one block-level construct at a time + for len(data) > 0 { + // prefixed header: + // + // # Header 1 + // ## Header 2 + // ... + // ###### Header 6 + if p.isPrefixHeader(data) { + data = data[p.prefixHeader(out, data):] + continue + } + + // block of preformatted HTML: + // + //
+ // ... + //
+ if data[0] == '<' { + if i := p.html(out, data, true); i > 0 { + data = data[i:] + continue + } + } + + // title block + // + // % stuff + // % more stuff + // % even more stuff + if p.flags&EXTENSION_TITLEBLOCK != 0 { + if data[0] == '%' { + if i := p.titleBlock(out, data, true); i > 0 { + data = data[i:] + continue + } + } + } + + // blank lines. note: returns the # of bytes to skip + if i := p.isEmpty(data); i > 0 { + data = data[i:] + continue + } + + // indented code block: + // + // func max(a, b int) int { + // if a > b { + // return a + // } + // return b + // } + if p.codePrefix(data) > 0 { + data = data[p.code(out, data):] + continue + } + + // fenced code block: + // + // ``` go info string here + // func fact(n int) int { + // if n <= 1 { + // return n + // } + // return n * fact(n-1) + // } + // ``` + if p.flags&EXTENSION_FENCED_CODE != 0 { + if i := p.fencedCodeBlock(out, data, true); i > 0 { + data = data[i:] + continue + } + } + + // horizontal rule: + // + // ------ + // or + // ****** + // or + // ______ + if p.isHRule(data) { + p.r.HRule(out) + var i int + for i = 0; data[i] != '\n'; i++ { + } + data = data[i:] + continue + } + + // block quote: + // + // > A big quote I found somewhere + // > on the web + if p.quotePrefix(data) > 0 { + data = data[p.quote(out, data):] + continue + } + + // table: + // + // Name | Age | Phone + // ------|-----|--------- + // Bob | 31 | 555-1234 + // Alice | 27 | 555-4321 + if p.flags&EXTENSION_TABLES != 0 { + if i := p.table(out, data); i > 0 { + data = data[i:] + continue + } + } + + // an itemized/unordered list: + // + // * Item 1 + // * Item 2 + // + // also works with + or - + if p.uliPrefix(data) > 0 { + data = data[p.list(out, data, 0):] + continue + } + + // a numbered/ordered list: + // + // 1. Item 1 + // 2. Item 2 + if p.oliPrefix(data) > 0 { + data = data[p.list(out, data, LIST_TYPE_ORDERED):] + continue + } + + // definition lists: + // + // Term 1 + // : Definition a + // : Definition b + // + // Term 2 + // : Definition c + if p.flags&EXTENSION_DEFINITION_LISTS != 0 { + if p.dliPrefix(data) > 0 { + data = data[p.list(out, data, LIST_TYPE_DEFINITION):] + continue + } + } + + // anything else must look like a normal paragraph + // note: this finds underlined headers, too + data = data[p.paragraph(out, data):] + } + + p.nesting-- +} + +func (p *parser) isPrefixHeader(data []byte) bool { + if data[0] != '#' { + return false + } + + if p.flags&EXTENSION_SPACE_HEADERS != 0 { + level := 0 + for level < 6 && data[level] == '#' { + level++ + } + if data[level] != ' ' { + return false + } + } + return true +} + +func (p *parser) prefixHeader(out *bytes.Buffer, data []byte) int { + level := 0 + for level < 6 && data[level] == '#' { + level++ + } + i := skipChar(data, level, ' ') + end := skipUntilChar(data, i, '\n') + skip := end + id := "" + if p.flags&EXTENSION_HEADER_IDS != 0 { + j, k := 0, 0 + // find start/end of header id + for j = i; j < end-1 && (data[j] != '{' || data[j+1] != '#'); j++ { + } + for k = j + 1; k < end && data[k] != '}'; k++ { + } + // extract header id iff found + if j < end && k < end { + id = string(data[j+2 : k]) + end = j + skip = k + 1 + for end > 0 && data[end-1] == ' ' { + end-- + } + } + } + for end > 0 && data[end-1] == '#' { + if isBackslashEscaped(data, end-1) { + break + } + end-- + } + for end > 0 && data[end-1] == ' ' { + end-- + } + if end > i { + if id == "" && p.flags&EXTENSION_AUTO_HEADER_IDS != 0 { + id = SanitizedAnchorName(string(data[i:end])) + } + work := func() bool { + p.inline(out, data[i:end]) + return true + } + p.r.Header(out, work, level, id) + } + return skip +} + +func (p *parser) isUnderlinedHeader(data []byte) int { + // test of level 1 header + if data[0] == '=' { + i := skipChar(data, 1, '=') + i = skipChar(data, i, ' ') + if data[i] == '\n' { + return 1 + } else { + return 0 + } + } + + // test of level 2 header + if data[0] == '-' { + i := skipChar(data, 1, '-') + i = skipChar(data, i, ' ') + if data[i] == '\n' { + return 2 + } else { + return 0 + } + } + + return 0 +} + +func (p *parser) titleBlock(out *bytes.Buffer, data []byte, doRender bool) int { + if data[0] != '%' { + return 0 + } + splitData := bytes.Split(data, []byte("\n")) + var i int + for idx, b := range splitData { + if !bytes.HasPrefix(b, []byte("%")) { + i = idx // - 1 + break + } + } + + data = bytes.Join(splitData[0:i], []byte("\n")) + p.r.TitleBlock(out, data) + + return len(data) +} + +func (p *parser) html(out *bytes.Buffer, data []byte, doRender bool) int { + var i, j int + + // identify the opening tag + if data[0] != '<' { + return 0 + } + curtag, tagfound := p.htmlFindTag(data[1:]) + + // handle special cases + if !tagfound { + // check for an HTML comment + if size := p.htmlComment(out, data, doRender); size > 0 { + return size + } + + // check for an
tag + if size := p.htmlHr(out, data, doRender); size > 0 { + return size + } + + // check for HTML CDATA + if size := p.htmlCDATA(out, data, doRender); size > 0 { + return size + } + + // no special case recognized + return 0 + } + + // look for an unindented matching closing tag + // followed by a blank line + found := false + /* + closetag := []byte("\n") + j = len(curtag) + 1 + for !found { + // scan for a closing tag at the beginning of a line + if skip := bytes.Index(data[j:], closetag); skip >= 0 { + j += skip + len(closetag) + } else { + break + } + + // see if it is the only thing on the line + if skip := p.isEmpty(data[j:]); skip > 0 { + // see if it is followed by a blank line/eof + j += skip + if j >= len(data) { + found = true + i = j + } else { + if skip := p.isEmpty(data[j:]); skip > 0 { + j += skip + found = true + i = j + } + } + } + } + */ + + // if not found, try a second pass looking for indented match + // but not if tag is "ins" or "del" (following original Markdown.pl) + if !found && curtag != "ins" && curtag != "del" { + i = 1 + for i < len(data) { + i++ + for i < len(data) && !(data[i-1] == '<' && data[i] == '/') { + i++ + } + + if i+2+len(curtag) >= len(data) { + break + } + + j = p.htmlFindEnd(curtag, data[i-1:]) + + if j > 0 { + i += j - 1 + found = true + break + } + } + } + + if !found { + return 0 + } + + // the end of the block has been found + if doRender { + // trim newlines + end := i + for end > 0 && data[end-1] == '\n' { + end-- + } + p.r.BlockHtml(out, data[:end]) + } + + return i +} + +func (p *parser) renderHTMLBlock(out *bytes.Buffer, data []byte, start int, doRender bool) int { + // html block needs to end with a blank line + if i := p.isEmpty(data[start:]); i > 0 { + size := start + i + if doRender { + // trim trailing newlines + end := size + for end > 0 && data[end-1] == '\n' { + end-- + } + p.r.BlockHtml(out, data[:end]) + } + return size + } + return 0 +} + +// HTML comment, lax form +func (p *parser) htmlComment(out *bytes.Buffer, data []byte, doRender bool) int { + i := p.inlineHTMLComment(out, data) + return p.renderHTMLBlock(out, data, i, doRender) +} + +// HTML CDATA section +func (p *parser) htmlCDATA(out *bytes.Buffer, data []byte, doRender bool) int { + const cdataTag = "') { + i++ + } + i++ + // no end-of-comment marker + if i >= len(data) { + return 0 + } + return p.renderHTMLBlock(out, data, i, doRender) +} + +// HR, which is the only self-closing block tag considered +func (p *parser) htmlHr(out *bytes.Buffer, data []byte, doRender bool) int { + if data[0] != '<' || (data[1] != 'h' && data[1] != 'H') || (data[2] != 'r' && data[2] != 'R') { + return 0 + } + if data[3] != ' ' && data[3] != '/' && data[3] != '>' { + // not an
tag after all; at least not a valid one + return 0 + } + + i := 3 + for data[i] != '>' && data[i] != '\n' { + i++ + } + + if data[i] == '>' { + return p.renderHTMLBlock(out, data, i+1, doRender) + } + + return 0 +} + +func (p *parser) htmlFindTag(data []byte) (string, bool) { + i := 0 + for isalnum(data[i]) { + i++ + } + key := string(data[:i]) + if _, ok := blockTags[key]; ok { + return key, true + } + return "", false +} + +func (p *parser) htmlFindEnd(tag string, data []byte) int { + // assume data[0] == '<' && data[1] == '/' already tested + + // check if tag is a match + closetag := []byte("") + if !bytes.HasPrefix(data, closetag) { + return 0 + } + i := len(closetag) + + // check that the rest of the line is blank + skip := 0 + if skip = p.isEmpty(data[i:]); skip == 0 { + return 0 + } + i += skip + skip = 0 + + if i >= len(data) { + return i + } + + if p.flags&EXTENSION_LAX_HTML_BLOCKS != 0 { + return i + } + if skip = p.isEmpty(data[i:]); skip == 0 { + // following line must be blank + return 0 + } + + return i + skip +} + +func (*parser) isEmpty(data []byte) int { + // it is okay to call isEmpty on an empty buffer + if len(data) == 0 { + return 0 + } + + var i int + for i = 0; i < len(data) && data[i] != '\n'; i++ { + if data[i] != ' ' && data[i] != '\t' { + return 0 + } + } + return i + 1 +} + +func (*parser) isHRule(data []byte) bool { + i := 0 + + // skip up to three spaces + for i < 3 && data[i] == ' ' { + i++ + } + + // look at the hrule char + if data[i] != '*' && data[i] != '-' && data[i] != '_' { + return false + } + c := data[i] + + // the whole line must be the char or whitespace + n := 0 + for data[i] != '\n' { + switch { + case data[i] == c: + n++ + case data[i] != ' ': + return false + } + i++ + } + + return n >= 3 +} + +// isFenceLine checks if there's a fence line (e.g., ``` or ``` go) at the beginning of data, +// and returns the end index if so, or 0 otherwise. It also returns the marker found. +// If syntax is not nil, it gets set to the syntax specified in the fence line. +// A final newline is mandatory to recognize the fence line, unless newlineOptional is true. +func isFenceLine(data []byte, info *string, oldmarker string, newlineOptional bool) (end int, marker string) { + i, size := 0, 0 + + // skip up to three spaces + for i < len(data) && i < 3 && data[i] == ' ' { + i++ + } + + // check for the marker characters: ~ or ` + if i >= len(data) { + return 0, "" + } + if data[i] != '~' && data[i] != '`' { + return 0, "" + } + + c := data[i] + + // the whole line must be the same char or whitespace + for i < len(data) && data[i] == c { + size++ + i++ + } + + // the marker char must occur at least 3 times + if size < 3 { + return 0, "" + } + marker = string(data[i-size : i]) + + // if this is the end marker, it must match the beginning marker + if oldmarker != "" && marker != oldmarker { + return 0, "" + } + + // TODO(shurcooL): It's probably a good idea to simplify the 2 code paths here + // into one, always get the info string, and discard it if the caller doesn't care. + if info != nil { + infoLength := 0 + i = skipChar(data, i, ' ') + + if i >= len(data) { + if newlineOptional && i == len(data) { + return i, marker + } + return 0, "" + } + + infoStart := i + + if data[i] == '{' { + i++ + infoStart++ + + for i < len(data) && data[i] != '}' && data[i] != '\n' { + infoLength++ + i++ + } + + if i >= len(data) || data[i] != '}' { + return 0, "" + } + + // strip all whitespace at the beginning and the end + // of the {} block + for infoLength > 0 && isspace(data[infoStart]) { + infoStart++ + infoLength-- + } + + for infoLength > 0 && isspace(data[infoStart+infoLength-1]) { + infoLength-- + } + + i++ + } else { + for i < len(data) && !isverticalspace(data[i]) { + infoLength++ + i++ + } + } + + *info = strings.TrimSpace(string(data[infoStart : infoStart+infoLength])) + } + + i = skipChar(data, i, ' ') + if i >= len(data) || data[i] != '\n' { + if newlineOptional && i == len(data) { + return i, marker + } + return 0, "" + } + + return i + 1, marker // Take newline into account. +} + +// fencedCodeBlock returns the end index if data contains a fenced code block at the beginning, +// or 0 otherwise. It writes to out if doRender is true, otherwise it has no side effects. +// If doRender is true, a final newline is mandatory to recognize the fenced code block. +func (p *parser) fencedCodeBlock(out *bytes.Buffer, data []byte, doRender bool) int { + var infoString string + beg, marker := isFenceLine(data, &infoString, "", false) + if beg == 0 || beg >= len(data) { + return 0 + } + + var work bytes.Buffer + + for { + // safe to assume beg < len(data) + + // check for the end of the code block + newlineOptional := !doRender + fenceEnd, _ := isFenceLine(data[beg:], nil, marker, newlineOptional) + if fenceEnd != 0 { + beg += fenceEnd + break + } + + // copy the current line + end := skipUntilChar(data, beg, '\n') + 1 + + // did we reach the end of the buffer without a closing marker? + if end >= len(data) { + return 0 + } + + // verbatim copy to the working buffer + if doRender { + work.Write(data[beg:end]) + } + beg = end + } + + if doRender { + p.r.BlockCode(out, work.Bytes(), infoString) + } + + return beg +} + +func (p *parser) table(out *bytes.Buffer, data []byte) int { + var header bytes.Buffer + i, columns := p.tableHeader(&header, data) + if i == 0 { + return 0 + } + + var body bytes.Buffer + + for i < len(data) { + pipes, rowStart := 0, i + for ; data[i] != '\n'; i++ { + if data[i] == '|' { + pipes++ + } + } + + if pipes == 0 { + i = rowStart + break + } + + // include the newline in data sent to tableRow + i++ + p.tableRow(&body, data[rowStart:i], columns, false) + } + + p.r.Table(out, header.Bytes(), body.Bytes(), columns) + + return i +} + +// check if the specified position is preceded by an odd number of backslashes +func isBackslashEscaped(data []byte, i int) bool { + backslashes := 0 + for i-backslashes-1 >= 0 && data[i-backslashes-1] == '\\' { + backslashes++ + } + return backslashes&1 == 1 +} + +func (p *parser) tableHeader(out *bytes.Buffer, data []byte) (size int, columns []int) { + i := 0 + colCount := 1 + for i = 0; data[i] != '\n'; i++ { + if data[i] == '|' && !isBackslashEscaped(data, i) { + colCount++ + } + } + + // doesn't look like a table header + if colCount == 1 { + return + } + + // include the newline in the data sent to tableRow + header := data[:i+1] + + // column count ignores pipes at beginning or end of line + if data[0] == '|' { + colCount-- + } + if i > 2 && data[i-1] == '|' && !isBackslashEscaped(data, i-1) { + colCount-- + } + + columns = make([]int, colCount) + + // move on to the header underline + i++ + if i >= len(data) { + return + } + + if data[i] == '|' && !isBackslashEscaped(data, i) { + i++ + } + i = skipChar(data, i, ' ') + + // each column header is of form: / *:?-+:? *|/ with # dashes + # colons >= 3 + // and trailing | optional on last column + col := 0 + for data[i] != '\n' { + dashes := 0 + + if data[i] == ':' { + i++ + columns[col] |= TABLE_ALIGNMENT_LEFT + dashes++ + } + for data[i] == '-' { + i++ + dashes++ + } + if data[i] == ':' { + i++ + columns[col] |= TABLE_ALIGNMENT_RIGHT + dashes++ + } + for data[i] == ' ' { + i++ + } + + // end of column test is messy + switch { + case dashes < 3: + // not a valid column + return + + case data[i] == '|' && !isBackslashEscaped(data, i): + // marker found, now skip past trailing whitespace + col++ + i++ + for data[i] == ' ' { + i++ + } + + // trailing junk found after last column + if col >= colCount && data[i] != '\n' { + return + } + + case (data[i] != '|' || isBackslashEscaped(data, i)) && col+1 < colCount: + // something else found where marker was required + return + + case data[i] == '\n': + // marker is optional for the last column + col++ + + default: + // trailing junk found after last column + return + } + } + if col != colCount { + return + } + + p.tableRow(out, header, columns, true) + size = i + 1 + return +} + +func (p *parser) tableRow(out *bytes.Buffer, data []byte, columns []int, header bool) { + i, col := 0, 0 + var rowWork bytes.Buffer + + if data[i] == '|' && !isBackslashEscaped(data, i) { + i++ + } + + for col = 0; col < len(columns) && i < len(data); col++ { + for data[i] == ' ' { + i++ + } + + cellStart := i + + for (data[i] != '|' || isBackslashEscaped(data, i)) && data[i] != '\n' { + i++ + } + + cellEnd := i + + // skip the end-of-cell marker, possibly taking us past end of buffer + i++ + + for cellEnd > cellStart && data[cellEnd-1] == ' ' { + cellEnd-- + } + + var cellWork bytes.Buffer + p.inline(&cellWork, data[cellStart:cellEnd]) + + if header { + p.r.TableHeaderCell(&rowWork, cellWork.Bytes(), columns[col]) + } else { + p.r.TableCell(&rowWork, cellWork.Bytes(), columns[col]) + } + } + + // pad it out with empty columns to get the right number + for ; col < len(columns); col++ { + if header { + p.r.TableHeaderCell(&rowWork, nil, columns[col]) + } else { + p.r.TableCell(&rowWork, nil, columns[col]) + } + } + + // silently ignore rows with too many cells + + p.r.TableRow(out, rowWork.Bytes()) +} + +// returns blockquote prefix length +func (p *parser) quotePrefix(data []byte) int { + i := 0 + for i < 3 && data[i] == ' ' { + i++ + } + if data[i] == '>' { + if data[i+1] == ' ' { + return i + 2 + } + return i + 1 + } + return 0 +} + +// blockquote ends with at least one blank line +// followed by something without a blockquote prefix +func (p *parser) terminateBlockquote(data []byte, beg, end int) bool { + if p.isEmpty(data[beg:]) <= 0 { + return false + } + if end >= len(data) { + return true + } + return p.quotePrefix(data[end:]) == 0 && p.isEmpty(data[end:]) == 0 +} + +// parse a blockquote fragment +func (p *parser) quote(out *bytes.Buffer, data []byte) int { + var raw bytes.Buffer + beg, end := 0, 0 + for beg < len(data) { + end = beg + // Step over whole lines, collecting them. While doing that, check for + // fenced code and if one's found, incorporate it altogether, + // irregardless of any contents inside it + for data[end] != '\n' { + if p.flags&EXTENSION_FENCED_CODE != 0 { + if i := p.fencedCodeBlock(out, data[end:], false); i > 0 { + // -1 to compensate for the extra end++ after the loop: + end += i - 1 + break + } + } + end++ + } + end++ + + if pre := p.quotePrefix(data[beg:]); pre > 0 { + // skip the prefix + beg += pre + } else if p.terminateBlockquote(data, beg, end) { + break + } + + // this line is part of the blockquote + raw.Write(data[beg:end]) + beg = end + } + + var cooked bytes.Buffer + p.block(&cooked, raw.Bytes()) + p.r.BlockQuote(out, cooked.Bytes()) + return end +} + +// returns prefix length for block code +func (p *parser) codePrefix(data []byte) int { + if data[0] == ' ' && data[1] == ' ' && data[2] == ' ' && data[3] == ' ' { + return 4 + } + return 0 +} + +func (p *parser) code(out *bytes.Buffer, data []byte) int { + var work bytes.Buffer + + i := 0 + for i < len(data) { + beg := i + for data[i] != '\n' { + i++ + } + i++ + + blankline := p.isEmpty(data[beg:i]) > 0 + if pre := p.codePrefix(data[beg:i]); pre > 0 { + beg += pre + } else if !blankline { + // non-empty, non-prefixed line breaks the pre + i = beg + break + } + + // verbatim copy to the working buffeu + if blankline { + work.WriteByte('\n') + } else { + work.Write(data[beg:i]) + } + } + + // trim all the \n off the end of work + workbytes := work.Bytes() + eol := len(workbytes) + for eol > 0 && workbytes[eol-1] == '\n' { + eol-- + } + if eol != len(workbytes) { + work.Truncate(eol) + } + + work.WriteByte('\n') + + p.r.BlockCode(out, work.Bytes(), "") + + return i +} + +// returns unordered list item prefix +func (p *parser) uliPrefix(data []byte) int { + i := 0 + + // start with up to 3 spaces + for i < 3 && data[i] == ' ' { + i++ + } + + // need a *, +, or - followed by a space + if (data[i] != '*' && data[i] != '+' && data[i] != '-') || + data[i+1] != ' ' { + return 0 + } + return i + 2 +} + +// returns ordered list item prefix +func (p *parser) oliPrefix(data []byte) int { + i := 0 + + // start with up to 3 spaces + for i < 3 && data[i] == ' ' { + i++ + } + + // count the digits + start := i + for data[i] >= '0' && data[i] <= '9' { + i++ + } + + // we need >= 1 digits followed by a dot and a space + if start == i || data[i] != '.' || data[i+1] != ' ' { + return 0 + } + return i + 2 +} + +// returns definition list item prefix +func (p *parser) dliPrefix(data []byte) int { + i := 0 + + // need a : followed by a spaces + if data[i] != ':' || data[i+1] != ' ' { + return 0 + } + for data[i] == ' ' { + i++ + } + return i + 2 +} + +// parse ordered or unordered list block +func (p *parser) list(out *bytes.Buffer, data []byte, flags int) int { + i := 0 + flags |= LIST_ITEM_BEGINNING_OF_LIST + work := func() bool { + for i < len(data) { + skip := p.listItem(out, data[i:], &flags) + i += skip + + if skip == 0 || flags&LIST_ITEM_END_OF_LIST != 0 { + break + } + flags &= ^LIST_ITEM_BEGINNING_OF_LIST + } + return true + } + + p.r.List(out, work, flags) + return i +} + +// Parse a single list item. +// Assumes initial prefix is already removed if this is a sublist. +func (p *parser) listItem(out *bytes.Buffer, data []byte, flags *int) int { + // keep track of the indentation of the first line + itemIndent := 0 + for itemIndent < 3 && data[itemIndent] == ' ' { + itemIndent++ + } + + i := p.uliPrefix(data) + if i == 0 { + i = p.oliPrefix(data) + } + if i == 0 { + i = p.dliPrefix(data) + // reset definition term flag + if i > 0 { + *flags &= ^LIST_TYPE_TERM + } + } + if i == 0 { + // if in defnition list, set term flag and continue + if *flags&LIST_TYPE_DEFINITION != 0 { + *flags |= LIST_TYPE_TERM + } else { + return 0 + } + } + + // skip leading whitespace on first line + for data[i] == ' ' { + i++ + } + + // find the end of the line + line := i + for i > 0 && data[i-1] != '\n' { + i++ + } + + // get working buffer + var raw bytes.Buffer + + // put the first line into the working buffer + raw.Write(data[line:i]) + line = i + + // process the following lines + containsBlankLine := false + sublist := 0 + codeBlockMarker := "" + +gatherlines: + for line < len(data) { + i++ + + // find the end of this line + for data[i-1] != '\n' { + i++ + } + + // if it is an empty line, guess that it is part of this item + // and move on to the next line + if p.isEmpty(data[line:i]) > 0 { + containsBlankLine = true + raw.Write(data[line:i]) + line = i + continue + } + + // calculate the indentation + indent := 0 + for indent < 4 && line+indent < i && data[line+indent] == ' ' { + indent++ + } + + chunk := data[line+indent : i] + + if p.flags&EXTENSION_FENCED_CODE != 0 { + // determine if in or out of codeblock + // if in codeblock, ignore normal list processing + _, marker := isFenceLine(chunk, nil, codeBlockMarker, false) + if marker != "" { + if codeBlockMarker == "" { + // start of codeblock + codeBlockMarker = marker + } else { + // end of codeblock. + *flags |= LIST_ITEM_CONTAINS_BLOCK + codeBlockMarker = "" + } + } + // we are in a codeblock, write line, and continue + if codeBlockMarker != "" || marker != "" { + raw.Write(data[line+indent : i]) + line = i + continue gatherlines + } + } + + // evaluate how this line fits in + switch { + // is this a nested list item? + case (p.uliPrefix(chunk) > 0 && !p.isHRule(chunk)) || + p.oliPrefix(chunk) > 0 || + p.dliPrefix(chunk) > 0: + + if containsBlankLine { + // end the list if the type changed after a blank line + if indent <= itemIndent && + ((*flags&LIST_TYPE_ORDERED != 0 && p.uliPrefix(chunk) > 0) || + (*flags&LIST_TYPE_ORDERED == 0 && p.oliPrefix(chunk) > 0)) { + + *flags |= LIST_ITEM_END_OF_LIST + break gatherlines + } + *flags |= LIST_ITEM_CONTAINS_BLOCK + } + + // to be a nested list, it must be indented more + // if not, it is the next item in the same list + if indent <= itemIndent { + break gatherlines + } + + // is this the first item in the nested list? + if sublist == 0 { + sublist = raw.Len() + } + + // is this a nested prefix header? + case p.isPrefixHeader(chunk): + // if the header is not indented, it is not nested in the list + // and thus ends the list + if containsBlankLine && indent < 4 { + *flags |= LIST_ITEM_END_OF_LIST + break gatherlines + } + *flags |= LIST_ITEM_CONTAINS_BLOCK + + // anything following an empty line is only part + // of this item if it is indented 4 spaces + // (regardless of the indentation of the beginning of the item) + case containsBlankLine && indent < 4: + if *flags&LIST_TYPE_DEFINITION != 0 && i < len(data)-1 { + // is the next item still a part of this list? + next := i + for data[next] != '\n' { + next++ + } + for next < len(data)-1 && data[next] == '\n' { + next++ + } + if i < len(data)-1 && data[i] != ':' && data[next] != ':' { + *flags |= LIST_ITEM_END_OF_LIST + } + } else { + *flags |= LIST_ITEM_END_OF_LIST + } + break gatherlines + + // a blank line means this should be parsed as a block + case containsBlankLine: + *flags |= LIST_ITEM_CONTAINS_BLOCK + } + + containsBlankLine = false + + // add the line into the working buffer without prefix + raw.Write(data[line+indent : i]) + + line = i + } + + // If reached end of data, the Renderer.ListItem call we're going to make below + // is definitely the last in the list. + if line >= len(data) { + *flags |= LIST_ITEM_END_OF_LIST + } + + rawBytes := raw.Bytes() + + // render the contents of the list item + var cooked bytes.Buffer + if *flags&LIST_ITEM_CONTAINS_BLOCK != 0 && *flags&LIST_TYPE_TERM == 0 { + // intermediate render of block item, except for definition term + if sublist > 0 { + p.block(&cooked, rawBytes[:sublist]) + p.block(&cooked, rawBytes[sublist:]) + } else { + p.block(&cooked, rawBytes) + } + } else { + // intermediate render of inline item + if sublist > 0 { + p.inline(&cooked, rawBytes[:sublist]) + p.block(&cooked, rawBytes[sublist:]) + } else { + p.inline(&cooked, rawBytes) + } + } + + // render the actual list item + cookedBytes := cooked.Bytes() + parsedEnd := len(cookedBytes) + + // strip trailing newlines + for parsedEnd > 0 && cookedBytes[parsedEnd-1] == '\n' { + parsedEnd-- + } + p.r.ListItem(out, cookedBytes[:parsedEnd], *flags) + + return line +} + +// render a single paragraph that has already been parsed out +func (p *parser) renderParagraph(out *bytes.Buffer, data []byte) { + if len(data) == 0 { + return + } + + // trim leading spaces + beg := 0 + for data[beg] == ' ' { + beg++ + } + + // trim trailing newline + end := len(data) - 1 + + // trim trailing spaces + for end > beg && data[end-1] == ' ' { + end-- + } + + work := func() bool { + p.inline(out, data[beg:end]) + return true + } + p.r.Paragraph(out, work) +} + +func (p *parser) paragraph(out *bytes.Buffer, data []byte) int { + // prev: index of 1st char of previous line + // line: index of 1st char of current line + // i: index of cursor/end of current line + var prev, line, i int + + // keep going until we find something to mark the end of the paragraph + for i < len(data) { + // mark the beginning of the current line + prev = line + current := data[i:] + line = i + + // did we find a blank line marking the end of the paragraph? + if n := p.isEmpty(current); n > 0 { + // did this blank line followed by a definition list item? + if p.flags&EXTENSION_DEFINITION_LISTS != 0 { + if i < len(data)-1 && data[i+1] == ':' { + return p.list(out, data[prev:], LIST_TYPE_DEFINITION) + } + } + + p.renderParagraph(out, data[:i]) + return i + n + } + + // an underline under some text marks a header, so our paragraph ended on prev line + if i > 0 { + if level := p.isUnderlinedHeader(current); level > 0 { + // render the paragraph + p.renderParagraph(out, data[:prev]) + + // ignore leading and trailing whitespace + eol := i - 1 + for prev < eol && data[prev] == ' ' { + prev++ + } + for eol > prev && data[eol-1] == ' ' { + eol-- + } + + // render the header + // this ugly double closure avoids forcing variables onto the heap + work := func(o *bytes.Buffer, pp *parser, d []byte) func() bool { + return func() bool { + pp.inline(o, d) + return true + } + }(out, p, data[prev:eol]) + + id := "" + if p.flags&EXTENSION_AUTO_HEADER_IDS != 0 { + id = SanitizedAnchorName(string(data[prev:eol])) + } + + p.r.Header(out, work, level, id) + + // find the end of the underline + for data[i] != '\n' { + i++ + } + return i + } + } + + // if the next line starts a block of HTML, then the paragraph ends here + if p.flags&EXTENSION_LAX_HTML_BLOCKS != 0 { + if data[i] == '<' && p.html(out, current, false) > 0 { + // rewind to before the HTML block + p.renderParagraph(out, data[:i]) + return i + } + } + + // if there's a prefixed header or a horizontal rule after this, paragraph is over + if p.isPrefixHeader(current) || p.isHRule(current) { + p.renderParagraph(out, data[:i]) + return i + } + + // if there's a fenced code block, paragraph is over + if p.flags&EXTENSION_FENCED_CODE != 0 { + if p.fencedCodeBlock(out, current, false) > 0 { + p.renderParagraph(out, data[:i]) + return i + } + } + + // if there's a definition list item, prev line is a definition term + if p.flags&EXTENSION_DEFINITION_LISTS != 0 { + if p.dliPrefix(current) != 0 { + return p.list(out, data[prev:], LIST_TYPE_DEFINITION) + } + } + + // if there's a list after this, paragraph is over + if p.flags&EXTENSION_NO_EMPTY_LINE_BEFORE_BLOCK != 0 { + if p.uliPrefix(current) != 0 || + p.oliPrefix(current) != 0 || + p.quotePrefix(current) != 0 || + p.codePrefix(current) != 0 { + p.renderParagraph(out, data[:i]) + return i + } + } + + // otherwise, scan to the beginning of the next line + for data[i] != '\n' { + i++ + } + i++ + } + + p.renderParagraph(out, data[:i]) + return i +} + +// SanitizedAnchorName returns a sanitized anchor name for the given text. +// +// It implements the algorithm specified in the package comment. +func SanitizedAnchorName(text string) string { + var anchorName []rune + futureDash := false + for _, r := range text { + switch { + case unicode.IsLetter(r) || unicode.IsNumber(r): + if futureDash && len(anchorName) > 0 { + anchorName = append(anchorName, '-') + } + futureDash = false + anchorName = append(anchorName, unicode.ToLower(r)) + default: + futureDash = true + } + } + return string(anchorName) +} diff --git a/vendor/github.com/russross/blackfriday/doc.go b/vendor/github.com/russross/blackfriday/doc.go new file mode 100644 index 0000000000..9656c42a19 --- /dev/null +++ b/vendor/github.com/russross/blackfriday/doc.go @@ -0,0 +1,32 @@ +// Package blackfriday is a Markdown processor. +// +// It translates plain text with simple formatting rules into HTML or LaTeX. +// +// Sanitized Anchor Names +// +// Blackfriday includes an algorithm for creating sanitized anchor names +// corresponding to a given input text. This algorithm is used to create +// anchors for headings when EXTENSION_AUTO_HEADER_IDS is enabled. The +// algorithm is specified below, so that other packages can create +// compatible anchor names and links to those anchors. +// +// The algorithm iterates over the input text, interpreted as UTF-8, +// one Unicode code point (rune) at a time. All runes that are letters (category L) +// or numbers (category N) are considered valid characters. They are mapped to +// lower case, and included in the output. All other runes are considered +// invalid characters. Invalid characters that preceed the first valid character, +// as well as invalid character that follow the last valid character +// are dropped completely. All other sequences of invalid characters +// between two valid characters are replaced with a single dash character '-'. +// +// SanitizedAnchorName exposes this functionality, and can be used to +// create compatible links to the anchor names generated by blackfriday. +// This algorithm is also implemented in a small standalone package at +// github.com/shurcooL/sanitized_anchor_name. It can be useful for clients +// that want a small package and don't need full functionality of blackfriday. +package blackfriday + +// NOTE: Keep Sanitized Anchor Name algorithm in sync with package +// github.com/shurcooL/sanitized_anchor_name. +// Otherwise, users of sanitized_anchor_name will get anchor names +// that are incompatible with those generated by blackfriday. diff --git a/vendor/github.com/russross/blackfriday/go.mod b/vendor/github.com/russross/blackfriday/go.mod new file mode 100644 index 0000000000..b05561a066 --- /dev/null +++ b/vendor/github.com/russross/blackfriday/go.mod @@ -0,0 +1 @@ +module github.com/russross/blackfriday diff --git a/vendor/github.com/russross/blackfriday/html.go b/vendor/github.com/russross/blackfriday/html.go new file mode 100644 index 0000000000..e0a6c69c96 --- /dev/null +++ b/vendor/github.com/russross/blackfriday/html.go @@ -0,0 +1,938 @@ +// +// Blackfriday Markdown Processor +// Available at http://github.com/russross/blackfriday +// +// Copyright © 2011 Russ Ross . +// Distributed under the Simplified BSD License. +// See README.md for details. +// + +// +// +// HTML rendering backend +// +// + +package blackfriday + +import ( + "bytes" + "fmt" + "regexp" + "strconv" + "strings" +) + +// Html renderer configuration options. +const ( + HTML_SKIP_HTML = 1 << iota // skip preformatted HTML blocks + HTML_SKIP_STYLE // skip embedded - - -This is preheader text. Some clients will show this text as a preview. - - - - - - - - - - - -` -) diff --git a/vendor/openpitrix.io/openpitrix/pkg/constants/frontgate.go b/vendor/openpitrix.io/openpitrix/pkg/constants/frontgate.go deleted file mode 100644 index 8449cb942a..0000000000 --- a/vendor/openpitrix.io/openpitrix/pkg/constants/frontgate.go +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright 2018 The OpenPitrix Authors. All rights reserved. -// Use of this source code is governed by a Apache license -// that can be found in the LICENSE file. - -package constants - -// can use this id for internal test -const FrontgateVersionId = "appv-ABCDEFGHIJKLMNOPQRST" -const FrontgateAppId = "app-ABCDEFGHIJKLMNOPQRST" - -const FrontgateDefaultConf = ` -{ - "app_id": "app-ABCDEFGHIJKLMNOPQRST", - "version_id": "appv-ABCDEFGHIJKLMNOPQRST", - "name": "frontgate", - "description": "OpenPitrix built-in frontgate service", - "subnet": "", - "nodes": [{ - "container": { - "type": "docker", - "image": "openpitrix/openpitrix:metadata" - }, - "count": 3, - "cpu": 1, - "memory": 1024 - }] -} -` diff --git a/vendor/openpitrix.io/openpitrix/pkg/constants/notify_message.go b/vendor/openpitrix.io/openpitrix/pkg/constants/notify_message.go deleted file mode 100644 index 0e5c817a1b..0000000000 --- a/vendor/openpitrix.io/openpitrix/pkg/constants/notify_message.go +++ /dev/null @@ -1,708 +0,0 @@ -// Copyright 2018 The OpenPitrix Authors. All rights reserved. -// Use of this source code is governed by a Apache license -// that can be found in the LICENSE file. - -package constants - -import ( - "bytes" - "fmt" - "text/template" -) - -const ( - en = "en" - zhCN = "zh_cn" - defaultLocale = zhCN -) - -const EmailNotifyName = "email" - -type EmailNotifyContent struct { - Content string -} - -type NotifyMessage struct { - en string - zhCN string -} - -type NotifyTitle struct { - NotifyMessage -} - -type NotifyContent struct { - NotifyMessage -} - -func (n *NotifyMessage) GetMessage(locale string, params ...interface{}) string { - switch locale { - case en: - return fmt.Sprintf(n.en, params...) - case zhCN: - return fmt.Sprintf(n.zhCN, params...) - default: - return fmt.Sprintf(n.zhCN, params...) - } -} - -func (n *NotifyTitle) GetDefaultMessage(params ...interface{}) string { - return n.GetMessage(defaultLocale, params...) -} - -func (n *NotifyContent) GetDefaultMessage(params ...interface{}) string { - t, _ := template.New(EmailNotifyName).Parse(EmailNotifyTemplate) - - b := bytes.NewBuffer([]byte{}) - emailContent := &EmailNotifyContent{ - Content: n.GetMessage(defaultLocale, params...), - } - - t.Execute(b, emailContent) - return b.String() -} - -var ( - AdminInviteIsvNotifyTitle = NotifyTitle{ - NotifyMessage: NotifyMessage{ - zhCN: "【%s】邀请您成为平台服务商", - }, - } - AdminInviteIsvNotifyContent = NotifyContent{ - NotifyMessage: NotifyMessage{ - zhCN: ` - %s -

-

%s 您好

-

- %s邀请您入驻应用市场「%s」,成为优质服务商,为平台用户提供企业解决方案、产品和集成服务,共享快速收益。 -

- -

- 接受邀请 -

- -

- 如果按钮无法点击,请直接访问以下链接: -

- -

- %s -

- -

- 用户名:%s -

- -

- 密码:%s -

- -

- 首次登陆后请修改密码。 -

-
-

- * 此为系统邮件请勿回复 -

-`, - }, - } - - AdminInviteUserNotifyTitle = NotifyTitle{ - NotifyMessage: NotifyMessage{ - zhCN: "【%s】邀请您成为平台用户", - }, - } - AdminInviteUserNotifyContent = NotifyContent{ - NotifyMessage: NotifyMessage{ - zhCN: ` - %s -

-

Hi, %s

-

- %s邀请你加入「%s」,成为平台正式用户。 -

- -

- 接受邀请 -

- -

- 如果按钮无法点击,请直接访问以下链接: -

- -

- %s -

- -

- 用户名:%s -

- -

- 密码:%s -

-
-

- * 此为系统邮件请勿回复 -

-`, - }, - } - - IsvInviteMemberNotifyTitle = NotifyTitle{ - NotifyMessage: NotifyMessage{ - zhCN: "【%s】邀请您加入 %s 平台", - }, - } - IsvInviteMemberNotifyContent = NotifyContent{ - NotifyMessage: NotifyMessage{ - zhCN: ` - %s -

-

%s 您好

-

- %s邀请您加入「%s」平台协同工作。 -

- -

- 接受邀请 -

- -

- 如果按钮无法点击,请直接访问以下链接: -

- -

- %s -

- -

- 用户名:%s -

- -

- 密码:%s -

- -

- 首次登陆后请修改密码。 -

-
-

- * 此为系统邮件请勿回复 -

- -`, - }, - } - - SubmitVendorNotifyAdminTitle = NotifyTitle{ - NotifyMessage: NotifyMessage{ - zhCN: "【%s】%s 应用服务商资质申请", - }, - } - SubmitVendorNotifyAdminContent = NotifyContent{ - NotifyMessage: NotifyMessage{ - zhCN: ` - %s -

-

%s 您好

-

- 收到 %s 应用服务商资质申请,请尽快完成审核。 -

- -

- 审核 -

- -

- 如果按钮无法点击,请直接访问以下链接: -

- -

- %s -

- - -
-

- * 此为系统邮件请勿回复 -

- -`, - }, - } - - SubmitVendorNotifyIsvTitle = NotifyTitle{ - NotifyMessage: NotifyMessage{ - zhCN: "【%s】已收到您的应用服务商资质申请", - }, - } - SubmitVendorNotifyIsvContent = NotifyContent{ - NotifyMessage: NotifyMessage{ - zhCN: ` - %s -

-

%s 您好

-

- 已收到您的应用服务商资质申请,我们会在3个工作日内完成审核,请您耐心等待。 -

- -

- 查看申请 -

- -

- 如果按钮无法点击,请直接访问以下链接: -

- -

- %s -

- -
-

- * 此为系统邮件请勿回复 -

- - -`, - }, - } - - PassVendorNotifyTitle = NotifyTitle{ - NotifyMessage: NotifyMessage{ - zhCN: "【%s】您的 %s 应用服务商资质申请已通过", - }, - } - PassVendorNotifyContent = NotifyContent{ - NotifyMessage: NotifyMessage{ - zhCN: ` - %s -

-

%s 您好

-

- 恭喜您,应用服务商资质申请通过审核,正式成为 %s 应用服务商。 -

- -

- 查看详情 -

- -

- 如果按钮无法点击,请直接访问以下链接: -

- -

- %s -

- - -
-

- * 此为系统邮件请勿回复 -

-`, - }, - } - - RejectVendorNotifyTitle = NotifyTitle{ - NotifyMessage: NotifyMessage{ - zhCN: "【%s】已拒绝您的 %s 应用服务商资质申请", - }, - } - RejectVendorNotifyContent = NotifyContent{ - NotifyMessage: NotifyMessage{ - zhCN: ` - %s -

-

%s 您好

-

- 您提交的 %s 应用服务商资质申请信息有误,请核对相关内容,完善申请后重新提交。 -

- -

- 查看详情 -

- -

- 如果按钮无法点击,请直接访问以下链接: -

- -

- %s -

- - -
-

- * 此为系统邮件请勿回复 -

-`, - }, - } - - SubmitAppVersionNotifyReviewerTitle = NotifyTitle{ - NotifyMessage: NotifyMessage{ - zhCN: "【%s】%s 应用 %s 版本审核申请", - }, - } - SubmitAppVersionNotifyReviewerContent = NotifyContent{ - NotifyMessage: NotifyMessage{ - zhCN: ` - %s -

-

%s 您好

-

- 收到 %s 应用 %s 版本审核申请,请尽快完成审核。 -

- -

- 查看详情 -

- -

- 如果按钮无法点击,请直接访问以下链接: -

- -

- %s -

- - -
-

- * 此为系统邮件请勿回复 -

-`, - }, - } - - SubmitAppVersionNotifySubmitterTitle = NotifyTitle{ - NotifyMessage: NotifyMessage{ - zhCN: "【%s】已收到您的 %s 应用 %s 版本审核申请", - }, - } - SubmitAppVersionNotifySubmitterContent = NotifyContent{ - NotifyMessage: NotifyMessage{ - zhCN: ` - %s -

-

%s 您好

-

- 已收到您的 %s 应用 %s 版本审核申请,请您耐心等待。 -

- -

- 查看详情 -

- -

- 如果按钮无法点击,请直接访问以下链接: -

- -

- %s -

- - -
-

- * 此为系统邮件请勿回复 -

-`, - }, - } - - PassAppVersionInfoNotifyTitle = NotifyTitle{ - NotifyMessage: NotifyMessage{ - zhCN: "【%s】%s 应用 %s 版本通过应用信息审核", - }, - } - PassAppVersionInfoNotifyContent = NotifyContent{ - NotifyMessage: NotifyMessage{ - zhCN: ` - %s -

-

%s 您好

-

- 恭喜您,%s 应用 %s 版本已通过应用信息审核,等待平台商务审核。 -

- -

- 查看详情 -

- -

- 如果按钮无法点击,请直接访问以下链接: -

- -

- %s -

- - -
-

- * 此为系统邮件请勿回复 -

- -`, - }, - } - - PassAppVersionBusinessNotifyTitle = NotifyTitle{ - NotifyMessage: NotifyMessage{ - zhCN: "【%s】%s 应用 %s 版本通过平台商务审核", - }, - } - PassAppVersionBusinessNotifyContent = NotifyContent{ - NotifyMessage: NotifyMessage{ - zhCN: ` - %s -

-

%s 您好

-

- 恭喜您,%s 应用 %s 版本已通过平台商务审核,等待平台技术审核。 -

- -

- 查看详情 -

- -

- 如果按钮无法点击,请直接访问以下链接: -

- -

- %s -

- - -
-

- * 此为系统邮件请勿回复 -

-`, - }, - } - - PassAppVersionTechnicalNotifyTitle = NotifyTitle{ - NotifyMessage: NotifyMessage{ - zhCN: "【%s】%s 应用 %s 版本通过平台技术审核", - }, - } - PassAppVersionTechnicalNotifyContent = NotifyContent{ - NotifyMessage: NotifyMessage{ - zhCN: ` - %s -

-

%s 您好

-

- 恭喜您,%s 应用 %s 版本已通过平台技术审核,请尽快完成应用版本上架。 -

- -

- 查看详情 -

- -

- 如果按钮无法点击,请直接访问以下链接: -

- -

- %s -

- - -
-

- * 此为系统邮件请勿回复 -

-`, - }, - } - - RejectAppVersionInfoNotifyTitle = NotifyTitle{ - NotifyMessage: NotifyMessage{ - zhCN: "【%s】%s 应用 %s 版本未通过应用信息审核", - }, - } - RejectAppVersionInfoNotifyContent = NotifyContent{ - NotifyMessage: NotifyMessage{ - zhCN: ` - %s -

-

%s 您好

-

- 您提交的 %s 应用 %s 版本未通过应用信息审核,请核对相关内容,完善后重新提交。 -

- -

- 查看详情 -

- -

- 如果按钮无法点击,请直接访问以下链接: -

- -

- %s -

- - -
-

- * 此为系统邮件请勿回复 -

-`, - }, - } - - RejectAppVersionBusinessNotifyTitle = NotifyTitle{ - NotifyMessage: NotifyMessage{ - zhCN: "【%s】%s 应用 %s 版本未通过平台商务审核", - }, - } - RejectAppVersionBusinessNotifyContent = NotifyContent{ - NotifyMessage: NotifyMessage{ - zhCN: ` - %s -

-

%s 您好

-

- 您提交的 %s 应用 %s 版本未通过平台商务审核,请核对相关内容,完善后重新提交。 -

- -

- 查看详情 -

- -

- 如果按钮无法点击,请直接访问以下链接: -

- -

- %s -

- - -
-

- * 此为系统邮件请勿回复 -

-`, - }, - } - - RejectAppVersionTechnicalNotifyTitle = NotifyTitle{ - NotifyMessage: NotifyMessage{ - zhCN: "【%s】%s 应用 %s 版本未通过平台技术审核", - }, - } - RejectAppVersionTechnicalNotifyContent = NotifyContent{ - NotifyMessage: NotifyMessage{ - zhCN: ` - %s -

-

%s 您好

-

- 您提交的 %s 应用 %s 版本未通过平台技术审核,请核对相关内容,完善后重新提交。 -

- -

- 查看详情 -

- -

- 如果按钮无法点击,请直接访问以下链接: -

- -

- %s -

- - -
-

- * 此为系统邮件请勿回复 -

- -`, - }, - } - - ReleaseAppVersionNotifyTitle = NotifyTitle{ - NotifyMessage: NotifyMessage{ - zhCN: "【%s】%s 应用 %s 版本已上架", - }, - } - ReleaseAppVersionNotifyContent = NotifyContent{ - NotifyMessage: NotifyMessage{ - zhCN: ` - %s -

-

%s 您好

-

- %s 应用 %s 版本已上架到应用市场。 -

- -

- 查看详情 -

- -

- 如果按钮无法点击,请直接访问以下链接: -

- -

- %s -

- - -
-

- * 此为系统邮件请勿回复 -

-`, - }, - } - - SuspendAppVersionNotifyTitle = NotifyTitle{ - NotifyMessage: NotifyMessage{ - zhCN: "【%s】%s 应用 %s 版本已下架", - }, - } - SuspendAppVersionNotifyContent = NotifyContent{ - NotifyMessage: NotifyMessage{ - zhCN: ` - %s -

-

%s 您好

-

- %s 应用 %s 版本已从应用市场下架。 -

- -

- 查看详情 -

- -

- 如果按钮无法点击,请直接访问以下链接: -

- -

- %s -

- - -
-

- * 此为系统邮件请勿回复 -

-`, - }, - } -) diff --git a/vendor/openpitrix.io/openpitrix/pkg/constants/table.go b/vendor/openpitrix.io/openpitrix/pkg/constants/table.go deleted file mode 100644 index ba84be6828..0000000000 --- a/vendor/openpitrix.io/openpitrix/pkg/constants/table.go +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright 2018 The OpenPitrix Authors. All rights reserved. -// Use of this source code is governed by a Apache license -// that can be found in the LICENSE file. - -package constants - -const ( - TableApp = "app" - TableAppVersion = "app_version" - TableCategory = "category" - TableCategoryResource = "category_resource" - TableCluster = "cluster" - TableClusterCommon = "cluster_common" - TableClusterLink = "cluster_link" - TableClusterLoadbalancer = "cluster_loadbalancer" - TableClusterNode = "cluster_node" - TableClusterRole = "cluster_role" - TableJob = "job" - TableKeyPair = "key_pair" - TableNodeKeyPair = "node_key_pair" - TableRepo = "repo" - TableRepoEvent = "repo_event" - TableRepoLabel = "repo_label" - TableRepoProvider = "repo_provider" - TableRepoSelector = "repo_selector" - TableRuntime = "runtime" - TableRuntimeCredential = "runtime_credential" - TableTask = "task" - TableAttachment = "attachment" - - TableUser = "user" - TableGroupMember = "group_member" - TableUserPasswordReset = "user_password_reset" - TableGroup = "group" - TableUserClient = "user_client" - TableToken = "token" - - TableMarket = "market" - TableMarketUser = "market_user" - - TableAppVersionAudit = "app_version_audit" - TableAppVersionReview = "app_version_review" - TableVendorVerifyInfo = "vendor_verify_info" -) diff --git a/vendor/openpitrix.io/openpitrix/pkg/constants/user.go b/vendor/openpitrix.io/openpitrix/pkg/constants/user.go deleted file mode 100644 index 690d51a1e2..0000000000 --- a/vendor/openpitrix.io/openpitrix/pkg/constants/user.go +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright 2018 The OpenPitrix Authors. All rights reserved. -// Use of this source code is governed by a Apache license -// that can be found in the LICENSE file. - -package constants - -const UserSystem = "system" - -var InternalUsers = []string{ - UserSystem, -} diff --git a/vendor/openpitrix.io/openpitrix/pkg/db/Dockerfile b/vendor/openpitrix.io/openpitrix/pkg/db/Dockerfile deleted file mode 100644 index 8992068fca..0000000000 --- a/vendor/openpitrix.io/openpitrix/pkg/db/Dockerfile +++ /dev/null @@ -1,12 +0,0 @@ -# Copyright 2017 The OpenPitrix Authors. All rights reserved. -# Use of this source code is governed by a Apache license -# that can be found in the LICENSE file. - -FROM openpitrix/flyway:alpine - -USER root -RUN apk add --no-cache mysql-client - -COPY ./schema /flyway/sql -COPY ./ddl /flyway/sql/ddl -COPY ./scripts /flyway/sql/ddl diff --git a/vendor/openpitrix.io/openpitrix/pkg/db/condition.go b/vendor/openpitrix.io/openpitrix/pkg/db/condition.go deleted file mode 100644 index 5a96367ca9..0000000000 --- a/vendor/openpitrix.io/openpitrix/pkg/db/condition.go +++ /dev/null @@ -1,107 +0,0 @@ -// Copyright 2017 The OpenPitrix Authors. All rights reserved. -// Use of this source code is governed by a Apache license -// that can be found in the LICENSE file. - -package db - -import ( - "strings" - - "github.com/gocraft/dbr" -) - -const ( - placeholder = "?" -) - -type EqCondition struct { - dbr.Builder - Column string - Value interface{} -} - -// Copy From vendor/github.com/gocraft/dbr/condition.go:36 -func buildCmp(d dbr.Dialect, buf dbr.Buffer, pred string, column string, value interface{}) error { - buf.WriteString(d.QuoteIdent(column)) - buf.WriteString(" ") - buf.WriteString(pred) - buf.WriteString(" ") - buf.WriteString(placeholder) - - buf.WriteValue(value) - return nil -} - -// And creates AND from a list of conditions -func And(cond ...dbr.Builder) dbr.Builder { - return dbr.And(cond...) -} - -// Or creates OR from a list of conditions -func Or(cond ...dbr.Builder) dbr.Builder { - return dbr.Or(cond...) -} - -func escape(str string) string { - return strings.Map(func(r rune) rune { - switch r { - case '%', '\'', '^', '[', ']', '!', '_': - return ' ' - } - return r - }, str) -} - -func Like(column string, value string) dbr.Builder { - value = "%" + strings.TrimSpace(escape(value)) + "%" - return dbr.BuildFunc(func(d dbr.Dialect, buf dbr.Buffer) error { - return buildCmp(d, buf, "LIKE", column, value) - }) -} - -func Prefix(column string, value string) dbr.Builder { - value = strings.TrimSpace(escape(value)) + "%" - return dbr.BuildFunc(func(d dbr.Dialect, buf dbr.Buffer) error { - return buildCmp(d, buf, "LIKE", column, value) - }) -} - -// Eq is `=`. -// When value is nil, it will be translated to `IS NULL`. -// When value is a slice, it will be translated to `IN`. -// Otherwise it will be translated to `=`. -func Eq(column string, value interface{}) dbr.Builder { - return &EqCondition{ - Builder: dbr.Eq(column, value), - Column: column, - Value: value, - } -} - -// Neq is `!=`. -// When value is nil, it will be translated to `IS NOT NULL`. -// When value is a slice, it will be translated to `NOT IN`. -// Otherwise it will be translated to `!=`. -func Neq(column string, value interface{}) dbr.Builder { - return dbr.Neq(column, value) -} - -// Gt is `>`. -func Gt(column string, value interface{}) dbr.Builder { - return dbr.Gt(column, value) -} - -// Gte is '>='. -func Gte(column string, value interface{}) dbr.Builder { - return dbr.Gte(column, value) -} - -// Lt is '<'. -func Lt(column string, value interface{}) dbr.Builder { - return dbr.Lt(column, value) -} - -// Lte is `<=`. -func Lte(column string, value interface{}) dbr.Builder { - return dbr.Lte(column, value) -} diff --git a/vendor/openpitrix.io/openpitrix/pkg/db/connection.go b/vendor/openpitrix.io/openpitrix/pkg/db/connection.go deleted file mode 100644 index a7e53fda13..0000000000 --- a/vendor/openpitrix.io/openpitrix/pkg/db/connection.go +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright 2017 The OpenPitrix Authors. All rights reserved. -// Use of this source code is governed by a Apache license -// that can be found in the LICENSE file. - -package db - -import ( - "context" - "sync" - "time" - - "github.com/gocraft/dbr" - - "openpitrix.io/openpitrix/pkg/config" - "openpitrix.io/openpitrix/pkg/logger" -) - -type key int - -var dbMap = sync.Map{} -var dbKey key - -type Database struct { - Conn *dbr.Connection -} - -func OpenDatabase(cfg config.MysqlConfig) (*Database, error) { - // https://github.com/go-sql-driver/mysql/issues/9 - conn, err := dbr.Open("mysql", cfg.GetUrl()+"?parseTime=1&multiStatements=1&charset=utf8mb4&collation=utf8mb4_unicode_ci", nil) - if err != nil { - return nil, err - } - conn.SetMaxIdleConns(100) - conn.SetMaxOpenConns(100) - conn.SetConnMaxLifetime(10 * time.Second) - - db := &Database{ - Conn: conn, - } - dbMap.Store(cfg, db) - return db, nil -} - -func NewContext(ctx context.Context, cfg config.MysqlConfig) context.Context { - return context.WithValue(ctx, dbKey, cfg) -} - -func FromContext(ctx context.Context) (*Database, bool) { - cfg := ctx.Value(dbKey).(config.MysqlConfig) - var err error - db, ok := dbMap.Load(cfg) - if !ok { - db, err = OpenDatabase(cfg) - if err != nil { - logger.Critical(ctx, "Failed to open database: %+v", err) - return nil, false - } - } - return db.(*Database), true -} - -func (db *Database) New(ctx context.Context) *Conn { - actualDb, ok := FromContext(ctx) - var conn *dbr.Connection - if ok || db == nil { - conn = actualDb.Conn - } else { - conn = db.Conn - } - return &Conn{ - Session: conn.NewSession(&EventReceiver{ctx}), - ctx: ctx, - } -} diff --git a/vendor/openpitrix.io/openpitrix/pkg/db/db.go b/vendor/openpitrix.io/openpitrix/pkg/db/db.go deleted file mode 100644 index 412d52cf25..0000000000 --- a/vendor/openpitrix.io/openpitrix/pkg/db/db.go +++ /dev/null @@ -1,278 +0,0 @@ -package db - -import ( - "context" - "database/sql" - "fmt" - - _ "github.com/go-sql-driver/mysql" - "github.com/gocraft/dbr" -) - -const ( - DefaultSelectLimit = 200 -) - -func GetLimit(n uint64) uint64 { - if n < 0 { - n = 0 - } - if n > DefaultSelectLimit { - n = DefaultSelectLimit - } - return n -} - -func GetOffset(n uint64) uint64 { - if n < 0 { - n = 0 - } - return n -} - -type InsertHook func(query *InsertQuery) -type UpdateHook func(query *UpdateQuery) -type DeleteHook func(query *DeleteQuery) - -type SelectQuery struct { - *dbr.SelectBuilder - ctx context.Context - JoinCount int // for join filter -} - -type InsertQuery struct { - *dbr.InsertBuilder - ctx context.Context - Hook InsertHook -} - -type DeleteQuery struct { - *dbr.DeleteBuilder - ctx context.Context - Hook DeleteHook -} - -type UpdateQuery struct { - *dbr.UpdateBuilder - ctx context.Context - Hook UpdateHook -} - -type Conn struct { - *dbr.Session - ctx context.Context - InsertHook InsertHook - UpdateHook UpdateHook - DeleteHook DeleteHook -} - -// SelectQuery -// Example: Select().From().Where().Limit().Offset().OrderDir().Load() -// Select().From().Where().Limit().Offset().OrderDir().LoadOne() -// Select().From().Where().Count() -// SelectAll().From().Where().Limit().Offset().OrderDir().Load() -// SelectAll().From().Where().Limit().Offset().OrderDir().LoadOne() -// SelectAll().From().Where().Count() - -func (conn *Conn) Select(columns ...string) *SelectQuery { - return &SelectQuery{conn.Session.Select(columns...), conn.ctx, 0} -} - -func (conn *Conn) SelectBySql(query string, value ...interface{}) *SelectQuery { - return &SelectQuery{conn.Session.SelectBySql(query, value...), conn.ctx, 0} -} - -func (conn *Conn) SelectAll(columns ...string) *SelectQuery { - return &SelectQuery{conn.Session.Select("*"), conn.ctx, 0} -} - -func (b *SelectQuery) Join(table, on interface{}) *SelectQuery { - b.SelectBuilder.Join(table, on) - return b -} -func (b *SelectQuery) RightJoin(table, on interface{}) *SelectQuery { - b.SelectBuilder.RightJoin(table, on) - return b -} -func (b *SelectQuery) LeftJoin(table, on interface{}) *SelectQuery { - b.SelectBuilder.LeftJoin(table, on) - return b -} - -func (b *SelectQuery) JoinAs(table string, alias string, on interface{}) *SelectQuery { - b.SelectBuilder.Join(dbr.I(table).As(alias), on) - return b -} - -func (b *SelectQuery) From(table string) *SelectQuery { - b.SelectBuilder.From(table) - return b -} - -func (b *SelectQuery) Where(query interface{}, value ...interface{}) *SelectQuery { - b.SelectBuilder.Where(query, value...) - return b -} - -func (b *SelectQuery) GroupBy(col ...string) *SelectQuery { - b.SelectBuilder.GroupBy(col...) - return b -} - -func (b *SelectQuery) Distinct() *SelectQuery { - b.SelectBuilder.Distinct() - return b -} - -func (b *SelectQuery) Limit(n uint64) *SelectQuery { - n = GetLimit(n) - b.SelectBuilder.Limit(n) - return b -} - -func (b *SelectQuery) Offset(n uint64) *SelectQuery { - n = GetOffset(n) - b.SelectBuilder.Offset(n) - return b -} - -func (b *SelectQuery) OrderDir(col string, isAsc bool) *SelectQuery { - b.SelectBuilder.OrderDir(col, isAsc) - return b -} - -func (b *SelectQuery) Load(value interface{}) (int, error) { - return b.SelectBuilder.LoadContext(b.ctx, value) -} - -func (b *SelectQuery) LoadOne(value interface{}) error { - return b.SelectBuilder.LoadOneContext(b.ctx, value) -} - -func getColumns(dbrColumns []interface{}) string { - for _, column := range dbrColumns { - if c, ok := column.(string); ok { - return c - } - } - return "*" -} - -func (b *SelectQuery) Count() (count uint32, err error) { - // cache SelectStmt - selectStmt := b.SelectBuilder - - limit := selectStmt.LimitCount - offset := selectStmt.OffsetCount - column := selectStmt.Column - isDistinct := selectStmt.IsDistinct - order := selectStmt.Order - - b.LimitCount = -1 - b.OffsetCount = -1 - b.Column = []interface{}{"COUNT(*)"} - b.Order = []dbr.Builder{} - - if isDistinct { - b.Column = []interface{}{fmt.Sprintf("COUNT(DISTINCT %s)", getColumns(column))} - b.IsDistinct = false - } - - err = b.LoadOne(&count) - // fallback SelectStmt - selectStmt.LimitCount = limit - selectStmt.OffsetCount = offset - selectStmt.Column = column - selectStmt.IsDistinct = isDistinct - selectStmt.Order = order - b.SelectBuilder = selectStmt - return -} - -// InsertQuery -// Example: InsertInto().Columns().Record().Exec() - -func (conn *Conn) InsertInto(table string) *InsertQuery { - return &InsertQuery{conn.Session.InsertInto(table), conn.ctx, conn.InsertHook} -} - -func (b *InsertQuery) Exec() (sql.Result, error) { - result, err := b.InsertBuilder.ExecContext(b.ctx) - if b.Hook != nil && err == nil { - defer b.Hook(b) - } - return result, err -} - -func (b *InsertQuery) Columns(columns ...string) *InsertQuery { - b.InsertBuilder.Columns(columns...) - return b -} - -func (b *InsertQuery) Record(structValue interface{}) *InsertQuery { - if len(b.Column) == 0 { - b.Columns(GetColumnsFromStruct(structValue)...) - } - b.InsertBuilder.Record(structValue) - return b -} - -// DeleteQuery -// Example: DeleteFrom().Where().Limit().Exec() - -func (conn *Conn) DeleteFrom(table string) *DeleteQuery { - return &DeleteQuery{conn.Session.DeleteFrom(table), conn.ctx, conn.DeleteHook} -} - -func (b *DeleteQuery) Where(query interface{}, value ...interface{}) *DeleteQuery { - b.DeleteBuilder.Where(query, value...) - return b -} - -func (b *DeleteQuery) Limit(n uint64) *DeleteQuery { - b.DeleteBuilder.Limit(n) - return b -} - -func (b *DeleteQuery) Exec() (sql.Result, error) { - result, err := b.DeleteBuilder.ExecContext(b.ctx) - if b.Hook != nil && err == nil { - defer b.Hook(b) - } - return result, err -} - -// UpdateQuery -// Example: Update().Set().Where().Exec() - -func (conn *Conn) Update(table string) *UpdateQuery { - return &UpdateQuery{conn.Session.Update(table), conn.ctx, conn.UpdateHook} -} - -func (b *UpdateQuery) Exec() (sql.Result, error) { - result, err := b.UpdateBuilder.ExecContext(b.ctx) - if b.Hook != nil && err == nil { - defer b.Hook(b) - } - return result, err -} - -func (b *UpdateQuery) Set(column string, value interface{}) *UpdateQuery { - b.UpdateBuilder.Set(column, value) - return b -} - -func (b *UpdateQuery) SetMap(m map[string]interface{}) *UpdateQuery { - b.UpdateBuilder.SetMap(m) - return b -} - -func (b *UpdateQuery) Where(query interface{}, value ...interface{}) *UpdateQuery { - b.UpdateBuilder.Where(query, value...) - return b -} - -func (b *UpdateQuery) Limit(n uint64) *UpdateQuery { - b.UpdateBuilder.Limit(n) - return b -} diff --git a/vendor/openpitrix.io/openpitrix/pkg/db/errors.go b/vendor/openpitrix.io/openpitrix/pkg/db/errors.go deleted file mode 100644 index 69202a3419..0000000000 --- a/vendor/openpitrix.io/openpitrix/pkg/db/errors.go +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright 2018 The OpenPitrix Authors. All rights reserved. -// Use of this source code is governed by a Apache license -// that can be found in the LICENSE file. - -package db - -import ( - "github.com/gocraft/dbr" -) - -// package errors -var ( - ErrNotFound = dbr.ErrNotFound - ErrNotSupported = dbr.ErrNotSupported - ErrTableNotSpecified = dbr.ErrTableNotSpecified - ErrColumnNotSpecified = dbr.ErrColumnNotSpecified - ErrInvalidPointer = dbr.ErrInvalidPointer - ErrPlaceholderCount = dbr.ErrPlaceholderCount - ErrInvalidSliceLength = dbr.ErrInvalidSliceLength - ErrCantConvertToTime = dbr.ErrCantConvertToTime - ErrInvalidTimestring = dbr.ErrInvalidTimestring -) diff --git a/vendor/openpitrix.io/openpitrix/pkg/db/event.go b/vendor/openpitrix.io/openpitrix/pkg/db/event.go deleted file mode 100644 index 676dc09775..0000000000 --- a/vendor/openpitrix.io/openpitrix/pkg/db/event.go +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright 2017 The OpenPitrix Authors. All rights reserved. -// Use of this source code is governed by a Apache license -// that can be found in the LICENSE file. - -package db - -import ( - "context" - - "openpitrix.io/openpitrix/pkg/logger" -) - -// EventReceiver is a sentinel EventReceiver; use it if the caller doesn't supply one -type EventReceiver struct { - ctx context.Context -} - -// Event receives a simple notification when various events occur -func (n *EventReceiver) Event(eventName string) { - -} - -// EventKv receives a notification when various events occur along with -// optional key/value data -func (n *EventReceiver) EventKv(eventName string, kvs map[string]string) { -} - -// EventErr receives a notification of an error if one occurs -func (n *EventReceiver) EventErr(eventName string, err error) error { - return err -} - -// EventErrKv receives a notification of an error if one occurs along with -// optional key/value data -func (n *EventReceiver) EventErrKv(eventName string, err error, kvs map[string]string) error { - logger.Error(n.ctx, "%+v", err) - logger.Error(n.ctx, "%s: %+v", eventName, kvs) - return err -} - -// Timing receives the time an event took to happen -func (n *EventReceiver) Timing(eventName string, nanoseconds int64) { - -} - -// TimingKv receives the time an event took to happen along with optional key/value data -func (n *EventReceiver) TimingKv(eventName string, nanoseconds int64, kvs map[string]string) { - logger.Debug(n.ctx, "%s spend %.2fms: %+v", eventName, float32(nanoseconds)/1000000, kvs) -} diff --git a/vendor/openpitrix.io/openpitrix/pkg/db/util.go b/vendor/openpitrix.io/openpitrix/pkg/db/util.go deleted file mode 100644 index 82f2fb0611..0000000000 --- a/vendor/openpitrix.io/openpitrix/pkg/db/util.go +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright 2018 The OpenPitrix Authors. All rights reserved. -// Use of this source code is governed by a Apache license -// that can be found in the LICENSE file. - -package db - -import ( - "github.com/fatih/structs" - - "openpitrix.io/openpitrix/pkg/util/stringutil" -) - -func GetColumnsFromStruct(s interface{}) []string { - names := structs.Names(s) - for i, name := range names { - names[i] = stringutil.CamelCaseToUnderscore(name) - } - return names -} - -func GetColumnsFromStructWithPrefix(prefix string, s interface{}) []string { - names := structs.Names(s) - for i, name := range names { - names[i] = WithPrefix(prefix, stringutil.CamelCaseToUnderscore(name)) - } - return names -} - -func WithPrefix(prefix, str string) string { - return prefix + "." + str -} diff --git a/vendor/openpitrix.io/openpitrix/pkg/gerr/codes.go b/vendor/openpitrix.io/openpitrix/pkg/gerr/codes.go deleted file mode 100644 index dbac1516a0..0000000000 --- a/vendor/openpitrix.io/openpitrix/pkg/gerr/codes.go +++ /dev/null @@ -1,125 +0,0 @@ -// Copyright 2018 The OpenPitrix Authors. All rights reserved. -// Use of this source code is governed by a Apache license -// that can be found in the LICENSE file. - -package gerr - -import "google.golang.org/grpc/codes" - -const ( - // OK is returned on success. - OK = codes.OK - - // Canceled indicates the operation was canceled (typically by the caller). - Canceled = codes.Canceled - - // Unknown error. An example of where this error may be returned is - // if a Status value received from another address space belongs to - // an error-space that is not known in this address space. Also - // errors raised by APIs that do not return enough error information - // may be converted to this error. - Unknown = codes.Unknown - - // InvalidArgument indicates client specified an invalid argument. - // Note that this differs from FailedPrecondition. It indicates arguments - // that are problematic regardless of the state of the system - // (e.g., a malformed file name). - InvalidArgument = codes.InvalidArgument - - // DeadlineExceeded means operation expired before completion. - // For operations that change the state of the system, this error may be - // returned even if the operation has completed successfully. For - // example, a successful response from a server could have been delayed - // long enough for the deadline to expire. - DeadlineExceeded = codes.DeadlineExceeded - - // NotFound means some requested entity (e.g., file or directory) was - // not found. - NotFound = codes.NotFound - - // AlreadyExists means an attempt to create an entity failed because one - // already exists. - AlreadyExists = codes.AlreadyExists - - // PermissionDenied indicates the caller does not have permission to - // execute the specified operation. It must not be used for rejections - // caused by exhausting some resource (use ResourceExhausted - // instead for those errors). It must not be - // used if the caller cannot be identified (use Unauthenticated - // instead for those errors). - PermissionDenied = codes.PermissionDenied - - // ResourceExhausted indicates some resource has been exhausted, perhaps - // a per-user quota, or perhaps the entire file system is out of space. - ResourceExhausted = codes.ResourceExhausted - - // FailedPrecondition indicates operation was rejected because the - // system is not in a state required for the operation's execution. - // For example, directory to be deleted may be non-empty, an rmdir - // operation is applied to a non-directory, etc. - // - // A litmus test that may help a service implementor in deciding - // between FailedPrecondition, Aborted, and Unavailable: - // (a) Use Unavailable if the client can retry just the failing call. - // (b) Use Aborted if the client should retry at a higher-level - // (e.g., restarting a read-modify-write sequence). - // (c) Use FailedPrecondition if the client should not retry until - // the system state has been explicitly fixed. E.g., if an "rmdir" - // fails because the directory is non-empty, FailedPrecondition - // should be returned since the client should not retry unless - // they have first fixed up the directory by deleting files from it. - // (d) Use FailedPrecondition if the client performs conditional - // REST Get/Update/Delete on a resource and the resource on the - // server does not match the condition. E.g., conflicting - // read-modify-write on the same resource. - FailedPrecondition = codes.FailedPrecondition - - // Aborted indicates the operation was aborted, typically due to a - // concurrency issue like sequencer check failures, transaction aborts, - // etc. - // - // See litmus test above for deciding between FailedPrecondition, - // Aborted, and Unavailable. - Aborted = codes.Aborted - - // OutOfRange means operation was attempted past the valid range. - // E.g., seeking or reading past end of file. - // - // Unlike InvalidArgument, this error indicates a problem that may - // be fixed if the system state changes. For example, a 32-bit file - // system will generate InvalidArgument if asked to read at an - // offset that is not in the range [0,2^32-1], but it will generate - // OutOfRange if asked to read from an offset past the current - // file size. - // - // There is a fair bit of overlap between FailedPrecondition and - // OutOfRange. We recommend using OutOfRange (the more specific - // error) when it applies so that callers who are iterating through - // a space can easily look for an OutOfRange error to detect when - // they are done. - OutOfRange = codes.OutOfRange - - // Unimplemented indicates operation is not implemented or not - // supported/enabled in this service. - Unimplemented = codes.Unimplemented - - // Internal errors. Means some invariants expected by underlying - // system has been broken. If you see one of these errors, - // something is very broken. - Internal = codes.Internal - - // Unavailable indicates the service is currently unavailable. - // This is a most likely a transient condition and may be corrected - // by retrying with a backoff. - // - // See litmus test above for deciding between FailedPrecondition, - // Aborted, and Unavailable. - Unavailable = codes.Unavailable - - // DataLoss indicates unrecoverable data loss or corruption. - DataLoss = codes.DataLoss - - // Unauthenticated indicates the request does not have valid - // authentication credentials for the operation. - Unauthenticated = codes.Unauthenticated -) diff --git a/vendor/openpitrix.io/openpitrix/pkg/gerr/error.go b/vendor/openpitrix.io/openpitrix/pkg/gerr/error.go deleted file mode 100644 index 623efbdc60..0000000000 --- a/vendor/openpitrix.io/openpitrix/pkg/gerr/error.go +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright 2018 The OpenPitrix Authors. All rights reserved. -// Use of this source code is governed by a Apache license -// that can be found in the LICENSE file. - -package gerr - -import ( - "context" - "fmt" - - "github.com/pkg/errors" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" - - "openpitrix.io/openpitrix/pkg/logger" - - "openpitrix.io/openpitrix/pkg/pb" - "openpitrix.io/openpitrix/pkg/util/ctxutil" -) - -const En = "en" -const ZhCN = "zh_cn" -const DefaultLocale = En - -func newStatus(ctx context.Context, code codes.Code, err error, errMsg ErrorMessage, a ...interface{}) *status.Status { - locale := ctxutil.GetLocale(ctx) - if len(locale) == 0 { - locale = DefaultLocale - } - - s := status.New(code, errMsg.Message(locale, err, a...)) - - errorDetail := &pb.ErrorDetail{ErrorName: errMsg.Name} - if err != nil { - errorDetail.Cause = fmt.Sprintf("%+v", err) - } - logger.NewLogger().WithDepth(5).Error(ctx, "err: %+v, errMsg: %s", err, errMsg.Message(locale, err, a...)) - - sd, e := s.WithDetails(errorDetail) - if e == nil { - return sd - } else { - logger.NewLogger().WithDepth(5).Error(ctx, "%+v", errors.WithStack(e)) - } - return s -} - -func ClearErrorCause(err error) error { - if e, ok := status.FromError(err); ok { - details := e.Details() - if len(details) > 0 { - detail := details[0] - if d, ok := detail.(*pb.ErrorDetail); ok { - d.Cause = "" - // clear detail - proto := e.Proto() - proto.Details = proto.Details[:0] - e = status.FromProto(proto) - e, _ := e.WithDetails(d) - return e.Err() - } - } - } - return err -} - -type GRPCError interface { - error - GRPCStatus() *status.Status -} - -func New(ctx context.Context, code codes.Code, errMsg ErrorMessage, a ...interface{}) GRPCError { - return newStatus(ctx, code, nil, errMsg, a...).Err().(GRPCError) -} - -func NewWithDetail(ctx context.Context, code codes.Code, err error, errMsg ErrorMessage, a ...interface{}) GRPCError { - return newStatus(ctx, code, err, errMsg, a...).Err().(GRPCError) -} - -func IsGRPCError(err error) bool { - if e, ok := err.(GRPCError); ok && e != nil { - return true - } - return false -} diff --git a/vendor/openpitrix.io/openpitrix/pkg/gerr/message.go b/vendor/openpitrix.io/openpitrix/pkg/gerr/message.go deleted file mode 100644 index 13e0d4ccf7..0000000000 --- a/vendor/openpitrix.io/openpitrix/pkg/gerr/message.go +++ /dev/null @@ -1,495 +0,0 @@ -// Copyright 2018 The OpenPitrix Authors. All rights reserved. -// Use of this source code is governed by a Apache license -// that can be found in the LICENSE file. - -package gerr - -import "fmt" - -type ErrorMessage struct { - Name string - en string - zhCN string -} - -func (em ErrorMessage) Message(locale string, err error, a ...interface{}) string { - format := "" - switch locale { - case En: - format = em.en - case ZhCN: - if len(em.zhCN) > 0 { - format = em.zhCN - } else { - format = em.en - } - } - if err != nil { - return fmt.Sprintf("%s: %s", fmt.Sprintf(format, a...), err.Error()) - } else { - return fmt.Sprintf(format, a...) - } -} - -var ( - ErrorPermissionDenied = ErrorMessage{ - Name: "permission_denied", - en: "permission denied", - zhCN: "没有权限", - } - ErrorAuthFailure = ErrorMessage{ - Name: "auth_failure", - en: "auth failure", - zhCN: "认证失败", - } - ErrorAccessTokenExpired = ErrorMessage{ - Name: "access_token_expired", - en: "access token expired", - zhCN: "访问令牌已过期", - } - ErrorRefreshTokenExpired = ErrorMessage{ - Name: "refresh_token_expired", - en: "refresh token expired", - zhCN: "刷新令牌已过期", - } - ErrorEmailPasswordNotMatched = ErrorMessage{ - Name: "email_password_not_matched", - en: "email and password does not match", - zhCN: "邮箱和密码不匹配", - } - ErrorPasswordIncorrect = ErrorMessage{ - Name: "password_incorrect", - en: "password incorrect", - zhCN: "密码不正确", - } - ErrorRuntimeCredentialExists = ErrorMessage{ - Name: "runtime_credential_exists", - en: "runtime credential exists", - zhCN: "环境授权信息已存在", - } - ErrorUnsupportedRuntimeProvider = ErrorMessage{ - Name: "unsupported_runtime_provider", - en: "unsupported runtime provider [%s]", - zhCN: "不支持云环境服务商[%s]", - } - ErrorRuntimeExists = ErrorMessage{ - Name: "runtime_exists", - en: "runtime exists", - zhCN: "环境已存在", - } - ErrorEmailExists = ErrorMessage{ - Name: "email_exists", - en: "email [%s] exists", - zhCN: "邮箱[%s]已存在", - } - ErrorEmailNotExists = ErrorMessage{ - Name: "email_not_exists", - en: "email [%s] not exists", - zhCN: "邮箱[%s]不存在", - } - ErrorCreateResourcesFailed = ErrorMessage{ - Name: "create_resources_failed", - en: "create resources failed", - zhCN: "创建资源失败", - } - ErrorCreateResourceFailed = ErrorMessage{ - Name: "create_resource_failed", - en: "create resource [%s] failed", - zhCN: "创建资源[%s]失败", - } - ErrorDeleteResourcesFailed = ErrorMessage{ - Name: "delete_resources_failed", - en: "delete resources failed", - zhCN: "删除资源失败", - } - ErrorDeleteResourceFailed = ErrorMessage{ - Name: "delete_resource_failed", - en: "delete resource [%s] failed", - zhCN: "删除资源[%s]失败", - } - ErrorDeleteFrontgateWithClustersFailed = ErrorMessage{ - Name: "delete_frontgate_with_clusters_failed", - en: "delete frontgate [%s] with clusters [%s] failed", - zhCN: "删除代理[%s]失败,仍有[%s]依赖", - } - ErrorUpgradeResourceFailed = ErrorMessage{ - Name: "upgrade_resource_failed", - en: "upgrade resource [%s] failed", - zhCN: "升级资源[%s]失败", - } - ErrorRollbackResourceFailed = ErrorMessage{ - Name: "rollback_resource_failed", - en: "rollback resource [%s] failed", - zhCN: "回滚资源[%s]失败", - } - ErrorResizeResourceFailed = ErrorMessage{ - Name: "resize_resource_failed", - en: "resize resource [%s] failed", - zhCN: "调整资源[%s]失败", - } - ErrorAddResourceNodeFailed = ErrorMessage{ - Name: "add_resource_node_failed", - en: "add resource [%s] node failed", - zhCN: "为资源[%s]增加节点失败", - } - ErrorDeleteResourceNodeFailed = ErrorMessage{ - Name: "delete_resource_node_failed", - en: "delete resource [%s] node failed", - zhCN: "删除资源[%s]的节点失败", - } - ErrorUpdateResourceEnvFailed = ErrorMessage{ - Name: "update_resource_env_failed", - en: "update resource [%s] env failed", - zhCN: "更新资源[%s]环境变量失败", - } - ErrorUpdateResourceFailed = ErrorMessage{ - Name: "update_resource_failed", - en: "update resource [%s] failed", - zhCN: "更新资源[%s]失败", - } - ErrorStopResourceFailed = ErrorMessage{ - Name: "stop_resource_failed", - en: "stop resource [%s] failed", - zhCN: "暂停资源[%s]失败", - } - ErrorStartResourceFailed = ErrorMessage{ - Name: "start_resource_failed", - en: "start resource [%s] failed", - zhCN: "启动资源[%s]失败", - } - ErrorRecoverResourceFailed = ErrorMessage{ - Name: "recover_resource_failed", - en: "recover resource [%s] failed", - zhCN: "回复资源[%s]失败", - } - ErrorCeaseResourceFailed = ErrorMessage{ - Name: "cease_resource_failed", - en: "cease resource [%s] failed", - zhCN: "释放资源[%s]失败", - } - ErrorRetryTaskFailed = ErrorMessage{ - Name: "retry_task_failed", - en: "retry task [%s] failed", - zhCN: "重试任务[%s]失败", - } - ErrorDescribeResourcesFailed = ErrorMessage{ - Name: "describe_resources_failed", - en: "describe resources failed", - zhCN: "获取资源失败", - } - ErrorDescribeResourceFailed = ErrorMessage{ - Name: "describe_resource_failed", - en: "describe resource [%s] failed", - zhCN: "获取资源[%s]失败", - } - ErrorModifyResourcesFailed = ErrorMessage{ - Name: "modify_resources_failed", - en: "modify resources failed", - zhCN: "修改资源失败", - } - ErrorModifyResourceFailed = ErrorMessage{ - Name: "modify_resource_failed", - en: "modify resource [%s] failed", - zhCN: "修改资源[%s]失败", - } - ErrorResourceNotFound = ErrorMessage{ - Name: "resource_not_found", - en: "resource [%s] not found", - zhCN: "没有找到资源[%s]", - } - ErrorResourceRoleNotFound = ErrorMessage{ - Name: "resource_role_not_found", - en: "resource [%s] role [%s] not found", - zhCN: "没有找到资源[%s]对应的角色[%s]", - } - ErrorSubnetNotFound = ErrorMessage{ - Name: "subnet_not_found", - en: "subnet [%s] not found or vpc not bind eip", - zhCN: "没有找到子网[%s]或者VPC没有绑定公网IP", - } - ErrorThereAreNoAvailableSubnet = ErrorMessage{ - Name: "there_are_no_available_subnet", - en: "there are no available subnet", - zhCN: "没有可用的子网", - } - ErrorProviderNotFound = ErrorMessage{ - Name: "provider_not_found", - en: "provider [%s] not found", - zhCN: "云服务商[%s]不存在", - } - ErrorInternalError = ErrorMessage{ - Name: "internal_error", - en: "internal error", - zhCN: "内部错误", - } - ErrorMissingParameter = ErrorMessage{ - Name: "missing_parameter", - en: "missing parameter [%s]", - zhCN: "缺少参数[%s]", - } - ErrorValidateFailed = ErrorMessage{ - Name: "validate_failed", - en: "validate failed", - zhCN: "校验失败", - } - ErrorParameterParseFailed = ErrorMessage{ - Name: "parameter_parse_failed", - en: "parameter [%s] parse failed", - zhCN: "参数[%s]解析失败", - } - ErrorResourceAlreadyDeleted = ErrorMessage{ - Name: "resource_already_deleted", - en: "resource [%s] has already been deleted", - zhCN: "资源[%s]已被删除", - } - ErrorResourceNotInStatus = ErrorMessage{ - Name: "resource_not_in_status", - en: "resource [%s] is not in status [%s]", - zhCN: "资源[%s]不处于[%s]状态", - } - ErrorResourceTransitionStatus = ErrorMessage{ - Name: "resource_transition_status", - en: "resource [%s] is [%s]", - zhCN: "资源[%s]处于[%s]状态", - } - ErrorIllegalParameterLength = ErrorMessage{ - Name: "illegal_parameter_length", - en: "illegal parameter [%s] length", - zhCN: "参数[%s]的长度非法", - } - ErrorParameterShouldNotBeEmpty = ErrorMessage{ - Name: "parameter_should_not_be_empty", - en: "parameter [%s] should not be empty", - zhCN: "参数[%s]不应该为空", - } - ErrorUnsupportedParameterValue = ErrorMessage{ - Name: "unsupported_parameter_value", - en: "unsupported parameter [%s] value [%s]", - zhCN: "参数[%s]不支持值[%s]", - } - ErrorIllegalUrlFormat = ErrorMessage{ - Name: "illegal_url_format", - en: "illegal URL format [%s]", - zhCN: "非法的URL格式[%s]", - } - ErrorConflictRepoName = ErrorMessage{ - Name: "conflict_repo_name", - en: "conflict repo name [%s]", - zhCN: "仓库名称[%s]已存在", - } - ErrorResourceQuotaNotEnough = ErrorMessage{ - Name: "resource_quota_not_enough", - en: "resource quota not enough: %s", - zhCN: "资源配额不足: %s", - } - ErrorHelmReleaseExists = ErrorMessage{ - Name: "helm_release_exists", - en: "helm release [%s] already exists", - zhCN: "", - } - ErrorUnsupportedApiVersion = ErrorMessage{ - Name: "unsupported_api_version", - en: "unsupported api version [%s]", - zhCN: "不支持的API版本 [%s]", - } - ErrorCannotDeleteDefaultCategory = ErrorMessage{ - Name: "cannot_delete_default_category", - en: "cannot delete default category", - zhCN: "无法删除默认的分类", - } - ErrorAttachKeyPairsFailed = ErrorMessage{ - Name: "attach_key_pairs_failed", - en: "attach key pairs failed", - zhCN: "绑定key pair失败", - } - ErrorDetachKeyPairsFailed = ErrorMessage{ - Name: "detach_key_pairs_failed", - en: "detach key pairs failed", - zhCN: "解除key pair失败", - } - ErrorAppVersionIncorrectStatus = ErrorMessage{ - Name: "app_version_incorrect_status", - en: "app version [%s] has incorrect status [%s], cannot execute the current action", - zhCN: "应用版本[%s]状态为[%s], 无法执行此操作", - } - ErrorAppVersionInReview = ErrorMessage{ - Name: "app_version_in_review", - en: "app version is under review, app cannot be modified", - zhCN: "应用版本审核中, 应用无法修改", - } - ErrorLoadPackageFailed = ErrorMessage{ - Name: "load_package_failed", - en: "load package failed, reason: [%s]", - zhCN: "载入配置包失败, 原因: [%s]", - } - ErrorCannotChangeAppName = ErrorMessage{ - Name: "cannot_change_app_name", - en: "cannot change app name", - zhCN: "无法修改应用名称", - } - ErrorAppNameExists = ErrorMessage{ - Name: "app_name_exists", - en: "app name [%s] exists", - zhCN: "应用名称[%s]已存在", - } - ErrorAppVersionExists = ErrorMessage{ - Name: "app_version_exists", - en: "app version [%s:%s] exists", - zhCN: "应用版本[%s:%s]已存在", - } - ErrorCompanyNameExists = ErrorMessage{ - Name: "company_name_exists", - en: "company name [%s] exists", - zhCN: "公司名称[%s]已存在", - } - ErrorCannotAccessRepo = ErrorMessage{ - Name: "cannot_access_repo", - en: "cannot access repo", - zhCN: "仓库无法访问", - } - ErrorCannotWriteRepo = ErrorMessage{ - Name: "cannot_write_repo", - en: "cannot write repo [%s]", - zhCN: "仓库[%s]无法写入", - } - ErrorCannotDeleteInternalRepo = ErrorMessage{ - Name: "cannot_delete_internal_repo", - en: "cannot delete internal repo [%s]", - zhCN: "无法删除内置仓库[%s]", - } - ErrorResourceAccessDenied = ErrorMessage{ - Name: "error_resource_access_denied", - en: "access denied for resource [%s]", - zhCN: "拒绝访问资源[%s]", - } - ErrorExistsNoDeleteVersions = ErrorMessage{ - Name: "exists_no_delete_versions", - en: "app [%s] had some versions not deleted", - zhCN: "应用[%s]还有未删除的版本", - } - ErrorTillerNotServe = ErrorMessage{ - Name: "tiller_not_serve", - en: "tiller not serve in namespace [%s]", - zhCN: "tiller 在命名空间[%s]下未正常服务", - } - ErrorNamespaceUnavailable = ErrorMessage{ - Name: "namespace_unavailable", - en: "namespace [%s] unavailable", - zhCN: "命名空间[%s]不可用", - } - ErrorNamespaceNotMatchWithRegex = ErrorMessage{ - Name: "namespace_not_match_with_regex", - en: "namespace [%s] not match with regex [%s]", - zhCN: "命名空间[%s]命名不合法, 需要满足[%s]", - } - ErrorCredentialIllegal = ErrorMessage{ - Name: "credential_illegal", - en: "credential [%s] illegal", - zhCN: "credential [%s]不合法", - } - ErrorNamespaceExists = ErrorMessage{ - Name: "namespace exists", - en: "namespace [%s] exists", - zhCN: "命名空间[%s]已存在", - } - ErrorPackageParseFailed = ErrorMessage{ - Name: "package_parse_failed", - en: "package parse failed", - zhCN: "配置包解析失败", - } - ErrorAppNameConflictWithPackage = ErrorMessage{ - Name: "app_name_conflict_with_package", - en: "app name conflict with package", - zhCN: "应用名称与配置包内信息冲突", - } - ErrorImageDecodeFailed = ErrorMessage{ - Name: "image_decode_failed", - en: "image decode failed", - zhCN: "图片解码失败", - } - ErrorIllegalEmailFormat = ErrorMessage{ - Name: "illegal_email_format", - en: "illegal Email format [%s]", - zhCN: "非法的Email格式[%s]", - } - ErrorIllegalPhoneNumFormat = ErrorMessage{ - Name: "illegal_phone_num_format", - en: "illegal phone number format [%s]", - zhCN: "非法的电话号码格式[%s]", - } - ErrorIllegalBankAccountNumberFormat = ErrorMessage{ - Name: "illegal_bankAccountNumber_format", - en: "illegal BankAccountNumber format [%s]", - zhCN: "非法的银行账号格式[%s]", - } - ErrorGroupHadMembers = ErrorMessage{ - Name: "group_had_members", - en: "group had members", - zhCN: "组内还有成员", - } - ErrorSetNotificationConfig = ErrorMessage{ - Name: "error_set_notification_config", - en: "set notification config failed", - zhCN: "设置通知服务配置失败", - } - ErrorSetServiceConfig = ErrorMessage{ - Name: "error_set_service_config", - en: "set service config failed", - zhCN: "设置服务配置失败", - } - ErrorGetNotificationConfig = ErrorMessage{ - Name: "error_get_notification_config", - en: "get notification config failed", - zhCN: "查看通知服务配置失败", - } - ErrorCannotDeleteUsers = ErrorMessage{ - Name: "error_cannot_delete_users", - en: "cannot delete users", - zhCN: "无法删除用户", - } - ErrorCannotDeleteGroups = ErrorMessage{ - Name: "error_cannot_delete_groups", - en: "cannot delete groups", - zhCN: "无法删除用户组", - } - ErrorGroupNotFound = ErrorMessage{ - Name: "error_group_not_found", - en: "group [%s] not found", - zhCN: "没有找到用户组[%s]", - } - ErrorGroupAccessDenied = ErrorMessage{ - Name: "error_group_access_denied", - en: "access denied for group [%s]", - zhCN: "拒绝访问用户组[%s]", - } - ErrorUserNotFound = ErrorMessage{ - Name: "error_user_not_found", - en: "user [%s] not found", - zhCN: "没有找到用户[%s]", - } - ErrorUserAccessDenied = ErrorMessage{ - Name: "error_user_access_denied", - en: "access denied for user [%s]", - zhCN: "拒绝访问用户[%s]", - } - ErrorCannotJoinGroup = ErrorMessage{ - Name: "error_cannot_join_group", - en: "cannot join group", - zhCN: "无法加入用户组", - } - ErrorCannotLeaveGroup = ErrorMessage{ - Name: "error_cannot_leave_group", - en: "cannot leave group", - zhCN: "无法离开用户组", - } - ErrorCannotCreateUserWithRole = ErrorMessage{ - Name: "error_cannot_create_user_with_role", - en: "cannot create user with role [%s]", - zhCN: "无法创建[%s]角色的用户", - } - ErrorValidateEmailService = ErrorMessage{ - Name: "error_validate_email_service", - en: "validate email service failed", - zhCN: "验证邮件服务配置失败", - } -) diff --git a/vendor/openpitrix.io/openpitrix/pkg/logger/logger.go b/vendor/openpitrix.io/openpitrix/pkg/logger/logger.go deleted file mode 100644 index 06b742af07..0000000000 --- a/vendor/openpitrix.io/openpitrix/pkg/logger/logger.go +++ /dev/null @@ -1,201 +0,0 @@ -// Copyright 2018 The OpenPitrix Authors. All rights reserved. -// Use of this source code is governed by a Apache license -// that can be found in the LICENSE file. - -package logger - -import ( - "context" - "fmt" - "io" - "os" - "runtime" - "strings" - "sync/atomic" - "time" - - "openpitrix.io/openpitrix/pkg/util/ctxutil" -) - -type Level uint32 - -const ( - CriticalLevel Level = iota - ErrorLevel - WarnLevel - InfoLevel - DebugLevel -) - -func (level Level) String() string { - switch level { - case DebugLevel: - return "debug" - case InfoLevel: - return "info" - case WarnLevel: - return "warning" - case ErrorLevel: - return "error" - case CriticalLevel: - return "critical" - } - - return "unknown" -} - -func StringToLevel(level string) Level { - switch level { - case "critical": - return CriticalLevel - case "error": - return ErrorLevel - case "warn", "warning": - return WarnLevel - case "debug": - return DebugLevel - case "info": - return InfoLevel - } - return InfoLevel -} - -var logger = NewLogger().WithDepth(4) - -func Info(ctx context.Context, format string, v ...interface{}) { - logger.Info(ctx, format, v...) -} - -func Debug(ctx context.Context, format string, v ...interface{}) { - logger.Debug(ctx, format, v...) -} - -func Warn(ctx context.Context, format string, v ...interface{}) { - logger.Warn(ctx, format, v...) -} - -func Error(ctx context.Context, format string, v ...interface{}) { - logger.Error(ctx, format, v...) -} - -func Critical(ctx context.Context, format string, v ...interface{}) { - logger.Critical(ctx, format, v...) -} - -func SetOutput(output io.Writer) { - logger.SetOutput(output) -} - -var globalLogLevel = InfoLevel - -func SetLevelByString(level string) { - logger.SetLevelByString(level) - globalLogLevel = StringToLevel(level) -} - -func NewLogger() *Logger { - return &Logger{ - Level: globalLogLevel, - output: os.Stdout, - depth: 3, - } -} - -type Logger struct { - Level Level - output io.Writer - hideCallstack bool - depth int -} - -func (logger *Logger) level() Level { - return Level(atomic.LoadUint32((*uint32)(&logger.Level))) -} - -func (logger *Logger) SetLevel(level Level) { - atomic.StoreUint32((*uint32)(&logger.Level), uint32(level)) -} - -func (logger *Logger) SetLevelByString(level string) { - logger.SetLevel(StringToLevel(level)) -} - -var replacer = strings.NewReplacer("\r", "\\r", "\n", "\\n") - -func (logger *Logger) formatOutput(ctx context.Context, level Level, output string) string { - now := time.Now().Format("2006-01-02 15:04:05.99999") - messageId := ctxutil.GetMessageId(ctx) - requestId := ctxutil.GetRequestId(ctx) - - output = replacer.Replace(output) - - var suffix string - if len(requestId) > 0 { - messageId = append(messageId, requestId) - } - if len(messageId) > 0 { - suffix = fmt.Sprintf("(%s)", strings.Join(messageId, "|")) - } - if logger.hideCallstack { - return fmt.Sprintf("%-25s -%s- %s%s", - now, strings.ToUpper(level.String()), output, suffix) - } else { - _, file, line, ok := runtime.Caller(logger.depth) - if !ok { - file = "???" - line = 0 - } - // short file name - for i := len(file) - 1; i > 0; i-- { - if file[i] == '/' { - file = file[i+1:] - break - } - } - // 2018-03-27 02:08:44.93894 -INFO- Api service start http://openpitrix-api-gateway:9100 (main.go:44) - return fmt.Sprintf("%-25s -%s- %s (%s:%d)%s", - now, strings.ToUpper(level.String()), output, file, line, suffix) - } -} - -func (logger *Logger) logf(ctx context.Context, level Level, format string, args ...interface{}) { - if logger.level() < level { - return - } - fmt.Fprintln(logger.output, logger.formatOutput(ctx, level, fmt.Sprintf(format, args...))) -} - -func (logger *Logger) Debug(ctx context.Context, format string, args ...interface{}) { - logger.logf(ctx, DebugLevel, format, args...) -} - -func (logger *Logger) Info(ctx context.Context, format string, args ...interface{}) { - logger.logf(ctx, InfoLevel, format, args...) -} - -func (logger *Logger) Warn(ctx context.Context, format string, args ...interface{}) { - logger.logf(ctx, WarnLevel, format, args...) -} - -func (logger *Logger) Error(ctx context.Context, format string, args ...interface{}) { - logger.logf(ctx, ErrorLevel, format, args...) -} - -func (logger *Logger) Critical(ctx context.Context, format string, args ...interface{}) { - logger.logf(ctx, CriticalLevel, format, args...) -} - -func (logger *Logger) SetOutput(output io.Writer) *Logger { - logger.output = output - return logger -} - -func (logger *Logger) HideCallstack() *Logger { - logger.hideCallstack = true - return logger -} - -func (logger *Logger) WithDepth(depth int) *Logger { - logger.depth = depth - return logger -} diff --git a/vendor/openpitrix.io/openpitrix/pkg/manager/checker.go b/vendor/openpitrix.io/openpitrix/pkg/manager/checker.go deleted file mode 100644 index aca71b65cd..0000000000 --- a/vendor/openpitrix.io/openpitrix/pkg/manager/checker.go +++ /dev/null @@ -1,132 +0,0 @@ -// Copyright 2018 The OpenPitrix Authors. All rights reserved. -// Use of this source code is governed by a Apache license -// that can be found in the LICENSE file. - -package manager - -import ( - "context" - - "github.com/fatih/structs" - "github.com/golang/protobuf/ptypes/wrappers" - - "openpitrix.io/openpitrix/pkg/gerr" - "openpitrix.io/openpitrix/pkg/util/stringutil" -) - -type checker struct { - ctx context.Context - req Request - required []string - stringChosen map[string][]string -} - -func NewChecker(ctx context.Context, req Request) *checker { - return &checker{ - ctx: ctx, - req: req, - required: []string{}, - stringChosen: make(map[string][]string), - } -} - -func (c *checker) Required(params ...string) *checker { - c.required = append(c.required, params...) - return c -} - -func (c *checker) checkRequired(param string, value interface{}) error { - if len(c.required) > 0 && stringutil.StringIn(param, c.required) { - switch v := value.(type) { - case string: - if v == "" { - return gerr.New(c.ctx, gerr.InvalidArgument, gerr.ErrorMissingParameter, param) - } - case *wrappers.StringValue: - if v == nil || v.GetValue() == "" { - return gerr.New(c.ctx, gerr.InvalidArgument, gerr.ErrorMissingParameter, param) - } - case *wrappers.BytesValue: - if v == nil || len(v.GetValue()) == 0 { - return gerr.New(c.ctx, gerr.InvalidArgument, gerr.ErrorMissingParameter, param) - } - case []byte: - if len(v) == 0 { - return gerr.New(c.ctx, gerr.InvalidArgument, gerr.ErrorMissingParameter, param) - } - case []string: - var values []string - for _, v := range v { - if v != "" { - values = append(values, v) - } - } - if len(values) == 0 { - return gerr.New(c.ctx, gerr.InvalidArgument, gerr.ErrorMissingParameter, param) - } - } - } - return nil -} - -func (c *checker) StringChosen(param string, chosen []string) *checker { - if exist, ok := c.stringChosen[param]; ok { - c.stringChosen[param] = append(exist, chosen...) - } else { - c.stringChosen[param] = chosen - } - return c -} - -func (c *checker) checkStringChosen(param string, value interface{}) error { - if len(c.stringChosen) > 0 { - if chosen, ok := c.stringChosen[param]; ok { - switch v := value.(type) { - case string: - if !stringutil.StringIn(v, chosen) { - return gerr.New(c.ctx, gerr.InvalidArgument, gerr.ErrorUnsupportedParameterValue, param, v) - } - case *wrappers.StringValue: - if v != nil { - if !stringutil.StringIn(v.GetValue(), chosen) { - return gerr.New(c.ctx, gerr.InvalidArgument, gerr.ErrorUnsupportedParameterValue, param, v.GetValue()) - } - } - case []string: - for _, s := range v { - if !stringutil.StringIn(s, chosen) { - return gerr.New(c.ctx, gerr.InvalidArgument, gerr.ErrorUnsupportedParameterValue, param, s) - } - } - } - } - } - return nil -} - -func (c *checker) chainChecker(param string, value interface{}, checks ...func(string, interface{}) error) error { - var err error - for _, c := range checks { - err = c(param, value) - if err != nil { - return err - } - } - return nil -} - -func (c *checker) Exec() error { - for _, field := range structs.Fields(c.req) { - param := getFieldName(field) - value := field.Value() - - err := c.chainChecker(param, value, - c.checkRequired, - c.checkStringChosen, - ) - if err != nil { - return err - } - } - return nil -} diff --git a/vendor/openpitrix.io/openpitrix/pkg/manager/common.go b/vendor/openpitrix.io/openpitrix/pkg/manager/common.go deleted file mode 100644 index 4d9f39df62..0000000000 --- a/vendor/openpitrix.io/openpitrix/pkg/manager/common.go +++ /dev/null @@ -1,273 +0,0 @@ -// Copyright 2018 The OpenPitrix Authors. All rights reserved. -// Use of this source code is governed by a Apache license -// that can be found in the LICENSE file. - -package manager - -import ( - "context" - "fmt" - "reflect" - "strings" - "time" - - "github.com/fatih/structs" - "github.com/gocraft/dbr" - "github.com/golang/protobuf/ptypes/timestamp" - "github.com/golang/protobuf/ptypes/wrappers" - - "openpitrix.io/openpitrix/pkg/constants" - "openpitrix.io/openpitrix/pkg/db" - "openpitrix.io/openpitrix/pkg/logger" - "openpitrix.io/openpitrix/pkg/util/ctxutil" - "openpitrix.io/openpitrix/pkg/util/pbutil" - "openpitrix.io/openpitrix/pkg/util/reflectutil" - "openpitrix.io/openpitrix/pkg/util/stringutil" -) - -type Request interface { - Reset() - String() string - ProtoMessage() - Descriptor() ([]byte, []int) -} -type RequestWithSortKey interface { - Request - GetSortKey() *wrappers.StringValue -} -type RequestWithReverse interface { - RequestWithSortKey - GetReverse() *wrappers.BoolValue -} -type RequestWithOwner interface { - Request - GetOwner() []string -} - -const ( - TagName = "json" - SearchWordColumnName = "search_word" -) - -func getSearchFilter(tableName string, value interface{}, exclude ...string) dbr.Builder { - if v, ok := value.(string); ok { - var ops []dbr.Builder - for _, column := range constants.SearchColumns[tableName] { - if stringutil.StringIn(column, exclude) { - continue - } - // if column suffix is _id, must exact match - if strings.HasSuffix(column, "_id") { - ops = append(ops, db.Eq(column, v)) - } else { - ops = append(ops, db.Like(column, v)) - } - } - if len(ops) == 0 { - return nil - } - return db.Or(ops...) - } else if value != nil { - logger.Warn(nil, "search_word [%+v] is not string", value) - } - return nil -} - -func getReqValue(param interface{}) interface{} { - switch value := param.(type) { - case string: - if value == "" { - return nil - } - return value - case *wrappers.StringValue: - if value == nil { - return nil - } - return value.GetValue() - case *wrappers.Int32Value: - if value == nil { - return nil - } - return value.GetValue() - case []string: - var values []string - for _, v := range value { - if v != "" { - values = append(values, v) - } - } - if len(values) == 0 { - return nil - } - return values - } - return nil -} - -func BuildFilterConditions(req Request, tableName string, exclude ...string) dbr.Builder { - return buildFilterConditions(false, req, tableName, exclude...) -} - -func GetDisplayColumns(displayColumns []string, wholeColumns []string) []string { - if displayColumns == nil { - return wholeColumns - } else if len(displayColumns) == 0 { - return nil - } else { - var newDisplayColumns []string - for _, column := range displayColumns { - if stringutil.StringIn(column, wholeColumns) { - newDisplayColumns = append(newDisplayColumns, column) - } - } - return newDisplayColumns - } -} - -func BuildFilterConditionsWithPrefix(req Request, tableName string, exclude ...string) dbr.Builder { - return buildFilterConditions(true, req, tableName, exclude...) -} - -func getFieldName(field *structs.Field) string { - tag := field.Tag(TagName) - t := strings.Split(tag, ",") - if len(t) == 0 { - return "-" - } - return t[0] -} - -func buildFilterConditions(withPrefix bool, req Request, tableName string, exclude ...string) dbr.Builder { - var conditions []dbr.Builder - for _, field := range structs.Fields(req) { - column := getFieldName(field) - param := field.Value() - indexedColumns, ok := constants.IndexedColumns[tableName] - if ok && stringutil.StringIn(column, indexedColumns) { - value := getReqValue(param) - if value != nil { - key := column - if withPrefix { - key = tableName + "." + key - } - conditions = append(conditions, db.Eq(key, value)) - } - } - // TODO: search column - if column == SearchWordColumnName && stringutil.StringIn(tableName, constants.SearchWordColumnTable) { - value := getReqValue(param) - condition := getSearchFilter(tableName, value, exclude...) - if condition != nil { - conditions = append(conditions, condition) - } - } - } - if len(conditions) == 0 { - return nil - } - return db.And(conditions...) -} - -func BuildUpdateAttributes(req Request, columns ...string) map[string]interface{} { - attributes := make(map[string]interface{}) - for _, field := range structs.Fields(req) { - column := getFieldName(field) - f := field.Value() - v := reflect.ValueOf(f) - if !stringutil.StringIn(column, columns) { - continue - } - if !reflectutil.ValueIsNil(v) { - switch v := f.(type) { - case *wrappers.StringValue: - attributes[column] = v.GetValue() - case *wrappers.BoolValue: - attributes[column] = v.GetValue() - case *wrappers.Int32Value: - attributes[column] = v.GetValue() - case *wrappers.UInt32Value: - attributes[column] = v.GetValue() - case *timestamp.Timestamp: - attributes[column] = pbutil.GetTime(v) - case string, bool, int32, uint32, time.Time: - attributes[column] = v - - default: - attributes[column] = v - } - } - } - return attributes -} - -func AddQueryOrderDirWithPrefix(query *db.SelectQuery, req Request, defaultColumn, tableName string) *db.SelectQuery { - return addQueryOrderDir(query, req, defaultColumn, tableName) -} - -func AddQueryOrderDir(query *db.SelectQuery, req Request, defaultColumn string) *db.SelectQuery { - return addQueryOrderDir(query, req, defaultColumn, "") -} - -func addQueryOrderDir(query *db.SelectQuery, req Request, defaultColumn string, tableName string) *db.SelectQuery { - isAsc := false - if r, ok := req.(RequestWithReverse); ok { - reverse := r.GetReverse() - if reverse != nil { - isAsc = !reverse.GetValue() - } - } - if r, ok := req.(RequestWithSortKey); ok { - s := r.GetSortKey() - if s != nil { - defaultColumn = s.GetValue() - } - } - if !stringutil.StringIn(defaultColumn, constants.Fields) { - defaultColumn = constants.ColumnCreateTime - } - if len(tableName) > 0 { - defaultColumn = tableName + "." + defaultColumn - } - query = query.OrderDir(defaultColumn, isAsc) - return query -} - -func AddQueryJoinWithMap(query *db.SelectQuery, table, joinTable, primaryKey, keyField, valueField string, filterMap map[string][]string) *db.SelectQuery { - var whereCondition []dbr.Builder - for key, values := range filterMap { - aliasTableName := fmt.Sprintf("table_label_%d", query.JoinCount) - onCondition := fmt.Sprintf("%s.%s = %s.%s", aliasTableName, primaryKey, table, primaryKey) - query = query.Join(dbr.I(joinTable).As(aliasTableName), onCondition) - whereCondition = append(whereCondition, db.And(db.Eq(aliasTableName+"."+keyField, key), db.Eq(aliasTableName+"."+valueField, values))) - query.JoinCount++ - } - if len(whereCondition) > 0 { - query = query.Where(db.And(whereCondition...)) - } - return query -} - -func BuildPermissionFilter(ctx context.Context) dbr.Builder { - s := ctxutil.GetSender(ctx) - if s == nil { - return nil - } - ops := []dbr.Builder{ - db.Prefix(constants.ColumnOwnerPath, string(s.GetAccessPath())), - db.Eq(constants.ColumnOwner, s.UserId), - } - return db.Or(ops...) -} - -func BuildPermissionFilterWithPrefix(ctx context.Context, prefix string) dbr.Builder { - s := ctxutil.GetSender(ctx) - if s == nil { - return nil - } - ops := []dbr.Builder{ - db.Prefix(prefix+"."+constants.ColumnOwnerPath, string(s.GetAccessPath())), - db.Eq(prefix+"."+constants.ColumnOwner, s.UserId), - } - return db.Or(ops...) -} diff --git a/vendor/openpitrix.io/openpitrix/pkg/manager/grpc_client.go b/vendor/openpitrix.io/openpitrix/pkg/manager/grpc_client.go deleted file mode 100644 index 5b4a50f103..0000000000 --- a/vendor/openpitrix.io/openpitrix/pkg/manager/grpc_client.go +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright 2018 The OpenPitrix Authors. All rights reserved. -// Use of this source code is governed by a Apache license -// that can be found in the LICENSE file. - -package manager - -import ( - "context" - "crypto/tls" - "fmt" - "sync" - "time" - - "google.golang.org/grpc" - "google.golang.org/grpc/credentials" - "google.golang.org/grpc/keepalive" -) - -var ClientOptions = []grpc.DialOption{ - grpc.WithInsecure(), - grpc.WithKeepaliveParams(keepalive.ClientParameters{ - Time: 30 * time.Second, - Timeout: 10 * time.Second, - PermitWithoutStream: true, - }), -} - -var clientCache sync.Map - -func NewClient(host string, port int) (*grpc.ClientConn, error) { - endpoint := fmt.Sprintf("%s:%d", host, port) - if conn, ok := clientCache.Load(endpoint); ok { - return conn.(*grpc.ClientConn), nil - } - ctx := context.Background() - conn, err := grpc.DialContext(ctx, endpoint, ClientOptions...) - if err != nil { - return nil, err - } - //clientCache.Store(endpoint, conn) - return conn, nil -} - -func NewTLSClient(host string, port int, tlsConfig *tls.Config) (*grpc.ClientConn, error) { - endpoint := fmt.Sprintf("%s:%d", host, port) - if conn, ok := clientCache.Load(endpoint); ok { - return conn.(*grpc.ClientConn), nil - } - creds := credentials.NewTLS(tlsConfig) - tlsClientOptions := []grpc.DialOption{ - grpc.WithTransportCredentials(creds), - grpc.WithKeepaliveParams(keepalive.ClientParameters{ - Time: 30 * time.Second, - Timeout: 10 * time.Second, - PermitWithoutStream: true, - }), - } - conn, err := grpc.Dial(endpoint, tlsClientOptions...) - if err != nil { - return nil, err - } - clientCache.Store(endpoint, conn) - return conn, nil -} diff --git a/vendor/openpitrix.io/openpitrix/pkg/manager/grpc_server.go b/vendor/openpitrix.io/openpitrix/pkg/manager/grpc_server.go deleted file mode 100644 index 7b6b44a57a..0000000000 --- a/vendor/openpitrix.io/openpitrix/pkg/manager/grpc_server.go +++ /dev/null @@ -1,199 +0,0 @@ -// Copyright 2018 The OpenPitrix Authors. All rights reserved. -// Use of this source code is governed by a Apache license -// that can be found in the LICENSE file. - -package manager - -import ( - "context" - "fmt" - "net" - "runtime/debug" - "strings" - "time" - - "github.com/golang/protobuf/jsonpb" - "github.com/golang/protobuf/proto" - grpc_middleware "github.com/grpc-ecosystem/go-grpc-middleware" - grpc_recovery "github.com/grpc-ecosystem/go-grpc-middleware/recovery" - grpc_validator "github.com/grpc-ecosystem/go-grpc-middleware/validator" - "github.com/pkg/errors" - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/keepalive" - "google.golang.org/grpc/reflection" - "google.golang.org/grpc/status" - - "openpitrix.io/openpitrix/pkg/config" - "openpitrix.io/openpitrix/pkg/db" - "openpitrix.io/openpitrix/pkg/gerr" - "openpitrix.io/openpitrix/pkg/logger" - "openpitrix.io/openpitrix/pkg/util/ctxutil" - "openpitrix.io/openpitrix/pkg/version" -) - -type checkerT func(ctx context.Context, req interface{}) error -type builderT func(ctx context.Context, req interface{}) interface{} - -var ( - defaultChecker checkerT - defaultBuilder builderT -) - -type GrpcServer struct { - ServiceName string - Port int - showErrorCause bool - checker checkerT - builder builderT - mysqlConfig config.MysqlConfig -} - -type RegisterCallback func(*grpc.Server) - -func NewGrpcServer(serviceName string, port int) *GrpcServer { - return &GrpcServer{ - ServiceName: serviceName, - Port: port, - showErrorCause: false, - checker: defaultChecker, - builder: defaultBuilder, - } -} - -func (g *GrpcServer) ShowErrorCause(b bool) *GrpcServer { - g.showErrorCause = b - return g -} - -func (g *GrpcServer) WithChecker(c checkerT) *GrpcServer { - g.checker = c - return g -} - -func (g *GrpcServer) WithBuilder(b builderT) *GrpcServer { - g.builder = b - return g -} - -func (g *GrpcServer) WithMysqlConfig(cfg config.MysqlConfig) *GrpcServer { - g.mysqlConfig = cfg - return g -} - -func (g *GrpcServer) Serve(callback RegisterCallback, opt ...grpc.ServerOption) { - version.PrintVersionInfo(func(s string, i ...interface{}) { - logger.Info(nil, s, i) - }) - logger.Info(nil, "Service [%s] start listen at port [%d]", g.ServiceName, g.Port) - lis, err := net.Listen("tcp", fmt.Sprintf(":%d", g.Port)) - if err != nil { - err = errors.WithStack(err) - logger.Critical(nil, "failed to listen: %+v", err) - } - - builtinOptions := []grpc.ServerOption{ - grpc.KeepaliveEnforcementPolicy(keepalive.EnforcementPolicy{ - MinTime: 10 * time.Second, - PermitWithoutStream: true, - }), - grpc_middleware.WithUnaryServerChain( - grpc_validator.UnaryServerInterceptor(), - g.unaryServerLogInterceptor(), - func(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (resp interface{}, err error) { - ctx = db.NewContext(ctx, g.mysqlConfig) - - if g.checker != nil { - err = g.checker(ctx, req) - if err != nil { - return - } - } - - return handler(ctx, req) - }, - func(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (resp interface{}, err error) { - if g.builder != nil { - req = g.builder(ctx, req) - } - return handler(ctx, req) - }, - grpc_recovery.UnaryServerInterceptor( - grpc_recovery.WithRecoveryHandler(func(p interface{}) error { - logger.Critical(nil, "GRPC server recovery with error: %+v", p) - logger.Critical(nil, string(debug.Stack())) - if e, ok := p.(error); ok { - return gerr.NewWithDetail(nil, gerr.Internal, e, gerr.ErrorInternalError) - } - return gerr.New(nil, gerr.Internal, gerr.ErrorInternalError) - }), - ), - ), - grpc_middleware.WithStreamServerChain( - grpc_recovery.StreamServerInterceptor( - grpc_recovery.WithRecoveryHandler(func(p interface{}) error { - logger.Critical(nil, "GRPC server recovery with error: %+v", p) - logger.Critical(nil, string(debug.Stack())) - if e, ok := p.(error); ok { - return gerr.NewWithDetail(nil, gerr.Internal, e, gerr.ErrorInternalError) - } - return gerr.New(nil, gerr.Internal, gerr.ErrorInternalError) - }), - ), - ), - } - - grpcServer := grpc.NewServer(append(opt, builtinOptions...)...) - reflection.Register(grpcServer) - callback(grpcServer) - - if err = grpcServer.Serve(lis); err != nil { - err = errors.WithStack(err) - logger.Critical(nil, "%+v", err) - } -} - -var ( - jsonPbMarshaller = &jsonpb.Marshaler{ - OrigName: true, - } -) - -func (g *GrpcServer) unaryServerLogInterceptor() grpc.UnaryServerInterceptor { - showErrorCause := g.showErrorCause - - return func(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error) { - var err error - s := ctxutil.GetSender(ctx) - requestId := ctxutil.GetRequestId(ctx) - ctx = ctxutil.SetRequestId(ctx, requestId) - ctx = ctxutil.ContextWithSender(ctx, s) - locale := ctxutil.GetLocale(ctx) - ctx = ctxutil.SetLocale(ctx, locale) - - method := strings.Split(info.FullMethod, "/") - action := method[len(method)-1] - if p, ok := req.(proto.Message); ok { - if content, err := jsonPbMarshaller.MarshalToString(p); err != nil { - logger.Error(ctx, "Failed to marshal proto message to string [%s] [%+v] [%+v]", action, s, err) - } else { - logger.Info(ctx, "Request received [%s] [%+v] [%s]", action, s, content) - } - } - start := time.Now() - - resp, err := handler(ctx, req) - - elapsed := time.Since(start) - logger.Info(ctx, "Handled request [%s] [%+v] exec_time is [%s]", action, s, elapsed) - if e, ok := status.FromError(err); ok { - if e.Code() != codes.OK { - logger.Debug(ctx, "Response is error: %s, %s", e.Code().String(), e.Message()) - if !showErrorCause { - err = gerr.ClearErrorCause(err) - } - } - } - return resp, err - } -} diff --git a/vendor/openpitrix.io/openpitrix/pkg/pb/0.pb.go b/vendor/openpitrix.io/openpitrix/pkg/pb/0.pb.go deleted file mode 100644 index 36f2e000e0..0000000000 --- a/vendor/openpitrix.io/openpitrix/pkg/pb/0.pb.go +++ /dev/null @@ -1,49 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// source: 0.proto - -package pb - -import ( - fmt "fmt" - math "math" - - proto "github.com/golang/protobuf/proto" - _ "github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger/options" -) - -// 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 - -func init() { proto.RegisterFile("0.proto", fileDescriptor_b5d39afb3b422e60) } - -var fileDescriptor_b5d39afb3b422e60 = []byte{ - // 312 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x90, 0xcd, 0x4a, 0x33, 0x31, - 0x14, 0x86, 0xbf, 0x09, 0x7c, 0x3f, 0x04, 0x3e, 0x29, 0x03, 0x6e, 0xba, 0x3a, 0xb8, 0x29, 0x68, - 0x3b, 0xd3, 0x56, 0x10, 0xe9, 0xae, 0x05, 0xdb, 0x8a, 0x48, 0x8b, 0x3f, 0x08, 0xdd, 0x25, 0x33, - 0xc7, 0x4e, 0xea, 0x34, 0x27, 0x24, 0x99, 0xb6, 0xf6, 0x06, 0xdc, 0xbb, 0xf7, 0x0e, 0x04, 0x77, - 0x2e, 0xbd, 0x36, 0x71, 0x2a, 0x48, 0xd1, 0x5d, 0xf2, 0x70, 0x9e, 0xf3, 0xbe, 0x1c, 0xfe, 0xb7, - 0x19, 0x19, 0x4b, 0x9e, 0x42, 0x4e, 0x06, 0xb5, 0x51, 0xde, 0xaa, 0x55, 0xb5, 0x5e, 0xa2, 0xa4, - 0x31, 0x45, 0xdd, 0x70, 0x4b, 0x31, 0x9d, 0xa2, 0x8d, 0xc9, 0x78, 0x45, 0xda, 0xc5, 0x42, 0x6b, - 0xf2, 0xa2, 0x7c, 0x6f, 0xcc, 0xde, 0x1b, 0x7b, 0xec, 0xbe, 0xb2, 0x70, 0xc8, 0xc3, 0x91, 0x41, - 0x3d, 0x2e, 0x57, 0xc0, 0xd8, 0xd2, 0x0c, 0x13, 0xbf, 0x77, 0xf0, 0x13, 0x0d, 0x77, 0x33, 0xef, - 0x8d, 0xeb, 0xc4, 0xf1, 0x57, 0x68, 0xa4, 0xa8, 0xfd, 0xbb, 0x19, 0x35, 0xa3, 0xd6, 0x3e, 0x0b, - 0x58, 0xbb, 0x22, 0x8c, 0xc9, 0x55, 0x52, 0x06, 0xc5, 0x33, 0x47, 0xba, 0xf3, 0x8d, 0x4c, 0x5e, - 0x02, 0xfe, 0x1c, 0x70, 0xde, 0x43, 0x61, 0xd1, 0x76, 0x0b, 0x9f, 0x85, 0x4f, 0xc1, 0x3f, 0x16, - 0x3e, 0x04, 0x57, 0x19, 0xc2, 0xc7, 0x9f, 0xac, 0x5a, 0x97, 0xf3, 0x90, 0xa1, 0x48, 0xd1, 0xc2, - 0xbc, 0x70, 0x1e, 0x24, 0x82, 0x43, 0x0f, 0x9e, 0x60, 0x63, 0xc2, 0x2d, 0xe5, 0x39, 0x2d, 0x31, - 0x05, 0x79, 0x0f, 0x02, 0x9c, 0x11, 0x09, 0x82, 0xd0, 0x29, 0x08, 0xf0, 0x74, 0x87, 0x3a, 0x82, - 0x3e, 0x59, 0xc0, 0x95, 0x98, 0x9b, 0x1c, 0xeb, 0x50, 0xfb, 0xb4, 0x16, 0xc3, 0x6b, 0x21, 0x55, - 0xef, 0xe4, 0xf4, 0x4c, 0x1d, 0xeb, 0xd6, 0x45, 0xba, 0xb8, 0x19, 0xcd, 0x06, 0xfd, 0x22, 0x1f, - 0x5c, 0x9e, 0x1f, 0xad, 0x0b, 0x2d, 0x6b, 0x51, 0xf5, 0xff, 0x76, 0x09, 0x26, 0x2b, 0x7c, 0x67, - 0xab, 0xef, 0xaf, 0x09, 0x33, 0x52, 0xfe, 0x29, 0xef, 0x78, 0xf8, 0x1e, 0x00, 0x00, 0xff, 0xff, - 0x7e, 0x40, 0x21, 0xbf, 0x8c, 0x01, 0x00, 0x00, -} diff --git a/vendor/openpitrix.io/openpitrix/pkg/pb/account.pb.go b/vendor/openpitrix.io/openpitrix/pkg/pb/account.pb.go deleted file mode 100644 index 3c7779a493..0000000000 --- a/vendor/openpitrix.io/openpitrix/pkg/pb/account.pb.go +++ /dev/null @@ -1,5269 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// source: account.proto - -package pb - -import ( - context "context" - fmt "fmt" - math "math" - - proto "github.com/golang/protobuf/proto" - timestamp "github.com/golang/protobuf/ptypes/timestamp" - wrappers "github.com/golang/protobuf/ptypes/wrappers" - _ "github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger/options" - _ "google.golang.org/genproto/googleapis/api/annotations" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" -) - -// 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 - -type User struct { - // user id, user belong to different group and role, has different permissions - UserId *wrappers.StringValue `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` - // user name - Username *wrappers.StringValue `protobuf:"bytes,2,opt,name=username,proto3" json:"username,omitempty"` - // user email - Email *wrappers.StringValue `protobuf:"bytes,3,opt,name=email,proto3" json:"email,omitempty"` - // user phone number - PhoneNumber *wrappers.StringValue `protobuf:"bytes,4,opt,name=phone_number,json=phoneNumber,proto3" json:"phone_number,omitempty"` - // user description - Description *wrappers.StringValue `protobuf:"bytes,5,opt,name=description,proto3" json:"description,omitempty"` - // user status eg.[active|deleted] - Status *wrappers.StringValue `protobuf:"bytes,6,opt,name=status,proto3" json:"status,omitempty"` - // the time when user create - CreateTime *timestamp.Timestamp `protobuf:"bytes,7,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty"` - // the time when user update - UpdateTime *timestamp.Timestamp `protobuf:"bytes,8,opt,name=update_time,json=updateTime,proto3" json:"update_time,omitempty"` - // record changed time of status - StatusTime *timestamp.Timestamp `protobuf:"bytes,9,opt,name=status_time,json=statusTime,proto3" json:"status_time,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *User) Reset() { *m = User{} } -func (m *User) String() string { return proto.CompactTextString(m) } -func (*User) ProtoMessage() {} -func (*User) Descriptor() ([]byte, []int) { - return fileDescriptor_8e28828dcb8d24f0, []int{0} -} - -func (m *User) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_User.Unmarshal(m, b) -} -func (m *User) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_User.Marshal(b, m, deterministic) -} -func (m *User) XXX_Merge(src proto.Message) { - xxx_messageInfo_User.Merge(m, src) -} -func (m *User) XXX_Size() int { - return xxx_messageInfo_User.Size(m) -} -func (m *User) XXX_DiscardUnknown() { - xxx_messageInfo_User.DiscardUnknown(m) -} - -var xxx_messageInfo_User proto.InternalMessageInfo - -func (m *User) GetUserId() *wrappers.StringValue { - if m != nil { - return m.UserId - } - return nil -} - -func (m *User) GetUsername() *wrappers.StringValue { - if m != nil { - return m.Username - } - return nil -} - -func (m *User) GetEmail() *wrappers.StringValue { - if m != nil { - return m.Email - } - return nil -} - -func (m *User) GetPhoneNumber() *wrappers.StringValue { - if m != nil { - return m.PhoneNumber - } - return nil -} - -func (m *User) GetDescription() *wrappers.StringValue { - if m != nil { - return m.Description - } - return nil -} - -func (m *User) GetStatus() *wrappers.StringValue { - if m != nil { - return m.Status - } - return nil -} - -func (m *User) GetCreateTime() *timestamp.Timestamp { - if m != nil { - return m.CreateTime - } - return nil -} - -func (m *User) GetUpdateTime() *timestamp.Timestamp { - if m != nil { - return m.UpdateTime - } - return nil -} - -func (m *User) GetStatusTime() *timestamp.Timestamp { - if m != nil { - return m.StatusTime - } - return nil -} - -type UserDetail struct { - // user info - User *User `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"` - // list of user's role - RoleSet []*Role `protobuf:"bytes,2,rep,name=role_set,json=roleSet,proto3" json:"role_set,omitempty"` - // list of user's group - GroupSet []*Group `protobuf:"bytes,3,rep,name=group_set,json=groupSet,proto3" json:"group_set,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *UserDetail) Reset() { *m = UserDetail{} } -func (m *UserDetail) String() string { return proto.CompactTextString(m) } -func (*UserDetail) ProtoMessage() {} -func (*UserDetail) Descriptor() ([]byte, []int) { - return fileDescriptor_8e28828dcb8d24f0, []int{1} -} - -func (m *UserDetail) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_UserDetail.Unmarshal(m, b) -} -func (m *UserDetail) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_UserDetail.Marshal(b, m, deterministic) -} -func (m *UserDetail) XXX_Merge(src proto.Message) { - xxx_messageInfo_UserDetail.Merge(m, src) -} -func (m *UserDetail) XXX_Size() int { - return xxx_messageInfo_UserDetail.Size(m) -} -func (m *UserDetail) XXX_DiscardUnknown() { - xxx_messageInfo_UserDetail.DiscardUnknown(m) -} - -var xxx_messageInfo_UserDetail proto.InternalMessageInfo - -func (m *UserDetail) GetUser() *User { - if m != nil { - return m.User - } - return nil -} - -func (m *UserDetail) GetRoleSet() []*Role { - if m != nil { - return m.RoleSet - } - return nil -} - -func (m *UserDetail) GetGroupSet() []*Group { - if m != nil { - return m.GroupSet - } - return nil -} - -type Group struct { - // parent group id - ParentGroupId *wrappers.StringValue `protobuf:"bytes,1,opt,name=parent_group_id,json=parentGroupId,proto3" json:"parent_group_id,omitempty"` - // group id - GroupId *wrappers.StringValue `protobuf:"bytes,2,opt,name=group_id,json=groupId,proto3" json:"group_id,omitempty"` - // group path, a concat string gid-xxx.gid-xxx.gid... - GroupPath *wrappers.StringValue `protobuf:"bytes,3,opt,name=group_path,json=groupPath,proto3" json:"group_path,omitempty"` - // group name - Name *wrappers.StringValue `protobuf:"bytes,4,opt,name=name,proto3" json:"name,omitempty"` - // group status eg.[active|deleted] - Status *wrappers.StringValue `protobuf:"bytes,5,opt,name=status,proto3" json:"status,omitempty"` - // group description - Description *wrappers.StringValue `protobuf:"bytes,6,opt,name=description,proto3" json:"description,omitempty"` - // the time when user create - CreateTime *timestamp.Timestamp `protobuf:"bytes,7,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty"` - // the time when group update - UpdateTime *timestamp.Timestamp `protobuf:"bytes,8,opt,name=update_time,json=updateTime,proto3" json:"update_time,omitempty"` - // record group status changed time - StatusTime *timestamp.Timestamp `protobuf:"bytes,9,opt,name=status_time,json=statusTime,proto3" json:"status_time,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Group) Reset() { *m = Group{} } -func (m *Group) String() string { return proto.CompactTextString(m) } -func (*Group) ProtoMessage() {} -func (*Group) Descriptor() ([]byte, []int) { - return fileDescriptor_8e28828dcb8d24f0, []int{2} -} - -func (m *Group) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Group.Unmarshal(m, b) -} -func (m *Group) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Group.Marshal(b, m, deterministic) -} -func (m *Group) XXX_Merge(src proto.Message) { - xxx_messageInfo_Group.Merge(m, src) -} -func (m *Group) XXX_Size() int { - return xxx_messageInfo_Group.Size(m) -} -func (m *Group) XXX_DiscardUnknown() { - xxx_messageInfo_Group.DiscardUnknown(m) -} - -var xxx_messageInfo_Group proto.InternalMessageInfo - -func (m *Group) GetParentGroupId() *wrappers.StringValue { - if m != nil { - return m.ParentGroupId - } - return nil -} - -func (m *Group) GetGroupId() *wrappers.StringValue { - if m != nil { - return m.GroupId - } - return nil -} - -func (m *Group) GetGroupPath() *wrappers.StringValue { - if m != nil { - return m.GroupPath - } - return nil -} - -func (m *Group) GetName() *wrappers.StringValue { - if m != nil { - return m.Name - } - return nil -} - -func (m *Group) GetStatus() *wrappers.StringValue { - if m != nil { - return m.Status - } - return nil -} - -func (m *Group) GetDescription() *wrappers.StringValue { - if m != nil { - return m.Description - } - return nil -} - -func (m *Group) GetCreateTime() *timestamp.Timestamp { - if m != nil { - return m.CreateTime - } - return nil -} - -func (m *Group) GetUpdateTime() *timestamp.Timestamp { - if m != nil { - return m.UpdateTime - } - return nil -} - -func (m *Group) GetStatusTime() *timestamp.Timestamp { - if m != nil { - return m.StatusTime - } - return nil -} - -type GroupDetail struct { - // group base info - Group *Group `protobuf:"bytes,1,opt,name=group,proto3" json:"group,omitempty"` - // users in group - UserSet []*User `protobuf:"bytes,2,rep,name=user_set,json=userSet,proto3" json:"user_set,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *GroupDetail) Reset() { *m = GroupDetail{} } -func (m *GroupDetail) String() string { return proto.CompactTextString(m) } -func (*GroupDetail) ProtoMessage() {} -func (*GroupDetail) Descriptor() ([]byte, []int) { - return fileDescriptor_8e28828dcb8d24f0, []int{3} -} - -func (m *GroupDetail) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_GroupDetail.Unmarshal(m, b) -} -func (m *GroupDetail) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_GroupDetail.Marshal(b, m, deterministic) -} -func (m *GroupDetail) XXX_Merge(src proto.Message) { - xxx_messageInfo_GroupDetail.Merge(m, src) -} -func (m *GroupDetail) XXX_Size() int { - return xxx_messageInfo_GroupDetail.Size(m) -} -func (m *GroupDetail) XXX_DiscardUnknown() { - xxx_messageInfo_GroupDetail.DiscardUnknown(m) -} - -var xxx_messageInfo_GroupDetail proto.InternalMessageInfo - -func (m *GroupDetail) GetGroup() *Group { - if m != nil { - return m.Group - } - return nil -} - -func (m *GroupDetail) GetUserSet() []*User { - if m != nil { - return m.UserSet - } - return nil -} - -type DescribeUsersRequest struct { - // query key, support these fields(user_id, email, phone_number, status) - SearchWord *wrappers.StringValue `protobuf:"bytes,1,opt,name=search_word,json=searchWord,proto3" json:"search_word,omitempty"` - // sort key, order by sort_key, default create_time - SortKey *wrappers.StringValue `protobuf:"bytes,2,opt,name=sort_key,json=sortKey,proto3" json:"sort_key,omitempty"` - // value = 0 sort ASC, value = 1 sort DESC - Reverse *wrappers.BoolValue `protobuf:"bytes,3,opt,name=reverse,proto3" json:"reverse,omitempty"` - // data limit, default 20, max 200 - Limit uint32 `protobuf:"varint,4,opt,name=limit,proto3" json:"limit,omitempty"` - // data offset, default 0 - Offset uint32 `protobuf:"varint,5,opt,name=offset,proto3" json:"offset,omitempty"` - // use root group ids to get all group ids - RootGroupId []string `protobuf:"bytes,6,rep,name=root_group_id,json=rootGroupId,proto3" json:"root_group_id,omitempty"` - // group ids - GroupId []string `protobuf:"bytes,7,rep,name=group_id,json=groupId,proto3" json:"group_id,omitempty"` - // user ids - UserId []string `protobuf:"bytes,8,rep,name=user_id,json=userId,proto3" json:"user_id,omitempty"` - // status eg.[active|deleted] - Status []string `protobuf:"bytes,9,rep,name=status,proto3" json:"status,omitempty"` - // role ids - RoleId []string `protobuf:"bytes,10,rep,name=role_id,json=roleId,proto3" json:"role_id,omitempty"` - // username - Username []string `protobuf:"bytes,11,rep,name=username,proto3" json:"username,omitempty"` - // email, eg.op@yunify.com - Email []string `protobuf:"bytes,12,rep,name=email,proto3" json:"email,omitempty"` - // phone number, string of 11 digital - PhoneNumber []string `protobuf:"bytes,13,rep,name=phone_number,json=phoneNumber,proto3" json:"phone_number,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *DescribeUsersRequest) Reset() { *m = DescribeUsersRequest{} } -func (m *DescribeUsersRequest) String() string { return proto.CompactTextString(m) } -func (*DescribeUsersRequest) ProtoMessage() {} -func (*DescribeUsersRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_8e28828dcb8d24f0, []int{4} -} - -func (m *DescribeUsersRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_DescribeUsersRequest.Unmarshal(m, b) -} -func (m *DescribeUsersRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_DescribeUsersRequest.Marshal(b, m, deterministic) -} -func (m *DescribeUsersRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_DescribeUsersRequest.Merge(m, src) -} -func (m *DescribeUsersRequest) XXX_Size() int { - return xxx_messageInfo_DescribeUsersRequest.Size(m) -} -func (m *DescribeUsersRequest) XXX_DiscardUnknown() { - xxx_messageInfo_DescribeUsersRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_DescribeUsersRequest proto.InternalMessageInfo - -func (m *DescribeUsersRequest) GetSearchWord() *wrappers.StringValue { - if m != nil { - return m.SearchWord - } - return nil -} - -func (m *DescribeUsersRequest) GetSortKey() *wrappers.StringValue { - if m != nil { - return m.SortKey - } - return nil -} - -func (m *DescribeUsersRequest) GetReverse() *wrappers.BoolValue { - if m != nil { - return m.Reverse - } - return nil -} - -func (m *DescribeUsersRequest) GetLimit() uint32 { - if m != nil { - return m.Limit - } - return 0 -} - -func (m *DescribeUsersRequest) GetOffset() uint32 { - if m != nil { - return m.Offset - } - return 0 -} - -func (m *DescribeUsersRequest) GetRootGroupId() []string { - if m != nil { - return m.RootGroupId - } - return nil -} - -func (m *DescribeUsersRequest) GetGroupId() []string { - if m != nil { - return m.GroupId - } - return nil -} - -func (m *DescribeUsersRequest) GetUserId() []string { - if m != nil { - return m.UserId - } - return nil -} - -func (m *DescribeUsersRequest) GetStatus() []string { - if m != nil { - return m.Status - } - return nil -} - -func (m *DescribeUsersRequest) GetRoleId() []string { - if m != nil { - return m.RoleId - } - return nil -} - -func (m *DescribeUsersRequest) GetUsername() []string { - if m != nil { - return m.Username - } - return nil -} - -func (m *DescribeUsersRequest) GetEmail() []string { - if m != nil { - return m.Email - } - return nil -} - -func (m *DescribeUsersRequest) GetPhoneNumber() []string { - if m != nil { - return m.PhoneNumber - } - return nil -} - -type DescribeUsersResponse struct { - // total count of qualified user - TotalCount uint32 `protobuf:"varint,1,opt,name=total_count,json=totalCount,proto3" json:"total_count,omitempty"` - // list of user - UserSet []*User `protobuf:"bytes,2,rep,name=user_set,json=userSet,proto3" json:"user_set,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *DescribeUsersResponse) Reset() { *m = DescribeUsersResponse{} } -func (m *DescribeUsersResponse) String() string { return proto.CompactTextString(m) } -func (*DescribeUsersResponse) ProtoMessage() {} -func (*DescribeUsersResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_8e28828dcb8d24f0, []int{5} -} - -func (m *DescribeUsersResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_DescribeUsersResponse.Unmarshal(m, b) -} -func (m *DescribeUsersResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_DescribeUsersResponse.Marshal(b, m, deterministic) -} -func (m *DescribeUsersResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_DescribeUsersResponse.Merge(m, src) -} -func (m *DescribeUsersResponse) XXX_Size() int { - return xxx_messageInfo_DescribeUsersResponse.Size(m) -} -func (m *DescribeUsersResponse) XXX_DiscardUnknown() { - xxx_messageInfo_DescribeUsersResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_DescribeUsersResponse proto.InternalMessageInfo - -func (m *DescribeUsersResponse) GetTotalCount() uint32 { - if m != nil { - return m.TotalCount - } - return 0 -} - -func (m *DescribeUsersResponse) GetUserSet() []*User { - if m != nil { - return m.UserSet - } - return nil -} - -type DescribeUsersDetailResponse struct { - // total count of qualified user - TotalCount uint32 `protobuf:"varint,1,opt,name=total_count,json=totalCount,proto3" json:"total_count,omitempty"` - // list of user with detail info - UserDetailSet []*UserDetail `protobuf:"bytes,2,rep,name=user_detail_set,json=userDetailSet,proto3" json:"user_detail_set,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *DescribeUsersDetailResponse) Reset() { *m = DescribeUsersDetailResponse{} } -func (m *DescribeUsersDetailResponse) String() string { return proto.CompactTextString(m) } -func (*DescribeUsersDetailResponse) ProtoMessage() {} -func (*DescribeUsersDetailResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_8e28828dcb8d24f0, []int{6} -} - -func (m *DescribeUsersDetailResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_DescribeUsersDetailResponse.Unmarshal(m, b) -} -func (m *DescribeUsersDetailResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_DescribeUsersDetailResponse.Marshal(b, m, deterministic) -} -func (m *DescribeUsersDetailResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_DescribeUsersDetailResponse.Merge(m, src) -} -func (m *DescribeUsersDetailResponse) XXX_Size() int { - return xxx_messageInfo_DescribeUsersDetailResponse.Size(m) -} -func (m *DescribeUsersDetailResponse) XXX_DiscardUnknown() { - xxx_messageInfo_DescribeUsersDetailResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_DescribeUsersDetailResponse proto.InternalMessageInfo - -func (m *DescribeUsersDetailResponse) GetTotalCount() uint32 { - if m != nil { - return m.TotalCount - } - return 0 -} - -func (m *DescribeUsersDetailResponse) GetUserDetailSet() []*UserDetail { - if m != nil { - return m.UserDetailSet - } - return nil -} - -type ModifyUserRequest struct { - // required, id of user to be modify - UserId *wrappers.StringValue `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` - // user email, eg.op@yunify.com - Email *wrappers.StringValue `protobuf:"bytes,2,opt,name=email,proto3" json:"email,omitempty"` - // user name - Username *wrappers.StringValue `protobuf:"bytes,3,opt,name=username,proto3" json:"username,omitempty"` - // user description - Description *wrappers.StringValue `protobuf:"bytes,4,opt,name=description,proto3" json:"description,omitempty"` - // user password - Password *wrappers.StringValue `protobuf:"bytes,5,opt,name=password,proto3" json:"password,omitempty"` - // user phone number, string of 11 digital - PhoneNumber *wrappers.StringValue `protobuf:"bytes,6,opt,name=phone_number,json=phoneNumber,proto3" json:"phone_number,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ModifyUserRequest) Reset() { *m = ModifyUserRequest{} } -func (m *ModifyUserRequest) String() string { return proto.CompactTextString(m) } -func (*ModifyUserRequest) ProtoMessage() {} -func (*ModifyUserRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_8e28828dcb8d24f0, []int{7} -} - -func (m *ModifyUserRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ModifyUserRequest.Unmarshal(m, b) -} -func (m *ModifyUserRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ModifyUserRequest.Marshal(b, m, deterministic) -} -func (m *ModifyUserRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_ModifyUserRequest.Merge(m, src) -} -func (m *ModifyUserRequest) XXX_Size() int { - return xxx_messageInfo_ModifyUserRequest.Size(m) -} -func (m *ModifyUserRequest) XXX_DiscardUnknown() { - xxx_messageInfo_ModifyUserRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_ModifyUserRequest proto.InternalMessageInfo - -func (m *ModifyUserRequest) GetUserId() *wrappers.StringValue { - if m != nil { - return m.UserId - } - return nil -} - -func (m *ModifyUserRequest) GetEmail() *wrappers.StringValue { - if m != nil { - return m.Email - } - return nil -} - -func (m *ModifyUserRequest) GetUsername() *wrappers.StringValue { - if m != nil { - return m.Username - } - return nil -} - -func (m *ModifyUserRequest) GetDescription() *wrappers.StringValue { - if m != nil { - return m.Description - } - return nil -} - -func (m *ModifyUserRequest) GetPassword() *wrappers.StringValue { - if m != nil { - return m.Password - } - return nil -} - -func (m *ModifyUserRequest) GetPhoneNumber() *wrappers.StringValue { - if m != nil { - return m.PhoneNumber - } - return nil -} - -type ModifyUserResponse struct { - // id of user modified - UserId *wrappers.StringValue `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ModifyUserResponse) Reset() { *m = ModifyUserResponse{} } -func (m *ModifyUserResponse) String() string { return proto.CompactTextString(m) } -func (*ModifyUserResponse) ProtoMessage() {} -func (*ModifyUserResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_8e28828dcb8d24f0, []int{8} -} - -func (m *ModifyUserResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ModifyUserResponse.Unmarshal(m, b) -} -func (m *ModifyUserResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ModifyUserResponse.Marshal(b, m, deterministic) -} -func (m *ModifyUserResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_ModifyUserResponse.Merge(m, src) -} -func (m *ModifyUserResponse) XXX_Size() int { - return xxx_messageInfo_ModifyUserResponse.Size(m) -} -func (m *ModifyUserResponse) XXX_DiscardUnknown() { - xxx_messageInfo_ModifyUserResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_ModifyUserResponse proto.InternalMessageInfo - -func (m *ModifyUserResponse) GetUserId() *wrappers.StringValue { - if m != nil { - return m.UserId - } - return nil -} - -type DeleteUsersRequest struct { - // required, ids of user to delete - UserId []string `protobuf:"bytes,1,rep,name=user_id,json=userId,proto3" json:"user_id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *DeleteUsersRequest) Reset() { *m = DeleteUsersRequest{} } -func (m *DeleteUsersRequest) String() string { return proto.CompactTextString(m) } -func (*DeleteUsersRequest) ProtoMessage() {} -func (*DeleteUsersRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_8e28828dcb8d24f0, []int{9} -} - -func (m *DeleteUsersRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_DeleteUsersRequest.Unmarshal(m, b) -} -func (m *DeleteUsersRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_DeleteUsersRequest.Marshal(b, m, deterministic) -} -func (m *DeleteUsersRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_DeleteUsersRequest.Merge(m, src) -} -func (m *DeleteUsersRequest) XXX_Size() int { - return xxx_messageInfo_DeleteUsersRequest.Size(m) -} -func (m *DeleteUsersRequest) XXX_DiscardUnknown() { - xxx_messageInfo_DeleteUsersRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_DeleteUsersRequest proto.InternalMessageInfo - -func (m *DeleteUsersRequest) GetUserId() []string { - if m != nil { - return m.UserId - } - return nil -} - -type DeleteUsersResponse struct { - // ids of deleted user - UserId []string `protobuf:"bytes,1,rep,name=user_id,json=userId,proto3" json:"user_id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *DeleteUsersResponse) Reset() { *m = DeleteUsersResponse{} } -func (m *DeleteUsersResponse) String() string { return proto.CompactTextString(m) } -func (*DeleteUsersResponse) ProtoMessage() {} -func (*DeleteUsersResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_8e28828dcb8d24f0, []int{10} -} - -func (m *DeleteUsersResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_DeleteUsersResponse.Unmarshal(m, b) -} -func (m *DeleteUsersResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_DeleteUsersResponse.Marshal(b, m, deterministic) -} -func (m *DeleteUsersResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_DeleteUsersResponse.Merge(m, src) -} -func (m *DeleteUsersResponse) XXX_Size() int { - return xxx_messageInfo_DeleteUsersResponse.Size(m) -} -func (m *DeleteUsersResponse) XXX_DiscardUnknown() { - xxx_messageInfo_DeleteUsersResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_DeleteUsersResponse proto.InternalMessageInfo - -func (m *DeleteUsersResponse) GetUserId() []string { - if m != nil { - return m.UserId - } - return nil -} - -type CreatePasswordResetRequest struct { - // required, id of user to create reset password action - UserId *wrappers.StringValue `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` - // required, user password - Password *wrappers.StringValue `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *CreatePasswordResetRequest) Reset() { *m = CreatePasswordResetRequest{} } -func (m *CreatePasswordResetRequest) String() string { return proto.CompactTextString(m) } -func (*CreatePasswordResetRequest) ProtoMessage() {} -func (*CreatePasswordResetRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_8e28828dcb8d24f0, []int{11} -} - -func (m *CreatePasswordResetRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_CreatePasswordResetRequest.Unmarshal(m, b) -} -func (m *CreatePasswordResetRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_CreatePasswordResetRequest.Marshal(b, m, deterministic) -} -func (m *CreatePasswordResetRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_CreatePasswordResetRequest.Merge(m, src) -} -func (m *CreatePasswordResetRequest) XXX_Size() int { - return xxx_messageInfo_CreatePasswordResetRequest.Size(m) -} -func (m *CreatePasswordResetRequest) XXX_DiscardUnknown() { - xxx_messageInfo_CreatePasswordResetRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_CreatePasswordResetRequest proto.InternalMessageInfo - -func (m *CreatePasswordResetRequest) GetUserId() *wrappers.StringValue { - if m != nil { - return m.UserId - } - return nil -} - -func (m *CreatePasswordResetRequest) GetPassword() *wrappers.StringValue { - if m != nil { - return m.Password - } - return nil -} - -type CreatePasswordResetResponse struct { - // id of user that reset password - UserId *wrappers.StringValue `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` - // reset id, used to change password - ResetId *wrappers.StringValue `protobuf:"bytes,2,opt,name=reset_id,json=resetId,proto3" json:"reset_id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *CreatePasswordResetResponse) Reset() { *m = CreatePasswordResetResponse{} } -func (m *CreatePasswordResetResponse) String() string { return proto.CompactTextString(m) } -func (*CreatePasswordResetResponse) ProtoMessage() {} -func (*CreatePasswordResetResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_8e28828dcb8d24f0, []int{12} -} - -func (m *CreatePasswordResetResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_CreatePasswordResetResponse.Unmarshal(m, b) -} -func (m *CreatePasswordResetResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_CreatePasswordResetResponse.Marshal(b, m, deterministic) -} -func (m *CreatePasswordResetResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_CreatePasswordResetResponse.Merge(m, src) -} -func (m *CreatePasswordResetResponse) XXX_Size() int { - return xxx_messageInfo_CreatePasswordResetResponse.Size(m) -} -func (m *CreatePasswordResetResponse) XXX_DiscardUnknown() { - xxx_messageInfo_CreatePasswordResetResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_CreatePasswordResetResponse proto.InternalMessageInfo - -func (m *CreatePasswordResetResponse) GetUserId() *wrappers.StringValue { - if m != nil { - return m.UserId - } - return nil -} - -func (m *CreatePasswordResetResponse) GetResetId() *wrappers.StringValue { - if m != nil { - return m.ResetId - } - return nil -} - -type ChangePasswordRequest struct { - // required, new password for reset - NewPassword *wrappers.StringValue `protobuf:"bytes,1,opt,name=new_password,json=newPassword,proto3" json:"new_password,omitempty"` - // required, reset id - ResetId *wrappers.StringValue `protobuf:"bytes,2,opt,name=reset_id,json=resetId,proto3" json:"reset_id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ChangePasswordRequest) Reset() { *m = ChangePasswordRequest{} } -func (m *ChangePasswordRequest) String() string { return proto.CompactTextString(m) } -func (*ChangePasswordRequest) ProtoMessage() {} -func (*ChangePasswordRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_8e28828dcb8d24f0, []int{13} -} - -func (m *ChangePasswordRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ChangePasswordRequest.Unmarshal(m, b) -} -func (m *ChangePasswordRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ChangePasswordRequest.Marshal(b, m, deterministic) -} -func (m *ChangePasswordRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_ChangePasswordRequest.Merge(m, src) -} -func (m *ChangePasswordRequest) XXX_Size() int { - return xxx_messageInfo_ChangePasswordRequest.Size(m) -} -func (m *ChangePasswordRequest) XXX_DiscardUnknown() { - xxx_messageInfo_ChangePasswordRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_ChangePasswordRequest proto.InternalMessageInfo - -func (m *ChangePasswordRequest) GetNewPassword() *wrappers.StringValue { - if m != nil { - return m.NewPassword - } - return nil -} - -func (m *ChangePasswordRequest) GetResetId() *wrappers.StringValue { - if m != nil { - return m.ResetId - } - return nil -} - -type ChangePasswordResponse struct { - // id of user that changed password - UserId *wrappers.StringValue `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ChangePasswordResponse) Reset() { *m = ChangePasswordResponse{} } -func (m *ChangePasswordResponse) String() string { return proto.CompactTextString(m) } -func (*ChangePasswordResponse) ProtoMessage() {} -func (*ChangePasswordResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_8e28828dcb8d24f0, []int{14} -} - -func (m *ChangePasswordResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ChangePasswordResponse.Unmarshal(m, b) -} -func (m *ChangePasswordResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ChangePasswordResponse.Marshal(b, m, deterministic) -} -func (m *ChangePasswordResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_ChangePasswordResponse.Merge(m, src) -} -func (m *ChangePasswordResponse) XXX_Size() int { - return xxx_messageInfo_ChangePasswordResponse.Size(m) -} -func (m *ChangePasswordResponse) XXX_DiscardUnknown() { - xxx_messageInfo_ChangePasswordResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_ChangePasswordResponse proto.InternalMessageInfo - -func (m *ChangePasswordResponse) GetUserId() *wrappers.StringValue { - if m != nil { - return m.UserId - } - return nil -} - -type GetPasswordResetRequest struct { - // required, reset id - ResetId string `protobuf:"bytes,1,opt,name=reset_id,json=resetId,proto3" json:"reset_id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *GetPasswordResetRequest) Reset() { *m = GetPasswordResetRequest{} } -func (m *GetPasswordResetRequest) String() string { return proto.CompactTextString(m) } -func (*GetPasswordResetRequest) ProtoMessage() {} -func (*GetPasswordResetRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_8e28828dcb8d24f0, []int{15} -} - -func (m *GetPasswordResetRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_GetPasswordResetRequest.Unmarshal(m, b) -} -func (m *GetPasswordResetRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_GetPasswordResetRequest.Marshal(b, m, deterministic) -} -func (m *GetPasswordResetRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetPasswordResetRequest.Merge(m, src) -} -func (m *GetPasswordResetRequest) XXX_Size() int { - return xxx_messageInfo_GetPasswordResetRequest.Size(m) -} -func (m *GetPasswordResetRequest) XXX_DiscardUnknown() { - xxx_messageInfo_GetPasswordResetRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_GetPasswordResetRequest proto.InternalMessageInfo - -func (m *GetPasswordResetRequest) GetResetId() string { - if m != nil { - return m.ResetId - } - return "" -} - -type GetPasswordResetResponse struct { - // reset id - ResetId string `protobuf:"bytes,1,opt,name=reset_id,json=resetId,proto3" json:"reset_id,omitempty"` - // id of user changed password - UserId string `protobuf:"bytes,2,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *GetPasswordResetResponse) Reset() { *m = GetPasswordResetResponse{} } -func (m *GetPasswordResetResponse) String() string { return proto.CompactTextString(m) } -func (*GetPasswordResetResponse) ProtoMessage() {} -func (*GetPasswordResetResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_8e28828dcb8d24f0, []int{16} -} - -func (m *GetPasswordResetResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_GetPasswordResetResponse.Unmarshal(m, b) -} -func (m *GetPasswordResetResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_GetPasswordResetResponse.Marshal(b, m, deterministic) -} -func (m *GetPasswordResetResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetPasswordResetResponse.Merge(m, src) -} -func (m *GetPasswordResetResponse) XXX_Size() int { - return xxx_messageInfo_GetPasswordResetResponse.Size(m) -} -func (m *GetPasswordResetResponse) XXX_DiscardUnknown() { - xxx_messageInfo_GetPasswordResetResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_GetPasswordResetResponse proto.InternalMessageInfo - -func (m *GetPasswordResetResponse) GetResetId() string { - if m != nil { - return m.ResetId - } - return "" -} - -func (m *GetPasswordResetResponse) GetUserId() string { - if m != nil { - return m.UserId - } - return "" -} - -type CreateUserRequest struct { - // required, user email - Email *wrappers.StringValue `protobuf:"bytes,1,opt,name=email,proto3" json:"email,omitempty"` - // user phone number - PhoneNumber *wrappers.StringValue `protobuf:"bytes,2,opt,name=phone_number,json=phoneNumber,proto3" json:"phone_number,omitempty"` - // required, user password - Password *wrappers.StringValue `protobuf:"bytes,3,opt,name=password,proto3" json:"password,omitempty"` - // required, user role_id - RoleId *wrappers.StringValue `protobuf:"bytes,4,opt,name=role_id,json=roleId,proto3" json:"role_id,omitempty"` - // user description - Description *wrappers.StringValue `protobuf:"bytes,5,opt,name=description,proto3" json:"description,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *CreateUserRequest) Reset() { *m = CreateUserRequest{} } -func (m *CreateUserRequest) String() string { return proto.CompactTextString(m) } -func (*CreateUserRequest) ProtoMessage() {} -func (*CreateUserRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_8e28828dcb8d24f0, []int{17} -} - -func (m *CreateUserRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_CreateUserRequest.Unmarshal(m, b) -} -func (m *CreateUserRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_CreateUserRequest.Marshal(b, m, deterministic) -} -func (m *CreateUserRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_CreateUserRequest.Merge(m, src) -} -func (m *CreateUserRequest) XXX_Size() int { - return xxx_messageInfo_CreateUserRequest.Size(m) -} -func (m *CreateUserRequest) XXX_DiscardUnknown() { - xxx_messageInfo_CreateUserRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_CreateUserRequest proto.InternalMessageInfo - -func (m *CreateUserRequest) GetEmail() *wrappers.StringValue { - if m != nil { - return m.Email - } - return nil -} - -func (m *CreateUserRequest) GetPhoneNumber() *wrappers.StringValue { - if m != nil { - return m.PhoneNumber - } - return nil -} - -func (m *CreateUserRequest) GetPassword() *wrappers.StringValue { - if m != nil { - return m.Password - } - return nil -} - -func (m *CreateUserRequest) GetRoleId() *wrappers.StringValue { - if m != nil { - return m.RoleId - } - return nil -} - -func (m *CreateUserRequest) GetDescription() *wrappers.StringValue { - if m != nil { - return m.Description - } - return nil -} - -type CreateUserResponse struct { - // id of user created - UserId *wrappers.StringValue `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *CreateUserResponse) Reset() { *m = CreateUserResponse{} } -func (m *CreateUserResponse) String() string { return proto.CompactTextString(m) } -func (*CreateUserResponse) ProtoMessage() {} -func (*CreateUserResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_8e28828dcb8d24f0, []int{18} -} - -func (m *CreateUserResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_CreateUserResponse.Unmarshal(m, b) -} -func (m *CreateUserResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_CreateUserResponse.Marshal(b, m, deterministic) -} -func (m *CreateUserResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_CreateUserResponse.Merge(m, src) -} -func (m *CreateUserResponse) XXX_Size() int { - return xxx_messageInfo_CreateUserResponse.Size(m) -} -func (m *CreateUserResponse) XXX_DiscardUnknown() { - xxx_messageInfo_CreateUserResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_CreateUserResponse proto.InternalMessageInfo - -func (m *CreateUserResponse) GetUserId() *wrappers.StringValue { - if m != nil { - return m.UserId - } - return nil -} - -type ValidateUserPasswordRequest struct { - // required, user email - Email string `protobuf:"bytes,1,opt,name=email,proto3" json:"email,omitempty"` - // required, user password - Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ValidateUserPasswordRequest) Reset() { *m = ValidateUserPasswordRequest{} } -func (m *ValidateUserPasswordRequest) String() string { return proto.CompactTextString(m) } -func (*ValidateUserPasswordRequest) ProtoMessage() {} -func (*ValidateUserPasswordRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_8e28828dcb8d24f0, []int{19} -} - -func (m *ValidateUserPasswordRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ValidateUserPasswordRequest.Unmarshal(m, b) -} -func (m *ValidateUserPasswordRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ValidateUserPasswordRequest.Marshal(b, m, deterministic) -} -func (m *ValidateUserPasswordRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_ValidateUserPasswordRequest.Merge(m, src) -} -func (m *ValidateUserPasswordRequest) XXX_Size() int { - return xxx_messageInfo_ValidateUserPasswordRequest.Size(m) -} -func (m *ValidateUserPasswordRequest) XXX_DiscardUnknown() { - xxx_messageInfo_ValidateUserPasswordRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_ValidateUserPasswordRequest proto.InternalMessageInfo - -func (m *ValidateUserPasswordRequest) GetEmail() string { - if m != nil { - return m.Email - } - return "" -} - -func (m *ValidateUserPasswordRequest) GetPassword() string { - if m != nil { - return m.Password - } - return "" -} - -type ValidateUserPasswordResponse struct { - // validate password ok or not - Validated bool `protobuf:"varint,1,opt,name=validated,proto3" json:"validated,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ValidateUserPasswordResponse) Reset() { *m = ValidateUserPasswordResponse{} } -func (m *ValidateUserPasswordResponse) String() string { return proto.CompactTextString(m) } -func (*ValidateUserPasswordResponse) ProtoMessage() {} -func (*ValidateUserPasswordResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_8e28828dcb8d24f0, []int{20} -} - -func (m *ValidateUserPasswordResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ValidateUserPasswordResponse.Unmarshal(m, b) -} -func (m *ValidateUserPasswordResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ValidateUserPasswordResponse.Marshal(b, m, deterministic) -} -func (m *ValidateUserPasswordResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_ValidateUserPasswordResponse.Merge(m, src) -} -func (m *ValidateUserPasswordResponse) XXX_Size() int { - return xxx_messageInfo_ValidateUserPasswordResponse.Size(m) -} -func (m *ValidateUserPasswordResponse) XXX_DiscardUnknown() { - xxx_messageInfo_ValidateUserPasswordResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_ValidateUserPasswordResponse proto.InternalMessageInfo - -func (m *ValidateUserPasswordResponse) GetValidated() bool { - if m != nil { - return m.Validated - } - return false -} - -type CreateGroupRequest struct { - // required, parent group id - ParentGroupId *wrappers.StringValue `protobuf:"bytes,1,opt,name=parent_group_id,json=parentGroupId,proto3" json:"parent_group_id,omitempty"` - // required, group name - Name *wrappers.StringValue `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - // group description - Description *wrappers.StringValue `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *CreateGroupRequest) Reset() { *m = CreateGroupRequest{} } -func (m *CreateGroupRequest) String() string { return proto.CompactTextString(m) } -func (*CreateGroupRequest) ProtoMessage() {} -func (*CreateGroupRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_8e28828dcb8d24f0, []int{21} -} - -func (m *CreateGroupRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_CreateGroupRequest.Unmarshal(m, b) -} -func (m *CreateGroupRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_CreateGroupRequest.Marshal(b, m, deterministic) -} -func (m *CreateGroupRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_CreateGroupRequest.Merge(m, src) -} -func (m *CreateGroupRequest) XXX_Size() int { - return xxx_messageInfo_CreateGroupRequest.Size(m) -} -func (m *CreateGroupRequest) XXX_DiscardUnknown() { - xxx_messageInfo_CreateGroupRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_CreateGroupRequest proto.InternalMessageInfo - -func (m *CreateGroupRequest) GetParentGroupId() *wrappers.StringValue { - if m != nil { - return m.ParentGroupId - } - return nil -} - -func (m *CreateGroupRequest) GetName() *wrappers.StringValue { - if m != nil { - return m.Name - } - return nil -} - -func (m *CreateGroupRequest) GetDescription() *wrappers.StringValue { - if m != nil { - return m.Description - } - return nil -} - -type CreateGroupResponse struct { - // id of group created - GroupId *wrappers.StringValue `protobuf:"bytes,1,opt,name=group_id,json=groupId,proto3" json:"group_id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *CreateGroupResponse) Reset() { *m = CreateGroupResponse{} } -func (m *CreateGroupResponse) String() string { return proto.CompactTextString(m) } -func (*CreateGroupResponse) ProtoMessage() {} -func (*CreateGroupResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_8e28828dcb8d24f0, []int{22} -} - -func (m *CreateGroupResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_CreateGroupResponse.Unmarshal(m, b) -} -func (m *CreateGroupResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_CreateGroupResponse.Marshal(b, m, deterministic) -} -func (m *CreateGroupResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_CreateGroupResponse.Merge(m, src) -} -func (m *CreateGroupResponse) XXX_Size() int { - return xxx_messageInfo_CreateGroupResponse.Size(m) -} -func (m *CreateGroupResponse) XXX_DiscardUnknown() { - xxx_messageInfo_CreateGroupResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_CreateGroupResponse proto.InternalMessageInfo - -func (m *CreateGroupResponse) GetGroupId() *wrappers.StringValue { - if m != nil { - return m.GroupId - } - return nil -} - -type DescribeGroupsRequest struct { - // query key, support these fields(group_id, parent_group_id, group_path, status) - SearchWord *wrappers.StringValue `protobuf:"bytes,1,opt,name=search_word,json=searchWord,proto3" json:"search_word,omitempty"` - // sort key, order by sort_key, default create_time - SortKey *wrappers.StringValue `protobuf:"bytes,2,opt,name=sort_key,json=sortKey,proto3" json:"sort_key,omitempty"` - // value = 0 sort ASC, value = 1 sort DESC - Reverse *wrappers.BoolValue `protobuf:"bytes,3,opt,name=reverse,proto3" json:"reverse,omitempty"` - // data limit per page, default value 20, max value 200 - Limit uint32 `protobuf:"varint,4,opt,name=limit,proto3" json:"limit,omitempty"` - // data offset, default 0 - Offset uint32 `protobuf:"varint,5,opt,name=offset,proto3" json:"offset,omitempty"` - // use root group ids to get all groups - RootGroupId []string `protobuf:"bytes,6,rep,name=root_group_id,json=rootGroupId,proto3" json:"root_group_id,omitempty"` - // parent group ids - ParentGroupId []string `protobuf:"bytes,7,rep,name=parent_group_id,json=parentGroupId,proto3" json:"parent_group_id,omitempty"` - // group ids - GroupId []string `protobuf:"bytes,8,rep,name=group_id,json=groupId,proto3" json:"group_id,omitempty"` - // group path, a concat string gid-xxx.gid-xxx.gid... - GroupPath []string `protobuf:"bytes,9,rep,name=group_path,json=groupPath,proto3" json:"group_path,omitempty"` - // group name - GroupName []string `protobuf:"bytes,10,rep,name=group_name,json=groupName,proto3" json:"group_name,omitempty"` - // status eg.[active|deleted] - Status []string `protobuf:"bytes,11,rep,name=status,proto3" json:"status,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *DescribeGroupsRequest) Reset() { *m = DescribeGroupsRequest{} } -func (m *DescribeGroupsRequest) String() string { return proto.CompactTextString(m) } -func (*DescribeGroupsRequest) ProtoMessage() {} -func (*DescribeGroupsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_8e28828dcb8d24f0, []int{23} -} - -func (m *DescribeGroupsRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_DescribeGroupsRequest.Unmarshal(m, b) -} -func (m *DescribeGroupsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_DescribeGroupsRequest.Marshal(b, m, deterministic) -} -func (m *DescribeGroupsRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_DescribeGroupsRequest.Merge(m, src) -} -func (m *DescribeGroupsRequest) XXX_Size() int { - return xxx_messageInfo_DescribeGroupsRequest.Size(m) -} -func (m *DescribeGroupsRequest) XXX_DiscardUnknown() { - xxx_messageInfo_DescribeGroupsRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_DescribeGroupsRequest proto.InternalMessageInfo - -func (m *DescribeGroupsRequest) GetSearchWord() *wrappers.StringValue { - if m != nil { - return m.SearchWord - } - return nil -} - -func (m *DescribeGroupsRequest) GetSortKey() *wrappers.StringValue { - if m != nil { - return m.SortKey - } - return nil -} - -func (m *DescribeGroupsRequest) GetReverse() *wrappers.BoolValue { - if m != nil { - return m.Reverse - } - return nil -} - -func (m *DescribeGroupsRequest) GetLimit() uint32 { - if m != nil { - return m.Limit - } - return 0 -} - -func (m *DescribeGroupsRequest) GetOffset() uint32 { - if m != nil { - return m.Offset - } - return 0 -} - -func (m *DescribeGroupsRequest) GetRootGroupId() []string { - if m != nil { - return m.RootGroupId - } - return nil -} - -func (m *DescribeGroupsRequest) GetParentGroupId() []string { - if m != nil { - return m.ParentGroupId - } - return nil -} - -func (m *DescribeGroupsRequest) GetGroupId() []string { - if m != nil { - return m.GroupId - } - return nil -} - -func (m *DescribeGroupsRequest) GetGroupPath() []string { - if m != nil { - return m.GroupPath - } - return nil -} - -func (m *DescribeGroupsRequest) GetGroupName() []string { - if m != nil { - return m.GroupName - } - return nil -} - -func (m *DescribeGroupsRequest) GetStatus() []string { - if m != nil { - return m.Status - } - return nil -} - -type DescribeGroupsResponse struct { - // total count of qualified group - TotalCount uint32 `protobuf:"varint,1,opt,name=total_count,json=totalCount,proto3" json:"total_count,omitempty"` - // list of group - GroupSet []*Group `protobuf:"bytes,2,rep,name=group_set,json=groupSet,proto3" json:"group_set,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *DescribeGroupsResponse) Reset() { *m = DescribeGroupsResponse{} } -func (m *DescribeGroupsResponse) String() string { return proto.CompactTextString(m) } -func (*DescribeGroupsResponse) ProtoMessage() {} -func (*DescribeGroupsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_8e28828dcb8d24f0, []int{24} -} - -func (m *DescribeGroupsResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_DescribeGroupsResponse.Unmarshal(m, b) -} -func (m *DescribeGroupsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_DescribeGroupsResponse.Marshal(b, m, deterministic) -} -func (m *DescribeGroupsResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_DescribeGroupsResponse.Merge(m, src) -} -func (m *DescribeGroupsResponse) XXX_Size() int { - return xxx_messageInfo_DescribeGroupsResponse.Size(m) -} -func (m *DescribeGroupsResponse) XXX_DiscardUnknown() { - xxx_messageInfo_DescribeGroupsResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_DescribeGroupsResponse proto.InternalMessageInfo - -func (m *DescribeGroupsResponse) GetTotalCount() uint32 { - if m != nil { - return m.TotalCount - } - return 0 -} - -func (m *DescribeGroupsResponse) GetGroupSet() []*Group { - if m != nil { - return m.GroupSet - } - return nil -} - -type DescribeGroupsDetailResponse struct { - // total count of group with detail info - TotalCount uint32 `protobuf:"varint,1,opt,name=total_count,json=totalCount,proto3" json:"total_count,omitempty"` - // list of group with detail info - GroupDetailSet []*GroupDetail `protobuf:"bytes,2,rep,name=group_detail_set,json=groupDetailSet,proto3" json:"group_detail_set,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *DescribeGroupsDetailResponse) Reset() { *m = DescribeGroupsDetailResponse{} } -func (m *DescribeGroupsDetailResponse) String() string { return proto.CompactTextString(m) } -func (*DescribeGroupsDetailResponse) ProtoMessage() {} -func (*DescribeGroupsDetailResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_8e28828dcb8d24f0, []int{25} -} - -func (m *DescribeGroupsDetailResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_DescribeGroupsDetailResponse.Unmarshal(m, b) -} -func (m *DescribeGroupsDetailResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_DescribeGroupsDetailResponse.Marshal(b, m, deterministic) -} -func (m *DescribeGroupsDetailResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_DescribeGroupsDetailResponse.Merge(m, src) -} -func (m *DescribeGroupsDetailResponse) XXX_Size() int { - return xxx_messageInfo_DescribeGroupsDetailResponse.Size(m) -} -func (m *DescribeGroupsDetailResponse) XXX_DiscardUnknown() { - xxx_messageInfo_DescribeGroupsDetailResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_DescribeGroupsDetailResponse proto.InternalMessageInfo - -func (m *DescribeGroupsDetailResponse) GetTotalCount() uint32 { - if m != nil { - return m.TotalCount - } - return 0 -} - -func (m *DescribeGroupsDetailResponse) GetGroupDetailSet() []*GroupDetail { - if m != nil { - return m.GroupDetailSet - } - return nil -} - -type ModifyGroupRequest struct { - // required, id of group to modify - GroupId *wrappers.StringValue `protobuf:"bytes,1,opt,name=group_id,json=groupId,proto3" json:"group_id,omitempty"` - // group name - Name *wrappers.StringValue `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - // group description - Description *wrappers.StringValue `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` - // parent group id - ParentGroupId *wrappers.StringValue `protobuf:"bytes,4,opt,name=parent_group_id,json=parentGroupId,proto3" json:"parent_group_id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ModifyGroupRequest) Reset() { *m = ModifyGroupRequest{} } -func (m *ModifyGroupRequest) String() string { return proto.CompactTextString(m) } -func (*ModifyGroupRequest) ProtoMessage() {} -func (*ModifyGroupRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_8e28828dcb8d24f0, []int{26} -} - -func (m *ModifyGroupRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ModifyGroupRequest.Unmarshal(m, b) -} -func (m *ModifyGroupRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ModifyGroupRequest.Marshal(b, m, deterministic) -} -func (m *ModifyGroupRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_ModifyGroupRequest.Merge(m, src) -} -func (m *ModifyGroupRequest) XXX_Size() int { - return xxx_messageInfo_ModifyGroupRequest.Size(m) -} -func (m *ModifyGroupRequest) XXX_DiscardUnknown() { - xxx_messageInfo_ModifyGroupRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_ModifyGroupRequest proto.InternalMessageInfo - -func (m *ModifyGroupRequest) GetGroupId() *wrappers.StringValue { - if m != nil { - return m.GroupId - } - return nil -} - -func (m *ModifyGroupRequest) GetName() *wrappers.StringValue { - if m != nil { - return m.Name - } - return nil -} - -func (m *ModifyGroupRequest) GetDescription() *wrappers.StringValue { - if m != nil { - return m.Description - } - return nil -} - -func (m *ModifyGroupRequest) GetParentGroupId() *wrappers.StringValue { - if m != nil { - return m.ParentGroupId - } - return nil -} - -type ModifyGroupResponse struct { - // id of group modified - GroupId *wrappers.StringValue `protobuf:"bytes,1,opt,name=group_id,json=groupId,proto3" json:"group_id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ModifyGroupResponse) Reset() { *m = ModifyGroupResponse{} } -func (m *ModifyGroupResponse) String() string { return proto.CompactTextString(m) } -func (*ModifyGroupResponse) ProtoMessage() {} -func (*ModifyGroupResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_8e28828dcb8d24f0, []int{27} -} - -func (m *ModifyGroupResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ModifyGroupResponse.Unmarshal(m, b) -} -func (m *ModifyGroupResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ModifyGroupResponse.Marshal(b, m, deterministic) -} -func (m *ModifyGroupResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_ModifyGroupResponse.Merge(m, src) -} -func (m *ModifyGroupResponse) XXX_Size() int { - return xxx_messageInfo_ModifyGroupResponse.Size(m) -} -func (m *ModifyGroupResponse) XXX_DiscardUnknown() { - xxx_messageInfo_ModifyGroupResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_ModifyGroupResponse proto.InternalMessageInfo - -func (m *ModifyGroupResponse) GetGroupId() *wrappers.StringValue { - if m != nil { - return m.GroupId - } - return nil -} - -type DeleteGroupsRequest struct { - // required, ids of group to delete - GroupId []string `protobuf:"bytes,1,rep,name=group_id,json=groupId,proto3" json:"group_id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *DeleteGroupsRequest) Reset() { *m = DeleteGroupsRequest{} } -func (m *DeleteGroupsRequest) String() string { return proto.CompactTextString(m) } -func (*DeleteGroupsRequest) ProtoMessage() {} -func (*DeleteGroupsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_8e28828dcb8d24f0, []int{28} -} - -func (m *DeleteGroupsRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_DeleteGroupsRequest.Unmarshal(m, b) -} -func (m *DeleteGroupsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_DeleteGroupsRequest.Marshal(b, m, deterministic) -} -func (m *DeleteGroupsRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_DeleteGroupsRequest.Merge(m, src) -} -func (m *DeleteGroupsRequest) XXX_Size() int { - return xxx_messageInfo_DeleteGroupsRequest.Size(m) -} -func (m *DeleteGroupsRequest) XXX_DiscardUnknown() { - xxx_messageInfo_DeleteGroupsRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_DeleteGroupsRequest proto.InternalMessageInfo - -func (m *DeleteGroupsRequest) GetGroupId() []string { - if m != nil { - return m.GroupId - } - return nil -} - -type DeleteGroupsResponse struct { - // ids of group deleted - GroupId []string `protobuf:"bytes,1,rep,name=group_id,json=groupId,proto3" json:"group_id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *DeleteGroupsResponse) Reset() { *m = DeleteGroupsResponse{} } -func (m *DeleteGroupsResponse) String() string { return proto.CompactTextString(m) } -func (*DeleteGroupsResponse) ProtoMessage() {} -func (*DeleteGroupsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_8e28828dcb8d24f0, []int{29} -} - -func (m *DeleteGroupsResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_DeleteGroupsResponse.Unmarshal(m, b) -} -func (m *DeleteGroupsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_DeleteGroupsResponse.Marshal(b, m, deterministic) -} -func (m *DeleteGroupsResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_DeleteGroupsResponse.Merge(m, src) -} -func (m *DeleteGroupsResponse) XXX_Size() int { - return xxx_messageInfo_DeleteGroupsResponse.Size(m) -} -func (m *DeleteGroupsResponse) XXX_DiscardUnknown() { - xxx_messageInfo_DeleteGroupsResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_DeleteGroupsResponse proto.InternalMessageInfo - -func (m *DeleteGroupsResponse) GetGroupId() []string { - if m != nil { - return m.GroupId - } - return nil -} - -type JoinGroupRequest struct { - // required, ids of group for user to join in - GroupId []string `protobuf:"bytes,1,rep,name=group_id,json=groupId,proto3" json:"group_id,omitempty"` - // required, ids of user to join - UserId []string `protobuf:"bytes,2,rep,name=user_id,json=userId,proto3" json:"user_id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *JoinGroupRequest) Reset() { *m = JoinGroupRequest{} } -func (m *JoinGroupRequest) String() string { return proto.CompactTextString(m) } -func (*JoinGroupRequest) ProtoMessage() {} -func (*JoinGroupRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_8e28828dcb8d24f0, []int{30} -} - -func (m *JoinGroupRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_JoinGroupRequest.Unmarshal(m, b) -} -func (m *JoinGroupRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_JoinGroupRequest.Marshal(b, m, deterministic) -} -func (m *JoinGroupRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_JoinGroupRequest.Merge(m, src) -} -func (m *JoinGroupRequest) XXX_Size() int { - return xxx_messageInfo_JoinGroupRequest.Size(m) -} -func (m *JoinGroupRequest) XXX_DiscardUnknown() { - xxx_messageInfo_JoinGroupRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_JoinGroupRequest proto.InternalMessageInfo - -func (m *JoinGroupRequest) GetGroupId() []string { - if m != nil { - return m.GroupId - } - return nil -} - -func (m *JoinGroupRequest) GetUserId() []string { - if m != nil { - return m.UserId - } - return nil -} - -type JoinGroupResponse struct { - // ids of group for user to join in - GroupId []string `protobuf:"bytes,1,rep,name=group_id,json=groupId,proto3" json:"group_id,omitempty"` - // ids of user to join - UserId []string `protobuf:"bytes,2,rep,name=user_id,json=userId,proto3" json:"user_id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *JoinGroupResponse) Reset() { *m = JoinGroupResponse{} } -func (m *JoinGroupResponse) String() string { return proto.CompactTextString(m) } -func (*JoinGroupResponse) ProtoMessage() {} -func (*JoinGroupResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_8e28828dcb8d24f0, []int{31} -} - -func (m *JoinGroupResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_JoinGroupResponse.Unmarshal(m, b) -} -func (m *JoinGroupResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_JoinGroupResponse.Marshal(b, m, deterministic) -} -func (m *JoinGroupResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_JoinGroupResponse.Merge(m, src) -} -func (m *JoinGroupResponse) XXX_Size() int { - return xxx_messageInfo_JoinGroupResponse.Size(m) -} -func (m *JoinGroupResponse) XXX_DiscardUnknown() { - xxx_messageInfo_JoinGroupResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_JoinGroupResponse proto.InternalMessageInfo - -func (m *JoinGroupResponse) GetGroupId() []string { - if m != nil { - return m.GroupId - } - return nil -} - -func (m *JoinGroupResponse) GetUserId() []string { - if m != nil { - return m.UserId - } - return nil -} - -type LeaveGroupRequest struct { - // required, ids of group for user to leave from - GroupId []string `protobuf:"bytes,1,rep,name=group_id,json=groupId,proto3" json:"group_id,omitempty"` - // required, ids of user to leave - UserId []string `protobuf:"bytes,2,rep,name=user_id,json=userId,proto3" json:"user_id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *LeaveGroupRequest) Reset() { *m = LeaveGroupRequest{} } -func (m *LeaveGroupRequest) String() string { return proto.CompactTextString(m) } -func (*LeaveGroupRequest) ProtoMessage() {} -func (*LeaveGroupRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_8e28828dcb8d24f0, []int{32} -} - -func (m *LeaveGroupRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_LeaveGroupRequest.Unmarshal(m, b) -} -func (m *LeaveGroupRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_LeaveGroupRequest.Marshal(b, m, deterministic) -} -func (m *LeaveGroupRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_LeaveGroupRequest.Merge(m, src) -} -func (m *LeaveGroupRequest) XXX_Size() int { - return xxx_messageInfo_LeaveGroupRequest.Size(m) -} -func (m *LeaveGroupRequest) XXX_DiscardUnknown() { - xxx_messageInfo_LeaveGroupRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_LeaveGroupRequest proto.InternalMessageInfo - -func (m *LeaveGroupRequest) GetGroupId() []string { - if m != nil { - return m.GroupId - } - return nil -} - -func (m *LeaveGroupRequest) GetUserId() []string { - if m != nil { - return m.UserId - } - return nil -} - -type LeaveGroupResponse struct { - // ids of group for user to leave from - GroupId []string `protobuf:"bytes,1,rep,name=group_id,json=groupId,proto3" json:"group_id,omitempty"` - // ids of user to leave - UserId []string `protobuf:"bytes,2,rep,name=user_id,json=userId,proto3" json:"user_id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *LeaveGroupResponse) Reset() { *m = LeaveGroupResponse{} } -func (m *LeaveGroupResponse) String() string { return proto.CompactTextString(m) } -func (*LeaveGroupResponse) ProtoMessage() {} -func (*LeaveGroupResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_8e28828dcb8d24f0, []int{33} -} - -func (m *LeaveGroupResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_LeaveGroupResponse.Unmarshal(m, b) -} -func (m *LeaveGroupResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_LeaveGroupResponse.Marshal(b, m, deterministic) -} -func (m *LeaveGroupResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_LeaveGroupResponse.Merge(m, src) -} -func (m *LeaveGroupResponse) XXX_Size() int { - return xxx_messageInfo_LeaveGroupResponse.Size(m) -} -func (m *LeaveGroupResponse) XXX_DiscardUnknown() { - xxx_messageInfo_LeaveGroupResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_LeaveGroupResponse proto.InternalMessageInfo - -func (m *LeaveGroupResponse) GetGroupId() []string { - if m != nil { - return m.GroupId - } - return nil -} - -func (m *LeaveGroupResponse) GetUserId() []string { - if m != nil { - return m.UserId - } - return nil -} - -type Role struct { - // role id - RoleId string `protobuf:"bytes,1,opt,name=role_id,json=roleId,proto3" json:"role_id,omitempty"` - // role name - RoleName string `protobuf:"bytes,2,opt,name=role_name,json=roleName,proto3" json:"role_name,omitempty"` - // role description - Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` - // portal eg.[global_admin|user|isv] - Portal string `protobuf:"bytes,4,opt,name=portal,proto3" json:"portal,omitempty"` - // own - Owner string `protobuf:"bytes,5,opt,name=owner,proto3" json:"owner,omitempty"` - // owner path, concat string group_path:user_id - OwnerPath string `protobuf:"bytes,6,opt,name=owner_path,json=ownerPath,proto3" json:"owner_path,omitempty"` - // status eg.[active|deleted] - Status string `protobuf:"bytes,7,opt,name=status,proto3" json:"status,omitempty"` - // controller eg.[self|pitrix] - Controller string `protobuf:"bytes,8,opt,name=controller,proto3" json:"controller,omitempty"` - // the time when role create - CreateTime *timestamp.Timestamp `protobuf:"bytes,9,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty"` - // the time when role update - UpdateTime *timestamp.Timestamp `protobuf:"bytes,10,opt,name=update_time,json=updateTime,proto3" json:"update_time,omitempty"` - // record change time of status - StatusTime *timestamp.Timestamp `protobuf:"bytes,11,opt,name=status_time,json=statusTime,proto3" json:"status_time,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Role) Reset() { *m = Role{} } -func (m *Role) String() string { return proto.CompactTextString(m) } -func (*Role) ProtoMessage() {} -func (*Role) Descriptor() ([]byte, []int) { - return fileDescriptor_8e28828dcb8d24f0, []int{34} -} - -func (m *Role) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Role.Unmarshal(m, b) -} -func (m *Role) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Role.Marshal(b, m, deterministic) -} -func (m *Role) XXX_Merge(src proto.Message) { - xxx_messageInfo_Role.Merge(m, src) -} -func (m *Role) XXX_Size() int { - return xxx_messageInfo_Role.Size(m) -} -func (m *Role) XXX_DiscardUnknown() { - xxx_messageInfo_Role.DiscardUnknown(m) -} - -var xxx_messageInfo_Role proto.InternalMessageInfo - -func (m *Role) GetRoleId() string { - if m != nil { - return m.RoleId - } - return "" -} - -func (m *Role) GetRoleName() string { - if m != nil { - return m.RoleName - } - return "" -} - -func (m *Role) GetDescription() string { - if m != nil { - return m.Description - } - return "" -} - -func (m *Role) GetPortal() string { - if m != nil { - return m.Portal - } - return "" -} - -func (m *Role) GetOwner() string { - if m != nil { - return m.Owner - } - return "" -} - -func (m *Role) GetOwnerPath() string { - if m != nil { - return m.OwnerPath - } - return "" -} - -func (m *Role) GetStatus() string { - if m != nil { - return m.Status - } - return "" -} - -func (m *Role) GetController() string { - if m != nil { - return m.Controller - } - return "" -} - -func (m *Role) GetCreateTime() *timestamp.Timestamp { - if m != nil { - return m.CreateTime - } - return nil -} - -func (m *Role) GetUpdateTime() *timestamp.Timestamp { - if m != nil { - return m.UpdateTime - } - return nil -} - -func (m *Role) GetStatusTime() *timestamp.Timestamp { - if m != nil { - return m.StatusTime - } - return nil -} - -type Api struct { - // api id - ApiId string `protobuf:"bytes,1,opt,name=api_id,json=apiId,proto3" json:"api_id,omitempty"` - // api method, rpc method eg.[Token|CanDo|...] - ApiMethod string `protobuf:"bytes,2,opt,name=api_method,json=apiMethod,proto3" json:"api_method,omitempty"` - // url method, http verb - UrlMethod string `protobuf:"bytes,3,opt,name=url_method,json=urlMethod,proto3" json:"url_method,omitempty"` - // request url - Url string `protobuf:"bytes,4,opt,name=url,proto3" json:"url,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Api) Reset() { *m = Api{} } -func (m *Api) String() string { return proto.CompactTextString(m) } -func (*Api) ProtoMessage() {} -func (*Api) Descriptor() ([]byte, []int) { - return fileDescriptor_8e28828dcb8d24f0, []int{35} -} - -func (m *Api) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Api.Unmarshal(m, b) -} -func (m *Api) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Api.Marshal(b, m, deterministic) -} -func (m *Api) XXX_Merge(src proto.Message) { - xxx_messageInfo_Api.Merge(m, src) -} -func (m *Api) XXX_Size() int { - return xxx_messageInfo_Api.Size(m) -} -func (m *Api) XXX_DiscardUnknown() { - xxx_messageInfo_Api.DiscardUnknown(m) -} - -var xxx_messageInfo_Api proto.InternalMessageInfo - -func (m *Api) GetApiId() string { - if m != nil { - return m.ApiId - } - return "" -} - -func (m *Api) GetApiMethod() string { - if m != nil { - return m.ApiMethod - } - return "" -} - -func (m *Api) GetUrlMethod() string { - if m != nil { - return m.UrlMethod - } - return "" -} - -func (m *Api) GetUrl() string { - if m != nil { - return m.Url - } - return "" -} - -type ActionBundle struct { - // bundle of action, bundle contain one more api - ActionBundleId string `protobuf:"bytes,1,opt,name=action_bundle_id,json=actionBundleId,proto3" json:"action_bundle_id,omitempty"` - // name of bundle - ActionBundleName string `protobuf:"bytes,2,opt,name=action_bundle_name,json=actionBundleName,proto3" json:"action_bundle_name,omitempty"` - // list of api in bundle - ApiSet []*Api `protobuf:"bytes,3,rep,name=api_set,json=apiSet,proto3" json:"api_set,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ActionBundle) Reset() { *m = ActionBundle{} } -func (m *ActionBundle) String() string { return proto.CompactTextString(m) } -func (*ActionBundle) ProtoMessage() {} -func (*ActionBundle) Descriptor() ([]byte, []int) { - return fileDescriptor_8e28828dcb8d24f0, []int{36} -} - -func (m *ActionBundle) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ActionBundle.Unmarshal(m, b) -} -func (m *ActionBundle) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ActionBundle.Marshal(b, m, deterministic) -} -func (m *ActionBundle) XXX_Merge(src proto.Message) { - xxx_messageInfo_ActionBundle.Merge(m, src) -} -func (m *ActionBundle) XXX_Size() int { - return xxx_messageInfo_ActionBundle.Size(m) -} -func (m *ActionBundle) XXX_DiscardUnknown() { - xxx_messageInfo_ActionBundle.DiscardUnknown(m) -} - -var xxx_messageInfo_ActionBundle proto.InternalMessageInfo - -func (m *ActionBundle) GetActionBundleId() string { - if m != nil { - return m.ActionBundleId - } - return "" -} - -func (m *ActionBundle) GetActionBundleName() string { - if m != nil { - return m.ActionBundleName - } - return "" -} - -func (m *ActionBundle) GetApiSet() []*Api { - if m != nil { - return m.ApiSet - } - return nil -} - -type Feature struct { - // feature id - FeatureId string `protobuf:"bytes,1,opt,name=feature_id,json=featureId,proto3" json:"feature_id,omitempty"` - // feature name - FeatureName string `protobuf:"bytes,2,opt,name=feature_name,json=featureName,proto3" json:"feature_name,omitempty"` - // list of action bundle - ActionBundleSet []*ActionBundle `protobuf:"bytes,3,rep,name=action_bundle_set,json=actionBundleSet,proto3" json:"action_bundle_set,omitempty"` - // list of checked action bundle - CheckedActionBundleIdSet []string `protobuf:"bytes,4,rep,name=checked_action_bundle_id_set,json=checkedActionBundleIdSet,proto3" json:"checked_action_bundle_id_set,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Feature) Reset() { *m = Feature{} } -func (m *Feature) String() string { return proto.CompactTextString(m) } -func (*Feature) ProtoMessage() {} -func (*Feature) Descriptor() ([]byte, []int) { - return fileDescriptor_8e28828dcb8d24f0, []int{37} -} - -func (m *Feature) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Feature.Unmarshal(m, b) -} -func (m *Feature) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Feature.Marshal(b, m, deterministic) -} -func (m *Feature) XXX_Merge(src proto.Message) { - xxx_messageInfo_Feature.Merge(m, src) -} -func (m *Feature) XXX_Size() int { - return xxx_messageInfo_Feature.Size(m) -} -func (m *Feature) XXX_DiscardUnknown() { - xxx_messageInfo_Feature.DiscardUnknown(m) -} - -var xxx_messageInfo_Feature proto.InternalMessageInfo - -func (m *Feature) GetFeatureId() string { - if m != nil { - return m.FeatureId - } - return "" -} - -func (m *Feature) GetFeatureName() string { - if m != nil { - return m.FeatureName - } - return "" -} - -func (m *Feature) GetActionBundleSet() []*ActionBundle { - if m != nil { - return m.ActionBundleSet - } - return nil -} - -func (m *Feature) GetCheckedActionBundleIdSet() []string { - if m != nil { - return m.CheckedActionBundleIdSet - } - return nil -} - -type ModuleElem struct { - // module id - ModuleId string `protobuf:"bytes,1,opt,name=module_id,json=moduleId,proto3" json:"module_id,omitempty"` - // module name - ModuleName string `protobuf:"bytes,2,opt,name=module_name,json=moduleName,proto3" json:"module_name,omitempty"` - // list of feature - FeatureSet []*Feature `protobuf:"bytes,3,rep,name=feature_set,json=featureSet,proto3" json:"feature_set,omitempty"` - // access level of visiting data - DataLevel string `protobuf:"bytes,4,opt,name=data_level,json=dataLevel,proto3" json:"data_level,omitempty"` - // is all feature in module elem checked - IsCheckAll bool `protobuf:"varint,5,opt,name=is_check_all,json=isCheckAll,proto3" json:"is_check_all,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ModuleElem) Reset() { *m = ModuleElem{} } -func (m *ModuleElem) String() string { return proto.CompactTextString(m) } -func (*ModuleElem) ProtoMessage() {} -func (*ModuleElem) Descriptor() ([]byte, []int) { - return fileDescriptor_8e28828dcb8d24f0, []int{38} -} - -func (m *ModuleElem) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ModuleElem.Unmarshal(m, b) -} -func (m *ModuleElem) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ModuleElem.Marshal(b, m, deterministic) -} -func (m *ModuleElem) XXX_Merge(src proto.Message) { - xxx_messageInfo_ModuleElem.Merge(m, src) -} -func (m *ModuleElem) XXX_Size() int { - return xxx_messageInfo_ModuleElem.Size(m) -} -func (m *ModuleElem) XXX_DiscardUnknown() { - xxx_messageInfo_ModuleElem.DiscardUnknown(m) -} - -var xxx_messageInfo_ModuleElem proto.InternalMessageInfo - -func (m *ModuleElem) GetModuleId() string { - if m != nil { - return m.ModuleId - } - return "" -} - -func (m *ModuleElem) GetModuleName() string { - if m != nil { - return m.ModuleName - } - return "" -} - -func (m *ModuleElem) GetFeatureSet() []*Feature { - if m != nil { - return m.FeatureSet - } - return nil -} - -func (m *ModuleElem) GetDataLevel() string { - if m != nil { - return m.DataLevel - } - return "" -} - -func (m *ModuleElem) GetIsCheckAll() bool { - if m != nil { - return m.IsCheckAll - } - return false -} - -type Module struct { - // list of module elem - ModuleElemSet []*ModuleElem `protobuf:"bytes,1,rep,name=module_elem_set,json=moduleElemSet,proto3" json:"module_elem_set,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Module) Reset() { *m = Module{} } -func (m *Module) String() string { return proto.CompactTextString(m) } -func (*Module) ProtoMessage() {} -func (*Module) Descriptor() ([]byte, []int) { - return fileDescriptor_8e28828dcb8d24f0, []int{39} -} - -func (m *Module) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Module.Unmarshal(m, b) -} -func (m *Module) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Module.Marshal(b, m, deterministic) -} -func (m *Module) XXX_Merge(src proto.Message) { - xxx_messageInfo_Module.Merge(m, src) -} -func (m *Module) XXX_Size() int { - return xxx_messageInfo_Module.Size(m) -} -func (m *Module) XXX_DiscardUnknown() { - xxx_messageInfo_Module.DiscardUnknown(m) -} - -var xxx_messageInfo_Module proto.InternalMessageInfo - -func (m *Module) GetModuleElemSet() []*ModuleElem { - if m != nil { - return m.ModuleElemSet - } - return nil -} - -type CanDoRequest struct { - // required, id of user to check whether has permission - UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` - // required, request uri - Url string `protobuf:"bytes,2,opt,name=url,proto3" json:"url,omitempty"` - // required, url method, http verb - UrlMethod string `protobuf:"bytes,3,opt,name=url_method,json=urlMethod,proto3" json:"url_method,omitempty"` - // rpc method eg.[Token|CanDo|...] - ApiMethod string `protobuf:"bytes,4,opt,name=api_method,json=apiMethod,proto3" json:"api_method,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *CanDoRequest) Reset() { *m = CanDoRequest{} } -func (m *CanDoRequest) String() string { return proto.CompactTextString(m) } -func (*CanDoRequest) ProtoMessage() {} -func (*CanDoRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_8e28828dcb8d24f0, []int{40} -} - -func (m *CanDoRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_CanDoRequest.Unmarshal(m, b) -} -func (m *CanDoRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_CanDoRequest.Marshal(b, m, deterministic) -} -func (m *CanDoRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_CanDoRequest.Merge(m, src) -} -func (m *CanDoRequest) XXX_Size() int { - return xxx_messageInfo_CanDoRequest.Size(m) -} -func (m *CanDoRequest) XXX_DiscardUnknown() { - xxx_messageInfo_CanDoRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_CanDoRequest proto.InternalMessageInfo - -func (m *CanDoRequest) GetUserId() string { - if m != nil { - return m.UserId - } - return "" -} - -func (m *CanDoRequest) GetUrl() string { - if m != nil { - return m.Url - } - return "" -} - -func (m *CanDoRequest) GetUrlMethod() string { - if m != nil { - return m.UrlMethod - } - return "" -} - -func (m *CanDoRequest) GetApiMethod() string { - if m != nil { - return m.ApiMethod - } - return "" -} - -type CanDoResponse struct { - // id of user to check whether has permission - UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` - // access path of user - AccessPath string `protobuf:"bytes,2,opt,name=access_path,json=accessPath,proto3" json:"access_path,omitempty"` - // owner path of user, concat string group_path:user_id - OwnerPath string `protobuf:"bytes,3,opt,name=owner_path,json=ownerPath,proto3" json:"owner_path,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *CanDoResponse) Reset() { *m = CanDoResponse{} } -func (m *CanDoResponse) String() string { return proto.CompactTextString(m) } -func (*CanDoResponse) ProtoMessage() {} -func (*CanDoResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_8e28828dcb8d24f0, []int{41} -} - -func (m *CanDoResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_CanDoResponse.Unmarshal(m, b) -} -func (m *CanDoResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_CanDoResponse.Marshal(b, m, deterministic) -} -func (m *CanDoResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_CanDoResponse.Merge(m, src) -} -func (m *CanDoResponse) XXX_Size() int { - return xxx_messageInfo_CanDoResponse.Size(m) -} -func (m *CanDoResponse) XXX_DiscardUnknown() { - xxx_messageInfo_CanDoResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_CanDoResponse proto.InternalMessageInfo - -func (m *CanDoResponse) GetUserId() string { - if m != nil { - return m.UserId - } - return "" -} - -func (m *CanDoResponse) GetAccessPath() string { - if m != nil { - return m.AccessPath - } - return "" -} - -func (m *CanDoResponse) GetOwnerPath() string { - if m != nil { - return m.OwnerPath - } - return "" -} - -type GetRoleModuleRequest struct { - // required, use role id to get role's module - RoleId string `protobuf:"bytes,1,opt,name=role_id,json=roleId,proto3" json:"role_id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *GetRoleModuleRequest) Reset() { *m = GetRoleModuleRequest{} } -func (m *GetRoleModuleRequest) String() string { return proto.CompactTextString(m) } -func (*GetRoleModuleRequest) ProtoMessage() {} -func (*GetRoleModuleRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_8e28828dcb8d24f0, []int{42} -} - -func (m *GetRoleModuleRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_GetRoleModuleRequest.Unmarshal(m, b) -} -func (m *GetRoleModuleRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_GetRoleModuleRequest.Marshal(b, m, deterministic) -} -func (m *GetRoleModuleRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetRoleModuleRequest.Merge(m, src) -} -func (m *GetRoleModuleRequest) XXX_Size() int { - return xxx_messageInfo_GetRoleModuleRequest.Size(m) -} -func (m *GetRoleModuleRequest) XXX_DiscardUnknown() { - xxx_messageInfo_GetRoleModuleRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_GetRoleModuleRequest proto.InternalMessageInfo - -func (m *GetRoleModuleRequest) GetRoleId() string { - if m != nil { - return m.RoleId - } - return "" -} - -type GetRoleModuleResponse struct { - // role id - RoleId string `protobuf:"bytes,1,opt,name=role_id,json=roleId,proto3" json:"role_id,omitempty"` - // module info of role - Module *Module `protobuf:"bytes,2,opt,name=module,proto3" json:"module,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *GetRoleModuleResponse) Reset() { *m = GetRoleModuleResponse{} } -func (m *GetRoleModuleResponse) String() string { return proto.CompactTextString(m) } -func (*GetRoleModuleResponse) ProtoMessage() {} -func (*GetRoleModuleResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_8e28828dcb8d24f0, []int{43} -} - -func (m *GetRoleModuleResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_GetRoleModuleResponse.Unmarshal(m, b) -} -func (m *GetRoleModuleResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_GetRoleModuleResponse.Marshal(b, m, deterministic) -} -func (m *GetRoleModuleResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetRoleModuleResponse.Merge(m, src) -} -func (m *GetRoleModuleResponse) XXX_Size() int { - return xxx_messageInfo_GetRoleModuleResponse.Size(m) -} -func (m *GetRoleModuleResponse) XXX_DiscardUnknown() { - xxx_messageInfo_GetRoleModuleResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_GetRoleModuleResponse proto.InternalMessageInfo - -func (m *GetRoleModuleResponse) GetRoleId() string { - if m != nil { - return m.RoleId - } - return "" -} - -func (m *GetRoleModuleResponse) GetModule() *Module { - if m != nil { - return m.Module - } - return nil -} - -type ModifyRoleModuleRequest struct { - // required, use role id to modify role module - RoleId string `protobuf:"bytes,1,opt,name=role_id,json=roleId,proto3" json:"role_id,omitempty"` - // required, module info - Module *Module `protobuf:"bytes,2,opt,name=module,proto3" json:"module,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ModifyRoleModuleRequest) Reset() { *m = ModifyRoleModuleRequest{} } -func (m *ModifyRoleModuleRequest) String() string { return proto.CompactTextString(m) } -func (*ModifyRoleModuleRequest) ProtoMessage() {} -func (*ModifyRoleModuleRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_8e28828dcb8d24f0, []int{44} -} - -func (m *ModifyRoleModuleRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ModifyRoleModuleRequest.Unmarshal(m, b) -} -func (m *ModifyRoleModuleRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ModifyRoleModuleRequest.Marshal(b, m, deterministic) -} -func (m *ModifyRoleModuleRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_ModifyRoleModuleRequest.Merge(m, src) -} -func (m *ModifyRoleModuleRequest) XXX_Size() int { - return xxx_messageInfo_ModifyRoleModuleRequest.Size(m) -} -func (m *ModifyRoleModuleRequest) XXX_DiscardUnknown() { - xxx_messageInfo_ModifyRoleModuleRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_ModifyRoleModuleRequest proto.InternalMessageInfo - -func (m *ModifyRoleModuleRequest) GetRoleId() string { - if m != nil { - return m.RoleId - } - return "" -} - -func (m *ModifyRoleModuleRequest) GetModule() *Module { - if m != nil { - return m.Module - } - return nil -} - -type ModifyRoleModuleResponse struct { - // role id used to modify role module - RoleId string `protobuf:"bytes,1,opt,name=role_id,json=roleId,proto3" json:"role_id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ModifyRoleModuleResponse) Reset() { *m = ModifyRoleModuleResponse{} } -func (m *ModifyRoleModuleResponse) String() string { return proto.CompactTextString(m) } -func (*ModifyRoleModuleResponse) ProtoMessage() {} -func (*ModifyRoleModuleResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_8e28828dcb8d24f0, []int{45} -} - -func (m *ModifyRoleModuleResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ModifyRoleModuleResponse.Unmarshal(m, b) -} -func (m *ModifyRoleModuleResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ModifyRoleModuleResponse.Marshal(b, m, deterministic) -} -func (m *ModifyRoleModuleResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_ModifyRoleModuleResponse.Merge(m, src) -} -func (m *ModifyRoleModuleResponse) XXX_Size() int { - return xxx_messageInfo_ModifyRoleModuleResponse.Size(m) -} -func (m *ModifyRoleModuleResponse) XXX_DiscardUnknown() { - xxx_messageInfo_ModifyRoleModuleResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_ModifyRoleModuleResponse proto.InternalMessageInfo - -func (m *ModifyRoleModuleResponse) GetRoleId() string { - if m != nil { - return m.RoleId - } - return "" -} - -type CreateRoleRequest struct { - // required, role name - RoleName string `protobuf:"bytes,1,opt,name=role_name,json=roleName,proto3" json:"role_name,omitempty"` - // role description - Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` - // required, portal of role eg.[global_admin|user|isv] - Portal string `protobuf:"bytes,3,opt,name=portal,proto3" json:"portal,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *CreateRoleRequest) Reset() { *m = CreateRoleRequest{} } -func (m *CreateRoleRequest) String() string { return proto.CompactTextString(m) } -func (*CreateRoleRequest) ProtoMessage() {} -func (*CreateRoleRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_8e28828dcb8d24f0, []int{46} -} - -func (m *CreateRoleRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_CreateRoleRequest.Unmarshal(m, b) -} -func (m *CreateRoleRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_CreateRoleRequest.Marshal(b, m, deterministic) -} -func (m *CreateRoleRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_CreateRoleRequest.Merge(m, src) -} -func (m *CreateRoleRequest) XXX_Size() int { - return xxx_messageInfo_CreateRoleRequest.Size(m) -} -func (m *CreateRoleRequest) XXX_DiscardUnknown() { - xxx_messageInfo_CreateRoleRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_CreateRoleRequest proto.InternalMessageInfo - -func (m *CreateRoleRequest) GetRoleName() string { - if m != nil { - return m.RoleName - } - return "" -} - -func (m *CreateRoleRequest) GetDescription() string { - if m != nil { - return m.Description - } - return "" -} - -func (m *CreateRoleRequest) GetPortal() string { - if m != nil { - return m.Portal - } - return "" -} - -type CreateRoleResponse struct { - // id of role created - RoleId string `protobuf:"bytes,1,opt,name=role_id,json=roleId,proto3" json:"role_id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *CreateRoleResponse) Reset() { *m = CreateRoleResponse{} } -func (m *CreateRoleResponse) String() string { return proto.CompactTextString(m) } -func (*CreateRoleResponse) ProtoMessage() {} -func (*CreateRoleResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_8e28828dcb8d24f0, []int{47} -} - -func (m *CreateRoleResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_CreateRoleResponse.Unmarshal(m, b) -} -func (m *CreateRoleResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_CreateRoleResponse.Marshal(b, m, deterministic) -} -func (m *CreateRoleResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_CreateRoleResponse.Merge(m, src) -} -func (m *CreateRoleResponse) XXX_Size() int { - return xxx_messageInfo_CreateRoleResponse.Size(m) -} -func (m *CreateRoleResponse) XXX_DiscardUnknown() { - xxx_messageInfo_CreateRoleResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_CreateRoleResponse proto.InternalMessageInfo - -func (m *CreateRoleResponse) GetRoleId() string { - if m != nil { - return m.RoleId - } - return "" -} - -type DeleteRolesRequest struct { - // required, ids of role to delete - RoleId []string `protobuf:"bytes,1,rep,name=role_id,json=roleId,proto3" json:"role_id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *DeleteRolesRequest) Reset() { *m = DeleteRolesRequest{} } -func (m *DeleteRolesRequest) String() string { return proto.CompactTextString(m) } -func (*DeleteRolesRequest) ProtoMessage() {} -func (*DeleteRolesRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_8e28828dcb8d24f0, []int{48} -} - -func (m *DeleteRolesRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_DeleteRolesRequest.Unmarshal(m, b) -} -func (m *DeleteRolesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_DeleteRolesRequest.Marshal(b, m, deterministic) -} -func (m *DeleteRolesRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_DeleteRolesRequest.Merge(m, src) -} -func (m *DeleteRolesRequest) XXX_Size() int { - return xxx_messageInfo_DeleteRolesRequest.Size(m) -} -func (m *DeleteRolesRequest) XXX_DiscardUnknown() { - xxx_messageInfo_DeleteRolesRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_DeleteRolesRequest proto.InternalMessageInfo - -func (m *DeleteRolesRequest) GetRoleId() []string { - if m != nil { - return m.RoleId - } - return nil -} - -type DeleteRolesResponse struct { - // ids of roles deleted - RoleId []string `protobuf:"bytes,1,rep,name=role_id,json=roleId,proto3" json:"role_id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *DeleteRolesResponse) Reset() { *m = DeleteRolesResponse{} } -func (m *DeleteRolesResponse) String() string { return proto.CompactTextString(m) } -func (*DeleteRolesResponse) ProtoMessage() {} -func (*DeleteRolesResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_8e28828dcb8d24f0, []int{49} -} - -func (m *DeleteRolesResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_DeleteRolesResponse.Unmarshal(m, b) -} -func (m *DeleteRolesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_DeleteRolesResponse.Marshal(b, m, deterministic) -} -func (m *DeleteRolesResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_DeleteRolesResponse.Merge(m, src) -} -func (m *DeleteRolesResponse) XXX_Size() int { - return xxx_messageInfo_DeleteRolesResponse.Size(m) -} -func (m *DeleteRolesResponse) XXX_DiscardUnknown() { - xxx_messageInfo_DeleteRolesResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_DeleteRolesResponse proto.InternalMessageInfo - -func (m *DeleteRolesResponse) GetRoleId() []string { - if m != nil { - return m.RoleId - } - return nil -} - -type ModifyRoleRequest struct { - // required, id of role to modify - RoleId string `protobuf:"bytes,1,opt,name=role_id,json=roleId,proto3" json:"role_id,omitempty"` - // role name - RoleName string `protobuf:"bytes,2,opt,name=role_name,json=roleName,proto3" json:"role_name,omitempty"` - // role description - Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ModifyRoleRequest) Reset() { *m = ModifyRoleRequest{} } -func (m *ModifyRoleRequest) String() string { return proto.CompactTextString(m) } -func (*ModifyRoleRequest) ProtoMessage() {} -func (*ModifyRoleRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_8e28828dcb8d24f0, []int{50} -} - -func (m *ModifyRoleRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ModifyRoleRequest.Unmarshal(m, b) -} -func (m *ModifyRoleRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ModifyRoleRequest.Marshal(b, m, deterministic) -} -func (m *ModifyRoleRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_ModifyRoleRequest.Merge(m, src) -} -func (m *ModifyRoleRequest) XXX_Size() int { - return xxx_messageInfo_ModifyRoleRequest.Size(m) -} -func (m *ModifyRoleRequest) XXX_DiscardUnknown() { - xxx_messageInfo_ModifyRoleRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_ModifyRoleRequest proto.InternalMessageInfo - -func (m *ModifyRoleRequest) GetRoleId() string { - if m != nil { - return m.RoleId - } - return "" -} - -func (m *ModifyRoleRequest) GetRoleName() string { - if m != nil { - return m.RoleName - } - return "" -} - -func (m *ModifyRoleRequest) GetDescription() string { - if m != nil { - return m.Description - } - return "" -} - -type ModifyRoleResponse struct { - // id of role modified - RoleId string `protobuf:"bytes,1,opt,name=role_id,json=roleId,proto3" json:"role_id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ModifyRoleResponse) Reset() { *m = ModifyRoleResponse{} } -func (m *ModifyRoleResponse) String() string { return proto.CompactTextString(m) } -func (*ModifyRoleResponse) ProtoMessage() {} -func (*ModifyRoleResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_8e28828dcb8d24f0, []int{51} -} - -func (m *ModifyRoleResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ModifyRoleResponse.Unmarshal(m, b) -} -func (m *ModifyRoleResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ModifyRoleResponse.Marshal(b, m, deterministic) -} -func (m *ModifyRoleResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_ModifyRoleResponse.Merge(m, src) -} -func (m *ModifyRoleResponse) XXX_Size() int { - return xxx_messageInfo_ModifyRoleResponse.Size(m) -} -func (m *ModifyRoleResponse) XXX_DiscardUnknown() { - xxx_messageInfo_ModifyRoleResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_ModifyRoleResponse proto.InternalMessageInfo - -func (m *ModifyRoleResponse) GetRoleId() string { - if m != nil { - return m.RoleId - } - return "" -} - -type GetRoleRequest struct { - // required, use role id to get role info - RoleId string `protobuf:"bytes,1,opt,name=role_id,json=roleId,proto3" json:"role_id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *GetRoleRequest) Reset() { *m = GetRoleRequest{} } -func (m *GetRoleRequest) String() string { return proto.CompactTextString(m) } -func (*GetRoleRequest) ProtoMessage() {} -func (*GetRoleRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_8e28828dcb8d24f0, []int{52} -} - -func (m *GetRoleRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_GetRoleRequest.Unmarshal(m, b) -} -func (m *GetRoleRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_GetRoleRequest.Marshal(b, m, deterministic) -} -func (m *GetRoleRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetRoleRequest.Merge(m, src) -} -func (m *GetRoleRequest) XXX_Size() int { - return xxx_messageInfo_GetRoleRequest.Size(m) -} -func (m *GetRoleRequest) XXX_DiscardUnknown() { - xxx_messageInfo_GetRoleRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_GetRoleRequest proto.InternalMessageInfo - -func (m *GetRoleRequest) GetRoleId() string { - if m != nil { - return m.RoleId - } - return "" -} - -type GetRoleResponse struct { - // role info - Role *Role `protobuf:"bytes,1,opt,name=role,proto3" json:"role,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *GetRoleResponse) Reset() { *m = GetRoleResponse{} } -func (m *GetRoleResponse) String() string { return proto.CompactTextString(m) } -func (*GetRoleResponse) ProtoMessage() {} -func (*GetRoleResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_8e28828dcb8d24f0, []int{53} -} - -func (m *GetRoleResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_GetRoleResponse.Unmarshal(m, b) -} -func (m *GetRoleResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_GetRoleResponse.Marshal(b, m, deterministic) -} -func (m *GetRoleResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetRoleResponse.Merge(m, src) -} -func (m *GetRoleResponse) XXX_Size() int { - return xxx_messageInfo_GetRoleResponse.Size(m) -} -func (m *GetRoleResponse) XXX_DiscardUnknown() { - xxx_messageInfo_GetRoleResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_GetRoleResponse proto.InternalMessageInfo - -func (m *GetRoleResponse) GetRole() *Role { - if m != nil { - return m.Role - } - return nil -} - -type DescribeRolesRequest struct { - // query key, support these fields(role_id, portal, status) - SearchWord string `protobuf:"bytes,1,opt,name=search_word,json=searchWord,proto3" json:"search_word,omitempty"` - // sort key, order by sort_key, default create_time - SortKey string `protobuf:"bytes,2,opt,name=sort_key,json=sortKey,proto3" json:"sort_key,omitempty"` - // value = 0 sort ASC, value = 1 sort DESC - Reverse bool `protobuf:"varint,3,opt,name=reverse,proto3" json:"reverse,omitempty"` - // data offset, default 0 - Offset uint32 `protobuf:"varint,4,opt,name=offset,proto3" json:"offset,omitempty"` - // data limit per page, default value 20, max value 200 - Limit uint32 `protobuf:"varint,5,opt,name=limit,proto3" json:"limit,omitempty"` - // role ids - RoleId []string `protobuf:"bytes,6,rep,name=role_id,json=roleId,proto3" json:"role_id,omitempty"` - // name - RoleName []string `protobuf:"bytes,7,rep,name=role_name,json=roleName,proto3" json:"role_name,omitempty"` - // portal eg.[global_admin|user|isv] - Portal []string `protobuf:"bytes,8,rep,name=portal,proto3" json:"portal,omitempty"` - // status eg.[active|deleted] - Status []string `protobuf:"bytes,9,rep,name=status,proto3" json:"status,omitempty"` - // action bundle ids - ActionBundleId []string `protobuf:"bytes,10,rep,name=action_bundle_id,json=actionBundleId,proto3" json:"action_bundle_id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *DescribeRolesRequest) Reset() { *m = DescribeRolesRequest{} } -func (m *DescribeRolesRequest) String() string { return proto.CompactTextString(m) } -func (*DescribeRolesRequest) ProtoMessage() {} -func (*DescribeRolesRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_8e28828dcb8d24f0, []int{54} -} - -func (m *DescribeRolesRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_DescribeRolesRequest.Unmarshal(m, b) -} -func (m *DescribeRolesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_DescribeRolesRequest.Marshal(b, m, deterministic) -} -func (m *DescribeRolesRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_DescribeRolesRequest.Merge(m, src) -} -func (m *DescribeRolesRequest) XXX_Size() int { - return xxx_messageInfo_DescribeRolesRequest.Size(m) -} -func (m *DescribeRolesRequest) XXX_DiscardUnknown() { - xxx_messageInfo_DescribeRolesRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_DescribeRolesRequest proto.InternalMessageInfo - -func (m *DescribeRolesRequest) GetSearchWord() string { - if m != nil { - return m.SearchWord - } - return "" -} - -func (m *DescribeRolesRequest) GetSortKey() string { - if m != nil { - return m.SortKey - } - return "" -} - -func (m *DescribeRolesRequest) GetReverse() bool { - if m != nil { - return m.Reverse - } - return false -} - -func (m *DescribeRolesRequest) GetOffset() uint32 { - if m != nil { - return m.Offset - } - return 0 -} - -func (m *DescribeRolesRequest) GetLimit() uint32 { - if m != nil { - return m.Limit - } - return 0 -} - -func (m *DescribeRolesRequest) GetRoleId() []string { - if m != nil { - return m.RoleId - } - return nil -} - -func (m *DescribeRolesRequest) GetRoleName() []string { - if m != nil { - return m.RoleName - } - return nil -} - -func (m *DescribeRolesRequest) GetPortal() []string { - if m != nil { - return m.Portal - } - return nil -} - -func (m *DescribeRolesRequest) GetStatus() []string { - if m != nil { - return m.Status - } - return nil -} - -func (m *DescribeRolesRequest) GetActionBundleId() []string { - if m != nil { - return m.ActionBundleId - } - return nil -} - -type DescribeRolesResponse struct { - // total count of roles - TotalCount uint32 `protobuf:"varint,1,opt,name=total_count,json=totalCount,proto3" json:"total_count,omitempty"` - // list of role - RoleSet []*Role `protobuf:"bytes,2,rep,name=role_set,json=roleSet,proto3" json:"role_set,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *DescribeRolesResponse) Reset() { *m = DescribeRolesResponse{} } -func (m *DescribeRolesResponse) String() string { return proto.CompactTextString(m) } -func (*DescribeRolesResponse) ProtoMessage() {} -func (*DescribeRolesResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_8e28828dcb8d24f0, []int{55} -} - -func (m *DescribeRolesResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_DescribeRolesResponse.Unmarshal(m, b) -} -func (m *DescribeRolesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_DescribeRolesResponse.Marshal(b, m, deterministic) -} -func (m *DescribeRolesResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_DescribeRolesResponse.Merge(m, src) -} -func (m *DescribeRolesResponse) XXX_Size() int { - return xxx_messageInfo_DescribeRolesResponse.Size(m) -} -func (m *DescribeRolesResponse) XXX_DiscardUnknown() { - xxx_messageInfo_DescribeRolesResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_DescribeRolesResponse proto.InternalMessageInfo - -func (m *DescribeRolesResponse) GetTotalCount() uint32 { - if m != nil { - return m.TotalCount - } - return 0 -} - -func (m *DescribeRolesResponse) GetRoleSet() []*Role { - if m != nil { - return m.RoleSet - } - return nil -} - -type BindUserRoleRequest struct { - // required, ids of user to bind - UserId []string `protobuf:"bytes,1,rep,name=user_id,json=userId,proto3" json:"user_id,omitempty"` - // required, ids of role for user to bind with - RoleId []string `protobuf:"bytes,2,rep,name=role_id,json=roleId,proto3" json:"role_id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *BindUserRoleRequest) Reset() { *m = BindUserRoleRequest{} } -func (m *BindUserRoleRequest) String() string { return proto.CompactTextString(m) } -func (*BindUserRoleRequest) ProtoMessage() {} -func (*BindUserRoleRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_8e28828dcb8d24f0, []int{56} -} - -func (m *BindUserRoleRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_BindUserRoleRequest.Unmarshal(m, b) -} -func (m *BindUserRoleRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_BindUserRoleRequest.Marshal(b, m, deterministic) -} -func (m *BindUserRoleRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_BindUserRoleRequest.Merge(m, src) -} -func (m *BindUserRoleRequest) XXX_Size() int { - return xxx_messageInfo_BindUserRoleRequest.Size(m) -} -func (m *BindUserRoleRequest) XXX_DiscardUnknown() { - xxx_messageInfo_BindUserRoleRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_BindUserRoleRequest proto.InternalMessageInfo - -func (m *BindUserRoleRequest) GetUserId() []string { - if m != nil { - return m.UserId - } - return nil -} - -func (m *BindUserRoleRequest) GetRoleId() []string { - if m != nil { - return m.RoleId - } - return nil -} - -type BindUserRoleResponse struct { - // ids of user bind - UserId []string `protobuf:"bytes,1,rep,name=user_id,json=userId,proto3" json:"user_id,omitempty"` - // ids of role for user to bind with - RoleId []string `protobuf:"bytes,2,rep,name=role_id,json=roleId,proto3" json:"role_id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *BindUserRoleResponse) Reset() { *m = BindUserRoleResponse{} } -func (m *BindUserRoleResponse) String() string { return proto.CompactTextString(m) } -func (*BindUserRoleResponse) ProtoMessage() {} -func (*BindUserRoleResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_8e28828dcb8d24f0, []int{57} -} - -func (m *BindUserRoleResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_BindUserRoleResponse.Unmarshal(m, b) -} -func (m *BindUserRoleResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_BindUserRoleResponse.Marshal(b, m, deterministic) -} -func (m *BindUserRoleResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_BindUserRoleResponse.Merge(m, src) -} -func (m *BindUserRoleResponse) XXX_Size() int { - return xxx_messageInfo_BindUserRoleResponse.Size(m) -} -func (m *BindUserRoleResponse) XXX_DiscardUnknown() { - xxx_messageInfo_BindUserRoleResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_BindUserRoleResponse proto.InternalMessageInfo - -func (m *BindUserRoleResponse) GetUserId() []string { - if m != nil { - return m.UserId - } - return nil -} - -func (m *BindUserRoleResponse) GetRoleId() []string { - if m != nil { - return m.RoleId - } - return nil -} - -type UnbindUserRoleRequest struct { - // ids of user to unbind - UserId []string `protobuf:"bytes,1,rep,name=user_id,json=userId,proto3" json:"user_id,omitempty"` - // ids of role for user to unbind with - RoleId []string `protobuf:"bytes,2,rep,name=role_id,json=roleId,proto3" json:"role_id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *UnbindUserRoleRequest) Reset() { *m = UnbindUserRoleRequest{} } -func (m *UnbindUserRoleRequest) String() string { return proto.CompactTextString(m) } -func (*UnbindUserRoleRequest) ProtoMessage() {} -func (*UnbindUserRoleRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_8e28828dcb8d24f0, []int{58} -} - -func (m *UnbindUserRoleRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_UnbindUserRoleRequest.Unmarshal(m, b) -} -func (m *UnbindUserRoleRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_UnbindUserRoleRequest.Marshal(b, m, deterministic) -} -func (m *UnbindUserRoleRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_UnbindUserRoleRequest.Merge(m, src) -} -func (m *UnbindUserRoleRequest) XXX_Size() int { - return xxx_messageInfo_UnbindUserRoleRequest.Size(m) -} -func (m *UnbindUserRoleRequest) XXX_DiscardUnknown() { - xxx_messageInfo_UnbindUserRoleRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_UnbindUserRoleRequest proto.InternalMessageInfo - -func (m *UnbindUserRoleRequest) GetUserId() []string { - if m != nil { - return m.UserId - } - return nil -} - -func (m *UnbindUserRoleRequest) GetRoleId() []string { - if m != nil { - return m.RoleId - } - return nil -} - -type UnbindUserRoleResponse struct { - // ids of user to unbind - UserId []string `protobuf:"bytes,1,rep,name=user_id,json=userId,proto3" json:"user_id,omitempty"` - // ids of role for user to unbind with - RoleId []string `protobuf:"bytes,2,rep,name=role_id,json=roleId,proto3" json:"role_id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *UnbindUserRoleResponse) Reset() { *m = UnbindUserRoleResponse{} } -func (m *UnbindUserRoleResponse) String() string { return proto.CompactTextString(m) } -func (*UnbindUserRoleResponse) ProtoMessage() {} -func (*UnbindUserRoleResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_8e28828dcb8d24f0, []int{59} -} - -func (m *UnbindUserRoleResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_UnbindUserRoleResponse.Unmarshal(m, b) -} -func (m *UnbindUserRoleResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_UnbindUserRoleResponse.Marshal(b, m, deterministic) -} -func (m *UnbindUserRoleResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_UnbindUserRoleResponse.Merge(m, src) -} -func (m *UnbindUserRoleResponse) XXX_Size() int { - return xxx_messageInfo_UnbindUserRoleResponse.Size(m) -} -func (m *UnbindUserRoleResponse) XXX_DiscardUnknown() { - xxx_messageInfo_UnbindUserRoleResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_UnbindUserRoleResponse proto.InternalMessageInfo - -func (m *UnbindUserRoleResponse) GetUserId() []string { - if m != nil { - return m.UserId - } - return nil -} - -func (m *UnbindUserRoleResponse) GetRoleId() []string { - if m != nil { - return m.RoleId - } - return nil -} - -type CreateClientRequest struct { - // required, user id for create client - UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *CreateClientRequest) Reset() { *m = CreateClientRequest{} } -func (m *CreateClientRequest) String() string { return proto.CompactTextString(m) } -func (*CreateClientRequest) ProtoMessage() {} -func (*CreateClientRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_8e28828dcb8d24f0, []int{60} -} - -func (m *CreateClientRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_CreateClientRequest.Unmarshal(m, b) -} -func (m *CreateClientRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_CreateClientRequest.Marshal(b, m, deterministic) -} -func (m *CreateClientRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_CreateClientRequest.Merge(m, src) -} -func (m *CreateClientRequest) XXX_Size() int { - return xxx_messageInfo_CreateClientRequest.Size(m) -} -func (m *CreateClientRequest) XXX_DiscardUnknown() { - xxx_messageInfo_CreateClientRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_CreateClientRequest proto.InternalMessageInfo - -func (m *CreateClientRequest) GetUserId() string { - if m != nil { - return m.UserId - } - return "" -} - -type CreateClientResponse struct { - // user id of client - UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` - // client id of user - ClientId string `protobuf:"bytes,2,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty"` - // client secret,used for validate client credentials - ClientSecret string `protobuf:"bytes,3,opt,name=client_secret,json=clientSecret,proto3" json:"client_secret,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *CreateClientResponse) Reset() { *m = CreateClientResponse{} } -func (m *CreateClientResponse) String() string { return proto.CompactTextString(m) } -func (*CreateClientResponse) ProtoMessage() {} -func (*CreateClientResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_8e28828dcb8d24f0, []int{61} -} - -func (m *CreateClientResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_CreateClientResponse.Unmarshal(m, b) -} -func (m *CreateClientResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_CreateClientResponse.Marshal(b, m, deterministic) -} -func (m *CreateClientResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_CreateClientResponse.Merge(m, src) -} -func (m *CreateClientResponse) XXX_Size() int { - return xxx_messageInfo_CreateClientResponse.Size(m) -} -func (m *CreateClientResponse) XXX_DiscardUnknown() { - xxx_messageInfo_CreateClientResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_CreateClientResponse proto.InternalMessageInfo - -func (m *CreateClientResponse) GetUserId() string { - if m != nil { - return m.UserId - } - return "" -} - -func (m *CreateClientResponse) GetClientId() string { - if m != nil { - return m.ClientId - } - return "" -} - -func (m *CreateClientResponse) GetClientSecret() string { - if m != nil { - return m.ClientSecret - } - return "" -} - -type TokenRequest struct { - // required, type of client request verification.eg.[client_credentials or password or refresh_token] - GrantType string `protobuf:"bytes,1,opt,name=grant_type,json=grantType,proto3" json:"grant_type,omitempty"` - // required, client id - ClientId string `protobuf:"bytes,2,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty"` - // required, used for validate client credentials - ClientSecret string `protobuf:"bytes,3,opt,name=client_secret,json=clientSecret,proto3" json:"client_secret,omitempty"` - // scope - Scope string `protobuf:"bytes,4,opt,name=scope,proto3" json:"scope,omitempty"` - // required or not depend on grant_type, user's name - Username string `protobuf:"bytes,5,opt,name=username,proto3" json:"username,omitempty"` - // required or not depend on grant_type, user's password - Password string `protobuf:"bytes,6,opt,name=password,proto3" json:"password,omitempty"` - // required or not depend on grant_type, refresh token to check whether token expired - RefreshToken string `protobuf:"bytes,7,opt,name=refresh_token,json=refreshToken,proto3" json:"refresh_token,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *TokenRequest) Reset() { *m = TokenRequest{} } -func (m *TokenRequest) String() string { return proto.CompactTextString(m) } -func (*TokenRequest) ProtoMessage() {} -func (*TokenRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_8e28828dcb8d24f0, []int{62} -} - -func (m *TokenRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_TokenRequest.Unmarshal(m, b) -} -func (m *TokenRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_TokenRequest.Marshal(b, m, deterministic) -} -func (m *TokenRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_TokenRequest.Merge(m, src) -} -func (m *TokenRequest) XXX_Size() int { - return xxx_messageInfo_TokenRequest.Size(m) -} -func (m *TokenRequest) XXX_DiscardUnknown() { - xxx_messageInfo_TokenRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_TokenRequest proto.InternalMessageInfo - -func (m *TokenRequest) GetGrantType() string { - if m != nil { - return m.GrantType - } - return "" -} - -func (m *TokenRequest) GetClientId() string { - if m != nil { - return m.ClientId - } - return "" -} - -func (m *TokenRequest) GetClientSecret() string { - if m != nil { - return m.ClientSecret - } - return "" -} - -func (m *TokenRequest) GetScope() string { - if m != nil { - return m.Scope - } - return "" -} - -func (m *TokenRequest) GetUsername() string { - if m != nil { - return m.Username - } - return "" -} - -func (m *TokenRequest) GetPassword() string { - if m != nil { - return m.Password - } - return "" -} - -func (m *TokenRequest) GetRefreshToken() string { - if m != nil { - return m.RefreshToken - } - return "" -} - -type TokenResponse struct { - // token type.eg.[sender,bearer] - TokenType string `protobuf:"bytes,1,opt,name=token_type,json=tokenType,proto3" json:"token_type,omitempty"` - // default 2h - ExpiresIn int32 `protobuf:"varint,2,opt,name=expires_in,json=expiresIn,proto3" json:"expires_in,omitempty"` - //access token, generator by jwt(key=secrete key) - AccessToken string `protobuf:"bytes,3,opt,name=access_token,json=accessToken,proto3" json:"access_token,omitempty"` - //refresh token, timeliness,default expired after 2 weeks - RefreshToken string `protobuf:"bytes,4,opt,name=refresh_token,json=refreshToken,proto3" json:"refresh_token,omitempty"` - //id token, generator by jwt(key="") - IdToken string `protobuf:"bytes,5,opt,name=id_token,json=idToken,proto3" json:"id_token,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *TokenResponse) Reset() { *m = TokenResponse{} } -func (m *TokenResponse) String() string { return proto.CompactTextString(m) } -func (*TokenResponse) ProtoMessage() {} -func (*TokenResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_8e28828dcb8d24f0, []int{63} -} - -func (m *TokenResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_TokenResponse.Unmarshal(m, b) -} -func (m *TokenResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_TokenResponse.Marshal(b, m, deterministic) -} -func (m *TokenResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_TokenResponse.Merge(m, src) -} -func (m *TokenResponse) XXX_Size() int { - return xxx_messageInfo_TokenResponse.Size(m) -} -func (m *TokenResponse) XXX_DiscardUnknown() { - xxx_messageInfo_TokenResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_TokenResponse proto.InternalMessageInfo - -func (m *TokenResponse) GetTokenType() string { - if m != nil { - return m.TokenType - } - return "" -} - -func (m *TokenResponse) GetExpiresIn() int32 { - if m != nil { - return m.ExpiresIn - } - return 0 -} - -func (m *TokenResponse) GetAccessToken() string { - if m != nil { - return m.AccessToken - } - return "" -} - -func (m *TokenResponse) GetRefreshToken() string { - if m != nil { - return m.RefreshToken - } - return "" -} - -func (m *TokenResponse) GetIdToken() string { - if m != nil { - return m.IdToken - } - return "" -} - -func init() { - proto.RegisterType((*User)(nil), "openpitrix.User") - proto.RegisterType((*UserDetail)(nil), "openpitrix.UserDetail") - proto.RegisterType((*Group)(nil), "openpitrix.Group") - proto.RegisterType((*GroupDetail)(nil), "openpitrix.GroupDetail") - proto.RegisterType((*DescribeUsersRequest)(nil), "openpitrix.DescribeUsersRequest") - proto.RegisterType((*DescribeUsersResponse)(nil), "openpitrix.DescribeUsersResponse") - proto.RegisterType((*DescribeUsersDetailResponse)(nil), "openpitrix.DescribeUsersDetailResponse") - proto.RegisterType((*ModifyUserRequest)(nil), "openpitrix.ModifyUserRequest") - proto.RegisterType((*ModifyUserResponse)(nil), "openpitrix.ModifyUserResponse") - proto.RegisterType((*DeleteUsersRequest)(nil), "openpitrix.DeleteUsersRequest") - proto.RegisterType((*DeleteUsersResponse)(nil), "openpitrix.DeleteUsersResponse") - proto.RegisterType((*CreatePasswordResetRequest)(nil), "openpitrix.CreatePasswordResetRequest") - proto.RegisterType((*CreatePasswordResetResponse)(nil), "openpitrix.CreatePasswordResetResponse") - proto.RegisterType((*ChangePasswordRequest)(nil), "openpitrix.ChangePasswordRequest") - proto.RegisterType((*ChangePasswordResponse)(nil), "openpitrix.ChangePasswordResponse") - proto.RegisterType((*GetPasswordResetRequest)(nil), "openpitrix.GetPasswordResetRequest") - proto.RegisterType((*GetPasswordResetResponse)(nil), "openpitrix.GetPasswordResetResponse") - proto.RegisterType((*CreateUserRequest)(nil), "openpitrix.CreateUserRequest") - proto.RegisterType((*CreateUserResponse)(nil), "openpitrix.CreateUserResponse") - proto.RegisterType((*ValidateUserPasswordRequest)(nil), "openpitrix.ValidateUserPasswordRequest") - proto.RegisterType((*ValidateUserPasswordResponse)(nil), "openpitrix.ValidateUserPasswordResponse") - proto.RegisterType((*CreateGroupRequest)(nil), "openpitrix.CreateGroupRequest") - proto.RegisterType((*CreateGroupResponse)(nil), "openpitrix.CreateGroupResponse") - proto.RegisterType((*DescribeGroupsRequest)(nil), "openpitrix.DescribeGroupsRequest") - proto.RegisterType((*DescribeGroupsResponse)(nil), "openpitrix.DescribeGroupsResponse") - proto.RegisterType((*DescribeGroupsDetailResponse)(nil), "openpitrix.DescribeGroupsDetailResponse") - proto.RegisterType((*ModifyGroupRequest)(nil), "openpitrix.ModifyGroupRequest") - proto.RegisterType((*ModifyGroupResponse)(nil), "openpitrix.ModifyGroupResponse") - proto.RegisterType((*DeleteGroupsRequest)(nil), "openpitrix.DeleteGroupsRequest") - proto.RegisterType((*DeleteGroupsResponse)(nil), "openpitrix.DeleteGroupsResponse") - proto.RegisterType((*JoinGroupRequest)(nil), "openpitrix.JoinGroupRequest") - proto.RegisterType((*JoinGroupResponse)(nil), "openpitrix.JoinGroupResponse") - proto.RegisterType((*LeaveGroupRequest)(nil), "openpitrix.LeaveGroupRequest") - proto.RegisterType((*LeaveGroupResponse)(nil), "openpitrix.LeaveGroupResponse") - proto.RegisterType((*Role)(nil), "openpitrix.Role") - proto.RegisterType((*Api)(nil), "openpitrix.Api") - proto.RegisterType((*ActionBundle)(nil), "openpitrix.ActionBundle") - proto.RegisterType((*Feature)(nil), "openpitrix.Feature") - proto.RegisterType((*ModuleElem)(nil), "openpitrix.ModuleElem") - proto.RegisterType((*Module)(nil), "openpitrix.Module") - proto.RegisterType((*CanDoRequest)(nil), "openpitrix.CanDoRequest") - proto.RegisterType((*CanDoResponse)(nil), "openpitrix.CanDoResponse") - proto.RegisterType((*GetRoleModuleRequest)(nil), "openpitrix.GetRoleModuleRequest") - proto.RegisterType((*GetRoleModuleResponse)(nil), "openpitrix.GetRoleModuleResponse") - proto.RegisterType((*ModifyRoleModuleRequest)(nil), "openpitrix.ModifyRoleModuleRequest") - proto.RegisterType((*ModifyRoleModuleResponse)(nil), "openpitrix.ModifyRoleModuleResponse") - proto.RegisterType((*CreateRoleRequest)(nil), "openpitrix.CreateRoleRequest") - proto.RegisterType((*CreateRoleResponse)(nil), "openpitrix.CreateRoleResponse") - proto.RegisterType((*DeleteRolesRequest)(nil), "openpitrix.DeleteRolesRequest") - proto.RegisterType((*DeleteRolesResponse)(nil), "openpitrix.DeleteRolesResponse") - proto.RegisterType((*ModifyRoleRequest)(nil), "openpitrix.ModifyRoleRequest") - proto.RegisterType((*ModifyRoleResponse)(nil), "openpitrix.ModifyRoleResponse") - proto.RegisterType((*GetRoleRequest)(nil), "openpitrix.GetRoleRequest") - proto.RegisterType((*GetRoleResponse)(nil), "openpitrix.GetRoleResponse") - proto.RegisterType((*DescribeRolesRequest)(nil), "openpitrix.DescribeRolesRequest") - proto.RegisterType((*DescribeRolesResponse)(nil), "openpitrix.DescribeRolesResponse") - proto.RegisterType((*BindUserRoleRequest)(nil), "openpitrix.BindUserRoleRequest") - proto.RegisterType((*BindUserRoleResponse)(nil), "openpitrix.BindUserRoleResponse") - proto.RegisterType((*UnbindUserRoleRequest)(nil), "openpitrix.UnbindUserRoleRequest") - proto.RegisterType((*UnbindUserRoleResponse)(nil), "openpitrix.UnbindUserRoleResponse") - proto.RegisterType((*CreateClientRequest)(nil), "openpitrix.CreateClientRequest") - proto.RegisterType((*CreateClientResponse)(nil), "openpitrix.CreateClientResponse") - proto.RegisterType((*TokenRequest)(nil), "openpitrix.TokenRequest") - proto.RegisterType((*TokenResponse)(nil), "openpitrix.TokenResponse") -} - -func init() { proto.RegisterFile("account.proto", fileDescriptor_8e28828dcb8d24f0) } - -var fileDescriptor_8e28828dcb8d24f0 = []byte{ - // 3561 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x3a, 0x5d, 0x6f, 0x1b, 0xc7, - 0xb5, 0x77, 0x29, 0x8a, 0x12, 0x0f, 0x45, 0x49, 0x1e, 0xcb, 0x32, 0x4d, 0x49, 0xf6, 0x7a, 0x63, - 0xd8, 0xb2, 0x2c, 0x4b, 0x89, 0x92, 0x20, 0x81, 0x73, 0xe3, 0x80, 0x96, 0x13, 0x5b, 0x49, 0xec, - 0x04, 0x74, 0x9c, 0x00, 0x37, 0x37, 0x21, 0x56, 0xdc, 0xa1, 0xb8, 0xf1, 0x72, 0x97, 0xd9, 0x5d, - 0x4a, 0xf1, 0xbd, 0x17, 0xb7, 0x68, 0xd0, 0x00, 0x6d, 0x81, 0xa0, 0x29, 0x8b, 0x14, 0xfd, 0x78, - 0x6a, 0x81, 0xbe, 0x04, 0x7d, 0x08, 0xfa, 0x52, 0xf4, 0xb1, 0x2f, 0x05, 0x0a, 0xf4, 0xa1, 0x1f, - 0xff, 0xa0, 0x2d, 0xd0, 0xf7, 0xf6, 0x0f, 0x14, 0x73, 0x66, 0x76, 0x77, 0x66, 0xb9, 0x94, 0x48, - 0x2b, 0x09, 0x50, 0xa0, 0x4f, 0xe2, 0xce, 0x39, 0x33, 0xe7, 0x63, 0xce, 0x9c, 0x4f, 0x41, 0xd9, - 0x6c, 0x36, 0xbd, 0x9e, 0x1b, 0x6e, 0x74, 0x7d, 0x2f, 0xf4, 0x08, 0x78, 0x5d, 0xea, 0x76, 0xed, - 0xd0, 0xb7, 0x3f, 0xa8, 0x9e, 0xdd, 0xf3, 0xbc, 0x3d, 0x87, 0x6e, 0x22, 0x64, 0xb7, 0xd7, 0xda, - 0x3c, 0xf0, 0xcd, 0x6e, 0x97, 0xfa, 0x01, 0xc7, 0xad, 0x9e, 0x4b, 0xc3, 0x43, 0xbb, 0x43, 0x83, - 0xd0, 0xec, 0x74, 0x05, 0xc2, 0xb2, 0x40, 0x30, 0xbb, 0xf6, 0xa6, 0xe9, 0xba, 0x5e, 0x68, 0x86, - 0xb6, 0xe7, 0x46, 0xdb, 0xd7, 0xf1, 0x4f, 0xf3, 0xea, 0x1e, 0x75, 0xaf, 0x06, 0x07, 0xe6, 0xde, - 0x1e, 0xf5, 0x37, 0xbd, 0x2e, 0x62, 0x0c, 0x62, 0x1b, 0x3f, 0xcc, 0x43, 0xfe, 0x7e, 0x40, 0x7d, - 0xf2, 0x34, 0x4c, 0xf5, 0x02, 0xea, 0x37, 0x6c, 0xab, 0xa2, 0xe9, 0xda, 0x6a, 0x69, 0x6b, 0x79, - 0x83, 0x93, 0xd9, 0x88, 0xf8, 0xd8, 0xb8, 0x17, 0xfa, 0xb6, 0xbb, 0xf7, 0xa6, 0xe9, 0xf4, 0x68, - 0xbd, 0xc0, 0x90, 0x77, 0x2c, 0xf2, 0x2c, 0x4c, 0xb3, 0x5f, 0xae, 0xd9, 0xa1, 0x95, 0xdc, 0x08, - 0xfb, 0x62, 0x6c, 0xb2, 0x05, 0x93, 0xb4, 0x63, 0xda, 0x4e, 0x65, 0x62, 0x84, 0x6d, 0x1c, 0x95, - 0xbc, 0x00, 0x33, 0xdd, 0xb6, 0xe7, 0xd2, 0x86, 0xdb, 0xeb, 0xec, 0x52, 0xbf, 0x92, 0x1f, 0x61, - 0x6b, 0x09, 0x77, 0xdc, 0xc5, 0x0d, 0xe4, 0x3a, 0x94, 0x2c, 0x1a, 0x34, 0x7d, 0x1b, 0x15, 0x52, - 0x99, 0x1c, 0x65, 0xbf, 0xb4, 0x81, 0x3c, 0x05, 0x85, 0x20, 0x34, 0xc3, 0x5e, 0x50, 0x29, 0x8c, - 0xa2, 0x24, 0x8e, 0x4b, 0x9e, 0x83, 0x52, 0xd3, 0xa7, 0x66, 0x48, 0x1b, 0xec, 0x2a, 0x2b, 0x53, - 0xb8, 0xb5, 0x3a, 0xb0, 0xf5, 0x8d, 0xe8, 0x9e, 0xeb, 0xc0, 0xd1, 0xd9, 0x02, 0xdb, 0xdc, 0xeb, - 0x5a, 0xf1, 0xe6, 0xe9, 0xa3, 0x37, 0x73, 0xf4, 0x68, 0x33, 0xe7, 0x81, 0x6f, 0x2e, 0x1e, 0xbd, - 0x99, 0xa3, 0xb3, 0x05, 0xe3, 0x3b, 0x1a, 0x00, 0xb3, 0x8d, 0x9b, 0x34, 0x64, 0xca, 0xbf, 0x00, - 0x79, 0x76, 0x79, 0xc2, 0x3c, 0xe6, 0x37, 0x12, 0x93, 0xde, 0x60, 0x58, 0x75, 0x84, 0x92, 0x2b, - 0x30, 0xed, 0x7b, 0x0e, 0x6d, 0x04, 0x34, 0xac, 0xe4, 0xf4, 0x89, 0x34, 0x66, 0xdd, 0x73, 0x68, - 0x7d, 0x8a, 0x61, 0xdc, 0xa3, 0x21, 0xd9, 0x80, 0xe2, 0x9e, 0xef, 0xf5, 0xba, 0x88, 0x3d, 0x81, - 0xd8, 0x27, 0x64, 0xec, 0x5b, 0x0c, 0x58, 0x9f, 0x46, 0x9c, 0x7b, 0x34, 0x34, 0x7e, 0x9a, 0x87, - 0x49, 0x5c, 0x23, 0x37, 0x61, 0xae, 0x6b, 0xfa, 0xd4, 0x0d, 0x1b, 0xfc, 0x80, 0x11, 0xcd, 0xb6, - 0xcc, 0x37, 0xe1, 0x19, 0x3b, 0x16, 0x79, 0x06, 0xa6, 0xe3, 0xed, 0xa3, 0x58, 0xef, 0xd4, 0x9e, - 0xd8, 0xf8, 0x1c, 0x00, 0xdf, 0xd8, 0x35, 0xc3, 0xf6, 0x48, 0x16, 0xcc, 0x05, 0x7d, 0xdd, 0x0c, - 0xdb, 0xe4, 0x71, 0xc8, 0xe3, 0x7b, 0x19, 0xc5, 0x7a, 0x11, 0x53, 0x32, 0xbb, 0xc9, 0x31, 0xcc, - 0x2e, 0x65, 0xec, 0x85, 0x71, 0x8d, 0xfd, 0x5f, 0xd4, 0x6c, 0x9b, 0x50, 0xc2, 0xfb, 0x15, 0x66, - 0x7b, 0x09, 0x26, 0x51, 0xf5, 0xc2, 0x3e, 0x32, 0xec, 0x8b, 0xc3, 0x99, 0xe5, 0xa2, 0x07, 0x1c, - 0x62, 0xb9, 0x68, 0xe3, 0xe8, 0x23, 0x99, 0x25, 0xfe, 0x7e, 0x02, 0x16, 0x6e, 0xa2, 0xae, 0x76, - 0x29, 0x83, 0x04, 0x75, 0xfa, 0x7e, 0x8f, 0x06, 0x21, 0x79, 0x1e, 0x4a, 0x01, 0x35, 0xfd, 0x66, - 0xbb, 0x71, 0xe0, 0xf9, 0xa3, 0x19, 0x25, 0xf0, 0x0d, 0x6f, 0x79, 0x3e, 0x5a, 0x64, 0xe0, 0xf9, - 0x61, 0xe3, 0x01, 0x7d, 0x38, 0x9a, 0x45, 0x32, 0xec, 0x57, 0xe8, 0x43, 0xf2, 0x14, 0x4c, 0xf9, - 0x74, 0x9f, 0xfa, 0x01, 0x15, 0xe6, 0x38, 0xa8, 0xae, 0x1b, 0x9e, 0xe7, 0x88, 0x5d, 0x02, 0x95, - 0x2c, 0xc0, 0xa4, 0x63, 0x77, 0xec, 0x10, 0x6d, 0xb1, 0x5c, 0xe7, 0x1f, 0x64, 0x11, 0x0a, 0x5e, - 0xab, 0xc5, 0xf4, 0x30, 0x89, 0xcb, 0xe2, 0x8b, 0x18, 0x50, 0xf6, 0x3d, 0x4f, 0x7a, 0x72, 0x05, - 0x7d, 0x62, 0xb5, 0x58, 0x2f, 0xb1, 0xc5, 0xe8, 0x49, 0x9d, 0x91, 0x9e, 0xd4, 0x14, 0x82, 0xe3, - 0x47, 0x73, 0x3a, 0x09, 0x31, 0xd3, 0x08, 0x89, 0x82, 0xc8, 0x62, 0x6c, 0xde, 0x45, 0xbe, 0x2e, - 0x0c, 0xf8, 0x34, 0xa0, 0xa7, 0x60, 0x1b, 0x80, 0x03, 0xd8, 0xe7, 0x8e, 0x45, 0xaa, 0x52, 0xd4, - 0x29, 0x21, 0x24, 0x89, 0x2b, 0x0b, 0x51, 0x5c, 0x99, 0x41, 0x80, 0x88, 0x1c, 0xe7, 0x53, 0x91, - 0xa3, 0xcc, 0x39, 0x97, 0x62, 0x83, 0x41, 0xe1, 0x54, 0xea, 0x46, 0x83, 0xae, 0xe7, 0x06, 0x94, - 0x9c, 0x83, 0x52, 0xe8, 0x85, 0xa6, 0xd3, 0xc0, 0x88, 0x8e, 0x57, 0x5a, 0xae, 0x03, 0x2e, 0x6d, - 0xb3, 0x95, 0xf1, 0x2c, 0xe7, 0xff, 0x61, 0x49, 0x21, 0xc3, 0xcd, 0x74, 0x74, 0x62, 0xd7, 0x61, - 0x0e, 0x89, 0x59, 0xb8, 0x4f, 0xa2, 0xb9, 0x98, 0xa6, 0x29, 0x4e, 0x2e, 0xf7, 0xe2, 0xdf, 0x8c, - 0xfe, 0x3f, 0x72, 0x70, 0xe2, 0x8e, 0x67, 0xd9, 0xad, 0x87, 0xc8, 0x97, 0x30, 0xdb, 0x47, 0x0c, - 0xff, 0x71, 0x10, 0xcf, 0x8d, 0x1e, 0xc4, 0xe5, 0x94, 0x61, 0x62, 0xac, 0x94, 0x21, 0xe5, 0xd0, - 0xf2, 0xe3, 0x3a, 0xb4, 0x67, 0x61, 0xba, 0x6b, 0x06, 0x01, 0x3e, 0xcc, 0x51, 0x1c, 0x69, 0x8c, - 0x3d, 0x90, 0x78, 0x14, 0xc6, 0x4c, 0x3c, 0x8c, 0x57, 0x80, 0xc8, 0x4a, 0x17, 0x97, 0xfd, 0x68, - 0x5a, 0x37, 0xae, 0x02, 0xb9, 0x49, 0x1d, 0x1a, 0xaa, 0x9e, 0xe7, 0xb4, 0x7c, 0x98, 0xf4, 0xbc, - 0x8c, 0x0d, 0x38, 0xa9, 0xa0, 0x0b, 0xe2, 0x43, 0xf1, 0x3f, 0xd6, 0xa0, 0xba, 0x8d, 0x9e, 0xfc, - 0x75, 0x21, 0x7f, 0x9d, 0x06, 0x34, 0x3c, 0xa6, 0xa9, 0xc8, 0xca, 0xcf, 0x8d, 0xa3, 0x7c, 0xc6, - 0xcf, 0x52, 0x26, 0x3f, 0xc7, 0xd2, 0x22, 0x73, 0xb5, 0x3e, 0x3b, 0x67, 0xe4, 0xe0, 0x8f, 0xd8, - 0x3b, 0x96, 0xf1, 0x5d, 0x0d, 0x4e, 0x6d, 0xb7, 0x4d, 0x77, 0x4f, 0xe2, 0x87, 0xab, 0xe6, 0x05, - 0x98, 0x71, 0xe9, 0x41, 0x23, 0x96, 0x73, 0x14, 0x76, 0x4a, 0x2e, 0x3d, 0x88, 0xce, 0x79, 0x74, - 0x9e, 0x5e, 0x83, 0xc5, 0x34, 0x4b, 0xc7, 0xb3, 0xb1, 0xa7, 0xe0, 0xf4, 0x2d, 0x1a, 0x66, 0x1a, - 0xc0, 0x19, 0x89, 0x49, 0x76, 0x64, 0x31, 0x61, 0xe3, 0x2e, 0x54, 0x06, 0x77, 0x09, 0x46, 0x86, - 0x6f, 0x93, 0x4d, 0x31, 0x87, 0x90, 0x88, 0x8b, 0x5f, 0xe5, 0xe0, 0x04, 0xbf, 0x7a, 0xd9, 0x59, - 0xc5, 0x5e, 0x47, 0x7b, 0xf4, 0xd2, 0x21, 0x37, 0x6e, 0xe9, 0x20, 0xdb, 0xef, 0xc4, 0x58, 0xce, - 0xe3, 0xe9, 0x24, 0x8c, 0x8d, 0xe2, 0xb2, 0xa2, 0x20, 0x77, 0xcc, 0x5a, 0x85, 0xb9, 0x1c, 0x59, - 0x75, 0xc7, 0x33, 0x87, 0xd7, 0x60, 0xe9, 0x4d, 0xd3, 0xb1, 0x2d, 0x71, 0x5c, 0xda, 0xf0, 0x17, - 0xe4, 0x1b, 0x89, 0x83, 0x6e, 0x35, 0xf5, 0xe4, 0x8b, 0xd2, 0xa3, 0xfe, 0x4f, 0x58, 0xce, 0x3e, - 0x50, 0xf0, 0xb9, 0x0c, 0xc5, 0x7d, 0x01, 0xe7, 0x9c, 0x4e, 0xd7, 0x93, 0x05, 0xe3, 0x77, 0x5a, - 0x24, 0x1c, 0x4f, 0xe1, 0x04, 0x1b, 0x5f, 0x4c, 0x55, 0x10, 0xe5, 0xe7, 0xb9, 0x91, 0xf3, 0xf3, - 0xd4, 0x55, 0x4d, 0x8c, 0x7b, 0x55, 0x77, 0xe1, 0xa4, 0x22, 0x8d, 0xd0, 0x81, 0x5c, 0x9e, 0x68, - 0x63, 0x94, 0x27, 0xc6, 0xe7, 0x13, 0x49, 0x2e, 0x83, 0x47, 0xfe, 0x3b, 0x3d, 0x15, 0x77, 0x7b, - 0x71, 0xd0, 0x42, 0x78, 0x96, 0x9a, 0xb2, 0x01, 0x39, 0x8d, 0x9d, 0x56, 0xd3, 0xd8, 0x15, 0xa5, - 0xf6, 0xe3, 0x19, 0xab, 0x54, 0xdd, 0xc5, 0x60, 0xb4, 0x21, 0x90, 0xc0, 0x77, 0x99, 0xa9, 0x24, - 0xb9, 0x6e, 0x49, 0xce, 0x75, 0x0d, 0x1b, 0x16, 0xd3, 0x37, 0x36, 0x6a, 0x46, 0xa8, 0x54, 0xd1, - 0xb9, 0xa3, 0xab, 0xe8, 0x0f, 0x35, 0x58, 0x56, 0x69, 0x8d, 0x9b, 0x83, 0xd6, 0x60, 0x9e, 0x53, - 0x1c, 0x48, 0x42, 0x4f, 0x0f, 0x10, 0x16, 0x67, 0xcf, 0xee, 0x25, 0x1f, 0x8c, 0x89, 0x8f, 0x72, - 0x51, 0x46, 0xa4, 0xbc, 0xe0, 0x47, 0x35, 0xf9, 0xaf, 0xfe, 0xd1, 0x66, 0x39, 0x9b, 0xfc, 0xd8, - 0xce, 0x86, 0x3d, 0x7d, 0x45, 0x0d, 0xc7, 0x7d, 0xfa, 0x8f, 0x47, 0xc9, 0x9e, 0xfa, 0xee, 0xcf, - 0x28, 0xe7, 0xc9, 0xf6, 0x6c, 0x3c, 0xc1, 0x2a, 0x59, 0x79, 0x47, 0x12, 0xaf, 0x87, 0x6d, 0x79, - 0x09, 0xe6, 0x5f, 0xf6, 0x6c, 0x57, 0xb9, 0xb9, 0xe1, 0xe8, 0x6a, 0x78, 0x97, 0x33, 0xcd, 0x5b, - 0x70, 0x42, 0x3a, 0xe7, 0x48, 0xba, 0x87, 0x1e, 0xf4, 0x2a, 0x35, 0xf7, 0xe9, 0xb1, 0x39, 0xba, - 0x0d, 0x44, 0x3e, 0xe8, 0x18, 0x2c, 0xfd, 0x68, 0x02, 0xf2, 0x75, 0xcf, 0xa1, 0x72, 0x15, 0xcb, - 0xa3, 0x63, 0x14, 0xe0, 0x97, 0xa0, 0x88, 0x80, 0xd8, 0x6e, 0x8b, 0x75, 0xec, 0x9d, 0xa1, 0x9f, - 0xd0, 0x07, 0xad, 0xb3, 0xa8, 0xda, 0xdf, 0x22, 0x14, 0xba, 0x9e, 0x1f, 0x9a, 0x0e, 0x9a, 0x5d, - 0xb1, 0x2e, 0xbe, 0x98, 0xd3, 0xf4, 0x0e, 0x5c, 0xea, 0xa3, 0x77, 0x2c, 0xd6, 0xf9, 0x07, 0x73, - 0x4b, 0xf8, 0x83, 0x7b, 0xad, 0x02, 0x82, 0x8a, 0xb8, 0x82, 0x5e, 0x2b, 0x71, 0x4b, 0x53, 0xfc, - 0x30, 0x51, 0x82, 0x9f, 0x05, 0x68, 0x7a, 0x6e, 0xe8, 0x7b, 0x8e, 0x43, 0x7d, 0xec, 0xe2, 0x14, - 0xeb, 0xd2, 0x4a, 0xba, 0x47, 0x54, 0x3c, 0x4e, 0x8f, 0x08, 0x8e, 0xd3, 0x23, 0x2a, 0x8d, 0xd5, - 0x23, 0x72, 0x60, 0xa2, 0xd6, 0xb5, 0xc9, 0x29, 0x28, 0x98, 0x5d, 0x3b, 0xb9, 0x99, 0x49, 0xb3, - 0x6b, 0x73, 0x0f, 0xcf, 0x96, 0x3b, 0x34, 0x6c, 0x7b, 0x51, 0xe6, 0x52, 0x34, 0xbb, 0xf6, 0x1d, - 0x5c, 0x60, 0xe0, 0x9e, 0xef, 0x44, 0x60, 0x7e, 0x33, 0xc5, 0x9e, 0xef, 0x08, 0xf0, 0x3c, 0x4c, - 0xf4, 0xfc, 0xe8, 0x52, 0xd8, 0x4f, 0xe3, 0x13, 0x0d, 0x66, 0x6a, 0x4d, 0x76, 0x69, 0x37, 0x7a, - 0xae, 0xe5, 0x50, 0xb2, 0x0a, 0xf3, 0x26, 0x7e, 0x37, 0x76, 0x71, 0x21, 0xe1, 0x60, 0xd6, 0x94, - 0xf0, 0x76, 0x2c, 0xb2, 0x0e, 0x44, 0xc5, 0x94, 0x8c, 0x65, 0x5e, 0xc6, 0x45, 0xa3, 0x59, 0x85, - 0x29, 0xc6, 0x78, 0xd2, 0x4d, 0x9d, 0x93, 0xdd, 0x71, 0xad, 0x6b, 0xd7, 0x99, 0xbc, 0xcc, 0xfd, - 0xfe, 0x41, 0x83, 0xa9, 0x97, 0xa8, 0x19, 0xf6, 0x7c, 0xca, 0xe4, 0x69, 0xf1, 0x9f, 0x09, 0x1f, - 0x45, 0xb1, 0xb2, 0x63, 0x91, 0xf3, 0x30, 0x13, 0x81, 0x25, 0xe2, 0x25, 0xb1, 0x86, 0x74, 0x6f, - 0xc2, 0x09, 0x95, 0xcb, 0x84, 0x83, 0x8a, 0xc2, 0x81, 0xc4, 0x70, 0x7d, 0x4e, 0x66, 0xff, 0x1e, - 0x0d, 0xc9, 0x75, 0x58, 0x6e, 0xb6, 0x69, 0xf3, 0x01, 0xb5, 0x1a, 0x69, 0xed, 0xe0, 0x81, 0x79, - 0x7c, 0x5f, 0x15, 0x81, 0x53, 0x53, 0x14, 0xc5, 0x64, 0xfa, 0xb5, 0x06, 0x70, 0xc7, 0xb3, 0x7a, - 0x0e, 0x7d, 0xd1, 0xa1, 0x1d, 0xf6, 0xbc, 0x3a, 0xf8, 0x95, 0x48, 0x35, 0xcd, 0x17, 0x76, 0x2c, - 0x16, 0xe2, 0x04, 0x50, 0x92, 0x09, 0xf8, 0xd2, 0x5d, 0xde, 0x72, 0x8d, 0x24, 0x94, 0x84, 0x39, - 0x29, 0x0b, 0x23, 0xd4, 0x57, 0x8f, 0x94, 0xc7, 0x44, 0x58, 0x01, 0xb0, 0xcc, 0xd0, 0x6c, 0x38, - 0x74, 0x9f, 0x46, 0x26, 0x50, 0x64, 0x2b, 0xaf, 0xb2, 0x05, 0xa2, 0xc3, 0x8c, 0x1d, 0x34, 0x50, - 0x80, 0x86, 0xe9, 0x38, 0xf8, 0x42, 0xa7, 0xeb, 0x60, 0x07, 0xdb, 0x6c, 0xa9, 0xe6, 0x38, 0xc6, - 0x6d, 0x28, 0x70, 0x11, 0xc8, 0x75, 0x98, 0x13, 0x1c, 0x52, 0x87, 0x76, 0x90, 0x09, 0x6d, 0xb0, - 0xcf, 0x93, 0xc8, 0x5b, 0x2f, 0x77, 0xe2, 0xdf, 0x4c, 0x1b, 0x07, 0x30, 0xb3, 0x6d, 0xba, 0x37, - 0xbd, 0xcc, 0xf6, 0x80, 0x54, 0x63, 0x45, 0xf6, 0x9a, 0x8b, 0xed, 0xf5, 0x28, 0x03, 0x57, 0x9f, - 0x47, 0x3e, 0xf5, 0x3c, 0x8c, 0x36, 0x94, 0x05, 0xe1, 0xac, 0x46, 0x83, 0x4c, 0xf9, 0x1c, 0x94, - 0xcc, 0x66, 0x93, 0x06, 0x01, 0x77, 0x4a, 0xe2, 0x12, 0xf8, 0x52, 0x94, 0x4b, 0x49, 0x4e, 0x6b, - 0x22, 0xe5, 0xb4, 0x8c, 0x4d, 0x58, 0xb8, 0x45, 0x43, 0xe6, 0x64, 0xb9, 0x1a, 0x24, 0x51, 0x33, - 0x3d, 0xae, 0xf1, 0xdf, 0x70, 0x2a, 0xb5, 0x21, 0x61, 0x31, 0xdb, 0x47, 0xaf, 0x41, 0x81, 0xab, - 0x55, 0x24, 0x16, 0x64, 0x50, 0xf9, 0x75, 0x81, 0x61, 0xbc, 0x0b, 0xa7, 0x79, 0x28, 0x1f, 0x9d, - 0xa3, 0xb1, 0xce, 0x7f, 0x12, 0x2a, 0x83, 0xe7, 0x1f, 0x21, 0x80, 0xf1, 0x5e, 0x54, 0x40, 0xe3, - 0xe4, 0x45, 0xb0, 0xa3, 0x44, 0x1e, 0xed, 0xf0, 0xc8, 0x93, 0x3b, 0x2c, 0xf2, 0x4c, 0xc8, 0x91, - 0xc7, 0xb8, 0x1a, 0x15, 0x65, 0x9c, 0xd6, 0x51, 0xac, 0xc5, 0x6d, 0x2c, 0x86, 0x1e, 0x64, 0xaa, - 0x4a, 0x6a, 0xfa, 0x26, 0x6d, 0x2c, 0x81, 0x9e, 0x75, 0xbc, 0x8c, 0xff, 0x20, 0xea, 0x73, 0xca, - 0x92, 0x7f, 0x49, 0xc1, 0x98, 0xc9, 0x22, 0x13, 0x3b, 0x4a, 0xf4, 0xcb, 0x30, 0x2b, 0x0c, 0xf1, - 0x48, 0x9b, 0x7d, 0x06, 0xe6, 0x62, 0x54, 0x71, 0xec, 0x05, 0xc8, 0x33, 0x60, 0xd6, 0x24, 0x0e, - 0xf1, 0x10, 0x6a, 0x7c, 0x96, 0x4b, 0x46, 0x14, 0x8a, 0x86, 0xcf, 0x0d, 0xd6, 0x80, 0x45, 0xa5, - 0xca, 0x3b, 0x93, 0xaa, 0xf2, 0x8a, 0x49, 0x1d, 0x57, 0x51, 0xeb, 0xb8, 0xe9, 0xa4, 0x56, 0x4b, - 0xaa, 0xb2, 0xbc, 0x52, 0x95, 0xc5, 0x35, 0xdc, 0xa4, 0x5c, 0xc3, 0x49, 0xe2, 0x16, 0x94, 0xd6, - 0xbe, 0x72, 0x0f, 0xbc, 0x34, 0x4b, 0xee, 0x21, 0x31, 0x3c, 0x31, 0x40, 0x10, 0x29, 0xcf, 0xb0, - 0x01, 0x42, 0x56, 0x9c, 0xe5, 0x15, 0x59, 0x2a, 0xce, 0xca, 0xcd, 0x7f, 0xd5, 0xbc, 0x46, 0x69, - 0xfe, 0x8f, 0x3c, 0xf0, 0x34, 0x6e, 0xc1, 0xc9, 0x1b, 0xb6, 0x6b, 0x61, 0x47, 0x46, 0xbd, 0xfc, - 0xcc, 0x56, 0xac, 0xac, 0xa6, 0x9c, 0x62, 0xdc, 0xb7, 0x61, 0x41, 0x3d, 0xe8, 0x88, 0xa6, 0xee, - 0xf0, 0x93, 0x76, 0xe0, 0xd4, 0x7d, 0x77, 0xf7, 0x0b, 0x61, 0xea, 0x65, 0x58, 0x4c, 0x1f, 0xf5, - 0xc8, 0x6c, 0x6d, 0x44, 0x2d, 0x91, 0x6d, 0xc7, 0xa6, 0x6e, 0x78, 0x54, 0x14, 0x33, 0xde, 0x87, - 0x05, 0x15, 0xff, 0xa8, 0xe0, 0xb3, 0x04, 0xc5, 0x26, 0xa2, 0x26, 0x5d, 0xc7, 0x69, 0xbe, 0xb0, - 0x63, 0x91, 0xc7, 0xa0, 0x2c, 0x80, 0x01, 0x6d, 0xfa, 0x18, 0xff, 0x19, 0xc2, 0x0c, 0x5f, 0xbc, - 0x87, 0x6b, 0xc6, 0x9f, 0x35, 0x98, 0x79, 0xc3, 0x7b, 0x40, 0xdd, 0x88, 0x39, 0x2c, 0xfd, 0x4d, - 0x37, 0x6c, 0x84, 0x0f, 0xbb, 0x91, 0x5f, 0x2d, 0xe2, 0xca, 0x1b, 0x0f, 0xbb, 0xf4, 0xf8, 0x14, - 0xd9, 0x5b, 0x0a, 0x9a, 0x5e, 0x97, 0x8a, 0xa0, 0xcb, 0x3f, 0x94, 0x69, 0x18, 0xcf, 0xf9, 0x93, - 0x91, 0x89, 0xdc, 0x82, 0x2b, 0xa8, 0x2d, 0x38, 0x46, 0xd2, 0xa7, 0x2d, 0x9f, 0x06, 0xed, 0x46, - 0xc8, 0xc4, 0x10, 0xa9, 0xff, 0x8c, 0x58, 0x44, 0xd1, 0x8c, 0xcf, 0x35, 0x28, 0x0b, 0x21, 0x85, - 0x46, 0x57, 0x00, 0x10, 0x5d, 0x91, 0x12, 0x57, 0x50, 0xca, 0x15, 0x00, 0xfa, 0x41, 0xd7, 0xf6, - 0x69, 0xd0, 0xb0, 0x79, 0xf4, 0x98, 0xac, 0x17, 0xc5, 0xca, 0x8e, 0xcb, 0xb2, 0x49, 0x11, 0xf3, - 0x39, 0x4d, 0xe1, 0x4b, 0xf9, 0x1a, 0x12, 0x1a, 0xe4, 0x2b, 0x3f, 0xc8, 0x17, 0xf3, 0x51, 0xb6, - 0x25, 0xe0, 0x5c, 0xe8, 0x29, 0xdb, 0x42, 0xd0, 0xd6, 0xdf, 0x16, 0x61, 0xb6, 0xc6, 0xff, 0xfd, - 0xe6, 0x8e, 0xe9, 0x9a, 0x7b, 0xd4, 0x27, 0xbf, 0xd5, 0xa0, 0xac, 0x4c, 0xdd, 0x88, 0x2e, 0x3f, - 0xd2, 0xac, 0x49, 0x6e, 0xf5, 0xfc, 0x21, 0x18, 0x5c, 0x15, 0x46, 0xd0, 0xaf, 0x35, 0xc8, 0x3b, - 0xb7, 0x68, 0xa8, 0x33, 0x85, 0x07, 0xeb, 0x7a, 0xcb, 0x76, 0x42, 0xea, 0xeb, 0x07, 0x76, 0xd8, - 0xd6, 0x5b, 0x36, 0x75, 0xac, 0x60, 0x55, 0x58, 0xdf, 0xba, 0x8e, 0x3d, 0xd1, 0x75, 0x5d, 0xee, - 0x42, 0xaf, 0xeb, 0xdc, 0x51, 0x5d, 0x5e, 0xd7, 0x2d, 0xda, 0x32, 0x7b, 0x4e, 0xa8, 0xfb, 0x34, - 0xec, 0xf9, 0xae, 0x6e, 0x3a, 0x0e, 0x3f, 0xf3, 0xc3, 0x3f, 0xfd, 0xf5, 0x7b, 0xb9, 0x12, 0x29, - 0x6e, 0xee, 0x3f, 0xb1, 0x89, 0x0b, 0xe4, 0x1b, 0x39, 0x16, 0x08, 0x07, 0x26, 0x88, 0x23, 0x48, - 0x74, 0x69, 0x28, 0x86, 0xda, 0x00, 0x32, 0x7e, 0xa2, 0xf5, 0x6b, 0x1f, 0x69, 0xe4, 0x43, 0x4d, - 0x12, 0xcd, 0x76, 0x9b, 0x4e, 0xcf, 0xa2, 0xf8, 0xa9, 0xdb, 0x6e, 0xcb, 0xd3, 0xbd, 0x96, 0xce, - 0x1e, 0xab, 0x6e, 0xba, 0x96, 0x8e, 0xe5, 0xf0, 0x97, 0x26, 0x3f, 0x21, 0xf3, 0xb1, 0xfc, 0xa2, - 0xe7, 0x44, 0xf6, 0x31, 0xd9, 0x17, 0x13, 0x35, 0xb2, 0x92, 0xca, 0x9b, 0xd4, 0xf1, 0x66, 0xf5, - 0xec, 0x30, 0xb0, 0x10, 0xf8, 0x72, 0xbf, 0x46, 0xc8, 0x3c, 0x07, 0x24, 0x12, 0x22, 0xed, 0xd9, - 0xad, 0x44, 0xf7, 0xd7, 0xb4, 0x35, 0xf2, 0x35, 0x28, 0x49, 0xd3, 0x34, 0x72, 0x56, 0xd5, 0x69, - 0x7a, 0x2a, 0x57, 0x3d, 0x37, 0x14, 0x2e, 0x48, 0x6f, 0xf6, 0x6b, 0x15, 0xb2, 0xc8, 0x21, 0x9c, - 0xf4, 0x2e, 0x67, 0xa1, 0x61, 0x5b, 0x9c, 0x81, 0x35, 0x95, 0x81, 0xef, 0x6b, 0x30, 0xab, 0xce, - 0x7a, 0x88, 0x62, 0xaa, 0x99, 0xa3, 0xa9, 0xaa, 0x71, 0x18, 0x8a, 0x60, 0xe5, 0xf9, 0x7e, 0x6d, - 0x91, 0x2c, 0x70, 0x20, 0x67, 0x25, 0xf2, 0x15, 0xc8, 0xc8, 0x59, 0xe3, 0x4c, 0xcc, 0xc8, 0x66, - 0x04, 0xb9, 0xd6, 0x44, 0x74, 0xc6, 0xd8, 0x2f, 0xb5, 0xc8, 0x67, 0x2b, 0x03, 0x20, 0x72, 0x51, - 0x21, 0x3d, 0x74, 0xb0, 0xa8, 0x9a, 0xe7, 0x21, 0x03, 0x3f, 0xe3, 0xb5, 0x7e, 0xed, 0x32, 0xb9, - 0xc4, 0x31, 0x74, 0x53, 0xf7, 0xf9, 0x7e, 0x3d, 0xf4, 0x74, 0x1c, 0x28, 0x21, 0xeb, 0x97, 0x02, - 0xc1, 0x3c, 0xb2, 0xbe, 0x62, 0x54, 0x32, 0x58, 0x47, 0x6c, 0xc6, 0xf9, 0x37, 0x35, 0x28, 0xef, - 0x04, 0xfb, 0xc9, 0xb8, 0x44, 0xb5, 0xa7, 0x81, 0x09, 0x94, 0x6a, 0x4f, 0x83, 0x53, 0x16, 0xe3, - 0xd9, 0x7e, 0x6d, 0x85, 0x2c, 0xed, 0x04, 0xfb, 0xec, 0x91, 0x74, 0x1d, 0x33, 0x6c, 0x79, 0x7e, - 0x47, 0xe7, 0xad, 0x0f, 0x64, 0x8f, 0x9b, 0xb5, 0x51, 0x66, 0x5c, 0xd9, 0xc1, 0x7e, 0x23, 0xbe, - 0xdd, 0x4f, 0x34, 0x80, 0x2f, 0x8e, 0x8f, 0xed, 0x7e, 0x6d, 0x9d, 0xac, 0x6d, 0x27, 0x74, 0xd7, - 0x75, 0xbb, 0xc5, 0xaf, 0xb6, 0x6d, 0xee, 0x53, 0xdd, 0xb4, 0x3a, 0xb6, 0xab, 0x77, 0xa9, 0xdf, - 0xb1, 0x83, 0xc0, 0xf6, 0x5c, 0x6e, 0x70, 0x86, 0x6a, 0x70, 0x9f, 0x69, 0x30, 0x9f, 0x9e, 0xea, - 0x91, 0xc7, 0x94, 0x46, 0x6f, 0xf6, 0xa4, 0xb0, 0x7a, 0xe1, 0x70, 0x24, 0xc1, 0xe4, 0x2b, 0xfd, - 0xda, 0x2a, 0xb9, 0xc8, 0x5c, 0x4d, 0x72, 0x97, 0xcc, 0xb7, 0x0c, 0xde, 0xa5, 0x30, 0xc4, 0x2a, - 0x19, 0x7a, 0x9b, 0xe4, 0x73, 0x0d, 0x16, 0xb2, 0x06, 0x4b, 0x44, 0xb1, 0xae, 0x43, 0x66, 0x59, - 0xd5, 0xd5, 0xa3, 0x11, 0x05, 0xe3, 0x2f, 0xf6, 0x6b, 0xcb, 0xa4, 0x1a, 0xa1, 0x70, 0xb5, 0x32, - 0x67, 0xa8, 0x30, 0xab, 0x1b, 0x4b, 0x19, 0xcc, 0x46, 0xa3, 0x2c, 0xa6, 0xdf, 0x4f, 0x35, 0x28, - 0x49, 0xe3, 0x1f, 0x92, 0x71, 0xa9, 0x72, 0x5f, 0x53, 0x75, 0x29, 0x19, 0x73, 0x23, 0xc6, 0xd7, - 0x55, 0x72, 0x45, 0xdc, 0xba, 0xf0, 0xcc, 0x26, 0xff, 0xa1, 0x37, 0x3d, 0x37, 0x34, 0x6d, 0x57, - 0xf7, 0x5c, 0xaa, 0x77, 0x3c, 0x5f, 0xb2, 0xc6, 0x39, 0x03, 0x18, 0xa3, 0x88, 0x86, 0xf7, 0xfe, - 0x17, 0x0d, 0x66, 0xd5, 0x39, 0x01, 0xc9, 0x8c, 0x89, 0x4a, 0xa7, 0x59, 0x75, 0x34, 0xd9, 0x23, - 0x0d, 0xe3, 0x5b, 0x5a, 0xbf, 0x16, 0x12, 0x9f, 0x5d, 0x39, 0x27, 0xb7, 0xae, 0x37, 0x4d, 0x57, - 0x89, 0x1e, 0x61, 0x9b, 0x06, 0x34, 0x8a, 0x21, 0x51, 0xf3, 0x75, 0x5d, 0x4f, 0x75, 0xdc, 0xd7, - 0xf5, 0x64, 0x14, 0x73, 0x78, 0x30, 0xe1, 0x74, 0x50, 0xd0, 0x19, 0x22, 0x09, 0x4a, 0x7e, 0x20, - 0x95, 0x49, 0xf2, 0x34, 0x64, 0x14, 0x59, 0x57, 0x87, 0xa3, 0xa4, 0x22, 0xea, 0x2f, 0xb4, 0x7e, - 0xed, 0x53, 0x8d, 0xf4, 0x35, 0x59, 0xe6, 0x28, 0xa4, 0x46, 0xc1, 0x4e, 0xb7, 0x5d, 0x3d, 0x6c, - 0xdb, 0x41, 0x74, 0x67, 0x5f, 0xa1, 0x4e, 0x4e, 0x92, 0x13, 0x89, 0x4e, 0xa2, 0x10, 0xfb, 0xbf, - 0x50, 0x92, 0x66, 0x13, 0x24, 0x23, 0x88, 0x0e, 0xb7, 0xcb, 0x8c, 0xa1, 0x86, 0x71, 0xa5, 0x5f, - 0x3b, 0x49, 0x44, 0x51, 0x2e, 0xcc, 0x31, 0x0e, 0xb3, 0x73, 0x5b, 0x29, 0xeb, 0xfb, 0x1f, 0x98, - 0x91, 0xc7, 0x12, 0x24, 0x23, 0x90, 0xaa, 0x97, 0xa1, 0x0f, 0x47, 0x10, 0xf4, 0x2f, 0xf5, 0x6b, - 0x73, 0xa4, 0x2c, 0x42, 0xad, 0x24, 0xfc, 0xdc, 0x5a, 0x8a, 0xf6, 0xc7, 0x1a, 0x14, 0xe3, 0xc1, - 0x04, 0x59, 0x96, 0x0f, 0x4e, 0xcf, 0x3d, 0xaa, 0x2b, 0x43, 0xa0, 0x89, 0x07, 0xbe, 0x48, 0x2e, - 0xb0, 0xf5, 0xf8, 0xda, 0xf1, 0xaa, 0xd9, 0xdd, 0xbe, 0xc7, 0x56, 0x63, 0x00, 0xb2, 0xb2, 0x60, - 0xcc, 0x49, 0xac, 0x30, 0x04, 0xe1, 0x21, 0x20, 0x19, 0x4b, 0xa8, 0x41, 0x61, 0x60, 0xee, 0xa1, - 0x06, 0x85, 0xc1, 0x69, 0x86, 0x71, 0xbb, 0x5f, 0x5b, 0x23, 0xab, 0x08, 0x18, 0xe4, 0xc9, 0xc1, - 0xe5, 0x96, 0xef, 0x75, 0x64, 0xb6, 0x4e, 0x19, 0xf3, 0x12, 0x5b, 0x88, 0x73, 0x4d, 0x5b, 0xdb, - 0xfa, 0x63, 0x09, 0xca, 0x35, 0xcc, 0xdc, 0xa3, 0x44, 0xfb, 0xe7, 0x1a, 0x4c, 0x62, 0xf7, 0x8f, - 0x28, 0x8d, 0x5f, 0xb9, 0x13, 0x59, 0x3d, 0x93, 0x01, 0x11, 0xac, 0xb9, 0xfd, 0xda, 0x5b, 0xe4, - 0x7e, 0xe4, 0x51, 0x03, 0xfd, 0xa0, 0x4d, 0xc3, 0x36, 0xf5, 0x99, 0xe5, 0x23, 0x8b, 0x6f, 0x8b, - 0xc4, 0xe8, 0x1d, 0x1e, 0xbe, 0x92, 0xc0, 0xc5, 0x82, 0xff, 0xbe, 0x1d, 0xd8, 0xcc, 0xbe, 0x03, - 0xaf, 0xe7, 0x37, 0xe9, 0xdb, 0x49, 0x0b, 0xf3, 0x5a, 0xcf, 0x77, 0xde, 0x91, 0x43, 0x5b, 0xd3, - 0x74, 0x2d, 0x8f, 0x29, 0xf6, 0x37, 0x1a, 0x94, 0x95, 0x8e, 0xa0, 0x9a, 0x45, 0x67, 0x75, 0x17, - 0xd5, 0xba, 0x20, 0xb3, 0x9d, 0x68, 0x74, 0xfb, 0xb5, 0xfb, 0xe4, 0x1e, 0x7b, 0xea, 0x98, 0x20, - 0xf3, 0xfe, 0xdd, 0xba, 0x6e, 0xd9, 0xad, 0x16, 0x65, 0x6f, 0x95, 0x2f, 0xb7, 0xcd, 0x40, 0x5a, - 0x52, 0x65, 0xe1, 0xf5, 0x90, 0x04, 0xe6, 0x67, 0xc8, 0xd9, 0x30, 0x3b, 0x23, 0xb8, 0xc6, 0xd7, - 0xc9, 0xcf, 0x34, 0x98, 0x4f, 0x37, 0x07, 0xd5, 0x18, 0x3d, 0xa4, 0x35, 0xa9, 0xc6, 0xe8, 0x61, - 0xfd, 0x45, 0xe3, 0x25, 0x8c, 0xd1, 0xe2, 0xe9, 0x4a, 0x42, 0xe9, 0x61, 0xdb, 0x0c, 0xd1, 0x70, - 0x76, 0x29, 0xbf, 0x00, 0x6a, 0xc9, 0x16, 0x23, 0x33, 0xc9, 0x14, 0xfe, 0xe3, 0x38, 0xbd, 0xc1, - 0xd9, 0x58, 0x46, 0x7a, 0x23, 0xb5, 0x20, 0xb2, 0xd2, 0x1b, 0xb9, 0xad, 0x60, 0xdc, 0xed, 0xd7, - 0x9e, 0x21, 0x4f, 0x8b, 0x40, 0xc7, 0x48, 0x8d, 0xac, 0xe3, 0x40, 0x36, 0x07, 0xce, 0xa4, 0xb6, - 0xc6, 0x1c, 0x9e, 0xd4, 0x62, 0xcc, 0xca, 0xed, 0xe5, 0x46, 0x5a, 0x56, 0x6e, 0xaf, 0x34, 0x8f, - 0x98, 0xc3, 0x5b, 0x20, 0xe4, 0x86, 0x19, 0x36, 0xdb, 0xba, 0xc5, 0xdd, 0x0e, 0xd2, 0x92, 0xf3, - 0xfa, 0x98, 0xf8, 0xff, 0x45, 0x05, 0xcd, 0xa0, 0x66, 0x06, 0xfa, 0x98, 0x59, 0x05, 0x8d, 0xa2, - 0x19, 0x5e, 0x55, 0x70, 0xca, 0x1d, 0xe9, 0xd6, 0xd2, 0x65, 0x4d, 0x4c, 0xbd, 0x05, 0x53, 0xc2, - 0x96, 0x49, 0x35, 0xc3, 0xc0, 0x23, 0xba, 0x4b, 0x99, 0x30, 0x41, 0xd4, 0x40, 0xff, 0x1a, 0x9b, - 0x7d, 0x4c, 0x0b, 0xc8, 0x74, 0x44, 0x8b, 0xf4, 0x92, 0x42, 0x9c, 0x2b, 0x39, 0xb3, 0x6c, 0x55, - 0xd4, 0x7c, 0xfe, 0x10, 0x0c, 0x41, 0xf9, 0x5c, 0xbf, 0x56, 0x22, 0xc5, 0x88, 0xb2, 0x52, 0x34, - 0xe3, 0x02, 0xb3, 0xbb, 0x19, 0xb9, 0x61, 0xa6, 0x86, 0x93, 0x8c, 0x9e, 0x9c, 0x1a, 0x4e, 0xb2, - 0x7a, 0x6d, 0xcc, 0x8f, 0x5e, 0x25, 0x57, 0x18, 0x28, 0xa9, 0x83, 0x79, 0x8e, 0x6d, 0x8a, 0x42, - 0x8e, 0x3a, 0x9e, 0xbb, 0x87, 0xcf, 0x19, 0x31, 0xe4, 0xa4, 0x9f, 0x21, 0x5c, 0x63, 0x8b, 0x4c, - 0xf9, 0xdf, 0xd6, 0x60, 0x56, 0xed, 0x9c, 0xa9, 0xd9, 0x47, 0x66, 0x83, 0x4e, 0xcd, 0xb4, 0xb2, - 0x1b, 0x6f, 0xc6, 0x13, 0x58, 0xd2, 0x71, 0x60, 0x92, 0xa0, 0x26, 0xcc, 0xac, 0x0d, 0x30, 0xb3, - 0xf5, 0xf7, 0xa8, 0xad, 0x15, 0xf9, 0xf4, 0xaf, 0x6b, 0x30, 0x23, 0xf7, 0xd6, 0x48, 0x46, 0x02, - 0xaa, 0x74, 0xe9, 0x54, 0xdd, 0x65, 0xb5, 0xe5, 0x8c, 0x0d, 0x34, 0x15, 0xf1, 0x72, 0x79, 0x8f, - 0x0b, 0x19, 0x5a, 0x34, 0x30, 0x0f, 0xf1, 0xcc, 0x5e, 0xd8, 0xde, 0xda, 0xe4, 0x00, 0xa6, 0xa1, - 0x77, 0x61, 0x92, 0xf7, 0x7d, 0x94, 0xb0, 0x22, 0x77, 0xdf, 0xd4, 0xb0, 0xa2, 0xb4, 0xac, 0x0c, - 0xbd, 0x5f, 0xcb, 0xed, 0xfe, 0x87, 0xec, 0x97, 0x04, 0x01, 0xec, 0x1f, 0x5d, 0xd3, 0xd6, 0x6e, - 0xe4, 0xff, 0x2b, 0xd7, 0xdd, 0xdd, 0x2d, 0xe0, 0xd8, 0xf8, 0xc9, 0x7f, 0x06, 0x00, 0x00, 0xff, - 0xff, 0xa9, 0x61, 0x9c, 0x7e, 0xbe, 0x35, 0x00, 0x00, -} - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConn - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion4 - -// AccountManagerClient is the client API for AccountManager service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type AccountManagerClient interface { - // Get users, filter with fields(user_id, email, phone_number, status), default return all users - DescribeUsers(ctx context.Context, in *DescribeUsersRequest, opts ...grpc.CallOption) (*DescribeUsersResponse, error) - // Get users, include user info of role and group, filter with fields(user_id, email, phone_number, status), default return all users - DescribeUsersDetail(ctx context.Context, in *DescribeUsersRequest, opts ...grpc.CallOption) (*DescribeUsersDetailResponse, error) - // Modify user info - ModifyUser(ctx context.Context, in *ModifyUserRequest, opts ...grpc.CallOption) (*ModifyUserResponse, error) - // Delete users by user_ids - DeleteUsers(ctx context.Context, in *DeleteUsersRequest, opts ...grpc.CallOption) (*DeleteUsersResponse, error) - // Change user password - ChangePassword(ctx context.Context, in *ChangePasswordRequest, opts ...grpc.CallOption) (*ChangePasswordResponse, error) - // Create a request to reset user password - CreatePasswordReset(ctx context.Context, in *CreatePasswordResetRequest, opts ...grpc.CallOption) (*CreatePasswordResetResponse, error) - // Isv of platform create user - IsvCreateUser(ctx context.Context, in *CreateUserRequest, opts ...grpc.CallOption) (*CreateUserResponse, error) - // Create user, if user have admin permission - CreateUser(ctx context.Context, in *CreateUserRequest, opts ...grpc.CallOption) (*CreateUserResponse, error) - // Get a request of reset user's password - GetPasswordReset(ctx context.Context, in *GetPasswordResetRequest, opts ...grpc.CallOption) (*GetPasswordResetResponse, error) - // Validate user and password - ValidateUserPassword(ctx context.Context, in *ValidateUserPasswordRequest, opts ...grpc.CallOption) (*ValidateUserPasswordResponse, error) - // Create group, a group contain one more user - CreateGroup(ctx context.Context, in *CreateGroupRequest, opts ...grpc.CallOption) (*CreateGroupResponse, error) - // Get groups, can filter with these fields(group_id, parent_group_id, group_path, status), default return all groups - DescribeGroups(ctx context.Context, in *DescribeGroupsRequest, opts ...grpc.CallOption) (*DescribeGroupsResponse, error) - // Get groups, include all user in this group, can filter with these fields(group_id, parent_group_id, group_path, status), default return all groups - DescribeGroupsDetail(ctx context.Context, in *DescribeGroupsRequest, opts ...grpc.CallOption) (*DescribeGroupsDetailResponse, error) - //Modify group info - ModifyGroup(ctx context.Context, in *ModifyGroupRequest, opts ...grpc.CallOption) (*ModifyGroupResponse, error) - // Delete groups - DeleteGroups(ctx context.Context, in *DeleteGroupsRequest, opts ...grpc.CallOption) (*DeleteGroupsResponse, error) - // Join groups, user can join in groups - JoinGroup(ctx context.Context, in *JoinGroupRequest, opts ...grpc.CallOption) (*JoinGroupResponse, error) - // Leave groups, user can leave from groups - LeaveGroup(ctx context.Context, in *LeaveGroupRequest, opts ...grpc.CallOption) (*LeaveGroupResponse, error) -} - -type accountManagerClient struct { - cc *grpc.ClientConn -} - -func NewAccountManagerClient(cc *grpc.ClientConn) AccountManagerClient { - return &accountManagerClient{cc} -} - -func (c *accountManagerClient) DescribeUsers(ctx context.Context, in *DescribeUsersRequest, opts ...grpc.CallOption) (*DescribeUsersResponse, error) { - out := new(DescribeUsersResponse) - err := c.cc.Invoke(ctx, "/openpitrix.AccountManager/DescribeUsers", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *accountManagerClient) DescribeUsersDetail(ctx context.Context, in *DescribeUsersRequest, opts ...grpc.CallOption) (*DescribeUsersDetailResponse, error) { - out := new(DescribeUsersDetailResponse) - err := c.cc.Invoke(ctx, "/openpitrix.AccountManager/DescribeUsersDetail", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *accountManagerClient) ModifyUser(ctx context.Context, in *ModifyUserRequest, opts ...grpc.CallOption) (*ModifyUserResponse, error) { - out := new(ModifyUserResponse) - err := c.cc.Invoke(ctx, "/openpitrix.AccountManager/ModifyUser", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *accountManagerClient) DeleteUsers(ctx context.Context, in *DeleteUsersRequest, opts ...grpc.CallOption) (*DeleteUsersResponse, error) { - out := new(DeleteUsersResponse) - err := c.cc.Invoke(ctx, "/openpitrix.AccountManager/DeleteUsers", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *accountManagerClient) ChangePassword(ctx context.Context, in *ChangePasswordRequest, opts ...grpc.CallOption) (*ChangePasswordResponse, error) { - out := new(ChangePasswordResponse) - err := c.cc.Invoke(ctx, "/openpitrix.AccountManager/ChangePassword", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *accountManagerClient) CreatePasswordReset(ctx context.Context, in *CreatePasswordResetRequest, opts ...grpc.CallOption) (*CreatePasswordResetResponse, error) { - out := new(CreatePasswordResetResponse) - err := c.cc.Invoke(ctx, "/openpitrix.AccountManager/CreatePasswordReset", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *accountManagerClient) IsvCreateUser(ctx context.Context, in *CreateUserRequest, opts ...grpc.CallOption) (*CreateUserResponse, error) { - out := new(CreateUserResponse) - err := c.cc.Invoke(ctx, "/openpitrix.AccountManager/IsvCreateUser", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *accountManagerClient) CreateUser(ctx context.Context, in *CreateUserRequest, opts ...grpc.CallOption) (*CreateUserResponse, error) { - out := new(CreateUserResponse) - err := c.cc.Invoke(ctx, "/openpitrix.AccountManager/CreateUser", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *accountManagerClient) GetPasswordReset(ctx context.Context, in *GetPasswordResetRequest, opts ...grpc.CallOption) (*GetPasswordResetResponse, error) { - out := new(GetPasswordResetResponse) - err := c.cc.Invoke(ctx, "/openpitrix.AccountManager/GetPasswordReset", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *accountManagerClient) ValidateUserPassword(ctx context.Context, in *ValidateUserPasswordRequest, opts ...grpc.CallOption) (*ValidateUserPasswordResponse, error) { - out := new(ValidateUserPasswordResponse) - err := c.cc.Invoke(ctx, "/openpitrix.AccountManager/ValidateUserPassword", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *accountManagerClient) CreateGroup(ctx context.Context, in *CreateGroupRequest, opts ...grpc.CallOption) (*CreateGroupResponse, error) { - out := new(CreateGroupResponse) - err := c.cc.Invoke(ctx, "/openpitrix.AccountManager/CreateGroup", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *accountManagerClient) DescribeGroups(ctx context.Context, in *DescribeGroupsRequest, opts ...grpc.CallOption) (*DescribeGroupsResponse, error) { - out := new(DescribeGroupsResponse) - err := c.cc.Invoke(ctx, "/openpitrix.AccountManager/DescribeGroups", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *accountManagerClient) DescribeGroupsDetail(ctx context.Context, in *DescribeGroupsRequest, opts ...grpc.CallOption) (*DescribeGroupsDetailResponse, error) { - out := new(DescribeGroupsDetailResponse) - err := c.cc.Invoke(ctx, "/openpitrix.AccountManager/DescribeGroupsDetail", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *accountManagerClient) ModifyGroup(ctx context.Context, in *ModifyGroupRequest, opts ...grpc.CallOption) (*ModifyGroupResponse, error) { - out := new(ModifyGroupResponse) - err := c.cc.Invoke(ctx, "/openpitrix.AccountManager/ModifyGroup", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *accountManagerClient) DeleteGroups(ctx context.Context, in *DeleteGroupsRequest, opts ...grpc.CallOption) (*DeleteGroupsResponse, error) { - out := new(DeleteGroupsResponse) - err := c.cc.Invoke(ctx, "/openpitrix.AccountManager/DeleteGroups", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *accountManagerClient) JoinGroup(ctx context.Context, in *JoinGroupRequest, opts ...grpc.CallOption) (*JoinGroupResponse, error) { - out := new(JoinGroupResponse) - err := c.cc.Invoke(ctx, "/openpitrix.AccountManager/JoinGroup", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *accountManagerClient) LeaveGroup(ctx context.Context, in *LeaveGroupRequest, opts ...grpc.CallOption) (*LeaveGroupResponse, error) { - out := new(LeaveGroupResponse) - err := c.cc.Invoke(ctx, "/openpitrix.AccountManager/LeaveGroup", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// AccountManagerServer is the server API for AccountManager service. -type AccountManagerServer interface { - // Get users, filter with fields(user_id, email, phone_number, status), default return all users - DescribeUsers(context.Context, *DescribeUsersRequest) (*DescribeUsersResponse, error) - // Get users, include user info of role and group, filter with fields(user_id, email, phone_number, status), default return all users - DescribeUsersDetail(context.Context, *DescribeUsersRequest) (*DescribeUsersDetailResponse, error) - // Modify user info - ModifyUser(context.Context, *ModifyUserRequest) (*ModifyUserResponse, error) - // Delete users by user_ids - DeleteUsers(context.Context, *DeleteUsersRequest) (*DeleteUsersResponse, error) - // Change user password - ChangePassword(context.Context, *ChangePasswordRequest) (*ChangePasswordResponse, error) - // Create a request to reset user password - CreatePasswordReset(context.Context, *CreatePasswordResetRequest) (*CreatePasswordResetResponse, error) - // Isv of platform create user - IsvCreateUser(context.Context, *CreateUserRequest) (*CreateUserResponse, error) - // Create user, if user have admin permission - CreateUser(context.Context, *CreateUserRequest) (*CreateUserResponse, error) - // Get a request of reset user's password - GetPasswordReset(context.Context, *GetPasswordResetRequest) (*GetPasswordResetResponse, error) - // Validate user and password - ValidateUserPassword(context.Context, *ValidateUserPasswordRequest) (*ValidateUserPasswordResponse, error) - // Create group, a group contain one more user - CreateGroup(context.Context, *CreateGroupRequest) (*CreateGroupResponse, error) - // Get groups, can filter with these fields(group_id, parent_group_id, group_path, status), default return all groups - DescribeGroups(context.Context, *DescribeGroupsRequest) (*DescribeGroupsResponse, error) - // Get groups, include all user in this group, can filter with these fields(group_id, parent_group_id, group_path, status), default return all groups - DescribeGroupsDetail(context.Context, *DescribeGroupsRequest) (*DescribeGroupsDetailResponse, error) - //Modify group info - ModifyGroup(context.Context, *ModifyGroupRequest) (*ModifyGroupResponse, error) - // Delete groups - DeleteGroups(context.Context, *DeleteGroupsRequest) (*DeleteGroupsResponse, error) - // Join groups, user can join in groups - JoinGroup(context.Context, *JoinGroupRequest) (*JoinGroupResponse, error) - // Leave groups, user can leave from groups - LeaveGroup(context.Context, *LeaveGroupRequest) (*LeaveGroupResponse, error) -} - -// UnimplementedAccountManagerServer can be embedded to have forward compatible implementations. -type UnimplementedAccountManagerServer struct { -} - -func (*UnimplementedAccountManagerServer) DescribeUsers(ctx context.Context, req *DescribeUsersRequest) (*DescribeUsersResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method DescribeUsers not implemented") -} -func (*UnimplementedAccountManagerServer) DescribeUsersDetail(ctx context.Context, req *DescribeUsersRequest) (*DescribeUsersDetailResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method DescribeUsersDetail not implemented") -} -func (*UnimplementedAccountManagerServer) ModifyUser(ctx context.Context, req *ModifyUserRequest) (*ModifyUserResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ModifyUser not implemented") -} -func (*UnimplementedAccountManagerServer) DeleteUsers(ctx context.Context, req *DeleteUsersRequest) (*DeleteUsersResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method DeleteUsers not implemented") -} -func (*UnimplementedAccountManagerServer) ChangePassword(ctx context.Context, req *ChangePasswordRequest) (*ChangePasswordResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ChangePassword not implemented") -} -func (*UnimplementedAccountManagerServer) CreatePasswordReset(ctx context.Context, req *CreatePasswordResetRequest) (*CreatePasswordResetResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method CreatePasswordReset not implemented") -} -func (*UnimplementedAccountManagerServer) IsvCreateUser(ctx context.Context, req *CreateUserRequest) (*CreateUserResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method IsvCreateUser not implemented") -} -func (*UnimplementedAccountManagerServer) CreateUser(ctx context.Context, req *CreateUserRequest) (*CreateUserResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method CreateUser not implemented") -} -func (*UnimplementedAccountManagerServer) GetPasswordReset(ctx context.Context, req *GetPasswordResetRequest) (*GetPasswordResetResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetPasswordReset not implemented") -} -func (*UnimplementedAccountManagerServer) ValidateUserPassword(ctx context.Context, req *ValidateUserPasswordRequest) (*ValidateUserPasswordResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ValidateUserPassword not implemented") -} -func (*UnimplementedAccountManagerServer) CreateGroup(ctx context.Context, req *CreateGroupRequest) (*CreateGroupResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method CreateGroup not implemented") -} -func (*UnimplementedAccountManagerServer) DescribeGroups(ctx context.Context, req *DescribeGroupsRequest) (*DescribeGroupsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method DescribeGroups not implemented") -} -func (*UnimplementedAccountManagerServer) DescribeGroupsDetail(ctx context.Context, req *DescribeGroupsRequest) (*DescribeGroupsDetailResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method DescribeGroupsDetail not implemented") -} -func (*UnimplementedAccountManagerServer) ModifyGroup(ctx context.Context, req *ModifyGroupRequest) (*ModifyGroupResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ModifyGroup not implemented") -} -func (*UnimplementedAccountManagerServer) DeleteGroups(ctx context.Context, req *DeleteGroupsRequest) (*DeleteGroupsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method DeleteGroups not implemented") -} -func (*UnimplementedAccountManagerServer) JoinGroup(ctx context.Context, req *JoinGroupRequest) (*JoinGroupResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method JoinGroup not implemented") -} -func (*UnimplementedAccountManagerServer) LeaveGroup(ctx context.Context, req *LeaveGroupRequest) (*LeaveGroupResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method LeaveGroup not implemented") -} - -func RegisterAccountManagerServer(s *grpc.Server, srv AccountManagerServer) { - s.RegisterService(&_AccountManager_serviceDesc, srv) -} - -func _AccountManager_DescribeUsers_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DescribeUsersRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AccountManagerServer).DescribeUsers(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/openpitrix.AccountManager/DescribeUsers", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AccountManagerServer).DescribeUsers(ctx, req.(*DescribeUsersRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _AccountManager_DescribeUsersDetail_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DescribeUsersRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AccountManagerServer).DescribeUsersDetail(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/openpitrix.AccountManager/DescribeUsersDetail", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AccountManagerServer).DescribeUsersDetail(ctx, req.(*DescribeUsersRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _AccountManager_ModifyUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ModifyUserRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AccountManagerServer).ModifyUser(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/openpitrix.AccountManager/ModifyUser", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AccountManagerServer).ModifyUser(ctx, req.(*ModifyUserRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _AccountManager_DeleteUsers_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DeleteUsersRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AccountManagerServer).DeleteUsers(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/openpitrix.AccountManager/DeleteUsers", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AccountManagerServer).DeleteUsers(ctx, req.(*DeleteUsersRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _AccountManager_ChangePassword_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ChangePasswordRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AccountManagerServer).ChangePassword(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/openpitrix.AccountManager/ChangePassword", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AccountManagerServer).ChangePassword(ctx, req.(*ChangePasswordRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _AccountManager_CreatePasswordReset_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CreatePasswordResetRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AccountManagerServer).CreatePasswordReset(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/openpitrix.AccountManager/CreatePasswordReset", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AccountManagerServer).CreatePasswordReset(ctx, req.(*CreatePasswordResetRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _AccountManager_IsvCreateUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CreateUserRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AccountManagerServer).IsvCreateUser(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/openpitrix.AccountManager/IsvCreateUser", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AccountManagerServer).IsvCreateUser(ctx, req.(*CreateUserRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _AccountManager_CreateUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CreateUserRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AccountManagerServer).CreateUser(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/openpitrix.AccountManager/CreateUser", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AccountManagerServer).CreateUser(ctx, req.(*CreateUserRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _AccountManager_GetPasswordReset_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetPasswordResetRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AccountManagerServer).GetPasswordReset(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/openpitrix.AccountManager/GetPasswordReset", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AccountManagerServer).GetPasswordReset(ctx, req.(*GetPasswordResetRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _AccountManager_ValidateUserPassword_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ValidateUserPasswordRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AccountManagerServer).ValidateUserPassword(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/openpitrix.AccountManager/ValidateUserPassword", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AccountManagerServer).ValidateUserPassword(ctx, req.(*ValidateUserPasswordRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _AccountManager_CreateGroup_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CreateGroupRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AccountManagerServer).CreateGroup(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/openpitrix.AccountManager/CreateGroup", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AccountManagerServer).CreateGroup(ctx, req.(*CreateGroupRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _AccountManager_DescribeGroups_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DescribeGroupsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AccountManagerServer).DescribeGroups(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/openpitrix.AccountManager/DescribeGroups", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AccountManagerServer).DescribeGroups(ctx, req.(*DescribeGroupsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _AccountManager_DescribeGroupsDetail_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DescribeGroupsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AccountManagerServer).DescribeGroupsDetail(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/openpitrix.AccountManager/DescribeGroupsDetail", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AccountManagerServer).DescribeGroupsDetail(ctx, req.(*DescribeGroupsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _AccountManager_ModifyGroup_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ModifyGroupRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AccountManagerServer).ModifyGroup(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/openpitrix.AccountManager/ModifyGroup", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AccountManagerServer).ModifyGroup(ctx, req.(*ModifyGroupRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _AccountManager_DeleteGroups_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DeleteGroupsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AccountManagerServer).DeleteGroups(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/openpitrix.AccountManager/DeleteGroups", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AccountManagerServer).DeleteGroups(ctx, req.(*DeleteGroupsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _AccountManager_JoinGroup_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(JoinGroupRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AccountManagerServer).JoinGroup(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/openpitrix.AccountManager/JoinGroup", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AccountManagerServer).JoinGroup(ctx, req.(*JoinGroupRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _AccountManager_LeaveGroup_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(LeaveGroupRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AccountManagerServer).LeaveGroup(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/openpitrix.AccountManager/LeaveGroup", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AccountManagerServer).LeaveGroup(ctx, req.(*LeaveGroupRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _AccountManager_serviceDesc = grpc.ServiceDesc{ - ServiceName: "openpitrix.AccountManager", - HandlerType: (*AccountManagerServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "DescribeUsers", - Handler: _AccountManager_DescribeUsers_Handler, - }, - { - MethodName: "DescribeUsersDetail", - Handler: _AccountManager_DescribeUsersDetail_Handler, - }, - { - MethodName: "ModifyUser", - Handler: _AccountManager_ModifyUser_Handler, - }, - { - MethodName: "DeleteUsers", - Handler: _AccountManager_DeleteUsers_Handler, - }, - { - MethodName: "ChangePassword", - Handler: _AccountManager_ChangePassword_Handler, - }, - { - MethodName: "CreatePasswordReset", - Handler: _AccountManager_CreatePasswordReset_Handler, - }, - { - MethodName: "IsvCreateUser", - Handler: _AccountManager_IsvCreateUser_Handler, - }, - { - MethodName: "CreateUser", - Handler: _AccountManager_CreateUser_Handler, - }, - { - MethodName: "GetPasswordReset", - Handler: _AccountManager_GetPasswordReset_Handler, - }, - { - MethodName: "ValidateUserPassword", - Handler: _AccountManager_ValidateUserPassword_Handler, - }, - { - MethodName: "CreateGroup", - Handler: _AccountManager_CreateGroup_Handler, - }, - { - MethodName: "DescribeGroups", - Handler: _AccountManager_DescribeGroups_Handler, - }, - { - MethodName: "DescribeGroupsDetail", - Handler: _AccountManager_DescribeGroupsDetail_Handler, - }, - { - MethodName: "ModifyGroup", - Handler: _AccountManager_ModifyGroup_Handler, - }, - { - MethodName: "DeleteGroups", - Handler: _AccountManager_DeleteGroups_Handler, - }, - { - MethodName: "JoinGroup", - Handler: _AccountManager_JoinGroup_Handler, - }, - { - MethodName: "LeaveGroup", - Handler: _AccountManager_LeaveGroup_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "account.proto", -} - -// AccessManagerClient is the client API for AccessManager service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type AccessManagerClient interface { - // Validate whether the user[user_id] have permission to visit resource[url_method:url] - CanDo(ctx context.Context, in *CanDoRequest, opts ...grpc.CallOption) (*CanDoResponse, error) - // Get role module, different role has different permission to access different module - GetRoleModule(ctx context.Context, in *GetRoleModuleRequest, opts ...grpc.CallOption) (*GetRoleModuleResponse, error) - // Modify role module that can be visited - ModifyRoleModule(ctx context.Context, in *ModifyRoleModuleRequest, opts ...grpc.CallOption) (*ModifyRoleModuleResponse, error) - // Create role, different role has different permissions - CreateRole(ctx context.Context, in *CreateRoleRequest, opts ...grpc.CallOption) (*CreateRoleResponse, error) - // Batch delete roles - DeleteRoles(ctx context.Context, in *DeleteRolesRequest, opts ...grpc.CallOption) (*DeleteRolesResponse, error) - // Modify role info - ModifyRole(ctx context.Context, in *ModifyRoleRequest, opts ...grpc.CallOption) (*ModifyRoleResponse, error) - // Get role info - GetRole(ctx context.Context, in *GetRoleRequest, opts ...grpc.CallOption) (*GetRoleResponse, error) - // Get roles, filter with these fields(role_id, portal, status) - DescribeRoles(ctx context.Context, in *DescribeRolesRequest, opts ...grpc.CallOption) (*DescribeRolesResponse, error) - // Bind role and user, a user belong to a role - BindUserRole(ctx context.Context, in *BindUserRoleRequest, opts ...grpc.CallOption) (*BindUserRoleResponse, error) - // Unbind user and role - UnbindUserRole(ctx context.Context, in *UnbindUserRoleRequest, opts ...grpc.CallOption) (*UnbindUserRoleResponse, error) -} - -type accessManagerClient struct { - cc *grpc.ClientConn -} - -func NewAccessManagerClient(cc *grpc.ClientConn) AccessManagerClient { - return &accessManagerClient{cc} -} - -func (c *accessManagerClient) CanDo(ctx context.Context, in *CanDoRequest, opts ...grpc.CallOption) (*CanDoResponse, error) { - out := new(CanDoResponse) - err := c.cc.Invoke(ctx, "/openpitrix.AccessManager/CanDo", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *accessManagerClient) GetRoleModule(ctx context.Context, in *GetRoleModuleRequest, opts ...grpc.CallOption) (*GetRoleModuleResponse, error) { - out := new(GetRoleModuleResponse) - err := c.cc.Invoke(ctx, "/openpitrix.AccessManager/GetRoleModule", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *accessManagerClient) ModifyRoleModule(ctx context.Context, in *ModifyRoleModuleRequest, opts ...grpc.CallOption) (*ModifyRoleModuleResponse, error) { - out := new(ModifyRoleModuleResponse) - err := c.cc.Invoke(ctx, "/openpitrix.AccessManager/ModifyRoleModule", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *accessManagerClient) CreateRole(ctx context.Context, in *CreateRoleRequest, opts ...grpc.CallOption) (*CreateRoleResponse, error) { - out := new(CreateRoleResponse) - err := c.cc.Invoke(ctx, "/openpitrix.AccessManager/CreateRole", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *accessManagerClient) DeleteRoles(ctx context.Context, in *DeleteRolesRequest, opts ...grpc.CallOption) (*DeleteRolesResponse, error) { - out := new(DeleteRolesResponse) - err := c.cc.Invoke(ctx, "/openpitrix.AccessManager/DeleteRoles", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *accessManagerClient) ModifyRole(ctx context.Context, in *ModifyRoleRequest, opts ...grpc.CallOption) (*ModifyRoleResponse, error) { - out := new(ModifyRoleResponse) - err := c.cc.Invoke(ctx, "/openpitrix.AccessManager/ModifyRole", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *accessManagerClient) GetRole(ctx context.Context, in *GetRoleRequest, opts ...grpc.CallOption) (*GetRoleResponse, error) { - out := new(GetRoleResponse) - err := c.cc.Invoke(ctx, "/openpitrix.AccessManager/GetRole", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *accessManagerClient) DescribeRoles(ctx context.Context, in *DescribeRolesRequest, opts ...grpc.CallOption) (*DescribeRolesResponse, error) { - out := new(DescribeRolesResponse) - err := c.cc.Invoke(ctx, "/openpitrix.AccessManager/DescribeRoles", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *accessManagerClient) BindUserRole(ctx context.Context, in *BindUserRoleRequest, opts ...grpc.CallOption) (*BindUserRoleResponse, error) { - out := new(BindUserRoleResponse) - err := c.cc.Invoke(ctx, "/openpitrix.AccessManager/BindUserRole", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *accessManagerClient) UnbindUserRole(ctx context.Context, in *UnbindUserRoleRequest, opts ...grpc.CallOption) (*UnbindUserRoleResponse, error) { - out := new(UnbindUserRoleResponse) - err := c.cc.Invoke(ctx, "/openpitrix.AccessManager/UnbindUserRole", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// AccessManagerServer is the server API for AccessManager service. -type AccessManagerServer interface { - // Validate whether the user[user_id] have permission to visit resource[url_method:url] - CanDo(context.Context, *CanDoRequest) (*CanDoResponse, error) - // Get role module, different role has different permission to access different module - GetRoleModule(context.Context, *GetRoleModuleRequest) (*GetRoleModuleResponse, error) - // Modify role module that can be visited - ModifyRoleModule(context.Context, *ModifyRoleModuleRequest) (*ModifyRoleModuleResponse, error) - // Create role, different role has different permissions - CreateRole(context.Context, *CreateRoleRequest) (*CreateRoleResponse, error) - // Batch delete roles - DeleteRoles(context.Context, *DeleteRolesRequest) (*DeleteRolesResponse, error) - // Modify role info - ModifyRole(context.Context, *ModifyRoleRequest) (*ModifyRoleResponse, error) - // Get role info - GetRole(context.Context, *GetRoleRequest) (*GetRoleResponse, error) - // Get roles, filter with these fields(role_id, portal, status) - DescribeRoles(context.Context, *DescribeRolesRequest) (*DescribeRolesResponse, error) - // Bind role and user, a user belong to a role - BindUserRole(context.Context, *BindUserRoleRequest) (*BindUserRoleResponse, error) - // Unbind user and role - UnbindUserRole(context.Context, *UnbindUserRoleRequest) (*UnbindUserRoleResponse, error) -} - -// UnimplementedAccessManagerServer can be embedded to have forward compatible implementations. -type UnimplementedAccessManagerServer struct { -} - -func (*UnimplementedAccessManagerServer) CanDo(ctx context.Context, req *CanDoRequest) (*CanDoResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method CanDo not implemented") -} -func (*UnimplementedAccessManagerServer) GetRoleModule(ctx context.Context, req *GetRoleModuleRequest) (*GetRoleModuleResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetRoleModule not implemented") -} -func (*UnimplementedAccessManagerServer) ModifyRoleModule(ctx context.Context, req *ModifyRoleModuleRequest) (*ModifyRoleModuleResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ModifyRoleModule not implemented") -} -func (*UnimplementedAccessManagerServer) CreateRole(ctx context.Context, req *CreateRoleRequest) (*CreateRoleResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method CreateRole not implemented") -} -func (*UnimplementedAccessManagerServer) DeleteRoles(ctx context.Context, req *DeleteRolesRequest) (*DeleteRolesResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method DeleteRoles not implemented") -} -func (*UnimplementedAccessManagerServer) ModifyRole(ctx context.Context, req *ModifyRoleRequest) (*ModifyRoleResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ModifyRole not implemented") -} -func (*UnimplementedAccessManagerServer) GetRole(ctx context.Context, req *GetRoleRequest) (*GetRoleResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetRole not implemented") -} -func (*UnimplementedAccessManagerServer) DescribeRoles(ctx context.Context, req *DescribeRolesRequest) (*DescribeRolesResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method DescribeRoles not implemented") -} -func (*UnimplementedAccessManagerServer) BindUserRole(ctx context.Context, req *BindUserRoleRequest) (*BindUserRoleResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method BindUserRole not implemented") -} -func (*UnimplementedAccessManagerServer) UnbindUserRole(ctx context.Context, req *UnbindUserRoleRequest) (*UnbindUserRoleResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method UnbindUserRole not implemented") -} - -func RegisterAccessManagerServer(s *grpc.Server, srv AccessManagerServer) { - s.RegisterService(&_AccessManager_serviceDesc, srv) -} - -func _AccessManager_CanDo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CanDoRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AccessManagerServer).CanDo(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/openpitrix.AccessManager/CanDo", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AccessManagerServer).CanDo(ctx, req.(*CanDoRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _AccessManager_GetRoleModule_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetRoleModuleRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AccessManagerServer).GetRoleModule(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/openpitrix.AccessManager/GetRoleModule", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AccessManagerServer).GetRoleModule(ctx, req.(*GetRoleModuleRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _AccessManager_ModifyRoleModule_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ModifyRoleModuleRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AccessManagerServer).ModifyRoleModule(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/openpitrix.AccessManager/ModifyRoleModule", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AccessManagerServer).ModifyRoleModule(ctx, req.(*ModifyRoleModuleRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _AccessManager_CreateRole_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CreateRoleRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AccessManagerServer).CreateRole(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/openpitrix.AccessManager/CreateRole", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AccessManagerServer).CreateRole(ctx, req.(*CreateRoleRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _AccessManager_DeleteRoles_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DeleteRolesRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AccessManagerServer).DeleteRoles(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/openpitrix.AccessManager/DeleteRoles", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AccessManagerServer).DeleteRoles(ctx, req.(*DeleteRolesRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _AccessManager_ModifyRole_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ModifyRoleRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AccessManagerServer).ModifyRole(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/openpitrix.AccessManager/ModifyRole", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AccessManagerServer).ModifyRole(ctx, req.(*ModifyRoleRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _AccessManager_GetRole_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetRoleRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AccessManagerServer).GetRole(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/openpitrix.AccessManager/GetRole", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AccessManagerServer).GetRole(ctx, req.(*GetRoleRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _AccessManager_DescribeRoles_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DescribeRolesRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AccessManagerServer).DescribeRoles(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/openpitrix.AccessManager/DescribeRoles", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AccessManagerServer).DescribeRoles(ctx, req.(*DescribeRolesRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _AccessManager_BindUserRole_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(BindUserRoleRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AccessManagerServer).BindUserRole(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/openpitrix.AccessManager/BindUserRole", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AccessManagerServer).BindUserRole(ctx, req.(*BindUserRoleRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _AccessManager_UnbindUserRole_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(UnbindUserRoleRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AccessManagerServer).UnbindUserRole(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/openpitrix.AccessManager/UnbindUserRole", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AccessManagerServer).UnbindUserRole(ctx, req.(*UnbindUserRoleRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _AccessManager_serviceDesc = grpc.ServiceDesc{ - ServiceName: "openpitrix.AccessManager", - HandlerType: (*AccessManagerServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "CanDo", - Handler: _AccessManager_CanDo_Handler, - }, - { - MethodName: "GetRoleModule", - Handler: _AccessManager_GetRoleModule_Handler, - }, - { - MethodName: "ModifyRoleModule", - Handler: _AccessManager_ModifyRoleModule_Handler, - }, - { - MethodName: "CreateRole", - Handler: _AccessManager_CreateRole_Handler, - }, - { - MethodName: "DeleteRoles", - Handler: _AccessManager_DeleteRoles_Handler, - }, - { - MethodName: "ModifyRole", - Handler: _AccessManager_ModifyRole_Handler, - }, - { - MethodName: "GetRole", - Handler: _AccessManager_GetRole_Handler, - }, - { - MethodName: "DescribeRoles", - Handler: _AccessManager_DescribeRoles_Handler, - }, - { - MethodName: "BindUserRole", - Handler: _AccessManager_BindUserRole_Handler, - }, - { - MethodName: "UnbindUserRole", - Handler: _AccessManager_UnbindUserRole_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "account.proto", -} - -// TokenManagerClient is the client API for TokenManager service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type TokenManagerClient interface { - // Create client - CreateClient(ctx context.Context, in *CreateClientRequest, opts ...grpc.CallOption) (*CreateClientResponse, error) - // get access_token with client_credentials or password - // - // Ref: - // - https://www.digitalocean.com/community/tutorials/an-introduction-to-oauth-2 - // - https://alexbilbie.com/guide-to-oauth-2-grants/ - // - https://tools.ietf.org/html/rfc6749#section-4.4 - // - // refresh access_token - // - // Ref: https://tools.ietf.org/html/rfc6749#section-6 - // - // Get token - Token(ctx context.Context, in *TokenRequest, opts ...grpc.CallOption) (*TokenResponse, error) -} - -type tokenManagerClient struct { - cc *grpc.ClientConn -} - -func NewTokenManagerClient(cc *grpc.ClientConn) TokenManagerClient { - return &tokenManagerClient{cc} -} - -func (c *tokenManagerClient) CreateClient(ctx context.Context, in *CreateClientRequest, opts ...grpc.CallOption) (*CreateClientResponse, error) { - out := new(CreateClientResponse) - err := c.cc.Invoke(ctx, "/openpitrix.TokenManager/CreateClient", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *tokenManagerClient) Token(ctx context.Context, in *TokenRequest, opts ...grpc.CallOption) (*TokenResponse, error) { - out := new(TokenResponse) - err := c.cc.Invoke(ctx, "/openpitrix.TokenManager/Token", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// TokenManagerServer is the server API for TokenManager service. -type TokenManagerServer interface { - // Create client - CreateClient(context.Context, *CreateClientRequest) (*CreateClientResponse, error) - // get access_token with client_credentials or password - // - // Ref: - // - https://www.digitalocean.com/community/tutorials/an-introduction-to-oauth-2 - // - https://alexbilbie.com/guide-to-oauth-2-grants/ - // - https://tools.ietf.org/html/rfc6749#section-4.4 - // - // refresh access_token - // - // Ref: https://tools.ietf.org/html/rfc6749#section-6 - // - // Get token - Token(context.Context, *TokenRequest) (*TokenResponse, error) -} - -// UnimplementedTokenManagerServer can be embedded to have forward compatible implementations. -type UnimplementedTokenManagerServer struct { -} - -func (*UnimplementedTokenManagerServer) CreateClient(ctx context.Context, req *CreateClientRequest) (*CreateClientResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method CreateClient not implemented") -} -func (*UnimplementedTokenManagerServer) Token(ctx context.Context, req *TokenRequest) (*TokenResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Token not implemented") -} - -func RegisterTokenManagerServer(s *grpc.Server, srv TokenManagerServer) { - s.RegisterService(&_TokenManager_serviceDesc, srv) -} - -func _TokenManager_CreateClient_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CreateClientRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(TokenManagerServer).CreateClient(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/openpitrix.TokenManager/CreateClient", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(TokenManagerServer).CreateClient(ctx, req.(*CreateClientRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _TokenManager_Token_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(TokenRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(TokenManagerServer).Token(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/openpitrix.TokenManager/Token", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(TokenManagerServer).Token(ctx, req.(*TokenRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _TokenManager_serviceDesc = grpc.ServiceDesc{ - ServiceName: "openpitrix.TokenManager", - HandlerType: (*TokenManagerServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "CreateClient", - Handler: _TokenManager_CreateClient_Handler, - }, - { - MethodName: "Token", - Handler: _TokenManager_Token_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "account.proto", -} diff --git a/vendor/openpitrix.io/openpitrix/pkg/pb/account.pb.gw.go b/vendor/openpitrix.io/openpitrix/pkg/pb/account.pb.gw.go deleted file mode 100644 index 214c08e759..0000000000 --- a/vendor/openpitrix.io/openpitrix/pkg/pb/account.pb.gw.go +++ /dev/null @@ -1,2445 +0,0 @@ -// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: account.proto - -/* -Package pb is a reverse proxy. - -It translates gRPC into RESTful JSON APIs. -*/ -package pb - -import ( - "context" - "io" - "net/http" - - "github.com/golang/protobuf/descriptor" - "github.com/golang/protobuf/proto" - "github.com/grpc-ecosystem/grpc-gateway/runtime" - "github.com/grpc-ecosystem/grpc-gateway/utilities" - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/grpclog" - "google.golang.org/grpc/status" -) - -// Suppress "imported and not used" errors -var _ codes.Code -var _ io.Reader -var _ status.Status -var _ = runtime.String -var _ = utilities.NewDoubleArray -var _ = descriptor.ForMessage - -var ( - filter_AccountManager_DescribeUsers_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_AccountManager_DescribeUsers_0(ctx context.Context, marshaler runtime.Marshaler, client AccountManagerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq DescribeUsersRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_AccountManager_DescribeUsers_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.DescribeUsers(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_AccountManager_DescribeUsers_0(ctx context.Context, marshaler runtime.Marshaler, server AccountManagerServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq DescribeUsersRequest - var metadata runtime.ServerMetadata - - if err := runtime.PopulateQueryParameters(&protoReq, req.URL.Query(), filter_AccountManager_DescribeUsers_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.DescribeUsers(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_AccountManager_DescribeUsersDetail_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_AccountManager_DescribeUsersDetail_0(ctx context.Context, marshaler runtime.Marshaler, client AccountManagerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq DescribeUsersRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_AccountManager_DescribeUsersDetail_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.DescribeUsersDetail(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_AccountManager_DescribeUsersDetail_0(ctx context.Context, marshaler runtime.Marshaler, server AccountManagerServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq DescribeUsersRequest - var metadata runtime.ServerMetadata - - if err := runtime.PopulateQueryParameters(&protoReq, req.URL.Query(), filter_AccountManager_DescribeUsersDetail_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.DescribeUsersDetail(ctx, &protoReq) - return msg, metadata, err - -} - -func request_AccountManager_ModifyUser_0(ctx context.Context, marshaler runtime.Marshaler, client AccountManagerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ModifyUserRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.ModifyUser(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_AccountManager_ModifyUser_0(ctx context.Context, marshaler runtime.Marshaler, server AccountManagerServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ModifyUserRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.ModifyUser(ctx, &protoReq) - return msg, metadata, err - -} - -func request_AccountManager_DeleteUsers_0(ctx context.Context, marshaler runtime.Marshaler, client AccountManagerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq DeleteUsersRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.DeleteUsers(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_AccountManager_DeleteUsers_0(ctx context.Context, marshaler runtime.Marshaler, server AccountManagerServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq DeleteUsersRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.DeleteUsers(ctx, &protoReq) - return msg, metadata, err - -} - -func request_AccountManager_ChangePassword_0(ctx context.Context, marshaler runtime.Marshaler, client AccountManagerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ChangePasswordRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.ChangePassword(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_AccountManager_ChangePassword_0(ctx context.Context, marshaler runtime.Marshaler, server AccountManagerServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ChangePasswordRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.ChangePassword(ctx, &protoReq) - return msg, metadata, err - -} - -func request_AccountManager_CreatePasswordReset_0(ctx context.Context, marshaler runtime.Marshaler, client AccountManagerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq CreatePasswordResetRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.CreatePasswordReset(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_AccountManager_CreatePasswordReset_0(ctx context.Context, marshaler runtime.Marshaler, server AccountManagerServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq CreatePasswordResetRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.CreatePasswordReset(ctx, &protoReq) - return msg, metadata, err - -} - -func request_AccountManager_IsvCreateUser_0(ctx context.Context, marshaler runtime.Marshaler, client AccountManagerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq CreateUserRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.IsvCreateUser(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_AccountManager_IsvCreateUser_0(ctx context.Context, marshaler runtime.Marshaler, server AccountManagerServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq CreateUserRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.IsvCreateUser(ctx, &protoReq) - return msg, metadata, err - -} - -func request_AccountManager_CreateUser_0(ctx context.Context, marshaler runtime.Marshaler, client AccountManagerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq CreateUserRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.CreateUser(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_AccountManager_CreateUser_0(ctx context.Context, marshaler runtime.Marshaler, server AccountManagerServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq CreateUserRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.CreateUser(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_AccountManager_GetPasswordReset_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_AccountManager_GetPasswordReset_0(ctx context.Context, marshaler runtime.Marshaler, client AccountManagerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq GetPasswordResetRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_AccountManager_GetPasswordReset_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.GetPasswordReset(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_AccountManager_GetPasswordReset_0(ctx context.Context, marshaler runtime.Marshaler, server AccountManagerServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq GetPasswordResetRequest - var metadata runtime.ServerMetadata - - if err := runtime.PopulateQueryParameters(&protoReq, req.URL.Query(), filter_AccountManager_GetPasswordReset_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.GetPasswordReset(ctx, &protoReq) - return msg, metadata, err - -} - -func request_AccountManager_ValidateUserPassword_0(ctx context.Context, marshaler runtime.Marshaler, client AccountManagerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ValidateUserPasswordRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.ValidateUserPassword(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_AccountManager_ValidateUserPassword_0(ctx context.Context, marshaler runtime.Marshaler, server AccountManagerServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ValidateUserPasswordRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.ValidateUserPassword(ctx, &protoReq) - return msg, metadata, err - -} - -func request_AccountManager_CreateGroup_0(ctx context.Context, marshaler runtime.Marshaler, client AccountManagerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq CreateGroupRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.CreateGroup(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_AccountManager_CreateGroup_0(ctx context.Context, marshaler runtime.Marshaler, server AccountManagerServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq CreateGroupRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.CreateGroup(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_AccountManager_DescribeGroups_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_AccountManager_DescribeGroups_0(ctx context.Context, marshaler runtime.Marshaler, client AccountManagerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq DescribeGroupsRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_AccountManager_DescribeGroups_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.DescribeGroups(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_AccountManager_DescribeGroups_0(ctx context.Context, marshaler runtime.Marshaler, server AccountManagerServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq DescribeGroupsRequest - var metadata runtime.ServerMetadata - - if err := runtime.PopulateQueryParameters(&protoReq, req.URL.Query(), filter_AccountManager_DescribeGroups_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.DescribeGroups(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_AccountManager_DescribeGroupsDetail_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_AccountManager_DescribeGroupsDetail_0(ctx context.Context, marshaler runtime.Marshaler, client AccountManagerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq DescribeGroupsRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_AccountManager_DescribeGroupsDetail_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.DescribeGroupsDetail(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_AccountManager_DescribeGroupsDetail_0(ctx context.Context, marshaler runtime.Marshaler, server AccountManagerServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq DescribeGroupsRequest - var metadata runtime.ServerMetadata - - if err := runtime.PopulateQueryParameters(&protoReq, req.URL.Query(), filter_AccountManager_DescribeGroupsDetail_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.DescribeGroupsDetail(ctx, &protoReq) - return msg, metadata, err - -} - -func request_AccountManager_ModifyGroup_0(ctx context.Context, marshaler runtime.Marshaler, client AccountManagerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ModifyGroupRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.ModifyGroup(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_AccountManager_ModifyGroup_0(ctx context.Context, marshaler runtime.Marshaler, server AccountManagerServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ModifyGroupRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.ModifyGroup(ctx, &protoReq) - return msg, metadata, err - -} - -func request_AccountManager_DeleteGroups_0(ctx context.Context, marshaler runtime.Marshaler, client AccountManagerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq DeleteGroupsRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.DeleteGroups(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_AccountManager_DeleteGroups_0(ctx context.Context, marshaler runtime.Marshaler, server AccountManagerServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq DeleteGroupsRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.DeleteGroups(ctx, &protoReq) - return msg, metadata, err - -} - -func request_AccountManager_JoinGroup_0(ctx context.Context, marshaler runtime.Marshaler, client AccountManagerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq JoinGroupRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.JoinGroup(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_AccountManager_JoinGroup_0(ctx context.Context, marshaler runtime.Marshaler, server AccountManagerServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq JoinGroupRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.JoinGroup(ctx, &protoReq) - return msg, metadata, err - -} - -func request_AccountManager_LeaveGroup_0(ctx context.Context, marshaler runtime.Marshaler, client AccountManagerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq LeaveGroupRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.LeaveGroup(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_AccountManager_LeaveGroup_0(ctx context.Context, marshaler runtime.Marshaler, server AccountManagerServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq LeaveGroupRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.LeaveGroup(ctx, &protoReq) - return msg, metadata, err - -} - -func request_AccessManager_CanDo_0(ctx context.Context, marshaler runtime.Marshaler, client AccessManagerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq CanDoRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.CanDo(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_AccessManager_CanDo_0(ctx context.Context, marshaler runtime.Marshaler, server AccessManagerServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq CanDoRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.CanDo(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_AccessManager_GetRoleModule_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_AccessManager_GetRoleModule_0(ctx context.Context, marshaler runtime.Marshaler, client AccessManagerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq GetRoleModuleRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_AccessManager_GetRoleModule_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.GetRoleModule(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_AccessManager_GetRoleModule_0(ctx context.Context, marshaler runtime.Marshaler, server AccessManagerServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq GetRoleModuleRequest - var metadata runtime.ServerMetadata - - if err := runtime.PopulateQueryParameters(&protoReq, req.URL.Query(), filter_AccessManager_GetRoleModule_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.GetRoleModule(ctx, &protoReq) - return msg, metadata, err - -} - -func request_AccessManager_ModifyRoleModule_0(ctx context.Context, marshaler runtime.Marshaler, client AccessManagerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ModifyRoleModuleRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.ModifyRoleModule(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_AccessManager_ModifyRoleModule_0(ctx context.Context, marshaler runtime.Marshaler, server AccessManagerServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ModifyRoleModuleRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.ModifyRoleModule(ctx, &protoReq) - return msg, metadata, err - -} - -func request_AccessManager_CreateRole_0(ctx context.Context, marshaler runtime.Marshaler, client AccessManagerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq CreateRoleRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.CreateRole(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_AccessManager_CreateRole_0(ctx context.Context, marshaler runtime.Marshaler, server AccessManagerServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq CreateRoleRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.CreateRole(ctx, &protoReq) - return msg, metadata, err - -} - -func request_AccessManager_DeleteRoles_0(ctx context.Context, marshaler runtime.Marshaler, client AccessManagerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq DeleteRolesRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.DeleteRoles(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_AccessManager_DeleteRoles_0(ctx context.Context, marshaler runtime.Marshaler, server AccessManagerServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq DeleteRolesRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.DeleteRoles(ctx, &protoReq) - return msg, metadata, err - -} - -func request_AccessManager_ModifyRole_0(ctx context.Context, marshaler runtime.Marshaler, client AccessManagerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ModifyRoleRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.ModifyRole(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_AccessManager_ModifyRole_0(ctx context.Context, marshaler runtime.Marshaler, server AccessManagerServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ModifyRoleRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.ModifyRole(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_AccessManager_GetRole_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_AccessManager_GetRole_0(ctx context.Context, marshaler runtime.Marshaler, client AccessManagerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq GetRoleRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_AccessManager_GetRole_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.GetRole(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_AccessManager_GetRole_0(ctx context.Context, marshaler runtime.Marshaler, server AccessManagerServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq GetRoleRequest - var metadata runtime.ServerMetadata - - if err := runtime.PopulateQueryParameters(&protoReq, req.URL.Query(), filter_AccessManager_GetRole_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.GetRole(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_AccessManager_DescribeRoles_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_AccessManager_DescribeRoles_0(ctx context.Context, marshaler runtime.Marshaler, client AccessManagerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq DescribeRolesRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_AccessManager_DescribeRoles_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.DescribeRoles(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_AccessManager_DescribeRoles_0(ctx context.Context, marshaler runtime.Marshaler, server AccessManagerServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq DescribeRolesRequest - var metadata runtime.ServerMetadata - - if err := runtime.PopulateQueryParameters(&protoReq, req.URL.Query(), filter_AccessManager_DescribeRoles_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.DescribeRoles(ctx, &protoReq) - return msg, metadata, err - -} - -func request_AccessManager_BindUserRole_0(ctx context.Context, marshaler runtime.Marshaler, client AccessManagerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq BindUserRoleRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.BindUserRole(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_AccessManager_BindUserRole_0(ctx context.Context, marshaler runtime.Marshaler, server AccessManagerServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq BindUserRoleRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.BindUserRole(ctx, &protoReq) - return msg, metadata, err - -} - -func request_AccessManager_UnbindUserRole_0(ctx context.Context, marshaler runtime.Marshaler, client AccessManagerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq UnbindUserRoleRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.UnbindUserRole(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_AccessManager_UnbindUserRole_0(ctx context.Context, marshaler runtime.Marshaler, server AccessManagerServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq UnbindUserRoleRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.UnbindUserRole(ctx, &protoReq) - return msg, metadata, err - -} - -func request_TokenManager_CreateClient_0(ctx context.Context, marshaler runtime.Marshaler, client TokenManagerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq CreateClientRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.CreateClient(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_TokenManager_CreateClient_0(ctx context.Context, marshaler runtime.Marshaler, server TokenManagerServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq CreateClientRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.CreateClient(ctx, &protoReq) - return msg, metadata, err - -} - -func request_TokenManager_Token_0(ctx context.Context, marshaler runtime.Marshaler, client TokenManagerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq TokenRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.Token(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_TokenManager_Token_0(ctx context.Context, marshaler runtime.Marshaler, server TokenManagerServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq TokenRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.Token(ctx, &protoReq) - return msg, metadata, err - -} - -// RegisterAccountManagerHandlerServer registers the http handlers for service AccountManager to "mux". -// UnaryRPC :call AccountManagerServer directly. -// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. -func RegisterAccountManagerHandlerServer(ctx context.Context, mux *runtime.ServeMux, server AccountManagerServer) error { - - mux.Handle("GET", pattern_AccountManager_DescribeUsers_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_AccountManager_DescribeUsers_0(rctx, inboundMarshaler, server, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_AccountManager_DescribeUsers_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_AccountManager_DescribeUsersDetail_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_AccountManager_DescribeUsersDetail_0(rctx, inboundMarshaler, server, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_AccountManager_DescribeUsersDetail_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("PATCH", pattern_AccountManager_ModifyUser_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_AccountManager_ModifyUser_0(rctx, inboundMarshaler, server, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_AccountManager_ModifyUser_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("DELETE", pattern_AccountManager_DeleteUsers_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_AccountManager_DeleteUsers_0(rctx, inboundMarshaler, server, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_AccountManager_DeleteUsers_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_AccountManager_ChangePassword_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_AccountManager_ChangePassword_0(rctx, inboundMarshaler, server, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_AccountManager_ChangePassword_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_AccountManager_CreatePasswordReset_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_AccountManager_CreatePasswordReset_0(rctx, inboundMarshaler, server, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_AccountManager_CreatePasswordReset_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_AccountManager_IsvCreateUser_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_AccountManager_IsvCreateUser_0(rctx, inboundMarshaler, server, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_AccountManager_IsvCreateUser_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_AccountManager_CreateUser_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_AccountManager_CreateUser_0(rctx, inboundMarshaler, server, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_AccountManager_CreateUser_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_AccountManager_GetPasswordReset_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_AccountManager_GetPasswordReset_0(rctx, inboundMarshaler, server, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_AccountManager_GetPasswordReset_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_AccountManager_ValidateUserPassword_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_AccountManager_ValidateUserPassword_0(rctx, inboundMarshaler, server, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_AccountManager_ValidateUserPassword_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_AccountManager_CreateGroup_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_AccountManager_CreateGroup_0(rctx, inboundMarshaler, server, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_AccountManager_CreateGroup_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_AccountManager_DescribeGroups_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_AccountManager_DescribeGroups_0(rctx, inboundMarshaler, server, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_AccountManager_DescribeGroups_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_AccountManager_DescribeGroupsDetail_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_AccountManager_DescribeGroupsDetail_0(rctx, inboundMarshaler, server, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_AccountManager_DescribeGroupsDetail_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("PATCH", pattern_AccountManager_ModifyGroup_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_AccountManager_ModifyGroup_0(rctx, inboundMarshaler, server, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_AccountManager_ModifyGroup_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("DELETE", pattern_AccountManager_DeleteGroups_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_AccountManager_DeleteGroups_0(rctx, inboundMarshaler, server, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_AccountManager_DeleteGroups_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_AccountManager_JoinGroup_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_AccountManager_JoinGroup_0(rctx, inboundMarshaler, server, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_AccountManager_JoinGroup_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_AccountManager_LeaveGroup_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_AccountManager_LeaveGroup_0(rctx, inboundMarshaler, server, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_AccountManager_LeaveGroup_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -// RegisterAccessManagerHandlerServer registers the http handlers for service AccessManager to "mux". -// UnaryRPC :call AccessManagerServer directly. -// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. -func RegisterAccessManagerHandlerServer(ctx context.Context, mux *runtime.ServeMux, server AccessManagerServer) error { - - mux.Handle("POST", pattern_AccessManager_CanDo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_AccessManager_CanDo_0(rctx, inboundMarshaler, server, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_AccessManager_CanDo_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_AccessManager_GetRoleModule_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_AccessManager_GetRoleModule_0(rctx, inboundMarshaler, server, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_AccessManager_GetRoleModule_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_AccessManager_ModifyRoleModule_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_AccessManager_ModifyRoleModule_0(rctx, inboundMarshaler, server, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_AccessManager_ModifyRoleModule_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_AccessManager_CreateRole_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_AccessManager_CreateRole_0(rctx, inboundMarshaler, server, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_AccessManager_CreateRole_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("DELETE", pattern_AccessManager_DeleteRoles_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_AccessManager_DeleteRoles_0(rctx, inboundMarshaler, server, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_AccessManager_DeleteRoles_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("PATCH", pattern_AccessManager_ModifyRole_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_AccessManager_ModifyRole_0(rctx, inboundMarshaler, server, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_AccessManager_ModifyRole_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_AccessManager_GetRole_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_AccessManager_GetRole_0(rctx, inboundMarshaler, server, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_AccessManager_GetRole_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_AccessManager_DescribeRoles_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_AccessManager_DescribeRoles_0(rctx, inboundMarshaler, server, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_AccessManager_DescribeRoles_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_AccessManager_BindUserRole_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_AccessManager_BindUserRole_0(rctx, inboundMarshaler, server, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_AccessManager_BindUserRole_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("DELETE", pattern_AccessManager_UnbindUserRole_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_AccessManager_UnbindUserRole_0(rctx, inboundMarshaler, server, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_AccessManager_UnbindUserRole_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -// RegisterTokenManagerHandlerServer registers the http handlers for service TokenManager to "mux". -// UnaryRPC :call TokenManagerServer directly. -// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. -func RegisterTokenManagerHandlerServer(ctx context.Context, mux *runtime.ServeMux, server TokenManagerServer) error { - - mux.Handle("POST", pattern_TokenManager_CreateClient_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_TokenManager_CreateClient_0(rctx, inboundMarshaler, server, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_TokenManager_CreateClient_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_TokenManager_Token_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_TokenManager_Token_0(rctx, inboundMarshaler, server, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_TokenManager_Token_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -// RegisterAccountManagerHandlerFromEndpoint is same as RegisterAccountManagerHandler but -// automatically dials to "endpoint" and closes the connection when "ctx" gets done. -func RegisterAccountManagerHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { - conn, err := grpc.Dial(endpoint, opts...) - if err != nil { - return err - } - defer func() { - if err != nil { - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - return - } - go func() { - <-ctx.Done() - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - }() - }() - - return RegisterAccountManagerHandler(ctx, mux, conn) -} - -// RegisterAccountManagerHandler registers the http handlers for service AccountManager to "mux". -// The handlers forward requests to the grpc endpoint over "conn". -func RegisterAccountManagerHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { - return RegisterAccountManagerHandlerClient(ctx, mux, NewAccountManagerClient(conn)) -} - -// RegisterAccountManagerHandlerClient registers the http handlers for service AccountManager -// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "AccountManagerClient". -// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "AccountManagerClient" -// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in -// "AccountManagerClient" to call the correct interceptors. -func RegisterAccountManagerHandlerClient(ctx context.Context, mux *runtime.ServeMux, client AccountManagerClient) error { - - mux.Handle("GET", pattern_AccountManager_DescribeUsers_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_AccountManager_DescribeUsers_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_AccountManager_DescribeUsers_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_AccountManager_DescribeUsersDetail_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_AccountManager_DescribeUsersDetail_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_AccountManager_DescribeUsersDetail_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("PATCH", pattern_AccountManager_ModifyUser_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_AccountManager_ModifyUser_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_AccountManager_ModifyUser_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("DELETE", pattern_AccountManager_DeleteUsers_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_AccountManager_DeleteUsers_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_AccountManager_DeleteUsers_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_AccountManager_ChangePassword_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_AccountManager_ChangePassword_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_AccountManager_ChangePassword_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_AccountManager_CreatePasswordReset_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_AccountManager_CreatePasswordReset_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_AccountManager_CreatePasswordReset_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_AccountManager_IsvCreateUser_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_AccountManager_IsvCreateUser_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_AccountManager_IsvCreateUser_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_AccountManager_CreateUser_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_AccountManager_CreateUser_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_AccountManager_CreateUser_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_AccountManager_GetPasswordReset_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_AccountManager_GetPasswordReset_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_AccountManager_GetPasswordReset_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_AccountManager_ValidateUserPassword_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_AccountManager_ValidateUserPassword_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_AccountManager_ValidateUserPassword_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_AccountManager_CreateGroup_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_AccountManager_CreateGroup_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_AccountManager_CreateGroup_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_AccountManager_DescribeGroups_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_AccountManager_DescribeGroups_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_AccountManager_DescribeGroups_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_AccountManager_DescribeGroupsDetail_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_AccountManager_DescribeGroupsDetail_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_AccountManager_DescribeGroupsDetail_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("PATCH", pattern_AccountManager_ModifyGroup_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_AccountManager_ModifyGroup_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_AccountManager_ModifyGroup_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("DELETE", pattern_AccountManager_DeleteGroups_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_AccountManager_DeleteGroups_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_AccountManager_DeleteGroups_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_AccountManager_JoinGroup_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_AccountManager_JoinGroup_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_AccountManager_JoinGroup_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_AccountManager_LeaveGroup_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_AccountManager_LeaveGroup_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_AccountManager_LeaveGroup_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -var ( - pattern_AccountManager_DescribeUsers_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "users"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_AccountManager_DescribeUsersDetail_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "users_detail"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_AccountManager_ModifyUser_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "users"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_AccountManager_DeleteUsers_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "users"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_AccountManager_ChangePassword_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "users", "password"}, "change", runtime.AssumeColonVerbOpt(true))) - - pattern_AccountManager_CreatePasswordReset_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "users", "password"}, "reset", runtime.AssumeColonVerbOpt(true))) - - pattern_AccountManager_IsvCreateUser_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "isv_users"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_AccountManager_CreateUser_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "users"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_AccountManager_GetPasswordReset_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "users", "password"}, "reset", runtime.AssumeColonVerbOpt(true))) - - pattern_AccountManager_ValidateUserPassword_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "users", "password"}, "validate", runtime.AssumeColonVerbOpt(true))) - - pattern_AccountManager_CreateGroup_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "groups"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_AccountManager_DescribeGroups_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "groups"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_AccountManager_DescribeGroupsDetail_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "groups_detail"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_AccountManager_ModifyGroup_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "groups"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_AccountManager_DeleteGroups_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "groups"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_AccountManager_JoinGroup_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "groups"}, "join", runtime.AssumeColonVerbOpt(true))) - - pattern_AccountManager_LeaveGroup_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "groups"}, "leave", runtime.AssumeColonVerbOpt(true))) -) - -var ( - forward_AccountManager_DescribeUsers_0 = runtime.ForwardResponseMessage - - forward_AccountManager_DescribeUsersDetail_0 = runtime.ForwardResponseMessage - - forward_AccountManager_ModifyUser_0 = runtime.ForwardResponseMessage - - forward_AccountManager_DeleteUsers_0 = runtime.ForwardResponseMessage - - forward_AccountManager_ChangePassword_0 = runtime.ForwardResponseMessage - - forward_AccountManager_CreatePasswordReset_0 = runtime.ForwardResponseMessage - - forward_AccountManager_IsvCreateUser_0 = runtime.ForwardResponseMessage - - forward_AccountManager_CreateUser_0 = runtime.ForwardResponseMessage - - forward_AccountManager_GetPasswordReset_0 = runtime.ForwardResponseMessage - - forward_AccountManager_ValidateUserPassword_0 = runtime.ForwardResponseMessage - - forward_AccountManager_CreateGroup_0 = runtime.ForwardResponseMessage - - forward_AccountManager_DescribeGroups_0 = runtime.ForwardResponseMessage - - forward_AccountManager_DescribeGroupsDetail_0 = runtime.ForwardResponseMessage - - forward_AccountManager_ModifyGroup_0 = runtime.ForwardResponseMessage - - forward_AccountManager_DeleteGroups_0 = runtime.ForwardResponseMessage - - forward_AccountManager_JoinGroup_0 = runtime.ForwardResponseMessage - - forward_AccountManager_LeaveGroup_0 = runtime.ForwardResponseMessage -) - -// RegisterAccessManagerHandlerFromEndpoint is same as RegisterAccessManagerHandler but -// automatically dials to "endpoint" and closes the connection when "ctx" gets done. -func RegisterAccessManagerHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { - conn, err := grpc.Dial(endpoint, opts...) - if err != nil { - return err - } - defer func() { - if err != nil { - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - return - } - go func() { - <-ctx.Done() - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - }() - }() - - return RegisterAccessManagerHandler(ctx, mux, conn) -} - -// RegisterAccessManagerHandler registers the http handlers for service AccessManager to "mux". -// The handlers forward requests to the grpc endpoint over "conn". -func RegisterAccessManagerHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { - return RegisterAccessManagerHandlerClient(ctx, mux, NewAccessManagerClient(conn)) -} - -// RegisterAccessManagerHandlerClient registers the http handlers for service AccessManager -// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "AccessManagerClient". -// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "AccessManagerClient" -// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in -// "AccessManagerClient" to call the correct interceptors. -func RegisterAccessManagerHandlerClient(ctx context.Context, mux *runtime.ServeMux, client AccessManagerClient) error { - - mux.Handle("POST", pattern_AccessManager_CanDo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_AccessManager_CanDo_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_AccessManager_CanDo_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_AccessManager_GetRoleModule_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_AccessManager_GetRoleModule_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_AccessManager_GetRoleModule_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_AccessManager_ModifyRoleModule_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_AccessManager_ModifyRoleModule_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_AccessManager_ModifyRoleModule_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_AccessManager_CreateRole_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_AccessManager_CreateRole_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_AccessManager_CreateRole_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("DELETE", pattern_AccessManager_DeleteRoles_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_AccessManager_DeleteRoles_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_AccessManager_DeleteRoles_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("PATCH", pattern_AccessManager_ModifyRole_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_AccessManager_ModifyRole_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_AccessManager_ModifyRole_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_AccessManager_GetRole_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_AccessManager_GetRole_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_AccessManager_GetRole_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_AccessManager_DescribeRoles_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_AccessManager_DescribeRoles_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_AccessManager_DescribeRoles_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_AccessManager_BindUserRole_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_AccessManager_BindUserRole_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_AccessManager_BindUserRole_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("DELETE", pattern_AccessManager_UnbindUserRole_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_AccessManager_UnbindUserRole_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_AccessManager_UnbindUserRole_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -var ( - pattern_AccessManager_CanDo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "cando"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_AccessManager_GetRoleModule_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "roles"}, "module", runtime.AssumeColonVerbOpt(true))) - - pattern_AccessManager_ModifyRoleModule_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "roles"}, "module", runtime.AssumeColonVerbOpt(true))) - - pattern_AccessManager_CreateRole_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "roles"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_AccessManager_DeleteRoles_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "roles"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_AccessManager_ModifyRole_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "roles"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_AccessManager_GetRole_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "role"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_AccessManager_DescribeRoles_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "roles"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_AccessManager_BindUserRole_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "user"}, "role", runtime.AssumeColonVerbOpt(true))) - - pattern_AccessManager_UnbindUserRole_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "user"}, "role", runtime.AssumeColonVerbOpt(true))) -) - -var ( - forward_AccessManager_CanDo_0 = runtime.ForwardResponseMessage - - forward_AccessManager_GetRoleModule_0 = runtime.ForwardResponseMessage - - forward_AccessManager_ModifyRoleModule_0 = runtime.ForwardResponseMessage - - forward_AccessManager_CreateRole_0 = runtime.ForwardResponseMessage - - forward_AccessManager_DeleteRoles_0 = runtime.ForwardResponseMessage - - forward_AccessManager_ModifyRole_0 = runtime.ForwardResponseMessage - - forward_AccessManager_GetRole_0 = runtime.ForwardResponseMessage - - forward_AccessManager_DescribeRoles_0 = runtime.ForwardResponseMessage - - forward_AccessManager_BindUserRole_0 = runtime.ForwardResponseMessage - - forward_AccessManager_UnbindUserRole_0 = runtime.ForwardResponseMessage -) - -// RegisterTokenManagerHandlerFromEndpoint is same as RegisterTokenManagerHandler but -// automatically dials to "endpoint" and closes the connection when "ctx" gets done. -func RegisterTokenManagerHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { - conn, err := grpc.Dial(endpoint, opts...) - if err != nil { - return err - } - defer func() { - if err != nil { - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - return - } - go func() { - <-ctx.Done() - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - }() - }() - - return RegisterTokenManagerHandler(ctx, mux, conn) -} - -// RegisterTokenManagerHandler registers the http handlers for service TokenManager to "mux". -// The handlers forward requests to the grpc endpoint over "conn". -func RegisterTokenManagerHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { - return RegisterTokenManagerHandlerClient(ctx, mux, NewTokenManagerClient(conn)) -} - -// RegisterTokenManagerHandlerClient registers the http handlers for service TokenManager -// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "TokenManagerClient". -// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "TokenManagerClient" -// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in -// "TokenManagerClient" to call the correct interceptors. -func RegisterTokenManagerHandlerClient(ctx context.Context, mux *runtime.ServeMux, client TokenManagerClient) error { - - mux.Handle("POST", pattern_TokenManager_CreateClient_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_TokenManager_CreateClient_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_TokenManager_CreateClient_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_TokenManager_Token_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_TokenManager_Token_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_TokenManager_Token_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -var ( - pattern_TokenManager_CreateClient_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "oauth2", "client"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_TokenManager_Token_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "oauth2", "token"}, "", runtime.AssumeColonVerbOpt(true))) -) - -var ( - forward_TokenManager_CreateClient_0 = runtime.ForwardResponseMessage - - forward_TokenManager_Token_0 = runtime.ForwardResponseMessage -) diff --git a/vendor/openpitrix.io/openpitrix/pkg/pb/app.pb.go b/vendor/openpitrix.io/openpitrix/pkg/pb/app.pb.go deleted file mode 100644 index 49945633a4..0000000000 --- a/vendor/openpitrix.io/openpitrix/pkg/pb/app.pb.go +++ /dev/null @@ -1,5322 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// source: app.proto - -package pb - -import ( - context "context" - fmt "fmt" - math "math" - - proto "github.com/golang/protobuf/proto" - timestamp "github.com/golang/protobuf/ptypes/timestamp" - wrappers "github.com/golang/protobuf/ptypes/wrappers" - _ "github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger/options" - _ "google.golang.org/genproto/googleapis/api/annotations" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" -) - -// 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 - -type UploadAppAttachmentRequest_Type int32 - -const ( - UploadAppAttachmentRequest_icon UploadAppAttachmentRequest_Type = 0 - UploadAppAttachmentRequest_screenshot UploadAppAttachmentRequest_Type = 1 -) - -var UploadAppAttachmentRequest_Type_name = map[int32]string{ - 0: "icon", - 1: "screenshot", -} - -var UploadAppAttachmentRequest_Type_value = map[string]int32{ - "icon": 0, - "screenshot": 1, -} - -func (x UploadAppAttachmentRequest_Type) String() string { - return proto.EnumName(UploadAppAttachmentRequest_Type_name, int32(x)) -} - -func (UploadAppAttachmentRequest_Type) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_e0f9056a14b86d47, []int{6, 0} -} - -type CreateAppRequest struct { - // required, app name - Name *wrappers.StringValue `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - // optional, vmbased/helm - VersionType *wrappers.StringValue `protobuf:"bytes,2,opt,name=version_type,json=versionType,proto3" json:"version_type,omitempty"` - // required, version with specific app package - VersionPackage *wrappers.BytesValue `protobuf:"bytes,3,opt,name=version_package,json=versionPackage,proto3" json:"version_package,omitempty"` - // required, version name of the app - VersionName *wrappers.StringValue `protobuf:"bytes,5,opt,name=version_name,json=versionName,proto3" json:"version_name,omitempty"` - // app icon - Icon *wrappers.BytesValue `protobuf:"bytes,6,opt,name=icon,proto3" json:"icon,omitempty"` - // isv - Isv *wrappers.StringValue `protobuf:"bytes,7,opt,name=isv,proto3" json:"isv,omitempty"` - // categories - Categories []string `protobuf:"bytes,8,rep,name=categories,proto3" json:"categories,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *CreateAppRequest) Reset() { *m = CreateAppRequest{} } -func (m *CreateAppRequest) String() string { return proto.CompactTextString(m) } -func (*CreateAppRequest) ProtoMessage() {} -func (*CreateAppRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_e0f9056a14b86d47, []int{0} -} - -func (m *CreateAppRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_CreateAppRequest.Unmarshal(m, b) -} -func (m *CreateAppRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_CreateAppRequest.Marshal(b, m, deterministic) -} -func (m *CreateAppRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_CreateAppRequest.Merge(m, src) -} -func (m *CreateAppRequest) XXX_Size() int { - return xxx_messageInfo_CreateAppRequest.Size(m) -} -func (m *CreateAppRequest) XXX_DiscardUnknown() { - xxx_messageInfo_CreateAppRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_CreateAppRequest proto.InternalMessageInfo - -func (m *CreateAppRequest) GetName() *wrappers.StringValue { - if m != nil { - return m.Name - } - return nil -} - -func (m *CreateAppRequest) GetVersionType() *wrappers.StringValue { - if m != nil { - return m.VersionType - } - return nil -} - -func (m *CreateAppRequest) GetVersionPackage() *wrappers.BytesValue { - if m != nil { - return m.VersionPackage - } - return nil -} - -func (m *CreateAppRequest) GetVersionName() *wrappers.StringValue { - if m != nil { - return m.VersionName - } - return nil -} - -func (m *CreateAppRequest) GetIcon() *wrappers.BytesValue { - if m != nil { - return m.Icon - } - return nil -} - -func (m *CreateAppRequest) GetIsv() *wrappers.StringValue { - if m != nil { - return m.Isv - } - return nil -} - -func (m *CreateAppRequest) GetCategories() []string { - if m != nil { - return m.Categories - } - return nil -} - -type CreateAppResponse struct { - // app id - AppId *wrappers.StringValue `protobuf:"bytes,1,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty"` - // version id of the app - VersionId *wrappers.StringValue `protobuf:"bytes,2,opt,name=version_id,json=versionId,proto3" json:"version_id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *CreateAppResponse) Reset() { *m = CreateAppResponse{} } -func (m *CreateAppResponse) String() string { return proto.CompactTextString(m) } -func (*CreateAppResponse) ProtoMessage() {} -func (*CreateAppResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_e0f9056a14b86d47, []int{1} -} - -func (m *CreateAppResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_CreateAppResponse.Unmarshal(m, b) -} -func (m *CreateAppResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_CreateAppResponse.Marshal(b, m, deterministic) -} -func (m *CreateAppResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_CreateAppResponse.Merge(m, src) -} -func (m *CreateAppResponse) XXX_Size() int { - return xxx_messageInfo_CreateAppResponse.Size(m) -} -func (m *CreateAppResponse) XXX_DiscardUnknown() { - xxx_messageInfo_CreateAppResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_CreateAppResponse proto.InternalMessageInfo - -func (m *CreateAppResponse) GetAppId() *wrappers.StringValue { - if m != nil { - return m.AppId - } - return nil -} - -func (m *CreateAppResponse) GetVersionId() *wrappers.StringValue { - if m != nil { - return m.VersionId - } - return nil -} - -type ValidatePackageRequest struct { - // optional, vmbased/helm - VersionType string `protobuf:"bytes,2,opt,name=version_type,json=versionType,proto3" json:"version_type,omitempty"` - // required, version package eg.[the wordpress-0.0.1.tgz will be encoded to bytes] - VersionPackage []byte `protobuf:"bytes,3,opt,name=version_package,json=versionPackage,proto3" json:"version_package,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ValidatePackageRequest) Reset() { *m = ValidatePackageRequest{} } -func (m *ValidatePackageRequest) String() string { return proto.CompactTextString(m) } -func (*ValidatePackageRequest) ProtoMessage() {} -func (*ValidatePackageRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_e0f9056a14b86d47, []int{2} -} - -func (m *ValidatePackageRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ValidatePackageRequest.Unmarshal(m, b) -} -func (m *ValidatePackageRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ValidatePackageRequest.Marshal(b, m, deterministic) -} -func (m *ValidatePackageRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_ValidatePackageRequest.Merge(m, src) -} -func (m *ValidatePackageRequest) XXX_Size() int { - return xxx_messageInfo_ValidatePackageRequest.Size(m) -} -func (m *ValidatePackageRequest) XXX_DiscardUnknown() { - xxx_messageInfo_ValidatePackageRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_ValidatePackageRequest proto.InternalMessageInfo - -func (m *ValidatePackageRequest) GetVersionType() string { - if m != nil { - return m.VersionType - } - return "" -} - -func (m *ValidatePackageRequest) GetVersionPackage() []byte { - if m != nil { - return m.VersionPackage - } - return nil -} - -type ValidatePackageResponse struct { - // filename map to detail - ErrorDetails map[string]string `protobuf:"bytes,1,rep,name=error_details,json=errorDetails,proto3" json:"error_details,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - // error eg.[json error] - Error *wrappers.StringValue `protobuf:"bytes,2,opt,name=error,proto3" json:"error,omitempty"` - // app name eg.[wordpress|mysql|...] - Name *wrappers.StringValue `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` - // app version name.eg.[0.1.0] - VersionName *wrappers.StringValue `protobuf:"bytes,4,opt,name=version_name,json=versionName,proto3" json:"version_name,omitempty"` - // app url - Url *wrappers.StringValue `protobuf:"bytes,5,opt,name=url,proto3" json:"url,omitempty"` - // app description - Description *wrappers.StringValue `protobuf:"bytes,6,opt,name=description,proto3" json:"description,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ValidatePackageResponse) Reset() { *m = ValidatePackageResponse{} } -func (m *ValidatePackageResponse) String() string { return proto.CompactTextString(m) } -func (*ValidatePackageResponse) ProtoMessage() {} -func (*ValidatePackageResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_e0f9056a14b86d47, []int{3} -} - -func (m *ValidatePackageResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ValidatePackageResponse.Unmarshal(m, b) -} -func (m *ValidatePackageResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ValidatePackageResponse.Marshal(b, m, deterministic) -} -func (m *ValidatePackageResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_ValidatePackageResponse.Merge(m, src) -} -func (m *ValidatePackageResponse) XXX_Size() int { - return xxx_messageInfo_ValidatePackageResponse.Size(m) -} -func (m *ValidatePackageResponse) XXX_DiscardUnknown() { - xxx_messageInfo_ValidatePackageResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_ValidatePackageResponse proto.InternalMessageInfo - -func (m *ValidatePackageResponse) GetErrorDetails() map[string]string { - if m != nil { - return m.ErrorDetails - } - return nil -} - -func (m *ValidatePackageResponse) GetError() *wrappers.StringValue { - if m != nil { - return m.Error - } - return nil -} - -func (m *ValidatePackageResponse) GetName() *wrappers.StringValue { - if m != nil { - return m.Name - } - return nil -} - -func (m *ValidatePackageResponse) GetVersionName() *wrappers.StringValue { - if m != nil { - return m.VersionName - } - return nil -} - -func (m *ValidatePackageResponse) GetUrl() *wrappers.StringValue { - if m != nil { - return m.Url - } - return nil -} - -func (m *ValidatePackageResponse) GetDescription() *wrappers.StringValue { - if m != nil { - return m.Description - } - return nil -} - -type ModifyAppRequest struct { - // required, id of app to modify - AppId *wrappers.StringValue `protobuf:"bytes,1,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty"` - // name of the app - Name *wrappers.StringValue `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - // description of the app - Description *wrappers.StringValue `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` - // home page of the app - Home *wrappers.StringValue `protobuf:"bytes,4,opt,name=home,proto3" json:"home,omitempty"` - // maintainers who maintainer the app - Maintainers *wrappers.StringValue `protobuf:"bytes,7,opt,name=maintainers,proto3" json:"maintainers,omitempty"` - // sources of app - Sources *wrappers.StringValue `protobuf:"bytes,8,opt,name=sources,proto3" json:"sources,omitempty"` - // instructions of the app - Readme *wrappers.StringValue `protobuf:"bytes,9,opt,name=readme,proto3" json:"readme,omitempty"` - // abstraction of app - Abstraction *wrappers.StringValue `protobuf:"bytes,10,opt,name=abstraction,proto3" json:"abstraction,omitempty"` - // tos of app - Tos *wrappers.StringValue `protobuf:"bytes,11,opt,name=tos,proto3" json:"tos,omitempty"` - // category id of the app - CategoryId *wrappers.StringValue `protobuf:"bytes,12,opt,name=category_id,json=categoryId,proto3" json:"category_id,omitempty"` - // key words of the app - Keywords *wrappers.StringValue `protobuf:"bytes,13,opt,name=keywords,proto3" json:"keywords,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ModifyAppRequest) Reset() { *m = ModifyAppRequest{} } -func (m *ModifyAppRequest) String() string { return proto.CompactTextString(m) } -func (*ModifyAppRequest) ProtoMessage() {} -func (*ModifyAppRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_e0f9056a14b86d47, []int{4} -} - -func (m *ModifyAppRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ModifyAppRequest.Unmarshal(m, b) -} -func (m *ModifyAppRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ModifyAppRequest.Marshal(b, m, deterministic) -} -func (m *ModifyAppRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_ModifyAppRequest.Merge(m, src) -} -func (m *ModifyAppRequest) XXX_Size() int { - return xxx_messageInfo_ModifyAppRequest.Size(m) -} -func (m *ModifyAppRequest) XXX_DiscardUnknown() { - xxx_messageInfo_ModifyAppRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_ModifyAppRequest proto.InternalMessageInfo - -func (m *ModifyAppRequest) GetAppId() *wrappers.StringValue { - if m != nil { - return m.AppId - } - return nil -} - -func (m *ModifyAppRequest) GetName() *wrappers.StringValue { - if m != nil { - return m.Name - } - return nil -} - -func (m *ModifyAppRequest) GetDescription() *wrappers.StringValue { - if m != nil { - return m.Description - } - return nil -} - -func (m *ModifyAppRequest) GetHome() *wrappers.StringValue { - if m != nil { - return m.Home - } - return nil -} - -func (m *ModifyAppRequest) GetMaintainers() *wrappers.StringValue { - if m != nil { - return m.Maintainers - } - return nil -} - -func (m *ModifyAppRequest) GetSources() *wrappers.StringValue { - if m != nil { - return m.Sources - } - return nil -} - -func (m *ModifyAppRequest) GetReadme() *wrappers.StringValue { - if m != nil { - return m.Readme - } - return nil -} - -func (m *ModifyAppRequest) GetAbstraction() *wrappers.StringValue { - if m != nil { - return m.Abstraction - } - return nil -} - -func (m *ModifyAppRequest) GetTos() *wrappers.StringValue { - if m != nil { - return m.Tos - } - return nil -} - -func (m *ModifyAppRequest) GetCategoryId() *wrappers.StringValue { - if m != nil { - return m.CategoryId - } - return nil -} - -func (m *ModifyAppRequest) GetKeywords() *wrappers.StringValue { - if m != nil { - return m.Keywords - } - return nil -} - -type ModifyAppResponse struct { - // id of app modified - AppId *wrappers.StringValue `protobuf:"bytes,1,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ModifyAppResponse) Reset() { *m = ModifyAppResponse{} } -func (m *ModifyAppResponse) String() string { return proto.CompactTextString(m) } -func (*ModifyAppResponse) ProtoMessage() {} -func (*ModifyAppResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_e0f9056a14b86d47, []int{5} -} - -func (m *ModifyAppResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ModifyAppResponse.Unmarshal(m, b) -} -func (m *ModifyAppResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ModifyAppResponse.Marshal(b, m, deterministic) -} -func (m *ModifyAppResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_ModifyAppResponse.Merge(m, src) -} -func (m *ModifyAppResponse) XXX_Size() int { - return xxx_messageInfo_ModifyAppResponse.Size(m) -} -func (m *ModifyAppResponse) XXX_DiscardUnknown() { - xxx_messageInfo_ModifyAppResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_ModifyAppResponse proto.InternalMessageInfo - -func (m *ModifyAppResponse) GetAppId() *wrappers.StringValue { - if m != nil { - return m.AppId - } - return nil -} - -type UploadAppAttachmentRequest struct { - // required, id of app to upload attachment - AppId *wrappers.StringValue `protobuf:"bytes,1,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty"` - // optional: icon/screenshot - Type UploadAppAttachmentRequest_Type `protobuf:"varint,2,opt,name=type,proto3,enum=openpitrix.UploadAppAttachmentRequest_Type" json:"type,omitempty"` - // required, content of attachment - AttachmentContent *wrappers.BytesValue `protobuf:"bytes,3,opt,name=attachment_content,json=attachmentContent,proto3" json:"attachment_content,omitempty"` - // only for screenshot, range: [0, 5] - Sequence *wrappers.UInt32Value `protobuf:"bytes,4,opt,name=sequence,proto3" json:"sequence,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *UploadAppAttachmentRequest) Reset() { *m = UploadAppAttachmentRequest{} } -func (m *UploadAppAttachmentRequest) String() string { return proto.CompactTextString(m) } -func (*UploadAppAttachmentRequest) ProtoMessage() {} -func (*UploadAppAttachmentRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_e0f9056a14b86d47, []int{6} -} - -func (m *UploadAppAttachmentRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_UploadAppAttachmentRequest.Unmarshal(m, b) -} -func (m *UploadAppAttachmentRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_UploadAppAttachmentRequest.Marshal(b, m, deterministic) -} -func (m *UploadAppAttachmentRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_UploadAppAttachmentRequest.Merge(m, src) -} -func (m *UploadAppAttachmentRequest) XXX_Size() int { - return xxx_messageInfo_UploadAppAttachmentRequest.Size(m) -} -func (m *UploadAppAttachmentRequest) XXX_DiscardUnknown() { - xxx_messageInfo_UploadAppAttachmentRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_UploadAppAttachmentRequest proto.InternalMessageInfo - -func (m *UploadAppAttachmentRequest) GetAppId() *wrappers.StringValue { - if m != nil { - return m.AppId - } - return nil -} - -func (m *UploadAppAttachmentRequest) GetType() UploadAppAttachmentRequest_Type { - if m != nil { - return m.Type - } - return UploadAppAttachmentRequest_icon -} - -func (m *UploadAppAttachmentRequest) GetAttachmentContent() *wrappers.BytesValue { - if m != nil { - return m.AttachmentContent - } - return nil -} - -func (m *UploadAppAttachmentRequest) GetSequence() *wrappers.UInt32Value { - if m != nil { - return m.Sequence - } - return nil -} - -type UploadAppAttachmentResponse struct { - // id of app to upload attachment - AppId *wrappers.StringValue `protobuf:"bytes,1,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *UploadAppAttachmentResponse) Reset() { *m = UploadAppAttachmentResponse{} } -func (m *UploadAppAttachmentResponse) String() string { return proto.CompactTextString(m) } -func (*UploadAppAttachmentResponse) ProtoMessage() {} -func (*UploadAppAttachmentResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_e0f9056a14b86d47, []int{7} -} - -func (m *UploadAppAttachmentResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_UploadAppAttachmentResponse.Unmarshal(m, b) -} -func (m *UploadAppAttachmentResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_UploadAppAttachmentResponse.Marshal(b, m, deterministic) -} -func (m *UploadAppAttachmentResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_UploadAppAttachmentResponse.Merge(m, src) -} -func (m *UploadAppAttachmentResponse) XXX_Size() int { - return xxx_messageInfo_UploadAppAttachmentResponse.Size(m) -} -func (m *UploadAppAttachmentResponse) XXX_DiscardUnknown() { - xxx_messageInfo_UploadAppAttachmentResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_UploadAppAttachmentResponse proto.InternalMessageInfo - -func (m *UploadAppAttachmentResponse) GetAppId() *wrappers.StringValue { - if m != nil { - return m.AppId - } - return nil -} - -type DeleteAppsRequest struct { - // required, ids of app to delete - AppId []string `protobuf:"bytes,1,rep,name=app_id,json=appId,proto3" json:"app_id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *DeleteAppsRequest) Reset() { *m = DeleteAppsRequest{} } -func (m *DeleteAppsRequest) String() string { return proto.CompactTextString(m) } -func (*DeleteAppsRequest) ProtoMessage() {} -func (*DeleteAppsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_e0f9056a14b86d47, []int{8} -} - -func (m *DeleteAppsRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_DeleteAppsRequest.Unmarshal(m, b) -} -func (m *DeleteAppsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_DeleteAppsRequest.Marshal(b, m, deterministic) -} -func (m *DeleteAppsRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_DeleteAppsRequest.Merge(m, src) -} -func (m *DeleteAppsRequest) XXX_Size() int { - return xxx_messageInfo_DeleteAppsRequest.Size(m) -} -func (m *DeleteAppsRequest) XXX_DiscardUnknown() { - xxx_messageInfo_DeleteAppsRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_DeleteAppsRequest proto.InternalMessageInfo - -func (m *DeleteAppsRequest) GetAppId() []string { - if m != nil { - return m.AppId - } - return nil -} - -type DeleteAppsResponse struct { - // ids of app deleted - AppId []string `protobuf:"bytes,1,rep,name=app_id,json=appId,proto3" json:"app_id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *DeleteAppsResponse) Reset() { *m = DeleteAppsResponse{} } -func (m *DeleteAppsResponse) String() string { return proto.CompactTextString(m) } -func (*DeleteAppsResponse) ProtoMessage() {} -func (*DeleteAppsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_e0f9056a14b86d47, []int{9} -} - -func (m *DeleteAppsResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_DeleteAppsResponse.Unmarshal(m, b) -} -func (m *DeleteAppsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_DeleteAppsResponse.Marshal(b, m, deterministic) -} -func (m *DeleteAppsResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_DeleteAppsResponse.Merge(m, src) -} -func (m *DeleteAppsResponse) XXX_Size() int { - return xxx_messageInfo_DeleteAppsResponse.Size(m) -} -func (m *DeleteAppsResponse) XXX_DiscardUnknown() { - xxx_messageInfo_DeleteAppsResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_DeleteAppsResponse proto.InternalMessageInfo - -func (m *DeleteAppsResponse) GetAppId() []string { - if m != nil { - return m.AppId - } - return nil -} - -type App struct { - // app id - AppId *wrappers.StringValue `protobuf:"bytes,1,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty"` - // whether there is a released version in the app - Active *wrappers.BoolValue `protobuf:"bytes,2,opt,name=active,proto3" json:"active,omitempty"` - // app name - Name *wrappers.StringValue `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` - // repository(store app package) id - RepoId *wrappers.StringValue `protobuf:"bytes,4,opt,name=repo_id,json=repoId,proto3" json:"repo_id,omitempty"` - // app description - Description *wrappers.StringValue `protobuf:"bytes,5,opt,name=description,proto3" json:"description,omitempty"` - // status eg.[modify|submit|review|cancel|release|delete|pass|reject|suspend|recover] - Status *wrappers.StringValue `protobuf:"bytes,6,opt,name=status,proto3" json:"status,omitempty"` - // app home page - Home *wrappers.StringValue `protobuf:"bytes,7,opt,name=home,proto3" json:"home,omitempty"` - // app icon - Icon *wrappers.StringValue `protobuf:"bytes,8,opt,name=icon,proto3" json:"icon,omitempty"` - // app screenshots - Screenshots *wrappers.StringValue `protobuf:"bytes,9,opt,name=screenshots,proto3" json:"screenshots,omitempty"` - // app maintainers - Maintainers *wrappers.StringValue `protobuf:"bytes,10,opt,name=maintainers,proto3" json:"maintainers,omitempty"` - // app key words - Keywords *wrappers.StringValue `protobuf:"bytes,11,opt,name=keywords,proto3" json:"keywords,omitempty"` - // sources of app - Sources *wrappers.StringValue `protobuf:"bytes,12,opt,name=sources,proto3" json:"sources,omitempty"` - // app instructions - Readme *wrappers.StringValue `protobuf:"bytes,13,opt,name=readme,proto3" json:"readme,omitempty"` - // chart name of app - ChartName *wrappers.StringValue `protobuf:"bytes,14,opt,name=chart_name,json=chartName,proto3" json:"chart_name,omitempty"` - // abstraction of app - Abstraction *wrappers.StringValue `protobuf:"bytes,15,opt,name=abstraction,proto3" json:"abstraction,omitempty"` - // tos of app - Tos *wrappers.StringValue `protobuf:"bytes,16,opt,name=tos,proto3" json:"tos,omitempty"` - // owner of app - Owner *wrappers.StringValue `protobuf:"bytes,17,opt,name=owner,proto3" json:"owner,omitempty"` - // the time when app create - CreateTime *timestamp.Timestamp `protobuf:"bytes,18,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty"` - // record status changed time - StatusTime *timestamp.Timestamp `protobuf:"bytes,19,opt,name=status_time,json=statusTime,proto3" json:"status_time,omitempty"` - // the time when app update - UpdateTime *timestamp.Timestamp `protobuf:"bytes,20,opt,name=update_time,json=updateTime,proto3" json:"update_time,omitempty"` - // list of category, the app may belong to one more category - CategorySet []*ResourceCategory `protobuf:"bytes,21,rep,name=category_set,json=categorySet,proto3" json:"category_set,omitempty"` - // latest version of app - LatestAppVersion *AppVersion `protobuf:"bytes,22,opt,name=latest_app_version,json=latestAppVersion,proto3" json:"latest_app_version,omitempty"` - // app version types eg.[vmbased|helm] - AppVersionTypes *wrappers.StringValue `protobuf:"bytes,23,opt,name=app_version_types,json=appVersionTypes,proto3" json:"app_version_types,omitempty"` - // company name - CompanyName *wrappers.StringValue `protobuf:"bytes,24,opt,name=company_name,json=companyName,proto3" json:"company_name,omitempty"` - // company website - CompanyWebsite *wrappers.StringValue `protobuf:"bytes,25,opt,name=company_website,json=companyWebsite,proto3" json:"company_website,omitempty"` - // company profile - CompanyProfile *wrappers.StringValue `protobuf:"bytes,26,opt,name=company_profile,json=companyProfile,proto3" json:"company_profile,omitempty"` - // company join time - CompanyJoinTime *timestamp.Timestamp `protobuf:"bytes,27,opt,name=company_join_time,json=companyJoinTime,proto3" json:"company_join_time,omitempty"` - // owner path of the app, concat string group_path:user_id - OwnerPath *wrappers.StringValue `protobuf:"bytes,28,opt,name=owner_path,json=ownerPath,proto3" json:"owner_path,omitempty"` - // the isv user who create the app - Isv *wrappers.StringValue `protobuf:"bytes,29,opt,name=isv,proto3" json:"isv,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *App) Reset() { *m = App{} } -func (m *App) String() string { return proto.CompactTextString(m) } -func (*App) ProtoMessage() {} -func (*App) Descriptor() ([]byte, []int) { - return fileDescriptor_e0f9056a14b86d47, []int{10} -} - -func (m *App) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_App.Unmarshal(m, b) -} -func (m *App) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_App.Marshal(b, m, deterministic) -} -func (m *App) XXX_Merge(src proto.Message) { - xxx_messageInfo_App.Merge(m, src) -} -func (m *App) XXX_Size() int { - return xxx_messageInfo_App.Size(m) -} -func (m *App) XXX_DiscardUnknown() { - xxx_messageInfo_App.DiscardUnknown(m) -} - -var xxx_messageInfo_App proto.InternalMessageInfo - -func (m *App) GetAppId() *wrappers.StringValue { - if m != nil { - return m.AppId - } - return nil -} - -func (m *App) GetActive() *wrappers.BoolValue { - if m != nil { - return m.Active - } - return nil -} - -func (m *App) GetName() *wrappers.StringValue { - if m != nil { - return m.Name - } - return nil -} - -func (m *App) GetRepoId() *wrappers.StringValue { - if m != nil { - return m.RepoId - } - return nil -} - -func (m *App) GetDescription() *wrappers.StringValue { - if m != nil { - return m.Description - } - return nil -} - -func (m *App) GetStatus() *wrappers.StringValue { - if m != nil { - return m.Status - } - return nil -} - -func (m *App) GetHome() *wrappers.StringValue { - if m != nil { - return m.Home - } - return nil -} - -func (m *App) GetIcon() *wrappers.StringValue { - if m != nil { - return m.Icon - } - return nil -} - -func (m *App) GetScreenshots() *wrappers.StringValue { - if m != nil { - return m.Screenshots - } - return nil -} - -func (m *App) GetMaintainers() *wrappers.StringValue { - if m != nil { - return m.Maintainers - } - return nil -} - -func (m *App) GetKeywords() *wrappers.StringValue { - if m != nil { - return m.Keywords - } - return nil -} - -func (m *App) GetSources() *wrappers.StringValue { - if m != nil { - return m.Sources - } - return nil -} - -func (m *App) GetReadme() *wrappers.StringValue { - if m != nil { - return m.Readme - } - return nil -} - -func (m *App) GetChartName() *wrappers.StringValue { - if m != nil { - return m.ChartName - } - return nil -} - -func (m *App) GetAbstraction() *wrappers.StringValue { - if m != nil { - return m.Abstraction - } - return nil -} - -func (m *App) GetTos() *wrappers.StringValue { - if m != nil { - return m.Tos - } - return nil -} - -func (m *App) GetOwner() *wrappers.StringValue { - if m != nil { - return m.Owner - } - return nil -} - -func (m *App) GetCreateTime() *timestamp.Timestamp { - if m != nil { - return m.CreateTime - } - return nil -} - -func (m *App) GetStatusTime() *timestamp.Timestamp { - if m != nil { - return m.StatusTime - } - return nil -} - -func (m *App) GetUpdateTime() *timestamp.Timestamp { - if m != nil { - return m.UpdateTime - } - return nil -} - -func (m *App) GetCategorySet() []*ResourceCategory { - if m != nil { - return m.CategorySet - } - return nil -} - -func (m *App) GetLatestAppVersion() *AppVersion { - if m != nil { - return m.LatestAppVersion - } - return nil -} - -func (m *App) GetAppVersionTypes() *wrappers.StringValue { - if m != nil { - return m.AppVersionTypes - } - return nil -} - -func (m *App) GetCompanyName() *wrappers.StringValue { - if m != nil { - return m.CompanyName - } - return nil -} - -func (m *App) GetCompanyWebsite() *wrappers.StringValue { - if m != nil { - return m.CompanyWebsite - } - return nil -} - -func (m *App) GetCompanyProfile() *wrappers.StringValue { - if m != nil { - return m.CompanyProfile - } - return nil -} - -func (m *App) GetCompanyJoinTime() *timestamp.Timestamp { - if m != nil { - return m.CompanyJoinTime - } - return nil -} - -func (m *App) GetOwnerPath() *wrappers.StringValue { - if m != nil { - return m.OwnerPath - } - return nil -} - -func (m *App) GetIsv() *wrappers.StringValue { - if m != nil { - return m.Isv - } - return nil -} - -type DescribeAppsRequest struct { - // query key, support these fields(app_id, name, repo_id, description, status, home, icon, screenshots, maintainers, sources, readme, owner, chart_name) - SearchWord *wrappers.StringValue `protobuf:"bytes,1,opt,name=search_word,json=searchWord,proto3" json:"search_word,omitempty"` - // sort key, order by sort_key, default create_time - SortKey *wrappers.StringValue `protobuf:"bytes,2,opt,name=sort_key,json=sortKey,proto3" json:"sort_key,omitempty"` - // value = 0 sort ASC, value = 1 sort DESC - Reverse *wrappers.BoolValue `protobuf:"bytes,3,opt,name=reverse,proto3" json:"reverse,omitempty"` - // data limit per page, default is 20, max value is 200 - Limit uint32 `protobuf:"varint,4,opt,name=limit,proto3" json:"limit,omitempty"` - // data offset, default is 0 - Offset uint32 `protobuf:"varint,5,opt,name=offset,proto3" json:"offset,omitempty"` - // app ids - AppId []string `protobuf:"bytes,11,rep,name=app_id,json=appId,proto3" json:"app_id,omitempty"` - // app name - Name []string `protobuf:"bytes,12,rep,name=name,proto3" json:"name,omitempty"` - // app repository ids - RepoId []string `protobuf:"bytes,13,rep,name=repo_id,json=repoId,proto3" json:"repo_id,omitempty"` - // app status eg.[modify|submit|review|cancel|release|delete|pass|reject|suspend|recover] - Status []string `protobuf:"bytes,14,rep,name=status,proto3" json:"status,omitempty"` - // app owner - Owner []string `protobuf:"bytes,15,rep,name=owner,proto3" json:"owner,omitempty"` - // app chart name - ChartName []string `protobuf:"bytes,16,rep,name=chart_name,json=chartName,proto3" json:"chart_name,omitempty"` - // app category ids - CategoryId []string `protobuf:"bytes,17,rep,name=category_id,json=categoryId,proto3" json:"category_id,omitempty"` - // select column to display - DisplayColumns []string `protobuf:"bytes,18,rep,name=display_columns,json=displayColumns,proto3" json:"display_columns,omitempty"` - // isv - Isv []string `protobuf:"bytes,19,rep,name=isv,proto3" json:"isv,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *DescribeAppsRequest) Reset() { *m = DescribeAppsRequest{} } -func (m *DescribeAppsRequest) String() string { return proto.CompactTextString(m) } -func (*DescribeAppsRequest) ProtoMessage() {} -func (*DescribeAppsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_e0f9056a14b86d47, []int{11} -} - -func (m *DescribeAppsRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_DescribeAppsRequest.Unmarshal(m, b) -} -func (m *DescribeAppsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_DescribeAppsRequest.Marshal(b, m, deterministic) -} -func (m *DescribeAppsRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_DescribeAppsRequest.Merge(m, src) -} -func (m *DescribeAppsRequest) XXX_Size() int { - return xxx_messageInfo_DescribeAppsRequest.Size(m) -} -func (m *DescribeAppsRequest) XXX_DiscardUnknown() { - xxx_messageInfo_DescribeAppsRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_DescribeAppsRequest proto.InternalMessageInfo - -func (m *DescribeAppsRequest) GetSearchWord() *wrappers.StringValue { - if m != nil { - return m.SearchWord - } - return nil -} - -func (m *DescribeAppsRequest) GetSortKey() *wrappers.StringValue { - if m != nil { - return m.SortKey - } - return nil -} - -func (m *DescribeAppsRequest) GetReverse() *wrappers.BoolValue { - if m != nil { - return m.Reverse - } - return nil -} - -func (m *DescribeAppsRequest) GetLimit() uint32 { - if m != nil { - return m.Limit - } - return 0 -} - -func (m *DescribeAppsRequest) GetOffset() uint32 { - if m != nil { - return m.Offset - } - return 0 -} - -func (m *DescribeAppsRequest) GetAppId() []string { - if m != nil { - return m.AppId - } - return nil -} - -func (m *DescribeAppsRequest) GetName() []string { - if m != nil { - return m.Name - } - return nil -} - -func (m *DescribeAppsRequest) GetRepoId() []string { - if m != nil { - return m.RepoId - } - return nil -} - -func (m *DescribeAppsRequest) GetStatus() []string { - if m != nil { - return m.Status - } - return nil -} - -func (m *DescribeAppsRequest) GetOwner() []string { - if m != nil { - return m.Owner - } - return nil -} - -func (m *DescribeAppsRequest) GetChartName() []string { - if m != nil { - return m.ChartName - } - return nil -} - -func (m *DescribeAppsRequest) GetCategoryId() []string { - if m != nil { - return m.CategoryId - } - return nil -} - -func (m *DescribeAppsRequest) GetDisplayColumns() []string { - if m != nil { - return m.DisplayColumns - } - return nil -} - -func (m *DescribeAppsRequest) GetIsv() []string { - if m != nil { - return m.Isv - } - return nil -} - -type DescribeAppsResponse struct { - // total count of qualified app - TotalCount uint32 `protobuf:"varint,1,opt,name=total_count,json=totalCount,proto3" json:"total_count,omitempty"` - // list of app - AppSet []*App `protobuf:"bytes,2,rep,name=app_set,json=appSet,proto3" json:"app_set,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *DescribeAppsResponse) Reset() { *m = DescribeAppsResponse{} } -func (m *DescribeAppsResponse) String() string { return proto.CompactTextString(m) } -func (*DescribeAppsResponse) ProtoMessage() {} -func (*DescribeAppsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_e0f9056a14b86d47, []int{12} -} - -func (m *DescribeAppsResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_DescribeAppsResponse.Unmarshal(m, b) -} -func (m *DescribeAppsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_DescribeAppsResponse.Marshal(b, m, deterministic) -} -func (m *DescribeAppsResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_DescribeAppsResponse.Merge(m, src) -} -func (m *DescribeAppsResponse) XXX_Size() int { - return xxx_messageInfo_DescribeAppsResponse.Size(m) -} -func (m *DescribeAppsResponse) XXX_DiscardUnknown() { - xxx_messageInfo_DescribeAppsResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_DescribeAppsResponse proto.InternalMessageInfo - -func (m *DescribeAppsResponse) GetTotalCount() uint32 { - if m != nil { - return m.TotalCount - } - return 0 -} - -func (m *DescribeAppsResponse) GetAppSet() []*App { - if m != nil { - return m.AppSet - } - return nil -} - -type CreateAppVersionRequest struct { - // required, id of app to create new version - AppId *wrappers.StringValue `protobuf:"bytes,1,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty"` - // required, version name eg.[0.1.0|0.1.3|...] - Name *wrappers.StringValue `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - // description of app of specific version - Description *wrappers.StringValue `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` - // optional: vmbased/helm - Type *wrappers.StringValue `protobuf:"bytes,4,opt,name=type,proto3" json:"type,omitempty"` - // package of app of specific version - Package *wrappers.BytesValue `protobuf:"bytes,5,opt,name=package,proto3" json:"package,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *CreateAppVersionRequest) Reset() { *m = CreateAppVersionRequest{} } -func (m *CreateAppVersionRequest) String() string { return proto.CompactTextString(m) } -func (*CreateAppVersionRequest) ProtoMessage() {} -func (*CreateAppVersionRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_e0f9056a14b86d47, []int{13} -} - -func (m *CreateAppVersionRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_CreateAppVersionRequest.Unmarshal(m, b) -} -func (m *CreateAppVersionRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_CreateAppVersionRequest.Marshal(b, m, deterministic) -} -func (m *CreateAppVersionRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_CreateAppVersionRequest.Merge(m, src) -} -func (m *CreateAppVersionRequest) XXX_Size() int { - return xxx_messageInfo_CreateAppVersionRequest.Size(m) -} -func (m *CreateAppVersionRequest) XXX_DiscardUnknown() { - xxx_messageInfo_CreateAppVersionRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_CreateAppVersionRequest proto.InternalMessageInfo - -func (m *CreateAppVersionRequest) GetAppId() *wrappers.StringValue { - if m != nil { - return m.AppId - } - return nil -} - -func (m *CreateAppVersionRequest) GetName() *wrappers.StringValue { - if m != nil { - return m.Name - } - return nil -} - -func (m *CreateAppVersionRequest) GetDescription() *wrappers.StringValue { - if m != nil { - return m.Description - } - return nil -} - -func (m *CreateAppVersionRequest) GetType() *wrappers.StringValue { - if m != nil { - return m.Type - } - return nil -} - -func (m *CreateAppVersionRequest) GetPackage() *wrappers.BytesValue { - if m != nil { - return m.Package - } - return nil -} - -type CreateAppVersionResponse struct { - // version id - VersionId *wrappers.StringValue `protobuf:"bytes,1,opt,name=version_id,json=versionId,proto3" json:"version_id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *CreateAppVersionResponse) Reset() { *m = CreateAppVersionResponse{} } -func (m *CreateAppVersionResponse) String() string { return proto.CompactTextString(m) } -func (*CreateAppVersionResponse) ProtoMessage() {} -func (*CreateAppVersionResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_e0f9056a14b86d47, []int{14} -} - -func (m *CreateAppVersionResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_CreateAppVersionResponse.Unmarshal(m, b) -} -func (m *CreateAppVersionResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_CreateAppVersionResponse.Marshal(b, m, deterministic) -} -func (m *CreateAppVersionResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_CreateAppVersionResponse.Merge(m, src) -} -func (m *CreateAppVersionResponse) XXX_Size() int { - return xxx_messageInfo_CreateAppVersionResponse.Size(m) -} -func (m *CreateAppVersionResponse) XXX_DiscardUnknown() { - xxx_messageInfo_CreateAppVersionResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_CreateAppVersionResponse proto.InternalMessageInfo - -func (m *CreateAppVersionResponse) GetVersionId() *wrappers.StringValue { - if m != nil { - return m.VersionId - } - return nil -} - -type ModifyAppVersionRequest struct { - // required, version id of app to modify - VersionId *wrappers.StringValue `protobuf:"bytes,1,opt,name=version_id,json=versionId,proto3" json:"version_id,omitempty"` - // app name - Name *wrappers.StringValue `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - // app description - Description *wrappers.StringValue `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` - // package of app to replace other - Package *wrappers.BytesValue `protobuf:"bytes,4,opt,name=package,proto3" json:"package,omitempty"` - // filename map to file_content - PackageFiles map[string][]byte `protobuf:"bytes,5,rep,name=package_files,json=packageFiles,proto3" json:"package_files,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ModifyAppVersionRequest) Reset() { *m = ModifyAppVersionRequest{} } -func (m *ModifyAppVersionRequest) String() string { return proto.CompactTextString(m) } -func (*ModifyAppVersionRequest) ProtoMessage() {} -func (*ModifyAppVersionRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_e0f9056a14b86d47, []int{15} -} - -func (m *ModifyAppVersionRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ModifyAppVersionRequest.Unmarshal(m, b) -} -func (m *ModifyAppVersionRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ModifyAppVersionRequest.Marshal(b, m, deterministic) -} -func (m *ModifyAppVersionRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_ModifyAppVersionRequest.Merge(m, src) -} -func (m *ModifyAppVersionRequest) XXX_Size() int { - return xxx_messageInfo_ModifyAppVersionRequest.Size(m) -} -func (m *ModifyAppVersionRequest) XXX_DiscardUnknown() { - xxx_messageInfo_ModifyAppVersionRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_ModifyAppVersionRequest proto.InternalMessageInfo - -func (m *ModifyAppVersionRequest) GetVersionId() *wrappers.StringValue { - if m != nil { - return m.VersionId - } - return nil -} - -func (m *ModifyAppVersionRequest) GetName() *wrappers.StringValue { - if m != nil { - return m.Name - } - return nil -} - -func (m *ModifyAppVersionRequest) GetDescription() *wrappers.StringValue { - if m != nil { - return m.Description - } - return nil -} - -func (m *ModifyAppVersionRequest) GetPackage() *wrappers.BytesValue { - if m != nil { - return m.Package - } - return nil -} - -func (m *ModifyAppVersionRequest) GetPackageFiles() map[string][]byte { - if m != nil { - return m.PackageFiles - } - return nil -} - -type ModifyAppVersionResponse struct { - // required, version id - VersionId *wrappers.StringValue `protobuf:"bytes,1,opt,name=version_id,json=versionId,proto3" json:"version_id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ModifyAppVersionResponse) Reset() { *m = ModifyAppVersionResponse{} } -func (m *ModifyAppVersionResponse) String() string { return proto.CompactTextString(m) } -func (*ModifyAppVersionResponse) ProtoMessage() {} -func (*ModifyAppVersionResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_e0f9056a14b86d47, []int{16} -} - -func (m *ModifyAppVersionResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ModifyAppVersionResponse.Unmarshal(m, b) -} -func (m *ModifyAppVersionResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ModifyAppVersionResponse.Marshal(b, m, deterministic) -} -func (m *ModifyAppVersionResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_ModifyAppVersionResponse.Merge(m, src) -} -func (m *ModifyAppVersionResponse) XXX_Size() int { - return xxx_messageInfo_ModifyAppVersionResponse.Size(m) -} -func (m *ModifyAppVersionResponse) XXX_DiscardUnknown() { - xxx_messageInfo_ModifyAppVersionResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_ModifyAppVersionResponse proto.InternalMessageInfo - -func (m *ModifyAppVersionResponse) GetVersionId() *wrappers.StringValue { - if m != nil { - return m.VersionId - } - return nil -} - -type AppVersion struct { - // version id of app - VersionId *wrappers.StringValue `protobuf:"bytes,1,opt,name=version_id,json=versionId,proto3" json:"version_id,omitempty"` - // active or not - Active *wrappers.BoolValue `protobuf:"bytes,2,opt,name=active,proto3" json:"active,omitempty"` - // app id - AppId *wrappers.StringValue `protobuf:"bytes,3,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty"` - // owner - Owner *wrappers.StringValue `protobuf:"bytes,4,opt,name=owner,proto3" json:"owner,omitempty"` - // version name - Name *wrappers.StringValue `protobuf:"bytes,5,opt,name=name,proto3" json:"name,omitempty"` - // description of app of specific version - Description *wrappers.StringValue `protobuf:"bytes,6,opt,name=description,proto3" json:"description,omitempty"` - // home of app of specific version - Home *wrappers.StringValue `protobuf:"bytes,7,opt,name=home,proto3" json:"home,omitempty"` - // icon of app of specific version - Icon *wrappers.StringValue `protobuf:"bytes,8,opt,name=icon,proto3" json:"icon,omitempty"` - // screenshots of app of specific version - Screenshots *wrappers.StringValue `protobuf:"bytes,9,opt,name=screenshots,proto3" json:"screenshots,omitempty"` - // maintainers of app of specific version - Maintainers *wrappers.StringValue `protobuf:"bytes,10,opt,name=maintainers,proto3" json:"maintainers,omitempty"` - // keywords of app of specific version - Keywords *wrappers.StringValue `protobuf:"bytes,11,opt,name=keywords,proto3" json:"keywords,omitempty"` - // sources of app of specific version - Sources *wrappers.StringValue `protobuf:"bytes,12,opt,name=sources,proto3" json:"sources,omitempty"` - // readme of app of specific version - Readme *wrappers.StringValue `protobuf:"bytes,13,opt,name=readme,proto3" json:"readme,omitempty"` - // package name of app of specific version - PackageName *wrappers.StringValue `protobuf:"bytes,14,opt,name=package_name,json=packageName,proto3" json:"package_name,omitempty"` - // status of app of specific version eg.[draft|submitted|passed|rejected|active|in-review|deleted|suspended] - Status *wrappers.StringValue `protobuf:"bytes,15,opt,name=status,proto3" json:"status,omitempty"` - // review id of app of specific version - ReviewId *wrappers.StringValue `protobuf:"bytes,16,opt,name=review_id,json=reviewId,proto3" json:"review_id,omitempty"` - // the time when app version create - CreateTime *timestamp.Timestamp `protobuf:"bytes,17,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty"` - // record status changed time - StatusTime *timestamp.Timestamp `protobuf:"bytes,18,opt,name=status_time,json=statusTime,proto3" json:"status_time,omitempty"` - // the time when app version update - UpdateTime *timestamp.Timestamp `protobuf:"bytes,19,opt,name=update_time,json=updateTime,proto3" json:"update_time,omitempty"` - // sequence of app of specific version - Sequence *wrappers.UInt32Value `protobuf:"bytes,20,opt,name=sequence,proto3" json:"sequence,omitempty"` - // message path of app of specific version - Message *wrappers.StringValue `protobuf:"bytes,21,opt,name=message,proto3" json:"message,omitempty"` - // type of app of specific version - Type *wrappers.StringValue `protobuf:"bytes,22,opt,name=type,proto3" json:"type,omitempty"` - // owner path of app of specific version, concat string group_path:user_id - OwnerPath *wrappers.StringValue `protobuf:"bytes,23,opt,name=owner_path,json=ownerPath,proto3" json:"owner_path,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *AppVersion) Reset() { *m = AppVersion{} } -func (m *AppVersion) String() string { return proto.CompactTextString(m) } -func (*AppVersion) ProtoMessage() {} -func (*AppVersion) Descriptor() ([]byte, []int) { - return fileDescriptor_e0f9056a14b86d47, []int{17} -} - -func (m *AppVersion) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_AppVersion.Unmarshal(m, b) -} -func (m *AppVersion) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_AppVersion.Marshal(b, m, deterministic) -} -func (m *AppVersion) XXX_Merge(src proto.Message) { - xxx_messageInfo_AppVersion.Merge(m, src) -} -func (m *AppVersion) XXX_Size() int { - return xxx_messageInfo_AppVersion.Size(m) -} -func (m *AppVersion) XXX_DiscardUnknown() { - xxx_messageInfo_AppVersion.DiscardUnknown(m) -} - -var xxx_messageInfo_AppVersion proto.InternalMessageInfo - -func (m *AppVersion) GetVersionId() *wrappers.StringValue { - if m != nil { - return m.VersionId - } - return nil -} - -func (m *AppVersion) GetActive() *wrappers.BoolValue { - if m != nil { - return m.Active - } - return nil -} - -func (m *AppVersion) GetAppId() *wrappers.StringValue { - if m != nil { - return m.AppId - } - return nil -} - -func (m *AppVersion) GetOwner() *wrappers.StringValue { - if m != nil { - return m.Owner - } - return nil -} - -func (m *AppVersion) GetName() *wrappers.StringValue { - if m != nil { - return m.Name - } - return nil -} - -func (m *AppVersion) GetDescription() *wrappers.StringValue { - if m != nil { - return m.Description - } - return nil -} - -func (m *AppVersion) GetHome() *wrappers.StringValue { - if m != nil { - return m.Home - } - return nil -} - -func (m *AppVersion) GetIcon() *wrappers.StringValue { - if m != nil { - return m.Icon - } - return nil -} - -func (m *AppVersion) GetScreenshots() *wrappers.StringValue { - if m != nil { - return m.Screenshots - } - return nil -} - -func (m *AppVersion) GetMaintainers() *wrappers.StringValue { - if m != nil { - return m.Maintainers - } - return nil -} - -func (m *AppVersion) GetKeywords() *wrappers.StringValue { - if m != nil { - return m.Keywords - } - return nil -} - -func (m *AppVersion) GetSources() *wrappers.StringValue { - if m != nil { - return m.Sources - } - return nil -} - -func (m *AppVersion) GetReadme() *wrappers.StringValue { - if m != nil { - return m.Readme - } - return nil -} - -func (m *AppVersion) GetPackageName() *wrappers.StringValue { - if m != nil { - return m.PackageName - } - return nil -} - -func (m *AppVersion) GetStatus() *wrappers.StringValue { - if m != nil { - return m.Status - } - return nil -} - -func (m *AppVersion) GetReviewId() *wrappers.StringValue { - if m != nil { - return m.ReviewId - } - return nil -} - -func (m *AppVersion) GetCreateTime() *timestamp.Timestamp { - if m != nil { - return m.CreateTime - } - return nil -} - -func (m *AppVersion) GetStatusTime() *timestamp.Timestamp { - if m != nil { - return m.StatusTime - } - return nil -} - -func (m *AppVersion) GetUpdateTime() *timestamp.Timestamp { - if m != nil { - return m.UpdateTime - } - return nil -} - -func (m *AppVersion) GetSequence() *wrappers.UInt32Value { - if m != nil { - return m.Sequence - } - return nil -} - -func (m *AppVersion) GetMessage() *wrappers.StringValue { - if m != nil { - return m.Message - } - return nil -} - -func (m *AppVersion) GetType() *wrappers.StringValue { - if m != nil { - return m.Type - } - return nil -} - -func (m *AppVersion) GetOwnerPath() *wrappers.StringValue { - if m != nil { - return m.OwnerPath - } - return nil -} - -type AppVersionAudit struct { - // id of version to audit - VersionId *wrappers.StringValue `protobuf:"bytes,1,opt,name=version_id,json=versionId,proto3" json:"version_id,omitempty"` - // id of specific version app - AppId *wrappers.StringValue `protobuf:"bytes,2,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty"` - // audit status, eg.[draft|submitted|passed|rejected|active|in-review|deleted|suspended] - Status *wrappers.StringValue `protobuf:"bytes,3,opt,name=status,proto3" json:"status,omitempty"` - // version name - VersionName *wrappers.StringValue `protobuf:"bytes,4,opt,name=version_name,json=versionName,proto3" json:"version_name,omitempty"` - // name of specific version app - AppName *wrappers.StringValue `protobuf:"bytes,5,opt,name=app_name,json=appName,proto3" json:"app_name,omitempty"` - // user of auditer - Operator *wrappers.StringValue `protobuf:"bytes,6,opt,name=operator,proto3" json:"operator,omitempty"` - // operator of auditer eg.[global_admin|developer|business|technical|isv] - OperatorType *wrappers.StringValue `protobuf:"bytes,7,opt,name=operator_type,json=operatorType,proto3" json:"operator_type,omitempty"` - // audit message - Message *wrappers.StringValue `protobuf:"bytes,8,opt,name=message,proto3" json:"message,omitempty"` - // review id - ReviewId *wrappers.StringValue `protobuf:"bytes,9,opt,name=review_id,json=reviewId,proto3" json:"review_id,omitempty"` - // record status changed time - StatusTime *timestamp.Timestamp `protobuf:"bytes,10,opt,name=status_time,json=statusTime,proto3" json:"status_time,omitempty"` - // version type - VersionType *wrappers.StringValue `protobuf:"bytes,11,opt,name=version_type,json=versionType,proto3" json:"version_type,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *AppVersionAudit) Reset() { *m = AppVersionAudit{} } -func (m *AppVersionAudit) String() string { return proto.CompactTextString(m) } -func (*AppVersionAudit) ProtoMessage() {} -func (*AppVersionAudit) Descriptor() ([]byte, []int) { - return fileDescriptor_e0f9056a14b86d47, []int{18} -} - -func (m *AppVersionAudit) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_AppVersionAudit.Unmarshal(m, b) -} -func (m *AppVersionAudit) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_AppVersionAudit.Marshal(b, m, deterministic) -} -func (m *AppVersionAudit) XXX_Merge(src proto.Message) { - xxx_messageInfo_AppVersionAudit.Merge(m, src) -} -func (m *AppVersionAudit) XXX_Size() int { - return xxx_messageInfo_AppVersionAudit.Size(m) -} -func (m *AppVersionAudit) XXX_DiscardUnknown() { - xxx_messageInfo_AppVersionAudit.DiscardUnknown(m) -} - -var xxx_messageInfo_AppVersionAudit proto.InternalMessageInfo - -func (m *AppVersionAudit) GetVersionId() *wrappers.StringValue { - if m != nil { - return m.VersionId - } - return nil -} - -func (m *AppVersionAudit) GetAppId() *wrappers.StringValue { - if m != nil { - return m.AppId - } - return nil -} - -func (m *AppVersionAudit) GetStatus() *wrappers.StringValue { - if m != nil { - return m.Status - } - return nil -} - -func (m *AppVersionAudit) GetVersionName() *wrappers.StringValue { - if m != nil { - return m.VersionName - } - return nil -} - -func (m *AppVersionAudit) GetAppName() *wrappers.StringValue { - if m != nil { - return m.AppName - } - return nil -} - -func (m *AppVersionAudit) GetOperator() *wrappers.StringValue { - if m != nil { - return m.Operator - } - return nil -} - -func (m *AppVersionAudit) GetOperatorType() *wrappers.StringValue { - if m != nil { - return m.OperatorType - } - return nil -} - -func (m *AppVersionAudit) GetMessage() *wrappers.StringValue { - if m != nil { - return m.Message - } - return nil -} - -func (m *AppVersionAudit) GetReviewId() *wrappers.StringValue { - if m != nil { - return m.ReviewId - } - return nil -} - -func (m *AppVersionAudit) GetStatusTime() *timestamp.Timestamp { - if m != nil { - return m.StatusTime - } - return nil -} - -func (m *AppVersionAudit) GetVersionType() *wrappers.StringValue { - if m != nil { - return m.VersionType - } - return nil -} - -type AppVersionReviewPhase struct { - // review status of app version eg.[isv-in-review|isv-passed|isv-rejected|isv-draft|business-in-review|business-passed|business-rejected|develop-draft|develop-in-review|develop-passed|develop-rejected|develop-draft] - Status *wrappers.StringValue `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"` - // user of reviewer - Operator *wrappers.StringValue `protobuf:"bytes,2,opt,name=operator,proto3" json:"operator,omitempty"` - // operator type of reviewer eg.[global_admin|developer|business|technical|isv] - OperatorType *wrappers.StringValue `protobuf:"bytes,3,opt,name=operator_type,json=operatorType,proto3" json:"operator_type,omitempty"` - // review message - Message *wrappers.StringValue `protobuf:"bytes,4,opt,name=message,proto3" json:"message,omitempty"` - // record status changed time - StatusTime *timestamp.Timestamp `protobuf:"bytes,5,opt,name=status_time,json=statusTime,proto3" json:"status_time,omitempty"` - // app version review time - ReviewTime *timestamp.Timestamp `protobuf:"bytes,6,opt,name=review_time,json=reviewTime,proto3" json:"review_time,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *AppVersionReviewPhase) Reset() { *m = AppVersionReviewPhase{} } -func (m *AppVersionReviewPhase) String() string { return proto.CompactTextString(m) } -func (*AppVersionReviewPhase) ProtoMessage() {} -func (*AppVersionReviewPhase) Descriptor() ([]byte, []int) { - return fileDescriptor_e0f9056a14b86d47, []int{19} -} - -func (m *AppVersionReviewPhase) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_AppVersionReviewPhase.Unmarshal(m, b) -} -func (m *AppVersionReviewPhase) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_AppVersionReviewPhase.Marshal(b, m, deterministic) -} -func (m *AppVersionReviewPhase) XXX_Merge(src proto.Message) { - xxx_messageInfo_AppVersionReviewPhase.Merge(m, src) -} -func (m *AppVersionReviewPhase) XXX_Size() int { - return xxx_messageInfo_AppVersionReviewPhase.Size(m) -} -func (m *AppVersionReviewPhase) XXX_DiscardUnknown() { - xxx_messageInfo_AppVersionReviewPhase.DiscardUnknown(m) -} - -var xxx_messageInfo_AppVersionReviewPhase proto.InternalMessageInfo - -func (m *AppVersionReviewPhase) GetStatus() *wrappers.StringValue { - if m != nil { - return m.Status - } - return nil -} - -func (m *AppVersionReviewPhase) GetOperator() *wrappers.StringValue { - if m != nil { - return m.Operator - } - return nil -} - -func (m *AppVersionReviewPhase) GetOperatorType() *wrappers.StringValue { - if m != nil { - return m.OperatorType - } - return nil -} - -func (m *AppVersionReviewPhase) GetMessage() *wrappers.StringValue { - if m != nil { - return m.Message - } - return nil -} - -func (m *AppVersionReviewPhase) GetStatusTime() *timestamp.Timestamp { - if m != nil { - return m.StatusTime - } - return nil -} - -func (m *AppVersionReviewPhase) GetReviewTime() *timestamp.Timestamp { - if m != nil { - return m.ReviewTime - } - return nil -} - -type AppVersionReview struct { - // review id - ReviewId *wrappers.StringValue `protobuf:"bytes,1,opt,name=review_id,json=reviewId,proto3" json:"review_id,omitempty"` - // id of app version - VersionId *wrappers.StringValue `protobuf:"bytes,2,opt,name=version_id,json=versionId,proto3" json:"version_id,omitempty"` - // app id - AppId *wrappers.StringValue `protobuf:"bytes,3,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty"` - // version name of specific app version - VersionName *wrappers.StringValue `protobuf:"bytes,4,opt,name=version_name,json=versionName,proto3" json:"version_name,omitempty"` - // app name - AppName *wrappers.StringValue `protobuf:"bytes,5,opt,name=app_name,json=appName,proto3" json:"app_name,omitempty"` - // review status eg.[isv-in-review|isv-passed|isv-rejected|isv-draft|business-in-review|business-passed|business-rejected|develop-draft|develop-in-review|develop-passed|develop-rejected|develop-draft] - Status *wrappers.StringValue `protobuf:"bytes,6,opt,name=status,proto3" json:"status,omitempty"` - // review phase, app need one more reviewer to review, when reviewer reviewed, status changed - Phase map[string]*AppVersionReviewPhase `protobuf:"bytes,7,rep,name=phase,proto3" json:"phase,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - // record status changed time - StatusTime *timestamp.Timestamp `protobuf:"bytes,8,opt,name=status_time,json=statusTime,proto3" json:"status_time,omitempty"` - // user who review the app version - Reviewer *wrappers.StringValue `protobuf:"bytes,9,opt,name=reviewer,proto3" json:"reviewer,omitempty"` - // version type - VersionType *wrappers.StringValue `protobuf:"bytes,10,opt,name=version_type,json=versionType,proto3" json:"version_type,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *AppVersionReview) Reset() { *m = AppVersionReview{} } -func (m *AppVersionReview) String() string { return proto.CompactTextString(m) } -func (*AppVersionReview) ProtoMessage() {} -func (*AppVersionReview) Descriptor() ([]byte, []int) { - return fileDescriptor_e0f9056a14b86d47, []int{20} -} - -func (m *AppVersionReview) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_AppVersionReview.Unmarshal(m, b) -} -func (m *AppVersionReview) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_AppVersionReview.Marshal(b, m, deterministic) -} -func (m *AppVersionReview) XXX_Merge(src proto.Message) { - xxx_messageInfo_AppVersionReview.Merge(m, src) -} -func (m *AppVersionReview) XXX_Size() int { - return xxx_messageInfo_AppVersionReview.Size(m) -} -func (m *AppVersionReview) XXX_DiscardUnknown() { - xxx_messageInfo_AppVersionReview.DiscardUnknown(m) -} - -var xxx_messageInfo_AppVersionReview proto.InternalMessageInfo - -func (m *AppVersionReview) GetReviewId() *wrappers.StringValue { - if m != nil { - return m.ReviewId - } - return nil -} - -func (m *AppVersionReview) GetVersionId() *wrappers.StringValue { - if m != nil { - return m.VersionId - } - return nil -} - -func (m *AppVersionReview) GetAppId() *wrappers.StringValue { - if m != nil { - return m.AppId - } - return nil -} - -func (m *AppVersionReview) GetVersionName() *wrappers.StringValue { - if m != nil { - return m.VersionName - } - return nil -} - -func (m *AppVersionReview) GetAppName() *wrappers.StringValue { - if m != nil { - return m.AppName - } - return nil -} - -func (m *AppVersionReview) GetStatus() *wrappers.StringValue { - if m != nil { - return m.Status - } - return nil -} - -func (m *AppVersionReview) GetPhase() map[string]*AppVersionReviewPhase { - if m != nil { - return m.Phase - } - return nil -} - -func (m *AppVersionReview) GetStatusTime() *timestamp.Timestamp { - if m != nil { - return m.StatusTime - } - return nil -} - -func (m *AppVersionReview) GetReviewer() *wrappers.StringValue { - if m != nil { - return m.Reviewer - } - return nil -} - -func (m *AppVersionReview) GetVersionType() *wrappers.StringValue { - if m != nil { - return m.VersionType - } - return nil -} - -type DescribeAppVersionReviewsRequest struct { - // query key, support these fields(review_id, version_id, app_id, status, reviewer, app_name, owner) - SearchWord *wrappers.StringValue `protobuf:"bytes,1,opt,name=search_word,json=searchWord,proto3" json:"search_word,omitempty"` - // sort key, order by sort_key, default create_time - SortKey *wrappers.StringValue `protobuf:"bytes,2,opt,name=sort_key,json=sortKey,proto3" json:"sort_key,omitempty"` - // value = 0 sort ASC, value = 1 sort DESC - Reverse *wrappers.BoolValue `protobuf:"bytes,3,opt,name=reverse,proto3" json:"reverse,omitempty"` - // data limit per page, default is 20, max value is 200 - Limit uint32 `protobuf:"varint,4,opt,name=limit,proto3" json:"limit,omitempty"` - // data offset, default is 0 - Offset uint32 `protobuf:"varint,5,opt,name=offset,proto3" json:"offset,omitempty"` - // app ids - AppId []string `protobuf:"bytes,10,rep,name=app_id,json=appId,proto3" json:"app_id,omitempty"` - // app version ids - VersionId []string `protobuf:"bytes,11,rep,name=version_id,json=versionId,proto3" json:"version_id,omitempty"` - // app version review ids - ReviewId []string `protobuf:"bytes,12,rep,name=review_id,json=reviewId,proto3" json:"review_id,omitempty"` - // app version status eg.[isv-in-review|isv-passed|isv-rejected|isv-draft|business-in-review|business-passed|business-rejected|develop-draft|develop-in-review|develop-passed|develop-rejected|develop-draft] - Status []string `protobuf:"bytes,13,rep,name=status,proto3" json:"status,omitempty"` - // select columns to display - DisplayColumns []string `protobuf:"bytes,14,rep,name=display_columns,json=displayColumns,proto3" json:"display_columns,omitempty"` - // reviewer of app version eg.[global_admin|developer|business|technical|isv] - Reviewer []string `protobuf:"bytes,15,rep,name=reviewer,proto3" json:"reviewer,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *DescribeAppVersionReviewsRequest) Reset() { *m = DescribeAppVersionReviewsRequest{} } -func (m *DescribeAppVersionReviewsRequest) String() string { return proto.CompactTextString(m) } -func (*DescribeAppVersionReviewsRequest) ProtoMessage() {} -func (*DescribeAppVersionReviewsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_e0f9056a14b86d47, []int{21} -} - -func (m *DescribeAppVersionReviewsRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_DescribeAppVersionReviewsRequest.Unmarshal(m, b) -} -func (m *DescribeAppVersionReviewsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_DescribeAppVersionReviewsRequest.Marshal(b, m, deterministic) -} -func (m *DescribeAppVersionReviewsRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_DescribeAppVersionReviewsRequest.Merge(m, src) -} -func (m *DescribeAppVersionReviewsRequest) XXX_Size() int { - return xxx_messageInfo_DescribeAppVersionReviewsRequest.Size(m) -} -func (m *DescribeAppVersionReviewsRequest) XXX_DiscardUnknown() { - xxx_messageInfo_DescribeAppVersionReviewsRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_DescribeAppVersionReviewsRequest proto.InternalMessageInfo - -func (m *DescribeAppVersionReviewsRequest) GetSearchWord() *wrappers.StringValue { - if m != nil { - return m.SearchWord - } - return nil -} - -func (m *DescribeAppVersionReviewsRequest) GetSortKey() *wrappers.StringValue { - if m != nil { - return m.SortKey - } - return nil -} - -func (m *DescribeAppVersionReviewsRequest) GetReverse() *wrappers.BoolValue { - if m != nil { - return m.Reverse - } - return nil -} - -func (m *DescribeAppVersionReviewsRequest) GetLimit() uint32 { - if m != nil { - return m.Limit - } - return 0 -} - -func (m *DescribeAppVersionReviewsRequest) GetOffset() uint32 { - if m != nil { - return m.Offset - } - return 0 -} - -func (m *DescribeAppVersionReviewsRequest) GetAppId() []string { - if m != nil { - return m.AppId - } - return nil -} - -func (m *DescribeAppVersionReviewsRequest) GetVersionId() []string { - if m != nil { - return m.VersionId - } - return nil -} - -func (m *DescribeAppVersionReviewsRequest) GetReviewId() []string { - if m != nil { - return m.ReviewId - } - return nil -} - -func (m *DescribeAppVersionReviewsRequest) GetStatus() []string { - if m != nil { - return m.Status - } - return nil -} - -func (m *DescribeAppVersionReviewsRequest) GetDisplayColumns() []string { - if m != nil { - return m.DisplayColumns - } - return nil -} - -func (m *DescribeAppVersionReviewsRequest) GetReviewer() []string { - if m != nil { - return m.Reviewer - } - return nil -} - -type DescribeAppVersionReviewsResponse struct { - // total count of reviews of app with specific version - TotalCount uint32 `protobuf:"varint,1,opt,name=total_count,json=totalCount,proto3" json:"total_count,omitempty"` - // list of reviews of app with specific version - AppVersionReviewSet []*AppVersionReview `protobuf:"bytes,2,rep,name=app_version_review_set,json=appVersionReviewSet,proto3" json:"app_version_review_set,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *DescribeAppVersionReviewsResponse) Reset() { *m = DescribeAppVersionReviewsResponse{} } -func (m *DescribeAppVersionReviewsResponse) String() string { return proto.CompactTextString(m) } -func (*DescribeAppVersionReviewsResponse) ProtoMessage() {} -func (*DescribeAppVersionReviewsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_e0f9056a14b86d47, []int{22} -} - -func (m *DescribeAppVersionReviewsResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_DescribeAppVersionReviewsResponse.Unmarshal(m, b) -} -func (m *DescribeAppVersionReviewsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_DescribeAppVersionReviewsResponse.Marshal(b, m, deterministic) -} -func (m *DescribeAppVersionReviewsResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_DescribeAppVersionReviewsResponse.Merge(m, src) -} -func (m *DescribeAppVersionReviewsResponse) XXX_Size() int { - return xxx_messageInfo_DescribeAppVersionReviewsResponse.Size(m) -} -func (m *DescribeAppVersionReviewsResponse) XXX_DiscardUnknown() { - xxx_messageInfo_DescribeAppVersionReviewsResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_DescribeAppVersionReviewsResponse proto.InternalMessageInfo - -func (m *DescribeAppVersionReviewsResponse) GetTotalCount() uint32 { - if m != nil { - return m.TotalCount - } - return 0 -} - -func (m *DescribeAppVersionReviewsResponse) GetAppVersionReviewSet() []*AppVersionReview { - if m != nil { - return m.AppVersionReviewSet - } - return nil -} - -type DescribeAppVersionAuditsRequest struct { - // query key, support these fields(version_id, app_id, status, operator, role) - SearchWord *wrappers.StringValue `protobuf:"bytes,1,opt,name=search_word,json=searchWord,proto3" json:"search_word,omitempty"` - // sort key, order by sort_key, default create_time - SortKey *wrappers.StringValue `protobuf:"bytes,2,opt,name=sort_key,json=sortKey,proto3" json:"sort_key,omitempty"` - // value = 0 sort ASC, value = 1 sort DESC - Reverse *wrappers.BoolValue `protobuf:"bytes,3,opt,name=reverse,proto3" json:"reverse,omitempty"` - // data limit per page, default is 20, max value is 200 - Limit uint32 `protobuf:"varint,4,opt,name=limit,proto3" json:"limit,omitempty"` - // data offset, default is 0 - Offset uint32 `protobuf:"varint,5,opt,name=offset,proto3" json:"offset,omitempty"` - // app ids - AppId []string `protobuf:"bytes,10,rep,name=app_id,json=appId,proto3" json:"app_id,omitempty"` - // app version ids - VersionId []string `protobuf:"bytes,11,rep,name=version_id,json=versionId,proto3" json:"version_id,omitempty"` - // app version audit status eg.[draft|submitted|passed|rejected|active|in-review|deleted|suspended] - Status []string `protobuf:"bytes,12,rep,name=status,proto3" json:"status,omitempty"` - // auditer of app version - Operator []string `protobuf:"bytes,13,rep,name=operator,proto3" json:"operator,omitempty"` - // operator type eg.[global_admin|developer|business|technical|isv] - OperatorType []string `protobuf:"bytes,14,rep,name=operator_type,json=operatorType,proto3" json:"operator_type,omitempty"` - // select columns to display - DisplayColumns []string `protobuf:"bytes,15,rep,name=display_columns,json=displayColumns,proto3" json:"display_columns,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *DescribeAppVersionAuditsRequest) Reset() { *m = DescribeAppVersionAuditsRequest{} } -func (m *DescribeAppVersionAuditsRequest) String() string { return proto.CompactTextString(m) } -func (*DescribeAppVersionAuditsRequest) ProtoMessage() {} -func (*DescribeAppVersionAuditsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_e0f9056a14b86d47, []int{23} -} - -func (m *DescribeAppVersionAuditsRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_DescribeAppVersionAuditsRequest.Unmarshal(m, b) -} -func (m *DescribeAppVersionAuditsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_DescribeAppVersionAuditsRequest.Marshal(b, m, deterministic) -} -func (m *DescribeAppVersionAuditsRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_DescribeAppVersionAuditsRequest.Merge(m, src) -} -func (m *DescribeAppVersionAuditsRequest) XXX_Size() int { - return xxx_messageInfo_DescribeAppVersionAuditsRequest.Size(m) -} -func (m *DescribeAppVersionAuditsRequest) XXX_DiscardUnknown() { - xxx_messageInfo_DescribeAppVersionAuditsRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_DescribeAppVersionAuditsRequest proto.InternalMessageInfo - -func (m *DescribeAppVersionAuditsRequest) GetSearchWord() *wrappers.StringValue { - if m != nil { - return m.SearchWord - } - return nil -} - -func (m *DescribeAppVersionAuditsRequest) GetSortKey() *wrappers.StringValue { - if m != nil { - return m.SortKey - } - return nil -} - -func (m *DescribeAppVersionAuditsRequest) GetReverse() *wrappers.BoolValue { - if m != nil { - return m.Reverse - } - return nil -} - -func (m *DescribeAppVersionAuditsRequest) GetLimit() uint32 { - if m != nil { - return m.Limit - } - return 0 -} - -func (m *DescribeAppVersionAuditsRequest) GetOffset() uint32 { - if m != nil { - return m.Offset - } - return 0 -} - -func (m *DescribeAppVersionAuditsRequest) GetAppId() []string { - if m != nil { - return m.AppId - } - return nil -} - -func (m *DescribeAppVersionAuditsRequest) GetVersionId() []string { - if m != nil { - return m.VersionId - } - return nil -} - -func (m *DescribeAppVersionAuditsRequest) GetStatus() []string { - if m != nil { - return m.Status - } - return nil -} - -func (m *DescribeAppVersionAuditsRequest) GetOperator() []string { - if m != nil { - return m.Operator - } - return nil -} - -func (m *DescribeAppVersionAuditsRequest) GetOperatorType() []string { - if m != nil { - return m.OperatorType - } - return nil -} - -func (m *DescribeAppVersionAuditsRequest) GetDisplayColumns() []string { - if m != nil { - return m.DisplayColumns - } - return nil -} - -type DescribeAppVersionAuditsResponse struct { - // total count of audits of app with specific version - TotalCount uint32 `protobuf:"varint,1,opt,name=total_count,json=totalCount,proto3" json:"total_count,omitempty"` - // list of audit - AppVersionAuditSet []*AppVersionAudit `protobuf:"bytes,2,rep,name=app_version_audit_set,json=appVersionAuditSet,proto3" json:"app_version_audit_set,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *DescribeAppVersionAuditsResponse) Reset() { *m = DescribeAppVersionAuditsResponse{} } -func (m *DescribeAppVersionAuditsResponse) String() string { return proto.CompactTextString(m) } -func (*DescribeAppVersionAuditsResponse) ProtoMessage() {} -func (*DescribeAppVersionAuditsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_e0f9056a14b86d47, []int{24} -} - -func (m *DescribeAppVersionAuditsResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_DescribeAppVersionAuditsResponse.Unmarshal(m, b) -} -func (m *DescribeAppVersionAuditsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_DescribeAppVersionAuditsResponse.Marshal(b, m, deterministic) -} -func (m *DescribeAppVersionAuditsResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_DescribeAppVersionAuditsResponse.Merge(m, src) -} -func (m *DescribeAppVersionAuditsResponse) XXX_Size() int { - return xxx_messageInfo_DescribeAppVersionAuditsResponse.Size(m) -} -func (m *DescribeAppVersionAuditsResponse) XXX_DiscardUnknown() { - xxx_messageInfo_DescribeAppVersionAuditsResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_DescribeAppVersionAuditsResponse proto.InternalMessageInfo - -func (m *DescribeAppVersionAuditsResponse) GetTotalCount() uint32 { - if m != nil { - return m.TotalCount - } - return 0 -} - -func (m *DescribeAppVersionAuditsResponse) GetAppVersionAuditSet() []*AppVersionAudit { - if m != nil { - return m.AppVersionAuditSet - } - return nil -} - -type DescribeAppVersionsRequest struct { - // query key, support these fields(version_id, app_id, name, owner, description, package_name, status, type) - SearchWord *wrappers.StringValue `protobuf:"bytes,1,opt,name=search_word,json=searchWord,proto3" json:"search_word,omitempty"` - // sort key, order by sort_key, default create_time - SortKey *wrappers.StringValue `protobuf:"bytes,2,opt,name=sort_key,json=sortKey,proto3" json:"sort_key,omitempty"` - // value = 0 sort ASC, value = 1 sort DESC - Reverse *wrappers.BoolValue `protobuf:"bytes,3,opt,name=reverse,proto3" json:"reverse,omitempty"` - // data limit per page, default value 20, max value 200 - Limit uint32 `protobuf:"varint,4,opt,name=limit,proto3" json:"limit,omitempty"` - // data offset, default 0 - Offset uint32 `protobuf:"varint,5,opt,name=offset,proto3" json:"offset,omitempty"` - // app version ids - VersionId []string `protobuf:"bytes,10,rep,name=version_id,json=versionId,proto3" json:"version_id,omitempty"` - // app ids - AppId []string `protobuf:"bytes,11,rep,name=app_id,json=appId,proto3" json:"app_id,omitempty"` - // app version name - Name []string `protobuf:"bytes,12,rep,name=name,proto3" json:"name,omitempty"` - // owner - Owner []string `protobuf:"bytes,13,rep,name=owner,proto3" json:"owner,omitempty"` - // description - Description []string `protobuf:"bytes,14,rep,name=description,proto3" json:"description,omitempty"` - // app version package name - PackageName []string `protobuf:"bytes,15,rep,name=package_name,json=packageName,proto3" json:"package_name,omitempty"` - // app version status eg.[draft|submitted|passed|rejected|active|in-review|deleted|suspended] - Status []string `protobuf:"bytes,16,rep,name=status,proto3" json:"status,omitempty"` - // app version type - Type []string `protobuf:"bytes,17,rep,name=type,proto3" json:"type,omitempty"` - // select columns to display - DisplayColumns []string `protobuf:"bytes,18,rep,name=display_columns,json=displayColumns,proto3" json:"display_columns,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *DescribeAppVersionsRequest) Reset() { *m = DescribeAppVersionsRequest{} } -func (m *DescribeAppVersionsRequest) String() string { return proto.CompactTextString(m) } -func (*DescribeAppVersionsRequest) ProtoMessage() {} -func (*DescribeAppVersionsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_e0f9056a14b86d47, []int{25} -} - -func (m *DescribeAppVersionsRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_DescribeAppVersionsRequest.Unmarshal(m, b) -} -func (m *DescribeAppVersionsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_DescribeAppVersionsRequest.Marshal(b, m, deterministic) -} -func (m *DescribeAppVersionsRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_DescribeAppVersionsRequest.Merge(m, src) -} -func (m *DescribeAppVersionsRequest) XXX_Size() int { - return xxx_messageInfo_DescribeAppVersionsRequest.Size(m) -} -func (m *DescribeAppVersionsRequest) XXX_DiscardUnknown() { - xxx_messageInfo_DescribeAppVersionsRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_DescribeAppVersionsRequest proto.InternalMessageInfo - -func (m *DescribeAppVersionsRequest) GetSearchWord() *wrappers.StringValue { - if m != nil { - return m.SearchWord - } - return nil -} - -func (m *DescribeAppVersionsRequest) GetSortKey() *wrappers.StringValue { - if m != nil { - return m.SortKey - } - return nil -} - -func (m *DescribeAppVersionsRequest) GetReverse() *wrappers.BoolValue { - if m != nil { - return m.Reverse - } - return nil -} - -func (m *DescribeAppVersionsRequest) GetLimit() uint32 { - if m != nil { - return m.Limit - } - return 0 -} - -func (m *DescribeAppVersionsRequest) GetOffset() uint32 { - if m != nil { - return m.Offset - } - return 0 -} - -func (m *DescribeAppVersionsRequest) GetVersionId() []string { - if m != nil { - return m.VersionId - } - return nil -} - -func (m *DescribeAppVersionsRequest) GetAppId() []string { - if m != nil { - return m.AppId - } - return nil -} - -func (m *DescribeAppVersionsRequest) GetName() []string { - if m != nil { - return m.Name - } - return nil -} - -func (m *DescribeAppVersionsRequest) GetOwner() []string { - if m != nil { - return m.Owner - } - return nil -} - -func (m *DescribeAppVersionsRequest) GetDescription() []string { - if m != nil { - return m.Description - } - return nil -} - -func (m *DescribeAppVersionsRequest) GetPackageName() []string { - if m != nil { - return m.PackageName - } - return nil -} - -func (m *DescribeAppVersionsRequest) GetStatus() []string { - if m != nil { - return m.Status - } - return nil -} - -func (m *DescribeAppVersionsRequest) GetType() []string { - if m != nil { - return m.Type - } - return nil -} - -func (m *DescribeAppVersionsRequest) GetDisplayColumns() []string { - if m != nil { - return m.DisplayColumns - } - return nil -} - -type DescribeAppVersionsResponse struct { - // total count of qualified app version - TotalCount uint32 `protobuf:"varint,1,opt,name=total_count,json=totalCount,proto3" json:"total_count,omitempty"` - // list of app vaesion - AppVersionSet []*AppVersion `protobuf:"bytes,2,rep,name=app_version_set,json=appVersionSet,proto3" json:"app_version_set,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *DescribeAppVersionsResponse) Reset() { *m = DescribeAppVersionsResponse{} } -func (m *DescribeAppVersionsResponse) String() string { return proto.CompactTextString(m) } -func (*DescribeAppVersionsResponse) ProtoMessage() {} -func (*DescribeAppVersionsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_e0f9056a14b86d47, []int{26} -} - -func (m *DescribeAppVersionsResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_DescribeAppVersionsResponse.Unmarshal(m, b) -} -func (m *DescribeAppVersionsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_DescribeAppVersionsResponse.Marshal(b, m, deterministic) -} -func (m *DescribeAppVersionsResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_DescribeAppVersionsResponse.Merge(m, src) -} -func (m *DescribeAppVersionsResponse) XXX_Size() int { - return xxx_messageInfo_DescribeAppVersionsResponse.Size(m) -} -func (m *DescribeAppVersionsResponse) XXX_DiscardUnknown() { - xxx_messageInfo_DescribeAppVersionsResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_DescribeAppVersionsResponse proto.InternalMessageInfo - -func (m *DescribeAppVersionsResponse) GetTotalCount() uint32 { - if m != nil { - return m.TotalCount - } - return 0 -} - -func (m *DescribeAppVersionsResponse) GetAppVersionSet() []*AppVersion { - if m != nil { - return m.AppVersionSet - } - return nil -} - -type GetAppVersionPackageRequest struct { - // required, use version id to get package - VersionId *wrappers.StringValue `protobuf:"bytes,1,opt,name=version_id,json=versionId,proto3" json:"version_id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *GetAppVersionPackageRequest) Reset() { *m = GetAppVersionPackageRequest{} } -func (m *GetAppVersionPackageRequest) String() string { return proto.CompactTextString(m) } -func (*GetAppVersionPackageRequest) ProtoMessage() {} -func (*GetAppVersionPackageRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_e0f9056a14b86d47, []int{27} -} - -func (m *GetAppVersionPackageRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_GetAppVersionPackageRequest.Unmarshal(m, b) -} -func (m *GetAppVersionPackageRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_GetAppVersionPackageRequest.Marshal(b, m, deterministic) -} -func (m *GetAppVersionPackageRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetAppVersionPackageRequest.Merge(m, src) -} -func (m *GetAppVersionPackageRequest) XXX_Size() int { - return xxx_messageInfo_GetAppVersionPackageRequest.Size(m) -} -func (m *GetAppVersionPackageRequest) XXX_DiscardUnknown() { - xxx_messageInfo_GetAppVersionPackageRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_GetAppVersionPackageRequest proto.InternalMessageInfo - -func (m *GetAppVersionPackageRequest) GetVersionId() *wrappers.StringValue { - if m != nil { - return m.VersionId - } - return nil -} - -type GetAppVersionPackageResponse struct { - // package of specific app version - Package []byte `protobuf:"bytes,1,opt,name=package,proto3" json:"package,omitempty"` - // app id of package - AppId *wrappers.StringValue `protobuf:"bytes,2,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty"` - // version id of package - VersionId *wrappers.StringValue `protobuf:"bytes,3,opt,name=version_id,json=versionId,proto3" json:"version_id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *GetAppVersionPackageResponse) Reset() { *m = GetAppVersionPackageResponse{} } -func (m *GetAppVersionPackageResponse) String() string { return proto.CompactTextString(m) } -func (*GetAppVersionPackageResponse) ProtoMessage() {} -func (*GetAppVersionPackageResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_e0f9056a14b86d47, []int{28} -} - -func (m *GetAppVersionPackageResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_GetAppVersionPackageResponse.Unmarshal(m, b) -} -func (m *GetAppVersionPackageResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_GetAppVersionPackageResponse.Marshal(b, m, deterministic) -} -func (m *GetAppVersionPackageResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetAppVersionPackageResponse.Merge(m, src) -} -func (m *GetAppVersionPackageResponse) XXX_Size() int { - return xxx_messageInfo_GetAppVersionPackageResponse.Size(m) -} -func (m *GetAppVersionPackageResponse) XXX_DiscardUnknown() { - xxx_messageInfo_GetAppVersionPackageResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_GetAppVersionPackageResponse proto.InternalMessageInfo - -func (m *GetAppVersionPackageResponse) GetPackage() []byte { - if m != nil { - return m.Package - } - return nil -} - -func (m *GetAppVersionPackageResponse) GetAppId() *wrappers.StringValue { - if m != nil { - return m.AppId - } - return nil -} - -func (m *GetAppVersionPackageResponse) GetVersionId() *wrappers.StringValue { - if m != nil { - return m.VersionId - } - return nil -} - -type GetAppVersionPackageFilesRequest struct { - // use version id to get file of package - VersionId *wrappers.StringValue `protobuf:"bytes,1,opt,name=version_id,json=versionId,proto3" json:"version_id,omitempty"` - // files - Files []string `protobuf:"bytes,2,rep,name=files,proto3" json:"files,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *GetAppVersionPackageFilesRequest) Reset() { *m = GetAppVersionPackageFilesRequest{} } -func (m *GetAppVersionPackageFilesRequest) String() string { return proto.CompactTextString(m) } -func (*GetAppVersionPackageFilesRequest) ProtoMessage() {} -func (*GetAppVersionPackageFilesRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_e0f9056a14b86d47, []int{29} -} - -func (m *GetAppVersionPackageFilesRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_GetAppVersionPackageFilesRequest.Unmarshal(m, b) -} -func (m *GetAppVersionPackageFilesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_GetAppVersionPackageFilesRequest.Marshal(b, m, deterministic) -} -func (m *GetAppVersionPackageFilesRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetAppVersionPackageFilesRequest.Merge(m, src) -} -func (m *GetAppVersionPackageFilesRequest) XXX_Size() int { - return xxx_messageInfo_GetAppVersionPackageFilesRequest.Size(m) -} -func (m *GetAppVersionPackageFilesRequest) XXX_DiscardUnknown() { - xxx_messageInfo_GetAppVersionPackageFilesRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_GetAppVersionPackageFilesRequest proto.InternalMessageInfo - -func (m *GetAppVersionPackageFilesRequest) GetVersionId() *wrappers.StringValue { - if m != nil { - return m.VersionId - } - return nil -} - -func (m *GetAppVersionPackageFilesRequest) GetFiles() []string { - if m != nil { - return m.Files - } - return nil -} - -type GetAppVersionPackageFilesResponse struct { - // filename map to content - Files map[string][]byte `protobuf:"bytes,1,rep,name=files,proto3" json:"files,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - // version id - VersionId *wrappers.StringValue `protobuf:"bytes,2,opt,name=version_id,json=versionId,proto3" json:"version_id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *GetAppVersionPackageFilesResponse) Reset() { *m = GetAppVersionPackageFilesResponse{} } -func (m *GetAppVersionPackageFilesResponse) String() string { return proto.CompactTextString(m) } -func (*GetAppVersionPackageFilesResponse) ProtoMessage() {} -func (*GetAppVersionPackageFilesResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_e0f9056a14b86d47, []int{30} -} - -func (m *GetAppVersionPackageFilesResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_GetAppVersionPackageFilesResponse.Unmarshal(m, b) -} -func (m *GetAppVersionPackageFilesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_GetAppVersionPackageFilesResponse.Marshal(b, m, deterministic) -} -func (m *GetAppVersionPackageFilesResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetAppVersionPackageFilesResponse.Merge(m, src) -} -func (m *GetAppVersionPackageFilesResponse) XXX_Size() int { - return xxx_messageInfo_GetAppVersionPackageFilesResponse.Size(m) -} -func (m *GetAppVersionPackageFilesResponse) XXX_DiscardUnknown() { - xxx_messageInfo_GetAppVersionPackageFilesResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_GetAppVersionPackageFilesResponse proto.InternalMessageInfo - -func (m *GetAppVersionPackageFilesResponse) GetFiles() map[string][]byte { - if m != nil { - return m.Files - } - return nil -} - -func (m *GetAppVersionPackageFilesResponse) GetVersionId() *wrappers.StringValue { - if m != nil { - return m.VersionId - } - return nil -} - -type GetAppStatisticsRequest struct { - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *GetAppStatisticsRequest) Reset() { *m = GetAppStatisticsRequest{} } -func (m *GetAppStatisticsRequest) String() string { return proto.CompactTextString(m) } -func (*GetAppStatisticsRequest) ProtoMessage() {} -func (*GetAppStatisticsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_e0f9056a14b86d47, []int{31} -} - -func (m *GetAppStatisticsRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_GetAppStatisticsRequest.Unmarshal(m, b) -} -func (m *GetAppStatisticsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_GetAppStatisticsRequest.Marshal(b, m, deterministic) -} -func (m *GetAppStatisticsRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetAppStatisticsRequest.Merge(m, src) -} -func (m *GetAppStatisticsRequest) XXX_Size() int { - return xxx_messageInfo_GetAppStatisticsRequest.Size(m) -} -func (m *GetAppStatisticsRequest) XXX_DiscardUnknown() { - xxx_messageInfo_GetAppStatisticsRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_GetAppStatisticsRequest proto.InternalMessageInfo - -type GetAppStatisticsResponse struct { - // range of app created time map to app count, max length is 14 - LastTwoWeekCreated map[string]uint32 `protobuf:"bytes,1,rep,name=last_two_week_created,json=lastTwoWeekCreated,proto3" json:"last_two_week_created,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` - // repo id map to app count, max length is 10 - TopTenRepos map[string]uint32 `protobuf:"bytes,2,rep,name=top_ten_repos,json=topTenRepos,proto3" json:"top_ten_repos,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` - // total app count - AppCount uint32 `protobuf:"varint,3,opt,name=app_count,json=appCount,proto3" json:"app_count,omitempty"` - // total repository count - RepoCount uint32 `protobuf:"varint,4,opt,name=repo_count,json=repoCount,proto3" json:"repo_count,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *GetAppStatisticsResponse) Reset() { *m = GetAppStatisticsResponse{} } -func (m *GetAppStatisticsResponse) String() string { return proto.CompactTextString(m) } -func (*GetAppStatisticsResponse) ProtoMessage() {} -func (*GetAppStatisticsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_e0f9056a14b86d47, []int{32} -} - -func (m *GetAppStatisticsResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_GetAppStatisticsResponse.Unmarshal(m, b) -} -func (m *GetAppStatisticsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_GetAppStatisticsResponse.Marshal(b, m, deterministic) -} -func (m *GetAppStatisticsResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetAppStatisticsResponse.Merge(m, src) -} -func (m *GetAppStatisticsResponse) XXX_Size() int { - return xxx_messageInfo_GetAppStatisticsResponse.Size(m) -} -func (m *GetAppStatisticsResponse) XXX_DiscardUnknown() { - xxx_messageInfo_GetAppStatisticsResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_GetAppStatisticsResponse proto.InternalMessageInfo - -func (m *GetAppStatisticsResponse) GetLastTwoWeekCreated() map[string]uint32 { - if m != nil { - return m.LastTwoWeekCreated - } - return nil -} - -func (m *GetAppStatisticsResponse) GetTopTenRepos() map[string]uint32 { - if m != nil { - return m.TopTenRepos - } - return nil -} - -func (m *GetAppStatisticsResponse) GetAppCount() uint32 { - if m != nil { - return m.AppCount - } - return 0 -} - -func (m *GetAppStatisticsResponse) GetRepoCount() uint32 { - if m != nil { - return m.RepoCount - } - return 0 -} - -type SubmitAppVersionRequest struct { - // required, id of version to submit - VersionId *wrappers.StringValue `protobuf:"bytes,1,opt,name=version_id,json=versionId,proto3" json:"version_id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *SubmitAppVersionRequest) Reset() { *m = SubmitAppVersionRequest{} } -func (m *SubmitAppVersionRequest) String() string { return proto.CompactTextString(m) } -func (*SubmitAppVersionRequest) ProtoMessage() {} -func (*SubmitAppVersionRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_e0f9056a14b86d47, []int{33} -} - -func (m *SubmitAppVersionRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_SubmitAppVersionRequest.Unmarshal(m, b) -} -func (m *SubmitAppVersionRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_SubmitAppVersionRequest.Marshal(b, m, deterministic) -} -func (m *SubmitAppVersionRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_SubmitAppVersionRequest.Merge(m, src) -} -func (m *SubmitAppVersionRequest) XXX_Size() int { - return xxx_messageInfo_SubmitAppVersionRequest.Size(m) -} -func (m *SubmitAppVersionRequest) XXX_DiscardUnknown() { - xxx_messageInfo_SubmitAppVersionRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_SubmitAppVersionRequest proto.InternalMessageInfo - -func (m *SubmitAppVersionRequest) GetVersionId() *wrappers.StringValue { - if m != nil { - return m.VersionId - } - return nil -} - -type SubmitAppVersionResponse struct { - // required, id of version submitted - VersionId *wrappers.StringValue `protobuf:"bytes,1,opt,name=version_id,json=versionId,proto3" json:"version_id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *SubmitAppVersionResponse) Reset() { *m = SubmitAppVersionResponse{} } -func (m *SubmitAppVersionResponse) String() string { return proto.CompactTextString(m) } -func (*SubmitAppVersionResponse) ProtoMessage() {} -func (*SubmitAppVersionResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_e0f9056a14b86d47, []int{34} -} - -func (m *SubmitAppVersionResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_SubmitAppVersionResponse.Unmarshal(m, b) -} -func (m *SubmitAppVersionResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_SubmitAppVersionResponse.Marshal(b, m, deterministic) -} -func (m *SubmitAppVersionResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_SubmitAppVersionResponse.Merge(m, src) -} -func (m *SubmitAppVersionResponse) XXX_Size() int { - return xxx_messageInfo_SubmitAppVersionResponse.Size(m) -} -func (m *SubmitAppVersionResponse) XXX_DiscardUnknown() { - xxx_messageInfo_SubmitAppVersionResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_SubmitAppVersionResponse proto.InternalMessageInfo - -func (m *SubmitAppVersionResponse) GetVersionId() *wrappers.StringValue { - if m != nil { - return m.VersionId - } - return nil -} - -type CancelAppVersionRequest struct { - // required, id of version to cancel - VersionId *wrappers.StringValue `protobuf:"bytes,1,opt,name=version_id,json=versionId,proto3" json:"version_id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *CancelAppVersionRequest) Reset() { *m = CancelAppVersionRequest{} } -func (m *CancelAppVersionRequest) String() string { return proto.CompactTextString(m) } -func (*CancelAppVersionRequest) ProtoMessage() {} -func (*CancelAppVersionRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_e0f9056a14b86d47, []int{35} -} - -func (m *CancelAppVersionRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_CancelAppVersionRequest.Unmarshal(m, b) -} -func (m *CancelAppVersionRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_CancelAppVersionRequest.Marshal(b, m, deterministic) -} -func (m *CancelAppVersionRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_CancelAppVersionRequest.Merge(m, src) -} -func (m *CancelAppVersionRequest) XXX_Size() int { - return xxx_messageInfo_CancelAppVersionRequest.Size(m) -} -func (m *CancelAppVersionRequest) XXX_DiscardUnknown() { - xxx_messageInfo_CancelAppVersionRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_CancelAppVersionRequest proto.InternalMessageInfo - -func (m *CancelAppVersionRequest) GetVersionId() *wrappers.StringValue { - if m != nil { - return m.VersionId - } - return nil -} - -type CancelAppVersionResponse struct { - // required, id of version canceled - VersionId *wrappers.StringValue `protobuf:"bytes,1,opt,name=version_id,json=versionId,proto3" json:"version_id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *CancelAppVersionResponse) Reset() { *m = CancelAppVersionResponse{} } -func (m *CancelAppVersionResponse) String() string { return proto.CompactTextString(m) } -func (*CancelAppVersionResponse) ProtoMessage() {} -func (*CancelAppVersionResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_e0f9056a14b86d47, []int{36} -} - -func (m *CancelAppVersionResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_CancelAppVersionResponse.Unmarshal(m, b) -} -func (m *CancelAppVersionResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_CancelAppVersionResponse.Marshal(b, m, deterministic) -} -func (m *CancelAppVersionResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_CancelAppVersionResponse.Merge(m, src) -} -func (m *CancelAppVersionResponse) XXX_Size() int { - return xxx_messageInfo_CancelAppVersionResponse.Size(m) -} -func (m *CancelAppVersionResponse) XXX_DiscardUnknown() { - xxx_messageInfo_CancelAppVersionResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_CancelAppVersionResponse proto.InternalMessageInfo - -func (m *CancelAppVersionResponse) GetVersionId() *wrappers.StringValue { - if m != nil { - return m.VersionId - } - return nil -} - -type ReleaseAppVersionRequest struct { - // required, id of version to release - VersionId *wrappers.StringValue `protobuf:"bytes,1,opt,name=version_id,json=versionId,proto3" json:"version_id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ReleaseAppVersionRequest) Reset() { *m = ReleaseAppVersionRequest{} } -func (m *ReleaseAppVersionRequest) String() string { return proto.CompactTextString(m) } -func (*ReleaseAppVersionRequest) ProtoMessage() {} -func (*ReleaseAppVersionRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_e0f9056a14b86d47, []int{37} -} - -func (m *ReleaseAppVersionRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ReleaseAppVersionRequest.Unmarshal(m, b) -} -func (m *ReleaseAppVersionRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ReleaseAppVersionRequest.Marshal(b, m, deterministic) -} -func (m *ReleaseAppVersionRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_ReleaseAppVersionRequest.Merge(m, src) -} -func (m *ReleaseAppVersionRequest) XXX_Size() int { - return xxx_messageInfo_ReleaseAppVersionRequest.Size(m) -} -func (m *ReleaseAppVersionRequest) XXX_DiscardUnknown() { - xxx_messageInfo_ReleaseAppVersionRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_ReleaseAppVersionRequest proto.InternalMessageInfo - -func (m *ReleaseAppVersionRequest) GetVersionId() *wrappers.StringValue { - if m != nil { - return m.VersionId - } - return nil -} - -type ReleaseAppVersionResponse struct { - // required, id of version released - VersionId *wrappers.StringValue `protobuf:"bytes,1,opt,name=version_id,json=versionId,proto3" json:"version_id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ReleaseAppVersionResponse) Reset() { *m = ReleaseAppVersionResponse{} } -func (m *ReleaseAppVersionResponse) String() string { return proto.CompactTextString(m) } -func (*ReleaseAppVersionResponse) ProtoMessage() {} -func (*ReleaseAppVersionResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_e0f9056a14b86d47, []int{38} -} - -func (m *ReleaseAppVersionResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ReleaseAppVersionResponse.Unmarshal(m, b) -} -func (m *ReleaseAppVersionResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ReleaseAppVersionResponse.Marshal(b, m, deterministic) -} -func (m *ReleaseAppVersionResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_ReleaseAppVersionResponse.Merge(m, src) -} -func (m *ReleaseAppVersionResponse) XXX_Size() int { - return xxx_messageInfo_ReleaseAppVersionResponse.Size(m) -} -func (m *ReleaseAppVersionResponse) XXX_DiscardUnknown() { - xxx_messageInfo_ReleaseAppVersionResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_ReleaseAppVersionResponse proto.InternalMessageInfo - -func (m *ReleaseAppVersionResponse) GetVersionId() *wrappers.StringValue { - if m != nil { - return m.VersionId - } - return nil -} - -type DeleteAppVersionRequest struct { - // required, id of version to delete - VersionId *wrappers.StringValue `protobuf:"bytes,1,opt,name=version_id,json=versionId,proto3" json:"version_id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *DeleteAppVersionRequest) Reset() { *m = DeleteAppVersionRequest{} } -func (m *DeleteAppVersionRequest) String() string { return proto.CompactTextString(m) } -func (*DeleteAppVersionRequest) ProtoMessage() {} -func (*DeleteAppVersionRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_e0f9056a14b86d47, []int{39} -} - -func (m *DeleteAppVersionRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_DeleteAppVersionRequest.Unmarshal(m, b) -} -func (m *DeleteAppVersionRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_DeleteAppVersionRequest.Marshal(b, m, deterministic) -} -func (m *DeleteAppVersionRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_DeleteAppVersionRequest.Merge(m, src) -} -func (m *DeleteAppVersionRequest) XXX_Size() int { - return xxx_messageInfo_DeleteAppVersionRequest.Size(m) -} -func (m *DeleteAppVersionRequest) XXX_DiscardUnknown() { - xxx_messageInfo_DeleteAppVersionRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_DeleteAppVersionRequest proto.InternalMessageInfo - -func (m *DeleteAppVersionRequest) GetVersionId() *wrappers.StringValue { - if m != nil { - return m.VersionId - } - return nil -} - -type DeleteAppVersionResponse struct { - // required, id of version deleted - VersionId *wrappers.StringValue `protobuf:"bytes,1,opt,name=version_id,json=versionId,proto3" json:"version_id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *DeleteAppVersionResponse) Reset() { *m = DeleteAppVersionResponse{} } -func (m *DeleteAppVersionResponse) String() string { return proto.CompactTextString(m) } -func (*DeleteAppVersionResponse) ProtoMessage() {} -func (*DeleteAppVersionResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_e0f9056a14b86d47, []int{40} -} - -func (m *DeleteAppVersionResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_DeleteAppVersionResponse.Unmarshal(m, b) -} -func (m *DeleteAppVersionResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_DeleteAppVersionResponse.Marshal(b, m, deterministic) -} -func (m *DeleteAppVersionResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_DeleteAppVersionResponse.Merge(m, src) -} -func (m *DeleteAppVersionResponse) XXX_Size() int { - return xxx_messageInfo_DeleteAppVersionResponse.Size(m) -} -func (m *DeleteAppVersionResponse) XXX_DiscardUnknown() { - xxx_messageInfo_DeleteAppVersionResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_DeleteAppVersionResponse proto.InternalMessageInfo - -func (m *DeleteAppVersionResponse) GetVersionId() *wrappers.StringValue { - if m != nil { - return m.VersionId - } - return nil -} - -type ReviewAppVersionRequest struct { - // required, id of version to review - VersionId *wrappers.StringValue `protobuf:"bytes,1,opt,name=version_id,json=versionId,proto3" json:"version_id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ReviewAppVersionRequest) Reset() { *m = ReviewAppVersionRequest{} } -func (m *ReviewAppVersionRequest) String() string { return proto.CompactTextString(m) } -func (*ReviewAppVersionRequest) ProtoMessage() {} -func (*ReviewAppVersionRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_e0f9056a14b86d47, []int{41} -} - -func (m *ReviewAppVersionRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ReviewAppVersionRequest.Unmarshal(m, b) -} -func (m *ReviewAppVersionRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ReviewAppVersionRequest.Marshal(b, m, deterministic) -} -func (m *ReviewAppVersionRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_ReviewAppVersionRequest.Merge(m, src) -} -func (m *ReviewAppVersionRequest) XXX_Size() int { - return xxx_messageInfo_ReviewAppVersionRequest.Size(m) -} -func (m *ReviewAppVersionRequest) XXX_DiscardUnknown() { - xxx_messageInfo_ReviewAppVersionRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_ReviewAppVersionRequest proto.InternalMessageInfo - -func (m *ReviewAppVersionRequest) GetVersionId() *wrappers.StringValue { - if m != nil { - return m.VersionId - } - return nil -} - -type ReviewAppVersionResponse struct { - // id of version reviewed - VersionId *wrappers.StringValue `protobuf:"bytes,1,opt,name=version_id,json=versionId,proto3" json:"version_id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ReviewAppVersionResponse) Reset() { *m = ReviewAppVersionResponse{} } -func (m *ReviewAppVersionResponse) String() string { return proto.CompactTextString(m) } -func (*ReviewAppVersionResponse) ProtoMessage() {} -func (*ReviewAppVersionResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_e0f9056a14b86d47, []int{42} -} - -func (m *ReviewAppVersionResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ReviewAppVersionResponse.Unmarshal(m, b) -} -func (m *ReviewAppVersionResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ReviewAppVersionResponse.Marshal(b, m, deterministic) -} -func (m *ReviewAppVersionResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_ReviewAppVersionResponse.Merge(m, src) -} -func (m *ReviewAppVersionResponse) XXX_Size() int { - return xxx_messageInfo_ReviewAppVersionResponse.Size(m) -} -func (m *ReviewAppVersionResponse) XXX_DiscardUnknown() { - xxx_messageInfo_ReviewAppVersionResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_ReviewAppVersionResponse proto.InternalMessageInfo - -func (m *ReviewAppVersionResponse) GetVersionId() *wrappers.StringValue { - if m != nil { - return m.VersionId - } - return nil -} - -type PassAppVersionRequest struct { - // required, id of version to pass - VersionId *wrappers.StringValue `protobuf:"bytes,1,opt,name=version_id,json=versionId,proto3" json:"version_id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *PassAppVersionRequest) Reset() { *m = PassAppVersionRequest{} } -func (m *PassAppVersionRequest) String() string { return proto.CompactTextString(m) } -func (*PassAppVersionRequest) ProtoMessage() {} -func (*PassAppVersionRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_e0f9056a14b86d47, []int{43} -} - -func (m *PassAppVersionRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_PassAppVersionRequest.Unmarshal(m, b) -} -func (m *PassAppVersionRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_PassAppVersionRequest.Marshal(b, m, deterministic) -} -func (m *PassAppVersionRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_PassAppVersionRequest.Merge(m, src) -} -func (m *PassAppVersionRequest) XXX_Size() int { - return xxx_messageInfo_PassAppVersionRequest.Size(m) -} -func (m *PassAppVersionRequest) XXX_DiscardUnknown() { - xxx_messageInfo_PassAppVersionRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_PassAppVersionRequest proto.InternalMessageInfo - -func (m *PassAppVersionRequest) GetVersionId() *wrappers.StringValue { - if m != nil { - return m.VersionId - } - return nil -} - -type PassAppVersionResponse struct { - // id of version passed - VersionId *wrappers.StringValue `protobuf:"bytes,1,opt,name=version_id,json=versionId,proto3" json:"version_id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *PassAppVersionResponse) Reset() { *m = PassAppVersionResponse{} } -func (m *PassAppVersionResponse) String() string { return proto.CompactTextString(m) } -func (*PassAppVersionResponse) ProtoMessage() {} -func (*PassAppVersionResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_e0f9056a14b86d47, []int{44} -} - -func (m *PassAppVersionResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_PassAppVersionResponse.Unmarshal(m, b) -} -func (m *PassAppVersionResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_PassAppVersionResponse.Marshal(b, m, deterministic) -} -func (m *PassAppVersionResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_PassAppVersionResponse.Merge(m, src) -} -func (m *PassAppVersionResponse) XXX_Size() int { - return xxx_messageInfo_PassAppVersionResponse.Size(m) -} -func (m *PassAppVersionResponse) XXX_DiscardUnknown() { - xxx_messageInfo_PassAppVersionResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_PassAppVersionResponse proto.InternalMessageInfo - -func (m *PassAppVersionResponse) GetVersionId() *wrappers.StringValue { - if m != nil { - return m.VersionId - } - return nil -} - -type RejectAppVersionRequest struct { - // required, id of version to reject - VersionId *wrappers.StringValue `protobuf:"bytes,1,opt,name=version_id,json=versionId,proto3" json:"version_id,omitempty"` - // reject message - Message *wrappers.StringValue `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *RejectAppVersionRequest) Reset() { *m = RejectAppVersionRequest{} } -func (m *RejectAppVersionRequest) String() string { return proto.CompactTextString(m) } -func (*RejectAppVersionRequest) ProtoMessage() {} -func (*RejectAppVersionRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_e0f9056a14b86d47, []int{45} -} - -func (m *RejectAppVersionRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_RejectAppVersionRequest.Unmarshal(m, b) -} -func (m *RejectAppVersionRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_RejectAppVersionRequest.Marshal(b, m, deterministic) -} -func (m *RejectAppVersionRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_RejectAppVersionRequest.Merge(m, src) -} -func (m *RejectAppVersionRequest) XXX_Size() int { - return xxx_messageInfo_RejectAppVersionRequest.Size(m) -} -func (m *RejectAppVersionRequest) XXX_DiscardUnknown() { - xxx_messageInfo_RejectAppVersionRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_RejectAppVersionRequest proto.InternalMessageInfo - -func (m *RejectAppVersionRequest) GetVersionId() *wrappers.StringValue { - if m != nil { - return m.VersionId - } - return nil -} - -func (m *RejectAppVersionRequest) GetMessage() *wrappers.StringValue { - if m != nil { - return m.Message - } - return nil -} - -type RejectAppVersionResponse struct { - // id of version rejected - VersionId *wrappers.StringValue `protobuf:"bytes,1,opt,name=version_id,json=versionId,proto3" json:"version_id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *RejectAppVersionResponse) Reset() { *m = RejectAppVersionResponse{} } -func (m *RejectAppVersionResponse) String() string { return proto.CompactTextString(m) } -func (*RejectAppVersionResponse) ProtoMessage() {} -func (*RejectAppVersionResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_e0f9056a14b86d47, []int{46} -} - -func (m *RejectAppVersionResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_RejectAppVersionResponse.Unmarshal(m, b) -} -func (m *RejectAppVersionResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_RejectAppVersionResponse.Marshal(b, m, deterministic) -} -func (m *RejectAppVersionResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_RejectAppVersionResponse.Merge(m, src) -} -func (m *RejectAppVersionResponse) XXX_Size() int { - return xxx_messageInfo_RejectAppVersionResponse.Size(m) -} -func (m *RejectAppVersionResponse) XXX_DiscardUnknown() { - xxx_messageInfo_RejectAppVersionResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_RejectAppVersionResponse proto.InternalMessageInfo - -func (m *RejectAppVersionResponse) GetVersionId() *wrappers.StringValue { - if m != nil { - return m.VersionId - } - return nil -} - -type SuspendAppVersionRequest struct { - // required, id of version to suspend - VersionId *wrappers.StringValue `protobuf:"bytes,1,opt,name=version_id,json=versionId,proto3" json:"version_id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *SuspendAppVersionRequest) Reset() { *m = SuspendAppVersionRequest{} } -func (m *SuspendAppVersionRequest) String() string { return proto.CompactTextString(m) } -func (*SuspendAppVersionRequest) ProtoMessage() {} -func (*SuspendAppVersionRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_e0f9056a14b86d47, []int{47} -} - -func (m *SuspendAppVersionRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_SuspendAppVersionRequest.Unmarshal(m, b) -} -func (m *SuspendAppVersionRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_SuspendAppVersionRequest.Marshal(b, m, deterministic) -} -func (m *SuspendAppVersionRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_SuspendAppVersionRequest.Merge(m, src) -} -func (m *SuspendAppVersionRequest) XXX_Size() int { - return xxx_messageInfo_SuspendAppVersionRequest.Size(m) -} -func (m *SuspendAppVersionRequest) XXX_DiscardUnknown() { - xxx_messageInfo_SuspendAppVersionRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_SuspendAppVersionRequest proto.InternalMessageInfo - -func (m *SuspendAppVersionRequest) GetVersionId() *wrappers.StringValue { - if m != nil { - return m.VersionId - } - return nil -} - -type SuspendAppVersionResponse struct { - // id of version suspended - VersionId *wrappers.StringValue `protobuf:"bytes,1,opt,name=version_id,json=versionId,proto3" json:"version_id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *SuspendAppVersionResponse) Reset() { *m = SuspendAppVersionResponse{} } -func (m *SuspendAppVersionResponse) String() string { return proto.CompactTextString(m) } -func (*SuspendAppVersionResponse) ProtoMessage() {} -func (*SuspendAppVersionResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_e0f9056a14b86d47, []int{48} -} - -func (m *SuspendAppVersionResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_SuspendAppVersionResponse.Unmarshal(m, b) -} -func (m *SuspendAppVersionResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_SuspendAppVersionResponse.Marshal(b, m, deterministic) -} -func (m *SuspendAppVersionResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_SuspendAppVersionResponse.Merge(m, src) -} -func (m *SuspendAppVersionResponse) XXX_Size() int { - return xxx_messageInfo_SuspendAppVersionResponse.Size(m) -} -func (m *SuspendAppVersionResponse) XXX_DiscardUnknown() { - xxx_messageInfo_SuspendAppVersionResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_SuspendAppVersionResponse proto.InternalMessageInfo - -func (m *SuspendAppVersionResponse) GetVersionId() *wrappers.StringValue { - if m != nil { - return m.VersionId - } - return nil -} - -type RecoverAppVersionRequest struct { - // required, id of version to recover - VersionId *wrappers.StringValue `protobuf:"bytes,1,opt,name=version_id,json=versionId,proto3" json:"version_id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *RecoverAppVersionRequest) Reset() { *m = RecoverAppVersionRequest{} } -func (m *RecoverAppVersionRequest) String() string { return proto.CompactTextString(m) } -func (*RecoverAppVersionRequest) ProtoMessage() {} -func (*RecoverAppVersionRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_e0f9056a14b86d47, []int{49} -} - -func (m *RecoverAppVersionRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_RecoverAppVersionRequest.Unmarshal(m, b) -} -func (m *RecoverAppVersionRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_RecoverAppVersionRequest.Marshal(b, m, deterministic) -} -func (m *RecoverAppVersionRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_RecoverAppVersionRequest.Merge(m, src) -} -func (m *RecoverAppVersionRequest) XXX_Size() int { - return xxx_messageInfo_RecoverAppVersionRequest.Size(m) -} -func (m *RecoverAppVersionRequest) XXX_DiscardUnknown() { - xxx_messageInfo_RecoverAppVersionRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_RecoverAppVersionRequest proto.InternalMessageInfo - -func (m *RecoverAppVersionRequest) GetVersionId() *wrappers.StringValue { - if m != nil { - return m.VersionId - } - return nil -} - -type RecoverAppVersionResponse struct { - // id of version recovered - VersionId *wrappers.StringValue `protobuf:"bytes,1,opt,name=version_id,json=versionId,proto3" json:"version_id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *RecoverAppVersionResponse) Reset() { *m = RecoverAppVersionResponse{} } -func (m *RecoverAppVersionResponse) String() string { return proto.CompactTextString(m) } -func (*RecoverAppVersionResponse) ProtoMessage() {} -func (*RecoverAppVersionResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_e0f9056a14b86d47, []int{50} -} - -func (m *RecoverAppVersionResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_RecoverAppVersionResponse.Unmarshal(m, b) -} -func (m *RecoverAppVersionResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_RecoverAppVersionResponse.Marshal(b, m, deterministic) -} -func (m *RecoverAppVersionResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_RecoverAppVersionResponse.Merge(m, src) -} -func (m *RecoverAppVersionResponse) XXX_Size() int { - return xxx_messageInfo_RecoverAppVersionResponse.Size(m) -} -func (m *RecoverAppVersionResponse) XXX_DiscardUnknown() { - xxx_messageInfo_RecoverAppVersionResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_RecoverAppVersionResponse proto.InternalMessageInfo - -func (m *RecoverAppVersionResponse) GetVersionId() *wrappers.StringValue { - if m != nil { - return m.VersionId - } - return nil -} - -type SyncRepoRequest struct { - // required, id of repository to synchronize - RepoId string `protobuf:"bytes,1,opt,name=repo_id,json=repoId,proto3" json:"repo_id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *SyncRepoRequest) Reset() { *m = SyncRepoRequest{} } -func (m *SyncRepoRequest) String() string { return proto.CompactTextString(m) } -func (*SyncRepoRequest) ProtoMessage() {} -func (*SyncRepoRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_e0f9056a14b86d47, []int{51} -} - -func (m *SyncRepoRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_SyncRepoRequest.Unmarshal(m, b) -} -func (m *SyncRepoRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_SyncRepoRequest.Marshal(b, m, deterministic) -} -func (m *SyncRepoRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_SyncRepoRequest.Merge(m, src) -} -func (m *SyncRepoRequest) XXX_Size() int { - return xxx_messageInfo_SyncRepoRequest.Size(m) -} -func (m *SyncRepoRequest) XXX_DiscardUnknown() { - xxx_messageInfo_SyncRepoRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_SyncRepoRequest proto.InternalMessageInfo - -func (m *SyncRepoRequest) GetRepoId() string { - if m != nil { - return m.RepoId - } - return "" -} - -type SyncRepoResponse struct { - // synchronized ok or not - Failed bool `protobuf:"varint,1,opt,name=failed,proto3" json:"failed,omitempty"` - // result - Result string `protobuf:"bytes,2,opt,name=result,proto3" json:"result,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *SyncRepoResponse) Reset() { *m = SyncRepoResponse{} } -func (m *SyncRepoResponse) String() string { return proto.CompactTextString(m) } -func (*SyncRepoResponse) ProtoMessage() {} -func (*SyncRepoResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_e0f9056a14b86d47, []int{52} -} - -func (m *SyncRepoResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_SyncRepoResponse.Unmarshal(m, b) -} -func (m *SyncRepoResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_SyncRepoResponse.Marshal(b, m, deterministic) -} -func (m *SyncRepoResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_SyncRepoResponse.Merge(m, src) -} -func (m *SyncRepoResponse) XXX_Size() int { - return xxx_messageInfo_SyncRepoResponse.Size(m) -} -func (m *SyncRepoResponse) XXX_DiscardUnknown() { - xxx_messageInfo_SyncRepoResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_SyncRepoResponse proto.InternalMessageInfo - -func (m *SyncRepoResponse) GetFailed() bool { - if m != nil { - return m.Failed - } - return false -} - -func (m *SyncRepoResponse) GetResult() string { - if m != nil { - return m.Result - } - return "" -} - -func init() { - proto.RegisterEnum("openpitrix.UploadAppAttachmentRequest_Type", UploadAppAttachmentRequest_Type_name, UploadAppAttachmentRequest_Type_value) - proto.RegisterType((*CreateAppRequest)(nil), "openpitrix.CreateAppRequest") - proto.RegisterType((*CreateAppResponse)(nil), "openpitrix.CreateAppResponse") - proto.RegisterType((*ValidatePackageRequest)(nil), "openpitrix.ValidatePackageRequest") - proto.RegisterType((*ValidatePackageResponse)(nil), "openpitrix.ValidatePackageResponse") - proto.RegisterMapType((map[string]string)(nil), "openpitrix.ValidatePackageResponse.ErrorDetailsEntry") - proto.RegisterType((*ModifyAppRequest)(nil), "openpitrix.ModifyAppRequest") - proto.RegisterType((*ModifyAppResponse)(nil), "openpitrix.ModifyAppResponse") - proto.RegisterType((*UploadAppAttachmentRequest)(nil), "openpitrix.UploadAppAttachmentRequest") - proto.RegisterType((*UploadAppAttachmentResponse)(nil), "openpitrix.UploadAppAttachmentResponse") - proto.RegisterType((*DeleteAppsRequest)(nil), "openpitrix.DeleteAppsRequest") - proto.RegisterType((*DeleteAppsResponse)(nil), "openpitrix.DeleteAppsResponse") - proto.RegisterType((*App)(nil), "openpitrix.App") - proto.RegisterType((*DescribeAppsRequest)(nil), "openpitrix.DescribeAppsRequest") - proto.RegisterType((*DescribeAppsResponse)(nil), "openpitrix.DescribeAppsResponse") - proto.RegisterType((*CreateAppVersionRequest)(nil), "openpitrix.CreateAppVersionRequest") - proto.RegisterType((*CreateAppVersionResponse)(nil), "openpitrix.CreateAppVersionResponse") - proto.RegisterType((*ModifyAppVersionRequest)(nil), "openpitrix.ModifyAppVersionRequest") - proto.RegisterMapType((map[string][]byte)(nil), "openpitrix.ModifyAppVersionRequest.PackageFilesEntry") - proto.RegisterType((*ModifyAppVersionResponse)(nil), "openpitrix.ModifyAppVersionResponse") - proto.RegisterType((*AppVersion)(nil), "openpitrix.AppVersion") - proto.RegisterType((*AppVersionAudit)(nil), "openpitrix.AppVersionAudit") - proto.RegisterType((*AppVersionReviewPhase)(nil), "openpitrix.AppVersionReviewPhase") - proto.RegisterType((*AppVersionReview)(nil), "openpitrix.AppVersionReview") - proto.RegisterMapType((map[string]*AppVersionReviewPhase)(nil), "openpitrix.AppVersionReview.PhaseEntry") - proto.RegisterType((*DescribeAppVersionReviewsRequest)(nil), "openpitrix.DescribeAppVersionReviewsRequest") - proto.RegisterType((*DescribeAppVersionReviewsResponse)(nil), "openpitrix.DescribeAppVersionReviewsResponse") - proto.RegisterType((*DescribeAppVersionAuditsRequest)(nil), "openpitrix.DescribeAppVersionAuditsRequest") - proto.RegisterType((*DescribeAppVersionAuditsResponse)(nil), "openpitrix.DescribeAppVersionAuditsResponse") - proto.RegisterType((*DescribeAppVersionsRequest)(nil), "openpitrix.DescribeAppVersionsRequest") - proto.RegisterType((*DescribeAppVersionsResponse)(nil), "openpitrix.DescribeAppVersionsResponse") - proto.RegisterType((*GetAppVersionPackageRequest)(nil), "openpitrix.GetAppVersionPackageRequest") - proto.RegisterType((*GetAppVersionPackageResponse)(nil), "openpitrix.GetAppVersionPackageResponse") - proto.RegisterType((*GetAppVersionPackageFilesRequest)(nil), "openpitrix.GetAppVersionPackageFilesRequest") - proto.RegisterType((*GetAppVersionPackageFilesResponse)(nil), "openpitrix.GetAppVersionPackageFilesResponse") - proto.RegisterMapType((map[string][]byte)(nil), "openpitrix.GetAppVersionPackageFilesResponse.FilesEntry") - proto.RegisterType((*GetAppStatisticsRequest)(nil), "openpitrix.GetAppStatisticsRequest") - proto.RegisterType((*GetAppStatisticsResponse)(nil), "openpitrix.GetAppStatisticsResponse") - proto.RegisterMapType((map[string]uint32)(nil), "openpitrix.GetAppStatisticsResponse.LastTwoWeekCreatedEntry") - proto.RegisterMapType((map[string]uint32)(nil), "openpitrix.GetAppStatisticsResponse.TopTenReposEntry") - proto.RegisterType((*SubmitAppVersionRequest)(nil), "openpitrix.SubmitAppVersionRequest") - proto.RegisterType((*SubmitAppVersionResponse)(nil), "openpitrix.SubmitAppVersionResponse") - proto.RegisterType((*CancelAppVersionRequest)(nil), "openpitrix.CancelAppVersionRequest") - proto.RegisterType((*CancelAppVersionResponse)(nil), "openpitrix.CancelAppVersionResponse") - proto.RegisterType((*ReleaseAppVersionRequest)(nil), "openpitrix.ReleaseAppVersionRequest") - proto.RegisterType((*ReleaseAppVersionResponse)(nil), "openpitrix.ReleaseAppVersionResponse") - proto.RegisterType((*DeleteAppVersionRequest)(nil), "openpitrix.DeleteAppVersionRequest") - proto.RegisterType((*DeleteAppVersionResponse)(nil), "openpitrix.DeleteAppVersionResponse") - proto.RegisterType((*ReviewAppVersionRequest)(nil), "openpitrix.ReviewAppVersionRequest") - proto.RegisterType((*ReviewAppVersionResponse)(nil), "openpitrix.ReviewAppVersionResponse") - proto.RegisterType((*PassAppVersionRequest)(nil), "openpitrix.PassAppVersionRequest") - proto.RegisterType((*PassAppVersionResponse)(nil), "openpitrix.PassAppVersionResponse") - proto.RegisterType((*RejectAppVersionRequest)(nil), "openpitrix.RejectAppVersionRequest") - proto.RegisterType((*RejectAppVersionResponse)(nil), "openpitrix.RejectAppVersionResponse") - proto.RegisterType((*SuspendAppVersionRequest)(nil), "openpitrix.SuspendAppVersionRequest") - proto.RegisterType((*SuspendAppVersionResponse)(nil), "openpitrix.SuspendAppVersionResponse") - proto.RegisterType((*RecoverAppVersionRequest)(nil), "openpitrix.RecoverAppVersionRequest") - proto.RegisterType((*RecoverAppVersionResponse)(nil), "openpitrix.RecoverAppVersionResponse") - proto.RegisterType((*SyncRepoRequest)(nil), "openpitrix.SyncRepoRequest") - proto.RegisterType((*SyncRepoResponse)(nil), "openpitrix.SyncRepoResponse") -} - -func init() { proto.RegisterFile("app.proto", fileDescriptor_e0f9056a14b86d47) } - -var fileDescriptor_e0f9056a14b86d47 = []byte{ - // 3987 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x5b, 0x4d, 0x6c, 0x24, 0x49, - 0x56, 0xde, 0xac, 0xb2, 0xdd, 0xf6, 0x2b, 0xbb, 0xed, 0x0a, 0xb7, 0xed, 0x72, 0xf5, 0x5f, 0x76, - 0x76, 0xef, 0xf4, 0x5f, 0xb5, 0x3d, 0xeb, 0x99, 0xd9, 0x69, 0x66, 0x98, 0x6e, 0x55, 0x77, 0xcf, - 0xec, 0xf4, 0xc2, 0x36, 0x4d, 0xb5, 0xa7, 0x1b, 0x1a, 0x89, 0x22, 0x5c, 0x15, 0xb6, 0x73, 0xbb, - 0x9c, 0x99, 0x9b, 0x11, 0x65, 0xe3, 0x0b, 0x87, 0x95, 0xf6, 0x08, 0x12, 0xb5, 0x12, 0x20, 0xb4, - 0x68, 0xf8, 0x97, 0x76, 0x24, 0x56, 0x08, 0x58, 0x69, 0x81, 0x91, 0x56, 0xc0, 0x8a, 0x0b, 0x3f, - 0x42, 0xe2, 0xc6, 0x81, 0x13, 0x27, 0x8e, 0x9c, 0x39, 0xa0, 0xf8, 0xc9, 0xcc, 0xc8, 0xac, 0xca, - 0xaa, 0xcc, 0x72, 0x59, 0xc3, 0x6a, 0xe7, 0x64, 0x57, 0xc6, 0x7b, 0x11, 0x2f, 0xde, 0xfb, 0xe2, - 0xfd, 0x45, 0x26, 0xcc, 0x61, 0xcf, 0xdb, 0xf0, 0x7c, 0x97, 0xb9, 0x08, 0x5c, 0x8f, 0x38, 0x9e, - 0xcd, 0x7c, 0xfb, 0x57, 0xab, 0x97, 0xf6, 0x5c, 0x77, 0xaf, 0x43, 0x36, 0xc5, 0xc8, 0x4e, 0x77, - 0x77, 0xf3, 0xc8, 0xc7, 0x9e, 0x47, 0x7c, 0x2a, 0x69, 0xab, 0x97, 0x93, 0xe3, 0xcc, 0x3e, 0x20, - 0x94, 0xe1, 0x03, 0x35, 0x59, 0xf5, 0x82, 0x22, 0xc0, 0x9e, 0xbd, 0x89, 0x1d, 0xc7, 0x65, 0x98, - 0xd9, 0xae, 0x13, 0xb0, 0xd7, 0xc4, 0x9f, 0xd6, 0x9d, 0x3d, 0xe2, 0xdc, 0xa1, 0x47, 0x78, 0x6f, - 0x8f, 0xf8, 0x9b, 0xae, 0x27, 0x28, 0x06, 0x50, 0x97, 0xd8, 0xb1, 0x47, 0xd4, 0x0f, 0xeb, 0xd7, - 0x8b, 0xb0, 0xf4, 0xd0, 0x27, 0x98, 0x91, 0xba, 0xe7, 0x35, 0xc8, 0x37, 0xba, 0x84, 0x32, 0xf4, - 0x3a, 0x4c, 0x39, 0xf8, 0x80, 0x54, 0x0c, 0xd3, 0xb8, 0x51, 0xda, 0xba, 0xb0, 0x21, 0x17, 0xdf, - 0x08, 0xa4, 0xdb, 0x78, 0xc6, 0x7c, 0xdb, 0xd9, 0x7b, 0x8e, 0x3b, 0x5d, 0xd2, 0x10, 0x94, 0xe8, - 0x3e, 0xcc, 0x1f, 0x12, 0x9f, 0xda, 0xae, 0xd3, 0xe4, 0xb3, 0x57, 0x0a, 0x19, 0x38, 0x4b, 0x8a, - 0x63, 0xfb, 0xd8, 0x23, 0xe8, 0x11, 0x2c, 0x06, 0x13, 0x78, 0xb8, 0xf5, 0x0a, 0xef, 0x91, 0x4a, - 0x51, 0xcc, 0x71, 0xbe, 0x6f, 0x8e, 0x07, 0xc7, 0x8c, 0x50, 0x39, 0xc5, 0x59, 0xc5, 0xf3, 0x54, - 0xb2, 0xe8, 0x62, 0x88, 0x0d, 0x4c, 0xe7, 0x10, 0xe3, 0x09, 0xdf, 0xc7, 0x26, 0x4c, 0xd9, 0x2d, - 0xd7, 0xa9, 0xcc, 0x8c, 0x5e, 0x5b, 0x10, 0xa2, 0x0d, 0x28, 0xda, 0xf4, 0xb0, 0x72, 0x26, 0xc3, - 0x42, 0x9c, 0x10, 0x5d, 0x02, 0x68, 0x61, 0x46, 0xf6, 0x5c, 0xdf, 0x26, 0xb4, 0x32, 0x6b, 0x16, - 0x6f, 0xcc, 0x35, 0xb4, 0x27, 0xd6, 0xb7, 0x0c, 0x28, 0x6b, 0xf6, 0xa0, 0x9e, 0xeb, 0x50, 0x82, - 0xde, 0x80, 0x19, 0xec, 0x79, 0x4d, 0xbb, 0x9d, 0xc9, 0x24, 0xd3, 0xd8, 0xf3, 0x1e, 0xb7, 0xd1, - 0xbb, 0x00, 0x81, 0x32, 0xec, 0x76, 0x26, 0x8b, 0xcc, 0x29, 0xfa, 0xc7, 0x6d, 0xab, 0x0d, 0xab, - 0xcf, 0x71, 0xc7, 0x6e, 0x63, 0x46, 0x94, 0x72, 0x03, 0x70, 0x5c, 0x19, 0x60, 0xea, 0xb9, 0xb8, - 0x31, 0xaf, 0x0f, 0x36, 0xe6, 0x7c, 0xd2, 0x5e, 0xd6, 0xbf, 0x14, 0x61, 0xad, 0x6f, 0x19, 0xb5, - 0xe7, 0x97, 0xb0, 0x40, 0x7c, 0xdf, 0xf5, 0x9b, 0x6d, 0xc2, 0xb0, 0xdd, 0xa1, 0x15, 0xc3, 0x2c, - 0xde, 0x28, 0x6d, 0xbd, 0xb5, 0x11, 0x9d, 0xab, 0x8d, 0x14, 0xde, 0x8d, 0xf7, 0x39, 0xe3, 0x23, - 0xc9, 0xf7, 0xbe, 0xc3, 0xfc, 0xe3, 0xc6, 0x3c, 0xd1, 0x1e, 0xa1, 0x2d, 0x98, 0x16, 0xbf, 0x33, - 0x69, 0x45, 0x92, 0x86, 0x87, 0xa2, 0x38, 0xce, 0xa1, 0x10, 0x9c, 0x53, 0x79, 0xd1, 0xb8, 0x01, - 0xc5, 0xae, 0xdf, 0xc9, 0x84, 0x62, 0x4e, 0x88, 0xee, 0x41, 0xa9, 0x4d, 0x68, 0xcb, 0xb7, 0xc5, - 0xd9, 0x57, 0x20, 0x1e, 0xb1, 0x9e, 0xc6, 0x50, 0xbd, 0x0f, 0xe5, 0x3e, 0xcd, 0xa1, 0x25, 0x28, - 0xbe, 0x22, 0xc7, 0x02, 0x78, 0x73, 0x0d, 0xfe, 0x2f, 0x3a, 0x07, 0xd3, 0x87, 0x9c, 0x59, 0x99, - 0x5e, 0xfe, 0x78, 0xa7, 0x70, 0xd7, 0xb0, 0xbe, 0x39, 0x0d, 0x4b, 0x5f, 0x73, 0xdb, 0xf6, 0xee, - 0xb1, 0xe6, 0x4d, 0xc6, 0x02, 0x6f, 0xa0, 0xed, 0x42, 0x66, 0x6d, 0x27, 0x36, 0x5f, 0xcc, 0xb9, - 0x79, 0xbe, 0xe2, 0xbe, 0x9b, 0xd1, 0x4a, 0x82, 0x92, 0xaf, 0x78, 0x80, 0x6d, 0x87, 0x61, 0xdb, - 0x21, 0x3e, 0xcd, 0xe4, 0x03, 0x74, 0x06, 0xf4, 0x65, 0x38, 0x43, 0xdd, 0xae, 0xdf, 0x12, 0x8e, - 0x60, 0x34, 0x6f, 0x40, 0x8c, 0xde, 0x84, 0x19, 0x9f, 0xe0, 0xf6, 0x01, 0xa9, 0xcc, 0x65, 0x60, - 0x53, 0xb4, 0x5c, 0x5a, 0xbc, 0x43, 0x99, 0x8f, 0x5b, 0x42, 0x3f, 0x90, 0x45, 0x5a, 0x8d, 0x81, - 0x83, 0x91, 0xb9, 0xb4, 0x52, 0xca, 0x02, 0x46, 0xe6, 0x52, 0xf4, 0x1e, 0x94, 0x94, 0x5f, 0x3b, - 0xe6, 0xb6, 0x9f, 0xcf, 0xc0, 0x17, 0x38, 0xc2, 0xe3, 0xc7, 0x6d, 0x74, 0x17, 0x66, 0x5f, 0x91, - 0xe3, 0x23, 0xd7, 0x6f, 0xd3, 0xca, 0x42, 0x06, 0xde, 0x90, 0xda, 0xfa, 0x10, 0xca, 0x1a, 0x06, - 0x4f, 0xe0, 0x41, 0xad, 0xbf, 0x29, 0x40, 0xf5, 0x23, 0xaf, 0xe3, 0xe2, 0x76, 0xdd, 0xf3, 0xea, - 0x8c, 0xe1, 0xd6, 0xfe, 0x01, 0x71, 0xd8, 0x89, 0x80, 0x7d, 0x1f, 0xa6, 0x42, 0xb7, 0x79, 0x76, - 0xeb, 0xb6, 0xee, 0xcd, 0xd2, 0x97, 0xda, 0xe0, 0x6e, 0xb5, 0x21, 0x18, 0xd1, 0x57, 0x01, 0xe1, - 0x70, 0xbc, 0xd9, 0x72, 0x1d, 0x46, 0x1c, 0x96, 0x25, 0x58, 0x96, 0x23, 0xb6, 0x87, 0x92, 0x8b, - 0x2b, 0x99, 0xf2, 0x15, 0x9c, 0x56, 0x3a, 0xee, 0x3f, 0x7a, 0xec, 0xb0, 0x37, 0xb6, 0x94, 0x92, - 0x03, 0x6a, 0xcb, 0x84, 0x29, 0xe1, 0xea, 0x67, 0x65, 0xc0, 0x5c, 0xfa, 0x02, 0x3a, 0x0b, 0x40, - 0x5b, 0x3e, 0x21, 0x0e, 0xdd, 0x77, 0xd9, 0x92, 0x61, 0x35, 0xe0, 0xfc, 0xc0, 0x0d, 0x9d, 0xc4, - 0x20, 0xb7, 0xa0, 0xfc, 0x88, 0x74, 0x88, 0x08, 0x8e, 0x34, 0x30, 0xc3, 0x8a, 0x36, 0x13, 0x0f, - 0xa7, 0x8a, 0xf6, 0x36, 0x20, 0x9d, 0x56, 0x2d, 0x9b, 0x42, 0xfc, 0x8f, 0x0b, 0x50, 0xac, 0x7b, - 0xde, 0x78, 0x26, 0xdd, 0x82, 0x19, 0x7e, 0x46, 0x0e, 0x03, 0x6f, 0x55, 0xed, 0xb7, 0x82, 0xeb, - 0x76, 0xd4, 0x69, 0x94, 0x94, 0x63, 0x44, 0x93, 0xb7, 0xe0, 0x8c, 0x4f, 0x3c, 0x97, 0xcb, 0x36, - 0x95, 0xed, 0xd8, 0x7b, 0xee, 0xe3, 0x76, 0xd2, 0x2d, 0x4e, 0xe7, 0x75, 0x8b, 0x6f, 0xc2, 0x0c, - 0x65, 0x98, 0x75, 0x69, 0xa6, 0x70, 0xa2, 0x68, 0x43, 0x67, 0x7a, 0x26, 0xb3, 0x33, 0x7d, 0x5d, - 0x65, 0x5e, 0x59, 0x3c, 0xa1, 0x4c, 0xbd, 0xee, 0x41, 0x29, 0x02, 0x1c, 0xcd, 0xe4, 0x0b, 0x75, - 0x86, 0xa4, 0xfb, 0x86, 0xbc, 0xee, 0x5b, 0xf7, 0x50, 0xa5, 0x3c, 0x1e, 0x4a, 0x77, 0xfc, 0xf3, - 0xe3, 0x39, 0xfe, 0x85, 0x1c, 0x8e, 0xff, 0x5d, 0x80, 0xd6, 0x3e, 0xf6, 0x99, 0x4c, 0x42, 0xce, - 0x66, 0xc9, 0x03, 0x05, 0xfd, 0x13, 0xdc, 0x1f, 0x35, 0x16, 0xc7, 0x8c, 0x1a, 0x4b, 0x59, 0xa3, - 0xc6, 0x16, 0x4c, 0xbb, 0x47, 0x0e, 0xf1, 0x2b, 0xe5, 0x2c, 0xe7, 0x4f, 0x90, 0xa2, 0x77, 0xa1, - 0xd4, 0x12, 0x29, 0x73, 0x93, 0x97, 0x4d, 0x15, 0x94, 0x72, 0x08, 0xb7, 0x83, 0x9a, 0xaa, 0x01, - 0x92, 0x9c, 0x3f, 0xe0, 0xcc, 0x12, 0xb3, 0x92, 0x79, 0x79, 0x34, 0xb3, 0x24, 0x0f, 0x98, 0xbb, - 0x5e, 0x3b, 0x5c, 0xf9, 0xdc, 0x68, 0x66, 0x49, 0x2e, 0x98, 0xef, 0xc3, 0x7c, 0x18, 0x20, 0x29, - 0x61, 0x95, 0x15, 0x91, 0xdf, 0x5e, 0xd0, 0x23, 0x42, 0x83, 0x48, 0xd3, 0x3f, 0x54, 0x74, 0x8d, - 0x30, 0xa4, 0x3e, 0x23, 0x0c, 0x3d, 0x02, 0xd4, 0xc1, 0x8c, 0x50, 0xd6, 0xe4, 0x3e, 0x4b, 0x25, - 0x8e, 0x95, 0x55, 0x21, 0xc4, 0xaa, 0x3e, 0x4d, 0xdd, 0xf3, 0x9e, 0xcb, 0xd1, 0xc6, 0x92, 0xe4, - 0x88, 0x9e, 0xa0, 0x0f, 0xa1, 0xac, 0xb1, 0x8b, 0x9c, 0x9e, 0x56, 0xd6, 0x32, 0x68, 0x7f, 0x11, - 0x87, 0x93, 0xf0, 0x50, 0x40, 0xc5, 0x86, 0xdc, 0x03, 0x0f, 0x3b, 0xc7, 0x12, 0x6a, 0x95, 0x2c, - 0x60, 0x51, 0x1c, 0x02, 0x6c, 0xef, 0xc3, 0x62, 0x30, 0xc1, 0x11, 0xd9, 0xa1, 0x36, 0x23, 0x95, - 0xf5, 0x0c, 0x73, 0x9c, 0x55, 0x4c, 0x2f, 0x24, 0x8f, 0x3e, 0x8d, 0xe7, 0xbb, 0xbb, 0x76, 0x87, - 0x54, 0xaa, 0x39, 0xa6, 0x79, 0x2a, 0x79, 0xd0, 0x07, 0x50, 0x0e, 0xa6, 0xf9, 0xba, 0x6b, 0x3b, - 0xd2, 0xc4, 0xe7, 0x47, 0x9a, 0x38, 0x58, 0xfb, 0xab, 0xae, 0xed, 0x28, 0x90, 0x80, 0xc0, 0x69, - 0xd3, 0xc3, 0x6c, 0xbf, 0x72, 0x21, 0xcb, 0xf9, 0x13, 0xf4, 0x4f, 0x31, 0xdb, 0x0f, 0xea, 0xcb, - 0x8b, 0x19, 0xeb, 0x4b, 0xeb, 0x3f, 0x8b, 0xb0, 0xfc, 0x48, 0xb8, 0xef, 0x9d, 0x58, 0x90, 0x7c, - 0x0f, 0x4a, 0x94, 0x60, 0xbf, 0xb5, 0xdf, 0xe4, 0x2e, 0x28, 0x53, 0x74, 0x03, 0xc9, 0xf0, 0xc2, - 0xf5, 0xdb, 0xe8, 0x6d, 0x98, 0xa5, 0xae, 0xcf, 0x9a, 0xbc, 0x12, 0x28, 0x64, 0x73, 0x59, 0x3e, - 0xfb, 0x19, 0x72, 0x8c, 0xde, 0xe4, 0x51, 0x8b, 0x63, 0x2b, 0x08, 0x75, 0xc3, 0x82, 0x63, 0x40, - 0xca, 0x2b, 0x8c, 0x8e, 0x7d, 0x60, 0x33, 0x11, 0xe9, 0x16, 0x1a, 0xf2, 0x07, 0x5a, 0x85, 0x19, - 0x77, 0x77, 0x97, 0x1f, 0x95, 0x69, 0xf1, 0x58, 0xfd, 0xd2, 0x62, 0x7a, 0x49, 0x8b, 0xe9, 0x08, - 0xa9, 0x10, 0x3b, 0x2f, 0x1e, 0xca, 0x20, 0xba, 0x16, 0x05, 0xd1, 0x05, 0xf1, 0x38, 0x08, 0x93, - 0xab, 0x61, 0x98, 0x3b, 0x2b, 0x9f, 0xab, 0x40, 0x76, 0x2e, 0xf0, 0x47, 0x8b, 0x72, 0x6a, 0xe9, - 0x71, 0x2e, 0xc6, 0x5c, 0xea, 0x92, 0x18, 0xd2, 0x9c, 0xe6, 0xe5, 0x78, 0xea, 0x5b, 0x8e, 0x55, - 0xf9, 0x3c, 0xb9, 0xbd, 0x0e, 0x8b, 0x6d, 0x9b, 0x7a, 0x1d, 0x7c, 0xdc, 0x6c, 0xb9, 0x9d, 0xee, - 0x81, 0x43, 0x2b, 0x48, 0x10, 0x9d, 0x55, 0x8f, 0x1f, 0xca, 0xa7, 0xbc, 0xf8, 0xe2, 0xe6, 0x5f, - 0x16, 0x83, 0xc2, 0xc0, 0x18, 0xce, 0xc5, 0xed, 0xab, 0x12, 0x9b, 0xcb, 0x50, 0x62, 0x2e, 0xc3, - 0x9d, 0x66, 0xcb, 0xed, 0x3a, 0x4c, 0x18, 0x78, 0xa1, 0x01, 0xe2, 0xd1, 0x43, 0xfe, 0x04, 0xdd, - 0x80, 0x33, 0x5c, 0x4b, 0x5c, 0x7d, 0x05, 0xe1, 0x69, 0x16, 0x13, 0x2e, 0xa2, 0xc1, 0xb5, 0xf8, - 0x8c, 0x30, 0xeb, 0xbb, 0x05, 0x58, 0x0b, 0x7b, 0x10, 0x81, 0xe3, 0xf8, 0xb1, 0x2b, 0xe6, 0x44, - 0x96, 0x9d, 0xa9, 0x98, 0x13, 0x69, 0xf5, 0x5b, 0x70, 0x26, 0xe8, 0x55, 0x4c, 0x8f, 0xce, 0xa5, - 0x03, 0x5a, 0xeb, 0x05, 0x54, 0xfa, 0x55, 0xa5, 0x4c, 0x12, 0x6f, 0xc0, 0x18, 0xf9, 0x1a, 0x30, - 0xdf, 0x29, 0xc2, 0x5a, 0x58, 0xc6, 0x24, 0x8c, 0x70, 0x92, 0x89, 0x3f, 0x03, 0x63, 0x68, 0xaa, - 0x9d, 0xca, 0xae, 0x5a, 0xf4, 0x12, 0x16, 0xd4, 0xbf, 0x4d, 0xee, 0x8f, 0x69, 0x65, 0xba, 0xbf, - 0x01, 0x94, 0xa2, 0xa1, 0x0d, 0xd5, 0x10, 0xfa, 0x80, 0xf3, 0xa9, 0x06, 0x90, 0xa7, 0x3d, 0xaa, - 0xde, 0x87, 0x72, 0x1f, 0xc9, 0xa8, 0x4e, 0xc7, 0xbc, 0xde, 0xe9, 0x78, 0x01, 0x95, 0xfe, 0xb5, - 0x27, 0x61, 0xf7, 0xef, 0x01, 0x80, 0x16, 0x9d, 0x4f, 0x64, 0xea, 0x71, 0x0a, 0x93, 0xe8, 0x80, - 0x17, 0xf3, 0x54, 0x40, 0xca, 0x4b, 0x4e, 0x65, 0xcf, 0xda, 0x02, 0x1c, 0x4e, 0x8f, 0x8b, 0xc3, - 0x99, 0x71, 0x3b, 0x3c, 0x9f, 0x17, 0x25, 0x9f, 0x7d, 0x51, 0x72, 0x1f, 0x82, 0x03, 0x99, 0xbd, - 0x2c, 0x29, 0x29, 0x0e, 0x11, 0x63, 0xa3, 0xba, 0x74, 0x31, 0x47, 0x5d, 0xfa, 0x53, 0x30, 0xe7, - 0x93, 0x43, 0x9b, 0x1c, 0x71, 0x80, 0x67, 0x29, 0x4a, 0x66, 0x25, 0xb9, 0x68, 0xa7, 0xc7, 0xaa, - 0x8c, 0xf2, 0x49, 0xaa, 0x0c, 0x74, 0x92, 0x2a, 0x63, 0x39, 0x57, 0x95, 0xa1, 0xb7, 0x78, 0xce, - 0xe5, 0x69, 0xf1, 0x70, 0x40, 0x1c, 0x10, 0x4a, 0xb9, 0xdb, 0x5e, 0xc9, 0x02, 0x08, 0x45, 0x1c, - 0xc6, 0xde, 0xd5, 0xcc, 0xb1, 0x37, 0x9e, 0x21, 0xaf, 0xe5, 0xca, 0x90, 0xad, 0x3f, 0x98, 0x86, - 0xc5, 0xc8, 0x61, 0xd6, 0xbb, 0x6d, 0xfb, 0x84, 0x01, 0x32, 0xf2, 0x80, 0x85, 0xec, 0x1e, 0x30, - 0x82, 0x63, 0x31, 0x07, 0x1c, 0x4f, 0x7c, 0x43, 0xf0, 0x36, 0xcc, 0x72, 0x59, 0x33, 0x3b, 0x52, - 0x9e, 0x02, 0x0a, 0xc6, 0xbb, 0x30, 0xeb, 0x7a, 0xc4, 0xc7, 0xcc, 0xf5, 0x33, 0x39, 0xd2, 0x90, - 0x1a, 0xd5, 0x61, 0x21, 0xf8, 0x5f, 0x5e, 0x00, 0x65, 0x71, 0xa7, 0xf3, 0x01, 0x8b, 0x68, 0x1a, - 0x6a, 0xc8, 0x9a, 0xcd, 0x83, 0xac, 0xd8, 0xe9, 0x9d, 0xcb, 0x7b, 0x7a, 0xf5, 0x03, 0x08, 0xb9, - 0x0e, 0x60, 0xf2, 0x76, 0xb3, 0x94, 0xf3, 0x76, 0xd3, 0xfa, 0xdf, 0x02, 0xac, 0xe8, 0x89, 0x02, - 0x17, 0xea, 0xe9, 0x3e, 0xa6, 0xba, 0x1b, 0x33, 0x72, 0xe0, 0x46, 0xb7, 0x5e, 0xe1, 0x64, 0xd6, - 0x2b, 0x9e, 0xc4, 0x7a, 0x53, 0x79, 0xac, 0x97, 0x30, 0xc1, 0x74, 0x5e, 0x1f, 0xa8, 0x4c, 0x2f, - 0x98, 0x67, 0x46, 0x33, 0x4b, 0x72, 0xfe, 0xc0, 0xfa, 0x87, 0x69, 0x58, 0x4a, 0xaa, 0x3f, 0x0e, - 0x26, 0x23, 0x27, 0x98, 0xc6, 0xbf, 0x59, 0x1d, 0x2f, 0xc1, 0xfa, 0xec, 0x1c, 0xc5, 0x78, 0xfd, - 0xdf, 0xf7, 0x60, 0xda, 0xe3, 0xf8, 0xae, 0x9c, 0x11, 0x39, 0xfb, 0xf5, 0x94, 0x6e, 0x94, 0x50, - 0xe8, 0x86, 0x38, 0x09, 0x32, 0x4b, 0x97, 0x5c, 0x49, 0xa8, 0xcc, 0xe6, 0x82, 0xca, 0x5d, 0x50, - 0x96, 0x22, 0x7e, 0x1e, 0x27, 0x41, 0xfc, 0xbe, 0x73, 0x0e, 0x39, 0xcf, 0x79, 0xf5, 0x97, 0x00, - 0xa2, 0xcd, 0x0c, 0xa8, 0x27, 0xde, 0xd6, 0xeb, 0x89, 0xd2, 0xd6, 0x95, 0x61, 0x6a, 0x11, 0x13, - 0xe9, 0x25, 0xc7, 0xf7, 0x8a, 0x60, 0x6a, 0xa5, 0x7f, 0x8c, 0xf8, 0x27, 0xac, 0xcf, 0x03, 0x7a, - 0x9f, 0xe7, 0x62, 0xec, 0x34, 0xca, 0x16, 0x90, 0x76, 0xde, 0xce, 0xeb, 0xe7, 0x5c, 0xf6, 0x82, - 0xa2, 0x93, 0x1c, 0xb5, 0x7d, 0x16, 0x62, 0x6d, 0x9f, 0x01, 0x0d, 0x9a, 0xb3, 0x03, 0x1b, 0x34, - 0x55, 0x0d, 0x6c, 0x8b, 0xfa, 0xe4, 0xc4, 0xb7, 0x7e, 0xdb, 0x80, 0x2b, 0x43, 0x0c, 0x96, 0xb5, - 0x71, 0xf3, 0xf3, 0xb0, 0xaa, 0x37, 0x68, 0xd5, 0x66, 0xa2, 0x3e, 0xce, 0x85, 0x61, 0x28, 0x6a, - 0x2c, 0xe3, 0xc4, 0x93, 0x67, 0x84, 0x59, 0xdf, 0x2f, 0xc2, 0xe5, 0x7e, 0xc9, 0x44, 0xee, 0xf4, - 0x39, 0x92, 0x52, 0x91, 0x14, 0x81, 0x65, 0x3e, 0x06, 0x96, 0xaa, 0x16, 0x8d, 0x25, 0x8c, 0xa2, - 0x78, 0x7b, 0x35, 0x19, 0x6f, 0x25, 0x8c, 0xe2, 0x11, 0x75, 0x00, 0xda, 0x16, 0x07, 0xa1, 0xcd, - 0xfa, 0xb6, 0x31, 0xc8, 0x05, 0x04, 0x76, 0xcb, 0x0a, 0xa8, 0x27, 0xb0, 0xa2, 0x03, 0x0a, 0x73, - 0x76, 0x0d, 0x4f, 0xe7, 0x07, 0xe3, 0x49, 0xac, 0xd2, 0x40, 0x38, 0xfe, 0x80, 0xa3, 0xe9, 0x7f, - 0x8a, 0x50, 0xed, 0x97, 0xea, 0x27, 0x02, 0x48, 0x71, 0xc4, 0x40, 0x12, 0x31, 0x39, 0x3a, 0xd3, - 0x61, 0xa3, 0x79, 0x41, 0x6f, 0x34, 0x9b, 0xf1, 0x96, 0x87, 0x04, 0x4f, 0xac, 0xa9, 0x71, 0x25, - 0x51, 0x48, 0x4b, 0xe0, 0xc4, 0x4a, 0xe5, 0x08, 0xb7, 0x4b, 0x31, 0xdc, 0x22, 0x55, 0xa8, 0xc9, - 0xfe, 0xb4, 0x2c, 0xc5, 0xb2, 0x76, 0xa6, 0xad, 0x5f, 0x83, 0xf3, 0x03, 0x6d, 0x9e, 0x15, 0x84, - 0xf7, 0x60, 0x51, 0x07, 0x61, 0x04, 0xbf, 0xb4, 0x9b, 0xab, 0x85, 0x08, 0x79, 0x1c, 0x74, 0x2f, - 0xe1, 0xfc, 0x57, 0x88, 0x76, 0x8f, 0x95, 0x78, 0x4b, 0xed, 0x44, 0x3d, 0xb8, 0x4f, 0x0c, 0xb8, - 0x30, 0x78, 0x72, 0xb5, 0xbb, 0x4a, 0xd4, 0xd1, 0x34, 0x44, 0x67, 0x30, 0x6c, 0x5a, 0x8e, 0x55, - 0x3c, 0xc6, 0x85, 0x2d, 0xe6, 0x13, 0xb6, 0x0b, 0xe6, 0x20, 0x59, 0x45, 0x5f, 0x73, 0x22, 0x0d, - 0xe3, 0x73, 0x30, 0x2d, 0xfb, 0xaf, 0x05, 0x89, 0x4c, 0xf1, 0xc3, 0xfa, 0x6f, 0x03, 0xae, 0x0c, - 0x59, 0x57, 0x29, 0xea, 0x49, 0xc0, 0x2b, 0x5f, 0xde, 0xbb, 0xab, 0xdb, 0x76, 0x24, 0xf7, 0x86, - 0xd6, 0xbe, 0x95, 0xd3, 0x9c, 0x28, 0xf3, 0xae, 0xde, 0x05, 0x18, 0xb3, 0xdb, 0xbb, 0x0e, 0x6b, - 0x52, 0xda, 0x67, 0x0c, 0x33, 0x9b, 0x32, 0xbb, 0x15, 0xa8, 0xd6, 0xfa, 0x6e, 0x11, 0x2a, 0xfd, - 0x63, 0x6a, 0xfb, 0x2e, 0xac, 0x74, 0x30, 0x65, 0x4d, 0x76, 0xe4, 0x36, 0x8f, 0x08, 0x79, 0xd5, - 0x94, 0x2d, 0xa1, 0xb6, 0x52, 0xc7, 0x4f, 0xf7, 0xab, 0xa3, 0x7f, 0x92, 0x8d, 0x9f, 0xc5, 0x94, - 0x6d, 0x1f, 0xb9, 0x2f, 0x08, 0x79, 0x25, 0xaf, 0x1a, 0xda, 0x52, 0x25, 0xa8, 0xd3, 0x37, 0x80, - 0x7e, 0x11, 0x16, 0x98, 0xeb, 0x35, 0x19, 0xe1, 0x79, 0x82, 0xe7, 0x52, 0x75, 0xa6, 0xde, 0xca, - 0xb4, 0xd0, 0xb6, 0xeb, 0x6d, 0x13, 0xa7, 0xc1, 0xf9, 0xe4, 0x0a, 0x25, 0x16, 0x3d, 0xe1, 0x79, - 0x14, 0x47, 0xb6, 0x3c, 0xcf, 0x45, 0x71, 0x9e, 0x79, 0x49, 0x21, 0x4f, 0xf3, 0x45, 0x00, 0x71, - 0xaf, 0x26, 0x47, 0xa5, 0xeb, 0x9c, 0xe3, 0x4f, 0xc4, 0x70, 0xf5, 0x7d, 0x58, 0x4b, 0xd9, 0xc5, - 0x28, 0x33, 0x2c, 0x68, 0x66, 0xa8, 0xde, 0x83, 0xa5, 0xa4, 0x8c, 0x79, 0xf8, 0xad, 0xe7, 0xb0, - 0xf6, 0xac, 0xbb, 0x73, 0x60, 0xb3, 0xc9, 0x5e, 0xa9, 0x58, 0x2f, 0xa0, 0xd2, 0x3f, 0xef, 0x24, - 0x2e, 0x03, 0x9e, 0xc3, 0xda, 0x43, 0xec, 0xb4, 0x48, 0x67, 0xf2, 0x02, 0xf7, 0xcf, 0x3b, 0x09, - 0x81, 0x5f, 0x40, 0xa5, 0x41, 0x3a, 0x04, 0x53, 0x32, 0x61, 0x89, 0x7f, 0x01, 0xd6, 0x07, 0x4c, - 0x3c, 0x21, 0x1d, 0x87, 0xef, 0x89, 0x4d, 0x58, 0xc7, 0xfd, 0xf3, 0x4e, 0x48, 0x60, 0x99, 0xc9, - 0x4f, 0x5e, 0xe0, 0xfe, 0x79, 0x27, 0x21, 0xf0, 0x36, 0xac, 0x3c, 0xc5, 0x94, 0x4e, 0x58, 0xdc, - 0x8f, 0x60, 0x35, 0x39, 0xeb, 0x24, 0x84, 0xfd, 0x0d, 0x83, 0xab, 0xf7, 0xeb, 0xa4, 0x35, 0x61, - 0x27, 0xa1, 0xb7, 0xcd, 0x0a, 0x39, 0xda, 0x66, 0xd2, 0x2c, 0x49, 0x79, 0x26, 0x74, 0x56, 0x9f, - 0x75, 0xa9, 0x47, 0x9c, 0xf6, 0xe4, 0xcf, 0xea, 0x80, 0x89, 0x27, 0xe6, 0x5e, 0x5a, 0xee, 0x21, - 0xf1, 0x4f, 0xc3, 0xbd, 0xf4, 0x4d, 0x3c, 0x09, 0x91, 0x6f, 0xc1, 0xe2, 0xb3, 0x63, 0xa7, 0xc5, - 0x23, 0x56, 0x20, 0xa9, 0xf6, 0x12, 0x8a, 0x0c, 0x5b, 0xea, 0x25, 0x14, 0xeb, 0x01, 0x2c, 0x45, - 0xb4, 0x6a, 0xf1, 0x55, 0x98, 0xd9, 0xc5, 0x76, 0x87, 0x48, 0xda, 0xd9, 0x86, 0xfa, 0xc5, 0x9f, - 0xfb, 0x84, 0x76, 0x3b, 0x4c, 0xbd, 0x85, 0xaf, 0x7e, 0x6d, 0x7d, 0xeb, 0x4d, 0x71, 0x7f, 0xfc, - 0x35, 0xec, 0xe0, 0x3d, 0xe2, 0xa3, 0xaf, 0xc0, 0x6c, 0x30, 0x25, 0x8a, 0x15, 0x76, 0x09, 0xa1, - 0xaa, 0x17, 0x06, 0x0f, 0x4a, 0x29, 0xac, 0x2f, 0xa0, 0xdf, 0x31, 0x60, 0x2e, 0x7c, 0xd3, 0x01, - 0xc5, 0xa8, 0x93, 0xdf, 0x0f, 0x55, 0x2f, 0xa6, 0x8c, 0xaa, 0xc9, 0x9e, 0xf4, 0xea, 0x77, 0xd1, - 0x97, 0xe5, 0x73, 0x13, 0x7b, 0x5e, 0xcd, 0xec, 0x52, 0xe2, 0x9b, 0xee, 0xae, 0x69, 0xd3, 0x43, - 0xb3, 0x85, 0x1d, 0xb3, 0x15, 0x8e, 0x99, 0xae, 0x63, 0xb2, 0x7d, 0x62, 0x7a, 0x1d, 0xcc, 0x76, - 0x5d, 0xff, 0xe0, 0x9b, 0xff, 0xfe, 0x5f, 0xdf, 0x2e, 0x2c, 0x58, 0xb3, 0x9b, 0x87, 0x5f, 0xda, - 0xc4, 0x9e, 0x47, 0xdf, 0x31, 0x6e, 0xa1, 0x3f, 0x37, 0x60, 0x31, 0xf1, 0x25, 0x08, 0xb2, 0x86, - 0x7e, 0x26, 0x22, 0xc5, 0xbc, 0x9a, 0xe1, 0x53, 0x12, 0x6b, 0xbb, 0x57, 0xbf, 0x83, 0x6e, 0x07, - 0xa3, 0x26, 0x97, 0x01, 0x33, 0x2e, 0xab, 0xca, 0xf8, 0x6f, 0xf0, 0xbf, 0xe6, 0xce, 0xb1, 0xe9, - 0x7a, 0x26, 0x73, 0xdd, 0xce, 0x4d, 0x21, 0xe1, 0x25, 0x6b, 0x3d, 0x90, 0x70, 0xf3, 0x50, 0xf1, - 0x06, 0xdf, 0xc2, 0x70, 0x91, 0x7f, 0xd7, 0x80, 0xa5, 0x64, 0x1e, 0x86, 0xae, 0x0e, 0xcf, 0xd2, - 0xa4, 0xd0, 0xd7, 0xb2, 0xa4, 0x72, 0xd6, 0xbb, 0xbd, 0xfa, 0x45, 0xc4, 0x0b, 0x24, 0x93, 0x86, - 0x83, 0xa6, 0xed, 0xec, 0xba, 0x5c, 0x72, 0x2e, 0x95, 0x90, 0x72, 0x05, 0x2d, 0x87, 0x52, 0x46, - 0x74, 0xe8, 0xf7, 0x0b, 0x30, 0xaf, 0xbf, 0x63, 0x84, 0x2e, 0xeb, 0x6b, 0x0e, 0x78, 0xbb, 0xac, - 0x6a, 0xa6, 0x13, 0x28, 0x81, 0xfe, 0xd9, 0xe8, 0xd5, 0x7f, 0x60, 0xa0, 0xef, 0x1b, 0x5c, 0x26, - 0xbe, 0x60, 0x4d, 0x18, 0x7a, 0xd7, 0xee, 0x30, 0xe2, 0x9b, 0x47, 0x36, 0xdb, 0xe7, 0x66, 0xa6, - 0xc4, 0xdc, 0xb5, 0x49, 0xa7, 0x4d, 0x6f, 0xc8, 0x22, 0xaa, 0x66, 0xf2, 0x9a, 0xb6, 0x66, 0xaa, - 0xe3, 0x52, 0x33, 0xb5, 0xca, 0xb7, 0x66, 0xca, 0x32, 0xb6, 0x66, 0xee, 0xbb, 0x9c, 0xc6, 0x6e, - 0x89, 0x67, 0xd1, 0x5d, 0x7a, 0xcd, 0xd4, 0x2e, 0xc6, 0x6b, 0xa6, 0xba, 0xaf, 0xe6, 0x93, 0xe1, - 0x36, 0x67, 0x10, 0x15, 0x76, 0xcd, 0x8c, 0x5e, 0xe4, 0xba, 0xc9, 0xe7, 0xdf, 0xc5, 0xdd, 0x0e, - 0x33, 0x7d, 0xc2, 0xba, 0xbe, 0x63, 0xe2, 0x4e, 0x27, 0xd2, 0x16, 0xa0, 0x10, 0x75, 0xe8, 0xaf, - 0x0a, 0x80, 0xc2, 0x7d, 0x8a, 0x17, 0x27, 0x26, 0xa5, 0xa8, 0xff, 0x30, 0x7a, 0xf5, 0x1f, 0x1a, - 0xe8, 0x53, 0xa9, 0x28, 0x31, 0xf5, 0x8f, 0xa9, 0xbe, 0xca, 0x68, 0x51, 0xe8, 0x4b, 0xec, 0xa1, - 0x29, 0xd4, 0xf6, 0x0d, 0x98, 0x0b, 0xdf, 0x9a, 0x89, 0xfb, 0x90, 0xe4, 0x57, 0x43, 0x71, 0x1f, - 0xd2, 0xf7, 0x3d, 0x87, 0x75, 0xbd, 0x57, 0x2f, 0xa3, 0x45, 0xf9, 0x5c, 0xf8, 0x09, 0x0e, 0x6e, - 0xe9, 0x1c, 0xb6, 0x62, 0xce, 0xe1, 0x63, 0x03, 0x96, 0x07, 0x7c, 0x87, 0x80, 0x5e, 0xcb, 0xf6, - 0xe5, 0x45, 0xf5, 0xfa, 0x48, 0x3a, 0x25, 0xd1, 0xdb, 0xbd, 0xfa, 0x1a, 0x5a, 0x91, 0x14, 0x42, - 0xa2, 0xe8, 0x73, 0x0b, 0x21, 0xd7, 0xda, 0x16, 0x52, 0x72, 0x6d, 0x46, 0x23, 0x5c, 0xc2, 0x43, - 0x80, 0xe8, 0x43, 0x05, 0x74, 0x31, 0x8e, 0x90, 0xc4, 0xc7, 0x0e, 0xd5, 0x4b, 0x69, 0xc3, 0x4a, - 0x8a, 0x9b, 0xbd, 0xfa, 0x32, 0x2a, 0x3f, 0xc0, 0xac, 0xb5, 0x6f, 0xb6, 0xc5, 0x70, 0x64, 0x90, - 0x85, 0x5b, 0x31, 0xcd, 0xfc, 0x9e, 0xa1, 0x7d, 0xfa, 0x19, 0xbc, 0x6f, 0x74, 0x75, 0xa0, 0xeb, - 0x8e, 0x87, 0xda, 0xb8, 0x0f, 0x4a, 0x7b, 0xfd, 0xcd, 0xba, 0xd7, 0xab, 0x9b, 0xe8, 0xd2, 0x43, - 0xcd, 0x95, 0xef, 0x9a, 0xd4, 0x23, 0x2d, 0x7b, 0xd7, 0x6e, 0x99, 0x2a, 0x40, 0x4a, 0x37, 0x64, - 0x2d, 0x29, 0xb9, 0x82, 0x76, 0x90, 0x90, 0xef, 0x8f, 0x0b, 0xb1, 0x57, 0x59, 0x83, 0x16, 0x53, - 0xdc, 0x72, 0xe9, 0x7d, 0xc7, 0xb8, 0xe5, 0x86, 0xf4, 0xaa, 0xac, 0xbf, 0x35, 0x7a, 0xf5, 0x8f, - 0x0d, 0xf4, 0x1d, 0x71, 0xe4, 0x02, 0x09, 0x94, 0xa3, 0x1c, 0x71, 0xec, 0xa2, 0xbc, 0xa0, 0x66, - 0xc6, 0x8f, 0xa0, 0x3a, 0x2d, 0xb1, 0x03, 0xa8, 0x37, 0xea, 0xa2, 0xe3, 0xc8, 0x8e, 0xbd, 0xf4, - 0xa3, 0x14, 0xca, 0x23, 0x34, 0x85, 0x50, 0x9f, 0xa6, 0xd0, 0x0f, 0x0b, 0xb0, 0xde, 0xe7, 0x8a, - 0x4e, 0x4f, 0x59, 0xff, 0x66, 0xf4, 0xea, 0x7f, 0x66, 0xa0, 0x4f, 0x74, 0xff, 0xf4, 0xff, 0x4a, - 0x67, 0xa1, 0xcb, 0x8c, 0xab, 0x6e, 0x1d, 0xad, 0xc5, 0xbd, 0x51, 0xa4, 0xc1, 0x4f, 0x0b, 0xbc, - 0x54, 0x1b, 0xdc, 0x55, 0x47, 0xb7, 0x87, 0x2b, 0x26, 0x76, 0x67, 0x52, 0xad, 0x65, 0x23, 0x56, - 0xaa, 0xfc, 0x91, 0xd1, 0xab, 0xff, 0xa1, 0x81, 0x3e, 0x96, 0xaa, 0x14, 0x63, 0xc2, 0x8d, 0xf1, - 0x0c, 0xc3, 0x76, 0x1d, 0xae, 0x4d, 0x25, 0xe3, 0x9d, 0xf0, 0xdc, 0x8c, 0xa7, 0xde, 0x40, 0x6d, - 0xc1, 0xad, 0x43, 0xcd, 0xf4, 0xdd, 0xce, 0x68, 0xd0, 0x29, 0xa1, 0x84, 0xfe, 0x2a, 0x68, 0x35, - 0x01, 0x3d, 0x79, 0x71, 0x40, 0xd1, 0x6f, 0xea, 0x00, 0x4c, 0x5e, 0x73, 0xa1, 0x11, 0x2a, 0x89, - 0x5f, 0x5f, 0x56, 0xef, 0x64, 0xa4, 0x56, 0x1a, 0xfc, 0x2d, 0xa3, 0x57, 0x67, 0xc8, 0xe7, 0xfa, - 0x93, 0xd7, 0x62, 0x74, 0x4c, 0xa5, 0x85, 0x37, 0x84, 0x35, 0x73, 0x98, 0xfe, 0x82, 0xab, 0xbd, - 0x9b, 0x31, 0x48, 0xf5, 0x5d, 0xce, 0x51, 0xe1, 0x5b, 0x93, 0xef, 0x87, 0xc6, 0x7d, 0x6b, 0xca, - 0x9b, 0xab, 0x71, 0xdf, 0x9a, 0xf6, 0x8a, 0xa9, 0xf2, 0xad, 0x2a, 0xfc, 0x05, 0xd6, 0x0a, 0xf2, - 0x3b, 0x9e, 0x2f, 0x63, 0xcf, 0x93, 0xbe, 0x75, 0x6b, 0xa0, 0x6f, 0xfd, 0x4b, 0x03, 0xce, 0x0d, - 0xea, 0xbf, 0xa2, 0xeb, 0xa3, 0x3a, 0xb4, 0x81, 0x9c, 0x37, 0x46, 0x13, 0x2a, 0x59, 0x3f, 0xec, - 0xd5, 0x5f, 0x43, 0xd7, 0xb8, 0x8d, 0xd4, 0x59, 0x4e, 0x35, 0x52, 0x8a, 0x56, 0x37, 0x83, 0xe6, - 0xfa, 0x5f, 0x1b, 0xb0, 0x9e, 0xda, 0x35, 0x8e, 0x23, 0x6d, 0x54, 0x4b, 0x3c, 0x8e, 0xb4, 0x91, - 0xad, 0x68, 0xeb, 0xbe, 0x88, 0xee, 0x2a, 0x79, 0x0d, 0x36, 0x62, 0x8a, 0xa6, 0xb4, 0x90, 0xfa, - 0x32, 0xba, 0x98, 0x22, 0xf5, 0xa6, 0xec, 0x5c, 0xff, 0x89, 0x01, 0x4b, 0xc9, 0x26, 0x61, 0x1c, - 0x11, 0x29, 0xad, 0xc9, 0x38, 0x22, 0xd2, 0xfa, 0x8c, 0xd6, 0x07, 0xbd, 0xfa, 0x79, 0xb4, 0x2e, - 0x87, 0x43, 0x44, 0x24, 0xc0, 0x60, 0x59, 0x7d, 0x42, 0xca, 0xcf, 0xb4, 0x36, 0xa9, 0xe0, 0xe3, - 0xc8, 0xe0, 0x72, 0x26, 0x7b, 0x83, 0x89, 0xac, 0x60, 0x70, 0x47, 0x32, 0x91, 0x15, 0xa4, 0xb4, - 0x17, 0x95, 0x9c, 0x72, 0x38, 0xbf, 0x9c, 0x2d, 0xc1, 0xc7, 0xe5, 0xfc, 0xc4, 0x80, 0x72, 0x5f, - 0x47, 0x10, 0x5d, 0x8b, 0x7f, 0x3d, 0x35, 0xb8, 0x13, 0x59, 0xfd, 0xe2, 0x08, 0xaa, 0x08, 0xb8, - 0x17, 0x50, 0x55, 0x8d, 0xa7, 0xc9, 0x7a, 0xd5, 0xba, 0x94, 0x22, 0xab, 0x2f, 0x19, 0x03, 0xa5, - 0x26, 0x9b, 0x81, 0x71, 0xa5, 0xa6, 0xb4, 0x20, 0xe3, 0x4a, 0x4d, 0xeb, 0x27, 0x2a, 0xa5, 0xca, - 0xe1, 0xfc, 0x4a, 0x95, 0x79, 0x22, 0x97, 0xf3, 0x53, 0x03, 0x96, 0x1f, 0xd3, 0xc3, 0x64, 0x1b, - 0x30, 0x2e, 0x6a, 0x4a, 0xf3, 0xb1, 0x7a, 0x6d, 0x38, 0x91, 0x12, 0xf5, 0x65, 0xaf, 0x7e, 0x1b, - 0xdd, 0xfc, 0x39, 0x15, 0x88, 0x82, 0xa2, 0x5f, 0xfa, 0xcd, 0x34, 0xd1, 0x5f, 0xb3, 0xae, 0xa4, - 0xea, 0x98, 0xf3, 0x6d, 0xda, 0xf4, 0x90, 0x8b, 0xff, 0x17, 0x06, 0x94, 0x1f, 0xd3, 0xc3, 0x78, - 0x5b, 0x10, 0xc5, 0xde, 0xb2, 0x19, 0xd8, 0x88, 0xac, 0x5a, 0xc3, 0x48, 0x94, 0xe0, 0xcf, 0x7b, - 0xf5, 0x9b, 0xe8, 0x7a, 0x52, 0x70, 0x0f, 0x53, 0x9a, 0x26, 0xf6, 0x35, 0xeb, 0x72, 0x8a, 0xd8, - 0x9c, 0x2b, 0x10, 0x3a, 0xd4, 0x79, 0xbc, 0xc7, 0x97, 0xd4, 0xf9, 0xc0, 0x8e, 0x64, 0x52, 0xe7, - 0x83, 0xdb, 0x84, 0xa9, 0x3a, 0xe7, 0xe4, 0xe3, 0xe8, 0x9c, 0xf3, 0x05, 0xe2, 0xff, 0x93, 0x01, - 0x95, 0x07, 0x5d, 0x6a, 0x3b, 0x84, 0xd2, 0xd3, 0xc4, 0x4d, 0xbb, 0x57, 0x7f, 0x1d, 0x6d, 0xe8, - 0x7b, 0xd8, 0x51, 0xab, 0x8e, 0x00, 0xcf, 0x6d, 0xeb, 0xb5, 0xe1, 0xe0, 0x09, 0xe6, 0xe1, 0xbb, - 0xf9, 0x3b, 0x03, 0x56, 0x83, 0xdd, 0x9c, 0x0e, 0x8c, 0x7e, 0xa5, 0x57, 0xdf, 0x40, 0xb5, 0x81, - 0xfb, 0x18, 0x86, 0xa5, 0x9b, 0xd6, 0xb5, 0x61, 0x58, 0xd2, 0xf7, 0x10, 0xb7, 0xc8, 0xe9, 0xa1, - 0x6a, 0xa8, 0x45, 0x86, 0x41, 0x6b, 0x98, 0x45, 0x04, 0xb4, 0xf4, 0xdd, 0xfc, 0xab, 0x01, 0xeb, - 0xdb, 0xa4, 0xb5, 0xef, 0xd8, 0x2d, 0xdc, 0x39, 0x4d, 0x80, 0xed, 0xf6, 0xea, 0x5f, 0x42, 0x9b, - 0xfa, 0x76, 0x58, 0xb0, 0xec, 0x08, 0x84, 0xd5, 0xac, 0xeb, 0xc3, 0x11, 0x16, 0x4e, 0xc4, 0x37, - 0xf4, 0x23, 0x03, 0xd6, 0xc2, 0x0d, 0x9d, 0x0e, 0xc6, 0x76, 0x7a, 0xf5, 0x4d, 0x74, 0x67, 0xf0, - 0x56, 0x86, 0x81, 0xec, 0x96, 0xf5, 0xc5, 0x61, 0x20, 0x8b, 0x6d, 0x23, 0x61, 0x97, 0xd3, 0x83, - 0xd9, 0x70, 0xbb, 0x0c, 0xc3, 0xd9, 0x30, 0xbb, 0x08, 0x9c, 0xc5, 0x36, 0xf4, 0x03, 0x03, 0x96, - 0xeb, 0xed, 0x03, 0xdb, 0x39, 0x1d, 0x9b, 0xf4, 0xfb, 0x60, 0xcc, 0x17, 0x1b, 0x6a, 0x8f, 0x74, - 0x1f, 0x2c, 0xec, 0x21, 0x26, 0xe0, 0xa2, 0xff, 0xbd, 0x01, 0x2b, 0x42, 0xf4, 0xd3, 0xb4, 0xc3, - 0x2f, 0x8b, 0x46, 0xb8, 0xbe, 0x01, 0xb1, 0xe4, 0x08, 0x1b, 0xdc, 0xb0, 0xae, 0x0e, 0xb7, 0x41, - 0xb8, 0x89, 0x3f, 0x32, 0xa0, 0xdc, 0x77, 0x6d, 0x84, 0x12, 0xc9, 0xef, 0xe0, 0xeb, 0xaa, 0x78, - 0x42, 0x97, 0x7a, 0xf7, 0x64, 0xd5, 0x7b, 0xf5, 0x15, 0xb4, 0xac, 0xc6, 0xf5, 0x42, 0x77, 0x44, - 0x26, 0x47, 0x25, 0x07, 0x97, 0xf2, 0x4f, 0x45, 0xda, 0x99, 0xb8, 0x29, 0x4a, 0xa6, 0x9d, 0x83, - 0x6f, 0xa8, 0x92, 0x69, 0x67, 0xca, 0x75, 0x93, 0xf5, 0xa8, 0x57, 0xaf, 0xa0, 0x55, 0x35, 0xae, - 0xeb, 0x35, 0x4b, 0xca, 0x29, 0x98, 0xde, 0x31, 0x6e, 0x3d, 0x98, 0x7a, 0x59, 0xf0, 0x76, 0x76, - 0x66, 0xc4, 0xf5, 0xd4, 0x1b, 0xff, 0x17, 0x00, 0x00, 0xff, 0xff, 0xd4, 0x78, 0x6d, 0xac, 0x98, - 0x4e, 0x00, 0x00, -} - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConn - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion4 - -// AppManagerClient is the client API for AppManager service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type AppManagerClient interface { - SyncRepo(ctx context.Context, in *SyncRepoRequest, opts ...grpc.CallOption) (*SyncRepoResponse, error) - // Create app, user of isv can create app on the platform - CreateApp(ctx context.Context, in *CreateAppRequest, opts ...grpc.CallOption) (*CreateAppResponse, error) - // Validate format of package(pack by op tool) - ValidatePackage(ctx context.Context, in *ValidatePackageRequest, opts ...grpc.CallOption) (*ValidatePackageResponse, error) - // Get statistics info of apps - GetAppStatistics(ctx context.Context, in *GetAppStatisticsRequest, opts ...grpc.CallOption) (*GetAppStatisticsResponse, error) - // Get apps, can filter with these fields(app_id, name, repo_id, description, status, home, icon, screenshots, maintainers, sources, readme, owner, chart_name), default return all apps - DescribeApps(ctx context.Context, in *DescribeAppsRequest, opts ...grpc.CallOption) (*DescribeAppsResponse, error) - // Get active apps, can filter with these fields(app_id, name, repo_id, description, status, home, icon, screenshots, maintainers, sources, readme, owner, chart_name), default return all apps - DescribeActiveApps(ctx context.Context, in *DescribeAppsRequest, opts ...grpc.CallOption) (*DescribeAppsResponse, error) - // Modify app info - ModifyApp(ctx context.Context, in *ModifyAppRequest, opts ...grpc.CallOption) (*ModifyAppResponse, error) - // Upload app attachment - UploadAppAttachment(ctx context.Context, in *UploadAppAttachmentRequest, opts ...grpc.CallOption) (*UploadAppAttachmentResponse, error) - // Batch delete apps - DeleteApps(ctx context.Context, in *DeleteAppsRequest, opts ...grpc.CallOption) (*DeleteAppsResponse, error) - // Create app of specific version - CreateAppVersion(ctx context.Context, in *CreateAppVersionRequest, opts ...grpc.CallOption) (*CreateAppVersionResponse, error) - // Get versions of app, can filter with these fields(version_id, app_id, name, owner, description, package_name, status, type), default return all app versions - DescribeAppVersions(ctx context.Context, in *DescribeAppVersionsRequest, opts ...grpc.CallOption) (*DescribeAppVersionsResponse, error) - // Get active versions of app, can filter with these fields(version_id, app_id, name, owner, description, package_name, status, type), default return all active app versions - DescribeActiveAppVersions(ctx context.Context, in *DescribeAppVersionsRequest, opts ...grpc.CallOption) (*DescribeAppVersionsResponse, error) - // Get audits information of version-specific app, can filter with these fields(version_id, app_id, status, operator, role), default return all app version audits - DescribeAppVersionAudits(ctx context.Context, in *DescribeAppVersionAuditsRequest, opts ...grpc.CallOption) (*DescribeAppVersionAuditsResponse, error) - // Get reviews of version-specific app, can filter with these fields(review_id, version_id, app_id, status, reviewer), default return all app version reviews - DescribeAppVersionReviews(ctx context.Context, in *DescribeAppVersionReviewsRequest, opts ...grpc.CallOption) (*DescribeAppVersionReviewsResponse, error) - // Modify version info of the app - ModifyAppVersion(ctx context.Context, in *ModifyAppVersionRequest, opts ...grpc.CallOption) (*ModifyAppVersionResponse, error) - // Get packages of version-specific app - GetAppVersionPackage(ctx context.Context, in *GetAppVersionPackageRequest, opts ...grpc.CallOption) (*GetAppVersionPackageResponse, error) - // Get app package files - GetAppVersionPackageFiles(ctx context.Context, in *GetAppVersionPackageFilesRequest, opts ...grpc.CallOption) (*GetAppVersionPackageFilesResponse, error) - // Submit version of the app - SubmitAppVersion(ctx context.Context, in *SubmitAppVersionRequest, opts ...grpc.CallOption) (*SubmitAppVersionResponse, error) - // Cancel version of the app - CancelAppVersion(ctx context.Context, in *CancelAppVersionRequest, opts ...grpc.CallOption) (*CancelAppVersionResponse, error) - // Release version of the app - ReleaseAppVersion(ctx context.Context, in *ReleaseAppVersionRequest, opts ...grpc.CallOption) (*ReleaseAppVersionResponse, error) - // Delete version of the app - DeleteAppVersion(ctx context.Context, in *DeleteAppVersionRequest, opts ...grpc.CallOption) (*DeleteAppVersionResponse, error) - // Operator of isv review version of the app - IsvReviewAppVersion(ctx context.Context, in *ReviewAppVersionRequest, opts ...grpc.CallOption) (*ReviewAppVersionResponse, error) - // Operator of isv pass version of the app - IsvPassAppVersion(ctx context.Context, in *PassAppVersionRequest, opts ...grpc.CallOption) (*PassAppVersionResponse, error) - // Operator of isv reject version of the app - IsvRejectAppVersion(ctx context.Context, in *RejectAppVersionRequest, opts ...grpc.CallOption) (*RejectAppVersionResponse, error) - // Operator of business review version of the app - BusinessReviewAppVersion(ctx context.Context, in *ReviewAppVersionRequest, opts ...grpc.CallOption) (*ReviewAppVersionResponse, error) - // Operator of business pass version of the app - BusinessPassAppVersion(ctx context.Context, in *PassAppVersionRequest, opts ...grpc.CallOption) (*PassAppVersionResponse, error) - // Operator of business reject version of the app - BusinessRejectAppVersion(ctx context.Context, in *RejectAppVersionRequest, opts ...grpc.CallOption) (*RejectAppVersionResponse, error) - // Operator of technical review version of the app - TechnicalReviewAppVersion(ctx context.Context, in *ReviewAppVersionRequest, opts ...grpc.CallOption) (*ReviewAppVersionResponse, error) - // Operator of technical pass version of the app - TechnicalPassAppVersion(ctx context.Context, in *PassAppVersionRequest, opts ...grpc.CallOption) (*PassAppVersionResponse, error) - // Operator of technical reject version of the app - TechnicalRejectAppVersion(ctx context.Context, in *RejectAppVersionRequest, opts ...grpc.CallOption) (*RejectAppVersionResponse, error) - // Operator of admin pass version of the app - AdminPassAppVersion(ctx context.Context, in *PassAppVersionRequest, opts ...grpc.CallOption) (*PassAppVersionResponse, error) - // Operator of admin reject version of the app - AdminRejectAppVersion(ctx context.Context, in *RejectAppVersionRequest, opts ...grpc.CallOption) (*RejectAppVersionResponse, error) - // Suspend app version - SuspendAppVersion(ctx context.Context, in *SuspendAppVersionRequest, opts ...grpc.CallOption) (*SuspendAppVersionResponse, error) - // Recover version of app - RecoverAppVersion(ctx context.Context, in *RecoverAppVersionRequest, opts ...grpc.CallOption) (*RecoverAppVersionResponse, error) -} - -type appManagerClient struct { - cc *grpc.ClientConn -} - -func NewAppManagerClient(cc *grpc.ClientConn) AppManagerClient { - return &appManagerClient{cc} -} - -func (c *appManagerClient) SyncRepo(ctx context.Context, in *SyncRepoRequest, opts ...grpc.CallOption) (*SyncRepoResponse, error) { - out := new(SyncRepoResponse) - err := c.cc.Invoke(ctx, "/openpitrix.AppManager/SyncRepo", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *appManagerClient) CreateApp(ctx context.Context, in *CreateAppRequest, opts ...grpc.CallOption) (*CreateAppResponse, error) { - out := new(CreateAppResponse) - err := c.cc.Invoke(ctx, "/openpitrix.AppManager/CreateApp", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *appManagerClient) ValidatePackage(ctx context.Context, in *ValidatePackageRequest, opts ...grpc.CallOption) (*ValidatePackageResponse, error) { - out := new(ValidatePackageResponse) - err := c.cc.Invoke(ctx, "/openpitrix.AppManager/ValidatePackage", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *appManagerClient) GetAppStatistics(ctx context.Context, in *GetAppStatisticsRequest, opts ...grpc.CallOption) (*GetAppStatisticsResponse, error) { - out := new(GetAppStatisticsResponse) - err := c.cc.Invoke(ctx, "/openpitrix.AppManager/GetAppStatistics", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *appManagerClient) DescribeApps(ctx context.Context, in *DescribeAppsRequest, opts ...grpc.CallOption) (*DescribeAppsResponse, error) { - out := new(DescribeAppsResponse) - err := c.cc.Invoke(ctx, "/openpitrix.AppManager/DescribeApps", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *appManagerClient) DescribeActiveApps(ctx context.Context, in *DescribeAppsRequest, opts ...grpc.CallOption) (*DescribeAppsResponse, error) { - out := new(DescribeAppsResponse) - err := c.cc.Invoke(ctx, "/openpitrix.AppManager/DescribeActiveApps", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *appManagerClient) ModifyApp(ctx context.Context, in *ModifyAppRequest, opts ...grpc.CallOption) (*ModifyAppResponse, error) { - out := new(ModifyAppResponse) - err := c.cc.Invoke(ctx, "/openpitrix.AppManager/ModifyApp", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *appManagerClient) UploadAppAttachment(ctx context.Context, in *UploadAppAttachmentRequest, opts ...grpc.CallOption) (*UploadAppAttachmentResponse, error) { - out := new(UploadAppAttachmentResponse) - err := c.cc.Invoke(ctx, "/openpitrix.AppManager/UploadAppAttachment", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *appManagerClient) DeleteApps(ctx context.Context, in *DeleteAppsRequest, opts ...grpc.CallOption) (*DeleteAppsResponse, error) { - out := new(DeleteAppsResponse) - err := c.cc.Invoke(ctx, "/openpitrix.AppManager/DeleteApps", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *appManagerClient) CreateAppVersion(ctx context.Context, in *CreateAppVersionRequest, opts ...grpc.CallOption) (*CreateAppVersionResponse, error) { - out := new(CreateAppVersionResponse) - err := c.cc.Invoke(ctx, "/openpitrix.AppManager/CreateAppVersion", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *appManagerClient) DescribeAppVersions(ctx context.Context, in *DescribeAppVersionsRequest, opts ...grpc.CallOption) (*DescribeAppVersionsResponse, error) { - out := new(DescribeAppVersionsResponse) - err := c.cc.Invoke(ctx, "/openpitrix.AppManager/DescribeAppVersions", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *appManagerClient) DescribeActiveAppVersions(ctx context.Context, in *DescribeAppVersionsRequest, opts ...grpc.CallOption) (*DescribeAppVersionsResponse, error) { - out := new(DescribeAppVersionsResponse) - err := c.cc.Invoke(ctx, "/openpitrix.AppManager/DescribeActiveAppVersions", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *appManagerClient) DescribeAppVersionAudits(ctx context.Context, in *DescribeAppVersionAuditsRequest, opts ...grpc.CallOption) (*DescribeAppVersionAuditsResponse, error) { - out := new(DescribeAppVersionAuditsResponse) - err := c.cc.Invoke(ctx, "/openpitrix.AppManager/DescribeAppVersionAudits", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *appManagerClient) DescribeAppVersionReviews(ctx context.Context, in *DescribeAppVersionReviewsRequest, opts ...grpc.CallOption) (*DescribeAppVersionReviewsResponse, error) { - out := new(DescribeAppVersionReviewsResponse) - err := c.cc.Invoke(ctx, "/openpitrix.AppManager/DescribeAppVersionReviews", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *appManagerClient) ModifyAppVersion(ctx context.Context, in *ModifyAppVersionRequest, opts ...grpc.CallOption) (*ModifyAppVersionResponse, error) { - out := new(ModifyAppVersionResponse) - err := c.cc.Invoke(ctx, "/openpitrix.AppManager/ModifyAppVersion", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *appManagerClient) GetAppVersionPackage(ctx context.Context, in *GetAppVersionPackageRequest, opts ...grpc.CallOption) (*GetAppVersionPackageResponse, error) { - out := new(GetAppVersionPackageResponse) - err := c.cc.Invoke(ctx, "/openpitrix.AppManager/GetAppVersionPackage", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *appManagerClient) GetAppVersionPackageFiles(ctx context.Context, in *GetAppVersionPackageFilesRequest, opts ...grpc.CallOption) (*GetAppVersionPackageFilesResponse, error) { - out := new(GetAppVersionPackageFilesResponse) - err := c.cc.Invoke(ctx, "/openpitrix.AppManager/GetAppVersionPackageFiles", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *appManagerClient) SubmitAppVersion(ctx context.Context, in *SubmitAppVersionRequest, opts ...grpc.CallOption) (*SubmitAppVersionResponse, error) { - out := new(SubmitAppVersionResponse) - err := c.cc.Invoke(ctx, "/openpitrix.AppManager/SubmitAppVersion", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *appManagerClient) CancelAppVersion(ctx context.Context, in *CancelAppVersionRequest, opts ...grpc.CallOption) (*CancelAppVersionResponse, error) { - out := new(CancelAppVersionResponse) - err := c.cc.Invoke(ctx, "/openpitrix.AppManager/CancelAppVersion", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *appManagerClient) ReleaseAppVersion(ctx context.Context, in *ReleaseAppVersionRequest, opts ...grpc.CallOption) (*ReleaseAppVersionResponse, error) { - out := new(ReleaseAppVersionResponse) - err := c.cc.Invoke(ctx, "/openpitrix.AppManager/ReleaseAppVersion", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *appManagerClient) DeleteAppVersion(ctx context.Context, in *DeleteAppVersionRequest, opts ...grpc.CallOption) (*DeleteAppVersionResponse, error) { - out := new(DeleteAppVersionResponse) - err := c.cc.Invoke(ctx, "/openpitrix.AppManager/DeleteAppVersion", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *appManagerClient) IsvReviewAppVersion(ctx context.Context, in *ReviewAppVersionRequest, opts ...grpc.CallOption) (*ReviewAppVersionResponse, error) { - out := new(ReviewAppVersionResponse) - err := c.cc.Invoke(ctx, "/openpitrix.AppManager/IsvReviewAppVersion", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *appManagerClient) IsvPassAppVersion(ctx context.Context, in *PassAppVersionRequest, opts ...grpc.CallOption) (*PassAppVersionResponse, error) { - out := new(PassAppVersionResponse) - err := c.cc.Invoke(ctx, "/openpitrix.AppManager/IsvPassAppVersion", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *appManagerClient) IsvRejectAppVersion(ctx context.Context, in *RejectAppVersionRequest, opts ...grpc.CallOption) (*RejectAppVersionResponse, error) { - out := new(RejectAppVersionResponse) - err := c.cc.Invoke(ctx, "/openpitrix.AppManager/IsvRejectAppVersion", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *appManagerClient) BusinessReviewAppVersion(ctx context.Context, in *ReviewAppVersionRequest, opts ...grpc.CallOption) (*ReviewAppVersionResponse, error) { - out := new(ReviewAppVersionResponse) - err := c.cc.Invoke(ctx, "/openpitrix.AppManager/BusinessReviewAppVersion", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *appManagerClient) BusinessPassAppVersion(ctx context.Context, in *PassAppVersionRequest, opts ...grpc.CallOption) (*PassAppVersionResponse, error) { - out := new(PassAppVersionResponse) - err := c.cc.Invoke(ctx, "/openpitrix.AppManager/BusinessPassAppVersion", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *appManagerClient) BusinessRejectAppVersion(ctx context.Context, in *RejectAppVersionRequest, opts ...grpc.CallOption) (*RejectAppVersionResponse, error) { - out := new(RejectAppVersionResponse) - err := c.cc.Invoke(ctx, "/openpitrix.AppManager/BusinessRejectAppVersion", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *appManagerClient) TechnicalReviewAppVersion(ctx context.Context, in *ReviewAppVersionRequest, opts ...grpc.CallOption) (*ReviewAppVersionResponse, error) { - out := new(ReviewAppVersionResponse) - err := c.cc.Invoke(ctx, "/openpitrix.AppManager/TechnicalReviewAppVersion", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *appManagerClient) TechnicalPassAppVersion(ctx context.Context, in *PassAppVersionRequest, opts ...grpc.CallOption) (*PassAppVersionResponse, error) { - out := new(PassAppVersionResponse) - err := c.cc.Invoke(ctx, "/openpitrix.AppManager/TechnicalPassAppVersion", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *appManagerClient) TechnicalRejectAppVersion(ctx context.Context, in *RejectAppVersionRequest, opts ...grpc.CallOption) (*RejectAppVersionResponse, error) { - out := new(RejectAppVersionResponse) - err := c.cc.Invoke(ctx, "/openpitrix.AppManager/TechnicalRejectAppVersion", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *appManagerClient) AdminPassAppVersion(ctx context.Context, in *PassAppVersionRequest, opts ...grpc.CallOption) (*PassAppVersionResponse, error) { - out := new(PassAppVersionResponse) - err := c.cc.Invoke(ctx, "/openpitrix.AppManager/AdminPassAppVersion", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *appManagerClient) AdminRejectAppVersion(ctx context.Context, in *RejectAppVersionRequest, opts ...grpc.CallOption) (*RejectAppVersionResponse, error) { - out := new(RejectAppVersionResponse) - err := c.cc.Invoke(ctx, "/openpitrix.AppManager/AdminRejectAppVersion", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *appManagerClient) SuspendAppVersion(ctx context.Context, in *SuspendAppVersionRequest, opts ...grpc.CallOption) (*SuspendAppVersionResponse, error) { - out := new(SuspendAppVersionResponse) - err := c.cc.Invoke(ctx, "/openpitrix.AppManager/SuspendAppVersion", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *appManagerClient) RecoverAppVersion(ctx context.Context, in *RecoverAppVersionRequest, opts ...grpc.CallOption) (*RecoverAppVersionResponse, error) { - out := new(RecoverAppVersionResponse) - err := c.cc.Invoke(ctx, "/openpitrix.AppManager/RecoverAppVersion", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// AppManagerServer is the server API for AppManager service. -type AppManagerServer interface { - SyncRepo(context.Context, *SyncRepoRequest) (*SyncRepoResponse, error) - // Create app, user of isv can create app on the platform - CreateApp(context.Context, *CreateAppRequest) (*CreateAppResponse, error) - // Validate format of package(pack by op tool) - ValidatePackage(context.Context, *ValidatePackageRequest) (*ValidatePackageResponse, error) - // Get statistics info of apps - GetAppStatistics(context.Context, *GetAppStatisticsRequest) (*GetAppStatisticsResponse, error) - // Get apps, can filter with these fields(app_id, name, repo_id, description, status, home, icon, screenshots, maintainers, sources, readme, owner, chart_name), default return all apps - DescribeApps(context.Context, *DescribeAppsRequest) (*DescribeAppsResponse, error) - // Get active apps, can filter with these fields(app_id, name, repo_id, description, status, home, icon, screenshots, maintainers, sources, readme, owner, chart_name), default return all apps - DescribeActiveApps(context.Context, *DescribeAppsRequest) (*DescribeAppsResponse, error) - // Modify app info - ModifyApp(context.Context, *ModifyAppRequest) (*ModifyAppResponse, error) - // Upload app attachment - UploadAppAttachment(context.Context, *UploadAppAttachmentRequest) (*UploadAppAttachmentResponse, error) - // Batch delete apps - DeleteApps(context.Context, *DeleteAppsRequest) (*DeleteAppsResponse, error) - // Create app of specific version - CreateAppVersion(context.Context, *CreateAppVersionRequest) (*CreateAppVersionResponse, error) - // Get versions of app, can filter with these fields(version_id, app_id, name, owner, description, package_name, status, type), default return all app versions - DescribeAppVersions(context.Context, *DescribeAppVersionsRequest) (*DescribeAppVersionsResponse, error) - // Get active versions of app, can filter with these fields(version_id, app_id, name, owner, description, package_name, status, type), default return all active app versions - DescribeActiveAppVersions(context.Context, *DescribeAppVersionsRequest) (*DescribeAppVersionsResponse, error) - // Get audits information of version-specific app, can filter with these fields(version_id, app_id, status, operator, role), default return all app version audits - DescribeAppVersionAudits(context.Context, *DescribeAppVersionAuditsRequest) (*DescribeAppVersionAuditsResponse, error) - // Get reviews of version-specific app, can filter with these fields(review_id, version_id, app_id, status, reviewer), default return all app version reviews - DescribeAppVersionReviews(context.Context, *DescribeAppVersionReviewsRequest) (*DescribeAppVersionReviewsResponse, error) - // Modify version info of the app - ModifyAppVersion(context.Context, *ModifyAppVersionRequest) (*ModifyAppVersionResponse, error) - // Get packages of version-specific app - GetAppVersionPackage(context.Context, *GetAppVersionPackageRequest) (*GetAppVersionPackageResponse, error) - // Get app package files - GetAppVersionPackageFiles(context.Context, *GetAppVersionPackageFilesRequest) (*GetAppVersionPackageFilesResponse, error) - // Submit version of the app - SubmitAppVersion(context.Context, *SubmitAppVersionRequest) (*SubmitAppVersionResponse, error) - // Cancel version of the app - CancelAppVersion(context.Context, *CancelAppVersionRequest) (*CancelAppVersionResponse, error) - // Release version of the app - ReleaseAppVersion(context.Context, *ReleaseAppVersionRequest) (*ReleaseAppVersionResponse, error) - // Delete version of the app - DeleteAppVersion(context.Context, *DeleteAppVersionRequest) (*DeleteAppVersionResponse, error) - // Operator of isv review version of the app - IsvReviewAppVersion(context.Context, *ReviewAppVersionRequest) (*ReviewAppVersionResponse, error) - // Operator of isv pass version of the app - IsvPassAppVersion(context.Context, *PassAppVersionRequest) (*PassAppVersionResponse, error) - // Operator of isv reject version of the app - IsvRejectAppVersion(context.Context, *RejectAppVersionRequest) (*RejectAppVersionResponse, error) - // Operator of business review version of the app - BusinessReviewAppVersion(context.Context, *ReviewAppVersionRequest) (*ReviewAppVersionResponse, error) - // Operator of business pass version of the app - BusinessPassAppVersion(context.Context, *PassAppVersionRequest) (*PassAppVersionResponse, error) - // Operator of business reject version of the app - BusinessRejectAppVersion(context.Context, *RejectAppVersionRequest) (*RejectAppVersionResponse, error) - // Operator of technical review version of the app - TechnicalReviewAppVersion(context.Context, *ReviewAppVersionRequest) (*ReviewAppVersionResponse, error) - // Operator of technical pass version of the app - TechnicalPassAppVersion(context.Context, *PassAppVersionRequest) (*PassAppVersionResponse, error) - // Operator of technical reject version of the app - TechnicalRejectAppVersion(context.Context, *RejectAppVersionRequest) (*RejectAppVersionResponse, error) - // Operator of admin pass version of the app - AdminPassAppVersion(context.Context, *PassAppVersionRequest) (*PassAppVersionResponse, error) - // Operator of admin reject version of the app - AdminRejectAppVersion(context.Context, *RejectAppVersionRequest) (*RejectAppVersionResponse, error) - // Suspend app version - SuspendAppVersion(context.Context, *SuspendAppVersionRequest) (*SuspendAppVersionResponse, error) - // Recover version of app - RecoverAppVersion(context.Context, *RecoverAppVersionRequest) (*RecoverAppVersionResponse, error) -} - -// UnimplementedAppManagerServer can be embedded to have forward compatible implementations. -type UnimplementedAppManagerServer struct { -} - -func (*UnimplementedAppManagerServer) SyncRepo(ctx context.Context, req *SyncRepoRequest) (*SyncRepoResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method SyncRepo not implemented") -} -func (*UnimplementedAppManagerServer) CreateApp(ctx context.Context, req *CreateAppRequest) (*CreateAppResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method CreateApp not implemented") -} -func (*UnimplementedAppManagerServer) ValidatePackage(ctx context.Context, req *ValidatePackageRequest) (*ValidatePackageResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ValidatePackage not implemented") -} -func (*UnimplementedAppManagerServer) GetAppStatistics(ctx context.Context, req *GetAppStatisticsRequest) (*GetAppStatisticsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetAppStatistics not implemented") -} -func (*UnimplementedAppManagerServer) DescribeApps(ctx context.Context, req *DescribeAppsRequest) (*DescribeAppsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method DescribeApps not implemented") -} -func (*UnimplementedAppManagerServer) DescribeActiveApps(ctx context.Context, req *DescribeAppsRequest) (*DescribeAppsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method DescribeActiveApps not implemented") -} -func (*UnimplementedAppManagerServer) ModifyApp(ctx context.Context, req *ModifyAppRequest) (*ModifyAppResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ModifyApp not implemented") -} -func (*UnimplementedAppManagerServer) UploadAppAttachment(ctx context.Context, req *UploadAppAttachmentRequest) (*UploadAppAttachmentResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method UploadAppAttachment not implemented") -} -func (*UnimplementedAppManagerServer) DeleteApps(ctx context.Context, req *DeleteAppsRequest) (*DeleteAppsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method DeleteApps not implemented") -} -func (*UnimplementedAppManagerServer) CreateAppVersion(ctx context.Context, req *CreateAppVersionRequest) (*CreateAppVersionResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method CreateAppVersion not implemented") -} -func (*UnimplementedAppManagerServer) DescribeAppVersions(ctx context.Context, req *DescribeAppVersionsRequest) (*DescribeAppVersionsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method DescribeAppVersions not implemented") -} -func (*UnimplementedAppManagerServer) DescribeActiveAppVersions(ctx context.Context, req *DescribeAppVersionsRequest) (*DescribeAppVersionsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method DescribeActiveAppVersions not implemented") -} -func (*UnimplementedAppManagerServer) DescribeAppVersionAudits(ctx context.Context, req *DescribeAppVersionAuditsRequest) (*DescribeAppVersionAuditsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method DescribeAppVersionAudits not implemented") -} -func (*UnimplementedAppManagerServer) DescribeAppVersionReviews(ctx context.Context, req *DescribeAppVersionReviewsRequest) (*DescribeAppVersionReviewsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method DescribeAppVersionReviews not implemented") -} -func (*UnimplementedAppManagerServer) ModifyAppVersion(ctx context.Context, req *ModifyAppVersionRequest) (*ModifyAppVersionResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ModifyAppVersion not implemented") -} -func (*UnimplementedAppManagerServer) GetAppVersionPackage(ctx context.Context, req *GetAppVersionPackageRequest) (*GetAppVersionPackageResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetAppVersionPackage not implemented") -} -func (*UnimplementedAppManagerServer) GetAppVersionPackageFiles(ctx context.Context, req *GetAppVersionPackageFilesRequest) (*GetAppVersionPackageFilesResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetAppVersionPackageFiles not implemented") -} -func (*UnimplementedAppManagerServer) SubmitAppVersion(ctx context.Context, req *SubmitAppVersionRequest) (*SubmitAppVersionResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method SubmitAppVersion not implemented") -} -func (*UnimplementedAppManagerServer) CancelAppVersion(ctx context.Context, req *CancelAppVersionRequest) (*CancelAppVersionResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method CancelAppVersion not implemented") -} -func (*UnimplementedAppManagerServer) ReleaseAppVersion(ctx context.Context, req *ReleaseAppVersionRequest) (*ReleaseAppVersionResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ReleaseAppVersion not implemented") -} -func (*UnimplementedAppManagerServer) DeleteAppVersion(ctx context.Context, req *DeleteAppVersionRequest) (*DeleteAppVersionResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method DeleteAppVersion not implemented") -} -func (*UnimplementedAppManagerServer) IsvReviewAppVersion(ctx context.Context, req *ReviewAppVersionRequest) (*ReviewAppVersionResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method IsvReviewAppVersion not implemented") -} -func (*UnimplementedAppManagerServer) IsvPassAppVersion(ctx context.Context, req *PassAppVersionRequest) (*PassAppVersionResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method IsvPassAppVersion not implemented") -} -func (*UnimplementedAppManagerServer) IsvRejectAppVersion(ctx context.Context, req *RejectAppVersionRequest) (*RejectAppVersionResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method IsvRejectAppVersion not implemented") -} -func (*UnimplementedAppManagerServer) BusinessReviewAppVersion(ctx context.Context, req *ReviewAppVersionRequest) (*ReviewAppVersionResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method BusinessReviewAppVersion not implemented") -} -func (*UnimplementedAppManagerServer) BusinessPassAppVersion(ctx context.Context, req *PassAppVersionRequest) (*PassAppVersionResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method BusinessPassAppVersion not implemented") -} -func (*UnimplementedAppManagerServer) BusinessRejectAppVersion(ctx context.Context, req *RejectAppVersionRequest) (*RejectAppVersionResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method BusinessRejectAppVersion not implemented") -} -func (*UnimplementedAppManagerServer) TechnicalReviewAppVersion(ctx context.Context, req *ReviewAppVersionRequest) (*ReviewAppVersionResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method TechnicalReviewAppVersion not implemented") -} -func (*UnimplementedAppManagerServer) TechnicalPassAppVersion(ctx context.Context, req *PassAppVersionRequest) (*PassAppVersionResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method TechnicalPassAppVersion not implemented") -} -func (*UnimplementedAppManagerServer) TechnicalRejectAppVersion(ctx context.Context, req *RejectAppVersionRequest) (*RejectAppVersionResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method TechnicalRejectAppVersion not implemented") -} -func (*UnimplementedAppManagerServer) AdminPassAppVersion(ctx context.Context, req *PassAppVersionRequest) (*PassAppVersionResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method AdminPassAppVersion not implemented") -} -func (*UnimplementedAppManagerServer) AdminRejectAppVersion(ctx context.Context, req *RejectAppVersionRequest) (*RejectAppVersionResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method AdminRejectAppVersion not implemented") -} -func (*UnimplementedAppManagerServer) SuspendAppVersion(ctx context.Context, req *SuspendAppVersionRequest) (*SuspendAppVersionResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method SuspendAppVersion not implemented") -} -func (*UnimplementedAppManagerServer) RecoverAppVersion(ctx context.Context, req *RecoverAppVersionRequest) (*RecoverAppVersionResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method RecoverAppVersion not implemented") -} - -func RegisterAppManagerServer(s *grpc.Server, srv AppManagerServer) { - s.RegisterService(&_AppManager_serviceDesc, srv) -} - -func _AppManager_SyncRepo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(SyncRepoRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AppManagerServer).SyncRepo(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/openpitrix.AppManager/SyncRepo", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AppManagerServer).SyncRepo(ctx, req.(*SyncRepoRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _AppManager_CreateApp_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CreateAppRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AppManagerServer).CreateApp(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/openpitrix.AppManager/CreateApp", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AppManagerServer).CreateApp(ctx, req.(*CreateAppRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _AppManager_ValidatePackage_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ValidatePackageRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AppManagerServer).ValidatePackage(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/openpitrix.AppManager/ValidatePackage", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AppManagerServer).ValidatePackage(ctx, req.(*ValidatePackageRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _AppManager_GetAppStatistics_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetAppStatisticsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AppManagerServer).GetAppStatistics(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/openpitrix.AppManager/GetAppStatistics", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AppManagerServer).GetAppStatistics(ctx, req.(*GetAppStatisticsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _AppManager_DescribeApps_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DescribeAppsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AppManagerServer).DescribeApps(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/openpitrix.AppManager/DescribeApps", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AppManagerServer).DescribeApps(ctx, req.(*DescribeAppsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _AppManager_DescribeActiveApps_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DescribeAppsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AppManagerServer).DescribeActiveApps(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/openpitrix.AppManager/DescribeActiveApps", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AppManagerServer).DescribeActiveApps(ctx, req.(*DescribeAppsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _AppManager_ModifyApp_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ModifyAppRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AppManagerServer).ModifyApp(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/openpitrix.AppManager/ModifyApp", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AppManagerServer).ModifyApp(ctx, req.(*ModifyAppRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _AppManager_UploadAppAttachment_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(UploadAppAttachmentRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AppManagerServer).UploadAppAttachment(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/openpitrix.AppManager/UploadAppAttachment", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AppManagerServer).UploadAppAttachment(ctx, req.(*UploadAppAttachmentRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _AppManager_DeleteApps_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DeleteAppsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AppManagerServer).DeleteApps(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/openpitrix.AppManager/DeleteApps", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AppManagerServer).DeleteApps(ctx, req.(*DeleteAppsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _AppManager_CreateAppVersion_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CreateAppVersionRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AppManagerServer).CreateAppVersion(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/openpitrix.AppManager/CreateAppVersion", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AppManagerServer).CreateAppVersion(ctx, req.(*CreateAppVersionRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _AppManager_DescribeAppVersions_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DescribeAppVersionsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AppManagerServer).DescribeAppVersions(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/openpitrix.AppManager/DescribeAppVersions", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AppManagerServer).DescribeAppVersions(ctx, req.(*DescribeAppVersionsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _AppManager_DescribeActiveAppVersions_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DescribeAppVersionsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AppManagerServer).DescribeActiveAppVersions(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/openpitrix.AppManager/DescribeActiveAppVersions", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AppManagerServer).DescribeActiveAppVersions(ctx, req.(*DescribeAppVersionsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _AppManager_DescribeAppVersionAudits_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DescribeAppVersionAuditsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AppManagerServer).DescribeAppVersionAudits(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/openpitrix.AppManager/DescribeAppVersionAudits", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AppManagerServer).DescribeAppVersionAudits(ctx, req.(*DescribeAppVersionAuditsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _AppManager_DescribeAppVersionReviews_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DescribeAppVersionReviewsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AppManagerServer).DescribeAppVersionReviews(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/openpitrix.AppManager/DescribeAppVersionReviews", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AppManagerServer).DescribeAppVersionReviews(ctx, req.(*DescribeAppVersionReviewsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _AppManager_ModifyAppVersion_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ModifyAppVersionRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AppManagerServer).ModifyAppVersion(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/openpitrix.AppManager/ModifyAppVersion", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AppManagerServer).ModifyAppVersion(ctx, req.(*ModifyAppVersionRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _AppManager_GetAppVersionPackage_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetAppVersionPackageRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AppManagerServer).GetAppVersionPackage(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/openpitrix.AppManager/GetAppVersionPackage", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AppManagerServer).GetAppVersionPackage(ctx, req.(*GetAppVersionPackageRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _AppManager_GetAppVersionPackageFiles_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetAppVersionPackageFilesRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AppManagerServer).GetAppVersionPackageFiles(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/openpitrix.AppManager/GetAppVersionPackageFiles", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AppManagerServer).GetAppVersionPackageFiles(ctx, req.(*GetAppVersionPackageFilesRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _AppManager_SubmitAppVersion_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(SubmitAppVersionRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AppManagerServer).SubmitAppVersion(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/openpitrix.AppManager/SubmitAppVersion", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AppManagerServer).SubmitAppVersion(ctx, req.(*SubmitAppVersionRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _AppManager_CancelAppVersion_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CancelAppVersionRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AppManagerServer).CancelAppVersion(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/openpitrix.AppManager/CancelAppVersion", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AppManagerServer).CancelAppVersion(ctx, req.(*CancelAppVersionRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _AppManager_ReleaseAppVersion_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ReleaseAppVersionRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AppManagerServer).ReleaseAppVersion(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/openpitrix.AppManager/ReleaseAppVersion", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AppManagerServer).ReleaseAppVersion(ctx, req.(*ReleaseAppVersionRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _AppManager_DeleteAppVersion_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DeleteAppVersionRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AppManagerServer).DeleteAppVersion(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/openpitrix.AppManager/DeleteAppVersion", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AppManagerServer).DeleteAppVersion(ctx, req.(*DeleteAppVersionRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _AppManager_IsvReviewAppVersion_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ReviewAppVersionRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AppManagerServer).IsvReviewAppVersion(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/openpitrix.AppManager/IsvReviewAppVersion", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AppManagerServer).IsvReviewAppVersion(ctx, req.(*ReviewAppVersionRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _AppManager_IsvPassAppVersion_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(PassAppVersionRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AppManagerServer).IsvPassAppVersion(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/openpitrix.AppManager/IsvPassAppVersion", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AppManagerServer).IsvPassAppVersion(ctx, req.(*PassAppVersionRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _AppManager_IsvRejectAppVersion_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(RejectAppVersionRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AppManagerServer).IsvRejectAppVersion(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/openpitrix.AppManager/IsvRejectAppVersion", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AppManagerServer).IsvRejectAppVersion(ctx, req.(*RejectAppVersionRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _AppManager_BusinessReviewAppVersion_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ReviewAppVersionRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AppManagerServer).BusinessReviewAppVersion(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/openpitrix.AppManager/BusinessReviewAppVersion", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AppManagerServer).BusinessReviewAppVersion(ctx, req.(*ReviewAppVersionRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _AppManager_BusinessPassAppVersion_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(PassAppVersionRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AppManagerServer).BusinessPassAppVersion(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/openpitrix.AppManager/BusinessPassAppVersion", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AppManagerServer).BusinessPassAppVersion(ctx, req.(*PassAppVersionRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _AppManager_BusinessRejectAppVersion_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(RejectAppVersionRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AppManagerServer).BusinessRejectAppVersion(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/openpitrix.AppManager/BusinessRejectAppVersion", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AppManagerServer).BusinessRejectAppVersion(ctx, req.(*RejectAppVersionRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _AppManager_TechnicalReviewAppVersion_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ReviewAppVersionRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AppManagerServer).TechnicalReviewAppVersion(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/openpitrix.AppManager/TechnicalReviewAppVersion", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AppManagerServer).TechnicalReviewAppVersion(ctx, req.(*ReviewAppVersionRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _AppManager_TechnicalPassAppVersion_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(PassAppVersionRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AppManagerServer).TechnicalPassAppVersion(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/openpitrix.AppManager/TechnicalPassAppVersion", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AppManagerServer).TechnicalPassAppVersion(ctx, req.(*PassAppVersionRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _AppManager_TechnicalRejectAppVersion_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(RejectAppVersionRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AppManagerServer).TechnicalRejectAppVersion(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/openpitrix.AppManager/TechnicalRejectAppVersion", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AppManagerServer).TechnicalRejectAppVersion(ctx, req.(*RejectAppVersionRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _AppManager_AdminPassAppVersion_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(PassAppVersionRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AppManagerServer).AdminPassAppVersion(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/openpitrix.AppManager/AdminPassAppVersion", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AppManagerServer).AdminPassAppVersion(ctx, req.(*PassAppVersionRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _AppManager_AdminRejectAppVersion_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(RejectAppVersionRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AppManagerServer).AdminRejectAppVersion(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/openpitrix.AppManager/AdminRejectAppVersion", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AppManagerServer).AdminRejectAppVersion(ctx, req.(*RejectAppVersionRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _AppManager_SuspendAppVersion_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(SuspendAppVersionRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AppManagerServer).SuspendAppVersion(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/openpitrix.AppManager/SuspendAppVersion", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AppManagerServer).SuspendAppVersion(ctx, req.(*SuspendAppVersionRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _AppManager_RecoverAppVersion_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(RecoverAppVersionRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AppManagerServer).RecoverAppVersion(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/openpitrix.AppManager/RecoverAppVersion", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AppManagerServer).RecoverAppVersion(ctx, req.(*RecoverAppVersionRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _AppManager_serviceDesc = grpc.ServiceDesc{ - ServiceName: "openpitrix.AppManager", - HandlerType: (*AppManagerServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "SyncRepo", - Handler: _AppManager_SyncRepo_Handler, - }, - { - MethodName: "CreateApp", - Handler: _AppManager_CreateApp_Handler, - }, - { - MethodName: "ValidatePackage", - Handler: _AppManager_ValidatePackage_Handler, - }, - { - MethodName: "GetAppStatistics", - Handler: _AppManager_GetAppStatistics_Handler, - }, - { - MethodName: "DescribeApps", - Handler: _AppManager_DescribeApps_Handler, - }, - { - MethodName: "DescribeActiveApps", - Handler: _AppManager_DescribeActiveApps_Handler, - }, - { - MethodName: "ModifyApp", - Handler: _AppManager_ModifyApp_Handler, - }, - { - MethodName: "UploadAppAttachment", - Handler: _AppManager_UploadAppAttachment_Handler, - }, - { - MethodName: "DeleteApps", - Handler: _AppManager_DeleteApps_Handler, - }, - { - MethodName: "CreateAppVersion", - Handler: _AppManager_CreateAppVersion_Handler, - }, - { - MethodName: "DescribeAppVersions", - Handler: _AppManager_DescribeAppVersions_Handler, - }, - { - MethodName: "DescribeActiveAppVersions", - Handler: _AppManager_DescribeActiveAppVersions_Handler, - }, - { - MethodName: "DescribeAppVersionAudits", - Handler: _AppManager_DescribeAppVersionAudits_Handler, - }, - { - MethodName: "DescribeAppVersionReviews", - Handler: _AppManager_DescribeAppVersionReviews_Handler, - }, - { - MethodName: "ModifyAppVersion", - Handler: _AppManager_ModifyAppVersion_Handler, - }, - { - MethodName: "GetAppVersionPackage", - Handler: _AppManager_GetAppVersionPackage_Handler, - }, - { - MethodName: "GetAppVersionPackageFiles", - Handler: _AppManager_GetAppVersionPackageFiles_Handler, - }, - { - MethodName: "SubmitAppVersion", - Handler: _AppManager_SubmitAppVersion_Handler, - }, - { - MethodName: "CancelAppVersion", - Handler: _AppManager_CancelAppVersion_Handler, - }, - { - MethodName: "ReleaseAppVersion", - Handler: _AppManager_ReleaseAppVersion_Handler, - }, - { - MethodName: "DeleteAppVersion", - Handler: _AppManager_DeleteAppVersion_Handler, - }, - { - MethodName: "IsvReviewAppVersion", - Handler: _AppManager_IsvReviewAppVersion_Handler, - }, - { - MethodName: "IsvPassAppVersion", - Handler: _AppManager_IsvPassAppVersion_Handler, - }, - { - MethodName: "IsvRejectAppVersion", - Handler: _AppManager_IsvRejectAppVersion_Handler, - }, - { - MethodName: "BusinessReviewAppVersion", - Handler: _AppManager_BusinessReviewAppVersion_Handler, - }, - { - MethodName: "BusinessPassAppVersion", - Handler: _AppManager_BusinessPassAppVersion_Handler, - }, - { - MethodName: "BusinessRejectAppVersion", - Handler: _AppManager_BusinessRejectAppVersion_Handler, - }, - { - MethodName: "TechnicalReviewAppVersion", - Handler: _AppManager_TechnicalReviewAppVersion_Handler, - }, - { - MethodName: "TechnicalPassAppVersion", - Handler: _AppManager_TechnicalPassAppVersion_Handler, - }, - { - MethodName: "TechnicalRejectAppVersion", - Handler: _AppManager_TechnicalRejectAppVersion_Handler, - }, - { - MethodName: "AdminPassAppVersion", - Handler: _AppManager_AdminPassAppVersion_Handler, - }, - { - MethodName: "AdminRejectAppVersion", - Handler: _AppManager_AdminRejectAppVersion_Handler, - }, - { - MethodName: "SuspendAppVersion", - Handler: _AppManager_SuspendAppVersion_Handler, - }, - { - MethodName: "RecoverAppVersion", - Handler: _AppManager_RecoverAppVersion_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "app.proto", -} diff --git a/vendor/openpitrix.io/openpitrix/pkg/pb/app.pb.gw.go b/vendor/openpitrix.io/openpitrix/pkg/pb/app.pb.gw.go deleted file mode 100644 index 36fe702d3b..0000000000 --- a/vendor/openpitrix.io/openpitrix/pkg/pb/app.pb.gw.go +++ /dev/null @@ -1,2635 +0,0 @@ -// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: app.proto - -/* -Package pb is a reverse proxy. - -It translates gRPC into RESTful JSON APIs. -*/ -package pb - -import ( - "context" - "io" - "net/http" - - "github.com/golang/protobuf/descriptor" - "github.com/golang/protobuf/proto" - "github.com/grpc-ecosystem/grpc-gateway/runtime" - "github.com/grpc-ecosystem/grpc-gateway/utilities" - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/grpclog" - "google.golang.org/grpc/status" -) - -// Suppress "imported and not used" errors -var _ codes.Code -var _ io.Reader -var _ status.Status -var _ = runtime.String -var _ = utilities.NewDoubleArray -var _ = descriptor.ForMessage - -func request_AppManager_CreateApp_0(ctx context.Context, marshaler runtime.Marshaler, client AppManagerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq CreateAppRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.CreateApp(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_AppManager_CreateApp_0(ctx context.Context, marshaler runtime.Marshaler, server AppManagerServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq CreateAppRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.CreateApp(ctx, &protoReq) - return msg, metadata, err - -} - -func request_AppManager_ValidatePackage_0(ctx context.Context, marshaler runtime.Marshaler, client AppManagerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ValidatePackageRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.ValidatePackage(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_AppManager_ValidatePackage_0(ctx context.Context, marshaler runtime.Marshaler, server AppManagerServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ValidatePackageRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.ValidatePackage(ctx, &protoReq) - return msg, metadata, err - -} - -func request_AppManager_GetAppStatistics_0(ctx context.Context, marshaler runtime.Marshaler, client AppManagerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq GetAppStatisticsRequest - var metadata runtime.ServerMetadata - - msg, err := client.GetAppStatistics(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_AppManager_GetAppStatistics_0(ctx context.Context, marshaler runtime.Marshaler, server AppManagerServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq GetAppStatisticsRequest - var metadata runtime.ServerMetadata - - msg, err := server.GetAppStatistics(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_AppManager_DescribeApps_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_AppManager_DescribeApps_0(ctx context.Context, marshaler runtime.Marshaler, client AppManagerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq DescribeAppsRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_AppManager_DescribeApps_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.DescribeApps(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_AppManager_DescribeApps_0(ctx context.Context, marshaler runtime.Marshaler, server AppManagerServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq DescribeAppsRequest - var metadata runtime.ServerMetadata - - if err := runtime.PopulateQueryParameters(&protoReq, req.URL.Query(), filter_AppManager_DescribeApps_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.DescribeApps(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_AppManager_DescribeActiveApps_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_AppManager_DescribeActiveApps_0(ctx context.Context, marshaler runtime.Marshaler, client AppManagerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq DescribeAppsRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_AppManager_DescribeActiveApps_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.DescribeActiveApps(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_AppManager_DescribeActiveApps_0(ctx context.Context, marshaler runtime.Marshaler, server AppManagerServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq DescribeAppsRequest - var metadata runtime.ServerMetadata - - if err := runtime.PopulateQueryParameters(&protoReq, req.URL.Query(), filter_AppManager_DescribeActiveApps_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.DescribeActiveApps(ctx, &protoReq) - return msg, metadata, err - -} - -func request_AppManager_ModifyApp_0(ctx context.Context, marshaler runtime.Marshaler, client AppManagerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ModifyAppRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.ModifyApp(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_AppManager_ModifyApp_0(ctx context.Context, marshaler runtime.Marshaler, server AppManagerServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ModifyAppRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.ModifyApp(ctx, &protoReq) - return msg, metadata, err - -} - -func request_AppManager_UploadAppAttachment_0(ctx context.Context, marshaler runtime.Marshaler, client AppManagerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq UploadAppAttachmentRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.UploadAppAttachment(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_AppManager_UploadAppAttachment_0(ctx context.Context, marshaler runtime.Marshaler, server AppManagerServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq UploadAppAttachmentRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.UploadAppAttachment(ctx, &protoReq) - return msg, metadata, err - -} - -func request_AppManager_DeleteApps_0(ctx context.Context, marshaler runtime.Marshaler, client AppManagerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq DeleteAppsRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.DeleteApps(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_AppManager_DeleteApps_0(ctx context.Context, marshaler runtime.Marshaler, server AppManagerServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq DeleteAppsRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.DeleteApps(ctx, &protoReq) - return msg, metadata, err - -} - -func request_AppManager_CreateAppVersion_0(ctx context.Context, marshaler runtime.Marshaler, client AppManagerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq CreateAppVersionRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.CreateAppVersion(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_AppManager_CreateAppVersion_0(ctx context.Context, marshaler runtime.Marshaler, server AppManagerServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq CreateAppVersionRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.CreateAppVersion(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_AppManager_DescribeAppVersions_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_AppManager_DescribeAppVersions_0(ctx context.Context, marshaler runtime.Marshaler, client AppManagerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq DescribeAppVersionsRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_AppManager_DescribeAppVersions_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.DescribeAppVersions(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_AppManager_DescribeAppVersions_0(ctx context.Context, marshaler runtime.Marshaler, server AppManagerServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq DescribeAppVersionsRequest - var metadata runtime.ServerMetadata - - if err := runtime.PopulateQueryParameters(&protoReq, req.URL.Query(), filter_AppManager_DescribeAppVersions_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.DescribeAppVersions(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_AppManager_DescribeActiveAppVersions_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_AppManager_DescribeActiveAppVersions_0(ctx context.Context, marshaler runtime.Marshaler, client AppManagerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq DescribeAppVersionsRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_AppManager_DescribeActiveAppVersions_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.DescribeActiveAppVersions(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_AppManager_DescribeActiveAppVersions_0(ctx context.Context, marshaler runtime.Marshaler, server AppManagerServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq DescribeAppVersionsRequest - var metadata runtime.ServerMetadata - - if err := runtime.PopulateQueryParameters(&protoReq, req.URL.Query(), filter_AppManager_DescribeActiveAppVersions_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.DescribeActiveAppVersions(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_AppManager_DescribeAppVersionAudits_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_AppManager_DescribeAppVersionAudits_0(ctx context.Context, marshaler runtime.Marshaler, client AppManagerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq DescribeAppVersionAuditsRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_AppManager_DescribeAppVersionAudits_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.DescribeAppVersionAudits(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_AppManager_DescribeAppVersionAudits_0(ctx context.Context, marshaler runtime.Marshaler, server AppManagerServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq DescribeAppVersionAuditsRequest - var metadata runtime.ServerMetadata - - if err := runtime.PopulateQueryParameters(&protoReq, req.URL.Query(), filter_AppManager_DescribeAppVersionAudits_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.DescribeAppVersionAudits(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_AppManager_DescribeAppVersionReviews_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_AppManager_DescribeAppVersionReviews_0(ctx context.Context, marshaler runtime.Marshaler, client AppManagerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq DescribeAppVersionReviewsRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_AppManager_DescribeAppVersionReviews_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.DescribeAppVersionReviews(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_AppManager_DescribeAppVersionReviews_0(ctx context.Context, marshaler runtime.Marshaler, server AppManagerServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq DescribeAppVersionReviewsRequest - var metadata runtime.ServerMetadata - - if err := runtime.PopulateQueryParameters(&protoReq, req.URL.Query(), filter_AppManager_DescribeAppVersionReviews_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.DescribeAppVersionReviews(ctx, &protoReq) - return msg, metadata, err - -} - -func request_AppManager_ModifyAppVersion_0(ctx context.Context, marshaler runtime.Marshaler, client AppManagerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ModifyAppVersionRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.ModifyAppVersion(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_AppManager_ModifyAppVersion_0(ctx context.Context, marshaler runtime.Marshaler, server AppManagerServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ModifyAppVersionRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.ModifyAppVersion(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_AppManager_GetAppVersionPackage_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_AppManager_GetAppVersionPackage_0(ctx context.Context, marshaler runtime.Marshaler, client AppManagerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq GetAppVersionPackageRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_AppManager_GetAppVersionPackage_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.GetAppVersionPackage(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_AppManager_GetAppVersionPackage_0(ctx context.Context, marshaler runtime.Marshaler, server AppManagerServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq GetAppVersionPackageRequest - var metadata runtime.ServerMetadata - - if err := runtime.PopulateQueryParameters(&protoReq, req.URL.Query(), filter_AppManager_GetAppVersionPackage_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.GetAppVersionPackage(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_AppManager_GetAppVersionPackageFiles_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_AppManager_GetAppVersionPackageFiles_0(ctx context.Context, marshaler runtime.Marshaler, client AppManagerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq GetAppVersionPackageFilesRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_AppManager_GetAppVersionPackageFiles_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.GetAppVersionPackageFiles(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_AppManager_GetAppVersionPackageFiles_0(ctx context.Context, marshaler runtime.Marshaler, server AppManagerServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq GetAppVersionPackageFilesRequest - var metadata runtime.ServerMetadata - - if err := runtime.PopulateQueryParameters(&protoReq, req.URL.Query(), filter_AppManager_GetAppVersionPackageFiles_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.GetAppVersionPackageFiles(ctx, &protoReq) - return msg, metadata, err - -} - -func request_AppManager_SubmitAppVersion_0(ctx context.Context, marshaler runtime.Marshaler, client AppManagerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq SubmitAppVersionRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.SubmitAppVersion(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_AppManager_SubmitAppVersion_0(ctx context.Context, marshaler runtime.Marshaler, server AppManagerServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq SubmitAppVersionRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.SubmitAppVersion(ctx, &protoReq) - return msg, metadata, err - -} - -func request_AppManager_CancelAppVersion_0(ctx context.Context, marshaler runtime.Marshaler, client AppManagerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq CancelAppVersionRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.CancelAppVersion(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_AppManager_CancelAppVersion_0(ctx context.Context, marshaler runtime.Marshaler, server AppManagerServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq CancelAppVersionRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.CancelAppVersion(ctx, &protoReq) - return msg, metadata, err - -} - -func request_AppManager_ReleaseAppVersion_0(ctx context.Context, marshaler runtime.Marshaler, client AppManagerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ReleaseAppVersionRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.ReleaseAppVersion(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_AppManager_ReleaseAppVersion_0(ctx context.Context, marshaler runtime.Marshaler, server AppManagerServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ReleaseAppVersionRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.ReleaseAppVersion(ctx, &protoReq) - return msg, metadata, err - -} - -func request_AppManager_DeleteAppVersion_0(ctx context.Context, marshaler runtime.Marshaler, client AppManagerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq DeleteAppVersionRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.DeleteAppVersion(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_AppManager_DeleteAppVersion_0(ctx context.Context, marshaler runtime.Marshaler, server AppManagerServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq DeleteAppVersionRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.DeleteAppVersion(ctx, &protoReq) - return msg, metadata, err - -} - -func request_AppManager_IsvReviewAppVersion_0(ctx context.Context, marshaler runtime.Marshaler, client AppManagerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ReviewAppVersionRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.IsvReviewAppVersion(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_AppManager_IsvReviewAppVersion_0(ctx context.Context, marshaler runtime.Marshaler, server AppManagerServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ReviewAppVersionRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.IsvReviewAppVersion(ctx, &protoReq) - return msg, metadata, err - -} - -func request_AppManager_IsvPassAppVersion_0(ctx context.Context, marshaler runtime.Marshaler, client AppManagerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq PassAppVersionRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.IsvPassAppVersion(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_AppManager_IsvPassAppVersion_0(ctx context.Context, marshaler runtime.Marshaler, server AppManagerServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq PassAppVersionRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.IsvPassAppVersion(ctx, &protoReq) - return msg, metadata, err - -} - -func request_AppManager_IsvRejectAppVersion_0(ctx context.Context, marshaler runtime.Marshaler, client AppManagerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq RejectAppVersionRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.IsvRejectAppVersion(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_AppManager_IsvRejectAppVersion_0(ctx context.Context, marshaler runtime.Marshaler, server AppManagerServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq RejectAppVersionRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.IsvRejectAppVersion(ctx, &protoReq) - return msg, metadata, err - -} - -func request_AppManager_BusinessReviewAppVersion_0(ctx context.Context, marshaler runtime.Marshaler, client AppManagerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ReviewAppVersionRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.BusinessReviewAppVersion(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_AppManager_BusinessReviewAppVersion_0(ctx context.Context, marshaler runtime.Marshaler, server AppManagerServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ReviewAppVersionRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.BusinessReviewAppVersion(ctx, &protoReq) - return msg, metadata, err - -} - -func request_AppManager_BusinessPassAppVersion_0(ctx context.Context, marshaler runtime.Marshaler, client AppManagerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq PassAppVersionRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.BusinessPassAppVersion(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_AppManager_BusinessPassAppVersion_0(ctx context.Context, marshaler runtime.Marshaler, server AppManagerServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq PassAppVersionRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.BusinessPassAppVersion(ctx, &protoReq) - return msg, metadata, err - -} - -func request_AppManager_BusinessRejectAppVersion_0(ctx context.Context, marshaler runtime.Marshaler, client AppManagerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq RejectAppVersionRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.BusinessRejectAppVersion(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_AppManager_BusinessRejectAppVersion_0(ctx context.Context, marshaler runtime.Marshaler, server AppManagerServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq RejectAppVersionRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.BusinessRejectAppVersion(ctx, &protoReq) - return msg, metadata, err - -} - -func request_AppManager_TechnicalReviewAppVersion_0(ctx context.Context, marshaler runtime.Marshaler, client AppManagerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ReviewAppVersionRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.TechnicalReviewAppVersion(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_AppManager_TechnicalReviewAppVersion_0(ctx context.Context, marshaler runtime.Marshaler, server AppManagerServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ReviewAppVersionRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.TechnicalReviewAppVersion(ctx, &protoReq) - return msg, metadata, err - -} - -func request_AppManager_TechnicalPassAppVersion_0(ctx context.Context, marshaler runtime.Marshaler, client AppManagerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq PassAppVersionRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.TechnicalPassAppVersion(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_AppManager_TechnicalPassAppVersion_0(ctx context.Context, marshaler runtime.Marshaler, server AppManagerServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq PassAppVersionRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.TechnicalPassAppVersion(ctx, &protoReq) - return msg, metadata, err - -} - -func request_AppManager_TechnicalRejectAppVersion_0(ctx context.Context, marshaler runtime.Marshaler, client AppManagerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq RejectAppVersionRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.TechnicalRejectAppVersion(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_AppManager_TechnicalRejectAppVersion_0(ctx context.Context, marshaler runtime.Marshaler, server AppManagerServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq RejectAppVersionRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.TechnicalRejectAppVersion(ctx, &protoReq) - return msg, metadata, err - -} - -func request_AppManager_AdminPassAppVersion_0(ctx context.Context, marshaler runtime.Marshaler, client AppManagerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq PassAppVersionRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.AdminPassAppVersion(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_AppManager_AdminPassAppVersion_0(ctx context.Context, marshaler runtime.Marshaler, server AppManagerServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq PassAppVersionRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.AdminPassAppVersion(ctx, &protoReq) - return msg, metadata, err - -} - -func request_AppManager_AdminRejectAppVersion_0(ctx context.Context, marshaler runtime.Marshaler, client AppManagerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq RejectAppVersionRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.AdminRejectAppVersion(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_AppManager_AdminRejectAppVersion_0(ctx context.Context, marshaler runtime.Marshaler, server AppManagerServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq RejectAppVersionRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.AdminRejectAppVersion(ctx, &protoReq) - return msg, metadata, err - -} - -func request_AppManager_SuspendAppVersion_0(ctx context.Context, marshaler runtime.Marshaler, client AppManagerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq SuspendAppVersionRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.SuspendAppVersion(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_AppManager_SuspendAppVersion_0(ctx context.Context, marshaler runtime.Marshaler, server AppManagerServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq SuspendAppVersionRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.SuspendAppVersion(ctx, &protoReq) - return msg, metadata, err - -} - -func request_AppManager_RecoverAppVersion_0(ctx context.Context, marshaler runtime.Marshaler, client AppManagerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq RecoverAppVersionRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.RecoverAppVersion(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_AppManager_RecoverAppVersion_0(ctx context.Context, marshaler runtime.Marshaler, server AppManagerServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq RecoverAppVersionRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.RecoverAppVersion(ctx, &protoReq) - return msg, metadata, err - -} - -// RegisterAppManagerHandlerServer registers the http handlers for service AppManager to "mux". -// UnaryRPC :call AppManagerServer directly. -// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. -func RegisterAppManagerHandlerServer(ctx context.Context, mux *runtime.ServeMux, server AppManagerServer) error { - - mux.Handle("POST", pattern_AppManager_CreateApp_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_AppManager_CreateApp_0(rctx, inboundMarshaler, server, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_AppManager_CreateApp_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_AppManager_ValidatePackage_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_AppManager_ValidatePackage_0(rctx, inboundMarshaler, server, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_AppManager_ValidatePackage_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_AppManager_GetAppStatistics_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_AppManager_GetAppStatistics_0(rctx, inboundMarshaler, server, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_AppManager_GetAppStatistics_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_AppManager_DescribeApps_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_AppManager_DescribeApps_0(rctx, inboundMarshaler, server, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_AppManager_DescribeApps_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_AppManager_DescribeActiveApps_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_AppManager_DescribeActiveApps_0(rctx, inboundMarshaler, server, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_AppManager_DescribeActiveApps_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("PATCH", pattern_AppManager_ModifyApp_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_AppManager_ModifyApp_0(rctx, inboundMarshaler, server, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_AppManager_ModifyApp_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("PATCH", pattern_AppManager_UploadAppAttachment_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_AppManager_UploadAppAttachment_0(rctx, inboundMarshaler, server, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_AppManager_UploadAppAttachment_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("DELETE", pattern_AppManager_DeleteApps_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_AppManager_DeleteApps_0(rctx, inboundMarshaler, server, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_AppManager_DeleteApps_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_AppManager_CreateAppVersion_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_AppManager_CreateAppVersion_0(rctx, inboundMarshaler, server, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_AppManager_CreateAppVersion_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_AppManager_DescribeAppVersions_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_AppManager_DescribeAppVersions_0(rctx, inboundMarshaler, server, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_AppManager_DescribeAppVersions_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_AppManager_DescribeActiveAppVersions_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_AppManager_DescribeActiveAppVersions_0(rctx, inboundMarshaler, server, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_AppManager_DescribeActiveAppVersions_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_AppManager_DescribeAppVersionAudits_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_AppManager_DescribeAppVersionAudits_0(rctx, inboundMarshaler, server, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_AppManager_DescribeAppVersionAudits_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_AppManager_DescribeAppVersionReviews_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_AppManager_DescribeAppVersionReviews_0(rctx, inboundMarshaler, server, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_AppManager_DescribeAppVersionReviews_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("PATCH", pattern_AppManager_ModifyAppVersion_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_AppManager_ModifyAppVersion_0(rctx, inboundMarshaler, server, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_AppManager_ModifyAppVersion_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_AppManager_GetAppVersionPackage_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_AppManager_GetAppVersionPackage_0(rctx, inboundMarshaler, server, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_AppManager_GetAppVersionPackage_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_AppManager_GetAppVersionPackageFiles_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_AppManager_GetAppVersionPackageFiles_0(rctx, inboundMarshaler, server, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_AppManager_GetAppVersionPackageFiles_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_AppManager_SubmitAppVersion_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_AppManager_SubmitAppVersion_0(rctx, inboundMarshaler, server, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_AppManager_SubmitAppVersion_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_AppManager_CancelAppVersion_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_AppManager_CancelAppVersion_0(rctx, inboundMarshaler, server, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_AppManager_CancelAppVersion_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_AppManager_ReleaseAppVersion_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_AppManager_ReleaseAppVersion_0(rctx, inboundMarshaler, server, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_AppManager_ReleaseAppVersion_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_AppManager_DeleteAppVersion_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_AppManager_DeleteAppVersion_0(rctx, inboundMarshaler, server, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_AppManager_DeleteAppVersion_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_AppManager_IsvReviewAppVersion_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_AppManager_IsvReviewAppVersion_0(rctx, inboundMarshaler, server, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_AppManager_IsvReviewAppVersion_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_AppManager_IsvPassAppVersion_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_AppManager_IsvPassAppVersion_0(rctx, inboundMarshaler, server, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_AppManager_IsvPassAppVersion_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_AppManager_IsvRejectAppVersion_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_AppManager_IsvRejectAppVersion_0(rctx, inboundMarshaler, server, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_AppManager_IsvRejectAppVersion_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_AppManager_BusinessReviewAppVersion_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_AppManager_BusinessReviewAppVersion_0(rctx, inboundMarshaler, server, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_AppManager_BusinessReviewAppVersion_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_AppManager_BusinessPassAppVersion_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_AppManager_BusinessPassAppVersion_0(rctx, inboundMarshaler, server, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_AppManager_BusinessPassAppVersion_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_AppManager_BusinessRejectAppVersion_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_AppManager_BusinessRejectAppVersion_0(rctx, inboundMarshaler, server, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_AppManager_BusinessRejectAppVersion_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_AppManager_TechnicalReviewAppVersion_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_AppManager_TechnicalReviewAppVersion_0(rctx, inboundMarshaler, server, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_AppManager_TechnicalReviewAppVersion_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_AppManager_TechnicalPassAppVersion_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_AppManager_TechnicalPassAppVersion_0(rctx, inboundMarshaler, server, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_AppManager_TechnicalPassAppVersion_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_AppManager_TechnicalRejectAppVersion_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_AppManager_TechnicalRejectAppVersion_0(rctx, inboundMarshaler, server, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_AppManager_TechnicalRejectAppVersion_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_AppManager_AdminPassAppVersion_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_AppManager_AdminPassAppVersion_0(rctx, inboundMarshaler, server, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_AppManager_AdminPassAppVersion_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_AppManager_AdminRejectAppVersion_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_AppManager_AdminRejectAppVersion_0(rctx, inboundMarshaler, server, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_AppManager_AdminRejectAppVersion_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_AppManager_SuspendAppVersion_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_AppManager_SuspendAppVersion_0(rctx, inboundMarshaler, server, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_AppManager_SuspendAppVersion_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_AppManager_RecoverAppVersion_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_AppManager_RecoverAppVersion_0(rctx, inboundMarshaler, server, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_AppManager_RecoverAppVersion_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -// RegisterAppManagerHandlerFromEndpoint is same as RegisterAppManagerHandler but -// automatically dials to "endpoint" and closes the connection when "ctx" gets done. -func RegisterAppManagerHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { - conn, err := grpc.Dial(endpoint, opts...) - if err != nil { - return err - } - defer func() { - if err != nil { - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - return - } - go func() { - <-ctx.Done() - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - }() - }() - - return RegisterAppManagerHandler(ctx, mux, conn) -} - -// RegisterAppManagerHandler registers the http handlers for service AppManager to "mux". -// The handlers forward requests to the grpc endpoint over "conn". -func RegisterAppManagerHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { - return RegisterAppManagerHandlerClient(ctx, mux, NewAppManagerClient(conn)) -} - -// RegisterAppManagerHandlerClient registers the http handlers for service AppManager -// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "AppManagerClient". -// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "AppManagerClient" -// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in -// "AppManagerClient" to call the correct interceptors. -func RegisterAppManagerHandlerClient(ctx context.Context, mux *runtime.ServeMux, client AppManagerClient) error { - - mux.Handle("POST", pattern_AppManager_CreateApp_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_AppManager_CreateApp_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_AppManager_CreateApp_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_AppManager_ValidatePackage_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_AppManager_ValidatePackage_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_AppManager_ValidatePackage_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_AppManager_GetAppStatistics_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_AppManager_GetAppStatistics_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_AppManager_GetAppStatistics_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_AppManager_DescribeApps_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_AppManager_DescribeApps_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_AppManager_DescribeApps_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_AppManager_DescribeActiveApps_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_AppManager_DescribeActiveApps_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_AppManager_DescribeActiveApps_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("PATCH", pattern_AppManager_ModifyApp_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_AppManager_ModifyApp_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_AppManager_ModifyApp_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("PATCH", pattern_AppManager_UploadAppAttachment_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_AppManager_UploadAppAttachment_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_AppManager_UploadAppAttachment_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("DELETE", pattern_AppManager_DeleteApps_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_AppManager_DeleteApps_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_AppManager_DeleteApps_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_AppManager_CreateAppVersion_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_AppManager_CreateAppVersion_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_AppManager_CreateAppVersion_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_AppManager_DescribeAppVersions_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_AppManager_DescribeAppVersions_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_AppManager_DescribeAppVersions_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_AppManager_DescribeActiveAppVersions_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_AppManager_DescribeActiveAppVersions_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_AppManager_DescribeActiveAppVersions_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_AppManager_DescribeAppVersionAudits_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_AppManager_DescribeAppVersionAudits_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_AppManager_DescribeAppVersionAudits_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_AppManager_DescribeAppVersionReviews_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_AppManager_DescribeAppVersionReviews_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_AppManager_DescribeAppVersionReviews_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("PATCH", pattern_AppManager_ModifyAppVersion_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_AppManager_ModifyAppVersion_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_AppManager_ModifyAppVersion_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_AppManager_GetAppVersionPackage_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_AppManager_GetAppVersionPackage_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_AppManager_GetAppVersionPackage_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_AppManager_GetAppVersionPackageFiles_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_AppManager_GetAppVersionPackageFiles_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_AppManager_GetAppVersionPackageFiles_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_AppManager_SubmitAppVersion_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_AppManager_SubmitAppVersion_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_AppManager_SubmitAppVersion_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_AppManager_CancelAppVersion_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_AppManager_CancelAppVersion_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_AppManager_CancelAppVersion_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_AppManager_ReleaseAppVersion_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_AppManager_ReleaseAppVersion_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_AppManager_ReleaseAppVersion_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_AppManager_DeleteAppVersion_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_AppManager_DeleteAppVersion_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_AppManager_DeleteAppVersion_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_AppManager_IsvReviewAppVersion_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_AppManager_IsvReviewAppVersion_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_AppManager_IsvReviewAppVersion_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_AppManager_IsvPassAppVersion_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_AppManager_IsvPassAppVersion_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_AppManager_IsvPassAppVersion_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_AppManager_IsvRejectAppVersion_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_AppManager_IsvRejectAppVersion_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_AppManager_IsvRejectAppVersion_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_AppManager_BusinessReviewAppVersion_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_AppManager_BusinessReviewAppVersion_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_AppManager_BusinessReviewAppVersion_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_AppManager_BusinessPassAppVersion_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_AppManager_BusinessPassAppVersion_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_AppManager_BusinessPassAppVersion_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_AppManager_BusinessRejectAppVersion_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_AppManager_BusinessRejectAppVersion_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_AppManager_BusinessRejectAppVersion_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_AppManager_TechnicalReviewAppVersion_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_AppManager_TechnicalReviewAppVersion_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_AppManager_TechnicalReviewAppVersion_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_AppManager_TechnicalPassAppVersion_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_AppManager_TechnicalPassAppVersion_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_AppManager_TechnicalPassAppVersion_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_AppManager_TechnicalRejectAppVersion_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_AppManager_TechnicalRejectAppVersion_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_AppManager_TechnicalRejectAppVersion_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_AppManager_AdminPassAppVersion_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_AppManager_AdminPassAppVersion_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_AppManager_AdminPassAppVersion_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_AppManager_AdminRejectAppVersion_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_AppManager_AdminRejectAppVersion_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_AppManager_AdminRejectAppVersion_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_AppManager_SuspendAppVersion_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_AppManager_SuspendAppVersion_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_AppManager_SuspendAppVersion_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_AppManager_RecoverAppVersion_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_AppManager_RecoverAppVersion_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_AppManager_RecoverAppVersion_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -var ( - pattern_AppManager_CreateApp_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "apps"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_AppManager_ValidatePackage_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "apps", "validate_package"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_AppManager_GetAppStatistics_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "apps", "statistics"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_AppManager_DescribeApps_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "apps"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_AppManager_DescribeActiveApps_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "active_apps"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_AppManager_ModifyApp_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "apps"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_AppManager_UploadAppAttachment_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "app", "attachment"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_AppManager_DeleteApps_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "apps"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_AppManager_CreateAppVersion_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "app_versions"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_AppManager_DescribeAppVersions_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "app_versions"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_AppManager_DescribeActiveAppVersions_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "active_app_versions"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_AppManager_DescribeAppVersionAudits_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "app_version_audits"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_AppManager_DescribeAppVersionReviews_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "app_version_reviews"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_AppManager_ModifyAppVersion_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "app_versions"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_AppManager_GetAppVersionPackage_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "app_version", "package"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_AppManager_GetAppVersionPackageFiles_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v1", "app_version", "package", "files"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_AppManager_SubmitAppVersion_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v1", "app_version", "action", "submit"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_AppManager_CancelAppVersion_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v1", "app_version", "action", "cancel"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_AppManager_ReleaseAppVersion_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v1", "app_version", "action", "release"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_AppManager_DeleteAppVersion_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v1", "app_version", "action", "delete"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_AppManager_IsvReviewAppVersion_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"v1", "app_version", "action", "review", "isv"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_AppManager_IsvPassAppVersion_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"v1", "app_version", "action", "pass", "isv"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_AppManager_IsvRejectAppVersion_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"v1", "app_version", "action", "reject", "isv"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_AppManager_BusinessReviewAppVersion_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"v1", "app_version", "action", "review", "business"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_AppManager_BusinessPassAppVersion_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"v1", "app_version", "action", "pass", "business"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_AppManager_BusinessRejectAppVersion_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"v1", "app_version", "action", "reject", "business"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_AppManager_TechnicalReviewAppVersion_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"v1", "app_version", "action", "review", "technical"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_AppManager_TechnicalPassAppVersion_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"v1", "app_version", "action", "pass", "technical"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_AppManager_TechnicalRejectAppVersion_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"v1", "app_version", "action", "reject", "technical"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_AppManager_AdminPassAppVersion_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"v1", "app_version", "action", "pass", "admin"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_AppManager_AdminRejectAppVersion_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"v1", "app_version", "action", "reject", "admin"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_AppManager_SuspendAppVersion_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v1", "app_version", "action", "suspend"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_AppManager_RecoverAppVersion_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v1", "app_version", "action", "recover"}, "", runtime.AssumeColonVerbOpt(true))) -) - -var ( - forward_AppManager_CreateApp_0 = runtime.ForwardResponseMessage - - forward_AppManager_ValidatePackage_0 = runtime.ForwardResponseMessage - - forward_AppManager_GetAppStatistics_0 = runtime.ForwardResponseMessage - - forward_AppManager_DescribeApps_0 = runtime.ForwardResponseMessage - - forward_AppManager_DescribeActiveApps_0 = runtime.ForwardResponseMessage - - forward_AppManager_ModifyApp_0 = runtime.ForwardResponseMessage - - forward_AppManager_UploadAppAttachment_0 = runtime.ForwardResponseMessage - - forward_AppManager_DeleteApps_0 = runtime.ForwardResponseMessage - - forward_AppManager_CreateAppVersion_0 = runtime.ForwardResponseMessage - - forward_AppManager_DescribeAppVersions_0 = runtime.ForwardResponseMessage - - forward_AppManager_DescribeActiveAppVersions_0 = runtime.ForwardResponseMessage - - forward_AppManager_DescribeAppVersionAudits_0 = runtime.ForwardResponseMessage - - forward_AppManager_DescribeAppVersionReviews_0 = runtime.ForwardResponseMessage - - forward_AppManager_ModifyAppVersion_0 = runtime.ForwardResponseMessage - - forward_AppManager_GetAppVersionPackage_0 = runtime.ForwardResponseMessage - - forward_AppManager_GetAppVersionPackageFiles_0 = runtime.ForwardResponseMessage - - forward_AppManager_SubmitAppVersion_0 = runtime.ForwardResponseMessage - - forward_AppManager_CancelAppVersion_0 = runtime.ForwardResponseMessage - - forward_AppManager_ReleaseAppVersion_0 = runtime.ForwardResponseMessage - - forward_AppManager_DeleteAppVersion_0 = runtime.ForwardResponseMessage - - forward_AppManager_IsvReviewAppVersion_0 = runtime.ForwardResponseMessage - - forward_AppManager_IsvPassAppVersion_0 = runtime.ForwardResponseMessage - - forward_AppManager_IsvRejectAppVersion_0 = runtime.ForwardResponseMessage - - forward_AppManager_BusinessReviewAppVersion_0 = runtime.ForwardResponseMessage - - forward_AppManager_BusinessPassAppVersion_0 = runtime.ForwardResponseMessage - - forward_AppManager_BusinessRejectAppVersion_0 = runtime.ForwardResponseMessage - - forward_AppManager_TechnicalReviewAppVersion_0 = runtime.ForwardResponseMessage - - forward_AppManager_TechnicalPassAppVersion_0 = runtime.ForwardResponseMessage - - forward_AppManager_TechnicalRejectAppVersion_0 = runtime.ForwardResponseMessage - - forward_AppManager_AdminPassAppVersion_0 = runtime.ForwardResponseMessage - - forward_AppManager_AdminRejectAppVersion_0 = runtime.ForwardResponseMessage - - forward_AppManager_SuspendAppVersion_0 = runtime.ForwardResponseMessage - - forward_AppManager_RecoverAppVersion_0 = runtime.ForwardResponseMessage -) diff --git a/vendor/openpitrix.io/openpitrix/pkg/pb/attachment.pb.go b/vendor/openpitrix.io/openpitrix/pkg/pb/attachment.pb.go deleted file mode 100644 index d159dffd3f..0000000000 --- a/vendor/openpitrix.io/openpitrix/pkg/pb/attachment.pb.go +++ /dev/null @@ -1,1036 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// source: attachment.proto - -package pb - -import ( - context "context" - fmt "fmt" - math "math" - - proto "github.com/golang/protobuf/proto" - timestamp "github.com/golang/protobuf/ptypes/timestamp" - _ "github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger/options" - _ "google.golang.org/genproto/googleapis/api/annotations" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" -) - -// 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 - -type GetAttachmentsRequest struct { - // required, attachment ids - AttachmentId []string `protobuf:"bytes,1,rep,name=attachment_id,json=attachmentId,proto3" json:"attachment_id,omitempty"` - // filename, attachment contain one more file - Filename []string `protobuf:"bytes,2,rep,name=filename,proto3" json:"filename,omitempty"` - // ignore the attachment file content, return the filenames directly - IgnoreContent bool `protobuf:"varint,3,opt,name=ignore_content,json=ignoreContent,proto3" json:"ignore_content,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *GetAttachmentsRequest) Reset() { *m = GetAttachmentsRequest{} } -func (m *GetAttachmentsRequest) String() string { return proto.CompactTextString(m) } -func (*GetAttachmentsRequest) ProtoMessage() {} -func (*GetAttachmentsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_50ce80bdd3ef17d6, []int{0} -} - -func (m *GetAttachmentsRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_GetAttachmentsRequest.Unmarshal(m, b) -} -func (m *GetAttachmentsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_GetAttachmentsRequest.Marshal(b, m, deterministic) -} -func (m *GetAttachmentsRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetAttachmentsRequest.Merge(m, src) -} -func (m *GetAttachmentsRequest) XXX_Size() int { - return xxx_messageInfo_GetAttachmentsRequest.Size(m) -} -func (m *GetAttachmentsRequest) XXX_DiscardUnknown() { - xxx_messageInfo_GetAttachmentsRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_GetAttachmentsRequest proto.InternalMessageInfo - -func (m *GetAttachmentsRequest) GetAttachmentId() []string { - if m != nil { - return m.AttachmentId - } - return nil -} - -func (m *GetAttachmentsRequest) GetFilename() []string { - if m != nil { - return m.Filename - } - return nil -} - -func (m *GetAttachmentsRequest) GetIgnoreContent() bool { - if m != nil { - return m.IgnoreContent - } - return false -} - -type GetAttachmentsResponse struct { - // attachment_id map to Attachment - Attachments map[string]*Attachment `protobuf:"bytes,1,rep,name=attachments,proto3" json:"attachments,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *GetAttachmentsResponse) Reset() { *m = GetAttachmentsResponse{} } -func (m *GetAttachmentsResponse) String() string { return proto.CompactTextString(m) } -func (*GetAttachmentsResponse) ProtoMessage() {} -func (*GetAttachmentsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_50ce80bdd3ef17d6, []int{1} -} - -func (m *GetAttachmentsResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_GetAttachmentsResponse.Unmarshal(m, b) -} -func (m *GetAttachmentsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_GetAttachmentsResponse.Marshal(b, m, deterministic) -} -func (m *GetAttachmentsResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetAttachmentsResponse.Merge(m, src) -} -func (m *GetAttachmentsResponse) XXX_Size() int { - return xxx_messageInfo_GetAttachmentsResponse.Size(m) -} -func (m *GetAttachmentsResponse) XXX_DiscardUnknown() { - xxx_messageInfo_GetAttachmentsResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_GetAttachmentsResponse proto.InternalMessageInfo - -func (m *GetAttachmentsResponse) GetAttachments() map[string]*Attachment { - if m != nil { - return m.Attachments - } - return nil -} - -type Attachment struct { - // attachment id - AttachmentId string `protobuf:"bytes,1,opt,name=attachment_id,json=attachmentId,proto3" json:"attachment_id,omitempty"` - // filename map to content - AttachmentContent map[string][]byte `protobuf:"bytes,2,rep,name=attachment_content,json=attachmentContent,proto3" json:"attachment_content,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - // the time attachment create - CreateTime *timestamp.Timestamp `protobuf:"bytes,3,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Attachment) Reset() { *m = Attachment{} } -func (m *Attachment) String() string { return proto.CompactTextString(m) } -func (*Attachment) ProtoMessage() {} -func (*Attachment) Descriptor() ([]byte, []int) { - return fileDescriptor_50ce80bdd3ef17d6, []int{2} -} - -func (m *Attachment) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Attachment.Unmarshal(m, b) -} -func (m *Attachment) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Attachment.Marshal(b, m, deterministic) -} -func (m *Attachment) XXX_Merge(src proto.Message) { - xxx_messageInfo_Attachment.Merge(m, src) -} -func (m *Attachment) XXX_Size() int { - return xxx_messageInfo_Attachment.Size(m) -} -func (m *Attachment) XXX_DiscardUnknown() { - xxx_messageInfo_Attachment.DiscardUnknown(m) -} - -var xxx_messageInfo_Attachment proto.InternalMessageInfo - -func (m *Attachment) GetAttachmentId() string { - if m != nil { - return m.AttachmentId - } - return "" -} - -func (m *Attachment) GetAttachmentContent() map[string][]byte { - if m != nil { - return m.AttachmentContent - } - return nil -} - -func (m *Attachment) GetCreateTime() *timestamp.Timestamp { - if m != nil { - return m.CreateTime - } - return nil -} - -type CreateAttachmentRequest struct { - // required, filename map to content - AttachmentContent map[string][]byte `protobuf:"bytes,1,rep,name=attachment_content,json=attachmentContent,proto3" json:"attachment_content,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *CreateAttachmentRequest) Reset() { *m = CreateAttachmentRequest{} } -func (m *CreateAttachmentRequest) String() string { return proto.CompactTextString(m) } -func (*CreateAttachmentRequest) ProtoMessage() {} -func (*CreateAttachmentRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_50ce80bdd3ef17d6, []int{3} -} - -func (m *CreateAttachmentRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_CreateAttachmentRequest.Unmarshal(m, b) -} -func (m *CreateAttachmentRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_CreateAttachmentRequest.Marshal(b, m, deterministic) -} -func (m *CreateAttachmentRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_CreateAttachmentRequest.Merge(m, src) -} -func (m *CreateAttachmentRequest) XXX_Size() int { - return xxx_messageInfo_CreateAttachmentRequest.Size(m) -} -func (m *CreateAttachmentRequest) XXX_DiscardUnknown() { - xxx_messageInfo_CreateAttachmentRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_CreateAttachmentRequest proto.InternalMessageInfo - -func (m *CreateAttachmentRequest) GetAttachmentContent() map[string][]byte { - if m != nil { - return m.AttachmentContent - } - return nil -} - -type CreateAttachmentResponse struct { - // attachment id - AttachmentId string `protobuf:"bytes,1,opt,name=attachment_id,json=attachmentId,proto3" json:"attachment_id,omitempty"` - // file name - Filename []string `protobuf:"bytes,2,rep,name=filename,proto3" json:"filename,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *CreateAttachmentResponse) Reset() { *m = CreateAttachmentResponse{} } -func (m *CreateAttachmentResponse) String() string { return proto.CompactTextString(m) } -func (*CreateAttachmentResponse) ProtoMessage() {} -func (*CreateAttachmentResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_50ce80bdd3ef17d6, []int{4} -} - -func (m *CreateAttachmentResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_CreateAttachmentResponse.Unmarshal(m, b) -} -func (m *CreateAttachmentResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_CreateAttachmentResponse.Marshal(b, m, deterministic) -} -func (m *CreateAttachmentResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_CreateAttachmentResponse.Merge(m, src) -} -func (m *CreateAttachmentResponse) XXX_Size() int { - return xxx_messageInfo_CreateAttachmentResponse.Size(m) -} -func (m *CreateAttachmentResponse) XXX_DiscardUnknown() { - xxx_messageInfo_CreateAttachmentResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_CreateAttachmentResponse proto.InternalMessageInfo - -func (m *CreateAttachmentResponse) GetAttachmentId() string { - if m != nil { - return m.AttachmentId - } - return "" -} - -func (m *CreateAttachmentResponse) GetFilename() []string { - if m != nil { - return m.Filename - } - return nil -} - -type AppendAttachmentRequest struct { - // required, attachment id - AttachmentId string `protobuf:"bytes,1,opt,name=attachment_id,json=attachmentId,proto3" json:"attachment_id,omitempty"` - // filename map to content - AttachmentContent map[string][]byte `protobuf:"bytes,2,rep,name=attachment_content,json=attachmentContent,proto3" json:"attachment_content,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *AppendAttachmentRequest) Reset() { *m = AppendAttachmentRequest{} } -func (m *AppendAttachmentRequest) String() string { return proto.CompactTextString(m) } -func (*AppendAttachmentRequest) ProtoMessage() {} -func (*AppendAttachmentRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_50ce80bdd3ef17d6, []int{5} -} - -func (m *AppendAttachmentRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_AppendAttachmentRequest.Unmarshal(m, b) -} -func (m *AppendAttachmentRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_AppendAttachmentRequest.Marshal(b, m, deterministic) -} -func (m *AppendAttachmentRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_AppendAttachmentRequest.Merge(m, src) -} -func (m *AppendAttachmentRequest) XXX_Size() int { - return xxx_messageInfo_AppendAttachmentRequest.Size(m) -} -func (m *AppendAttachmentRequest) XXX_DiscardUnknown() { - xxx_messageInfo_AppendAttachmentRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_AppendAttachmentRequest proto.InternalMessageInfo - -func (m *AppendAttachmentRequest) GetAttachmentId() string { - if m != nil { - return m.AttachmentId - } - return "" -} - -func (m *AppendAttachmentRequest) GetAttachmentContent() map[string][]byte { - if m != nil { - return m.AttachmentContent - } - return nil -} - -type AppendAttachmentResponse struct { - // attachment id - AttachmentId string `protobuf:"bytes,1,opt,name=attachment_id,json=attachmentId,proto3" json:"attachment_id,omitempty"` - // filename, attachment contain one more file - Filename []string `protobuf:"bytes,2,rep,name=filename,proto3" json:"filename,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *AppendAttachmentResponse) Reset() { *m = AppendAttachmentResponse{} } -func (m *AppendAttachmentResponse) String() string { return proto.CompactTextString(m) } -func (*AppendAttachmentResponse) ProtoMessage() {} -func (*AppendAttachmentResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_50ce80bdd3ef17d6, []int{6} -} - -func (m *AppendAttachmentResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_AppendAttachmentResponse.Unmarshal(m, b) -} -func (m *AppendAttachmentResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_AppendAttachmentResponse.Marshal(b, m, deterministic) -} -func (m *AppendAttachmentResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_AppendAttachmentResponse.Merge(m, src) -} -func (m *AppendAttachmentResponse) XXX_Size() int { - return xxx_messageInfo_AppendAttachmentResponse.Size(m) -} -func (m *AppendAttachmentResponse) XXX_DiscardUnknown() { - xxx_messageInfo_AppendAttachmentResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_AppendAttachmentResponse proto.InternalMessageInfo - -func (m *AppendAttachmentResponse) GetAttachmentId() string { - if m != nil { - return m.AttachmentId - } - return "" -} - -func (m *AppendAttachmentResponse) GetFilename() []string { - if m != nil { - return m.Filename - } - return nil -} - -type ReplaceAttachmentRequest struct { - // required, id of attachment to replace - AttachmentId string `protobuf:"bytes,1,opt,name=attachment_id,json=attachmentId,proto3" json:"attachment_id,omitempty"` - // filename map to content - AttachmentContent map[string][]byte `protobuf:"bytes,2,rep,name=attachment_content,json=attachmentContent,proto3" json:"attachment_content,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ReplaceAttachmentRequest) Reset() { *m = ReplaceAttachmentRequest{} } -func (m *ReplaceAttachmentRequest) String() string { return proto.CompactTextString(m) } -func (*ReplaceAttachmentRequest) ProtoMessage() {} -func (*ReplaceAttachmentRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_50ce80bdd3ef17d6, []int{7} -} - -func (m *ReplaceAttachmentRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ReplaceAttachmentRequest.Unmarshal(m, b) -} -func (m *ReplaceAttachmentRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ReplaceAttachmentRequest.Marshal(b, m, deterministic) -} -func (m *ReplaceAttachmentRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_ReplaceAttachmentRequest.Merge(m, src) -} -func (m *ReplaceAttachmentRequest) XXX_Size() int { - return xxx_messageInfo_ReplaceAttachmentRequest.Size(m) -} -func (m *ReplaceAttachmentRequest) XXX_DiscardUnknown() { - xxx_messageInfo_ReplaceAttachmentRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_ReplaceAttachmentRequest proto.InternalMessageInfo - -func (m *ReplaceAttachmentRequest) GetAttachmentId() string { - if m != nil { - return m.AttachmentId - } - return "" -} - -func (m *ReplaceAttachmentRequest) GetAttachmentContent() map[string][]byte { - if m != nil { - return m.AttachmentContent - } - return nil -} - -type ReplaceAttachmentResponse struct { - // id of attachment replaced - AttachmentId string `protobuf:"bytes,1,opt,name=attachment_id,json=attachmentId,proto3" json:"attachment_id,omitempty"` - // filename, attachment contain one more file - Filename []string `protobuf:"bytes,2,rep,name=filename,proto3" json:"filename,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ReplaceAttachmentResponse) Reset() { *m = ReplaceAttachmentResponse{} } -func (m *ReplaceAttachmentResponse) String() string { return proto.CompactTextString(m) } -func (*ReplaceAttachmentResponse) ProtoMessage() {} -func (*ReplaceAttachmentResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_50ce80bdd3ef17d6, []int{8} -} - -func (m *ReplaceAttachmentResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ReplaceAttachmentResponse.Unmarshal(m, b) -} -func (m *ReplaceAttachmentResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ReplaceAttachmentResponse.Marshal(b, m, deterministic) -} -func (m *ReplaceAttachmentResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_ReplaceAttachmentResponse.Merge(m, src) -} -func (m *ReplaceAttachmentResponse) XXX_Size() int { - return xxx_messageInfo_ReplaceAttachmentResponse.Size(m) -} -func (m *ReplaceAttachmentResponse) XXX_DiscardUnknown() { - xxx_messageInfo_ReplaceAttachmentResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_ReplaceAttachmentResponse proto.InternalMessageInfo - -func (m *ReplaceAttachmentResponse) GetAttachmentId() string { - if m != nil { - return m.AttachmentId - } - return "" -} - -func (m *ReplaceAttachmentResponse) GetFilename() []string { - if m != nil { - return m.Filename - } - return nil -} - -type DeleteAttachmentsRequest struct { - // required, ids of attachment to delete - AttachmentId []string `protobuf:"bytes,1,rep,name=attachment_id,json=attachmentId,proto3" json:"attachment_id,omitempty"` - // filename, attachment contain one more file - Filename []string `protobuf:"bytes,2,rep,name=filename,proto3" json:"filename,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *DeleteAttachmentsRequest) Reset() { *m = DeleteAttachmentsRequest{} } -func (m *DeleteAttachmentsRequest) String() string { return proto.CompactTextString(m) } -func (*DeleteAttachmentsRequest) ProtoMessage() {} -func (*DeleteAttachmentsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_50ce80bdd3ef17d6, []int{9} -} - -func (m *DeleteAttachmentsRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_DeleteAttachmentsRequest.Unmarshal(m, b) -} -func (m *DeleteAttachmentsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_DeleteAttachmentsRequest.Marshal(b, m, deterministic) -} -func (m *DeleteAttachmentsRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_DeleteAttachmentsRequest.Merge(m, src) -} -func (m *DeleteAttachmentsRequest) XXX_Size() int { - return xxx_messageInfo_DeleteAttachmentsRequest.Size(m) -} -func (m *DeleteAttachmentsRequest) XXX_DiscardUnknown() { - xxx_messageInfo_DeleteAttachmentsRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_DeleteAttachmentsRequest proto.InternalMessageInfo - -func (m *DeleteAttachmentsRequest) GetAttachmentId() []string { - if m != nil { - return m.AttachmentId - } - return nil -} - -func (m *DeleteAttachmentsRequest) GetFilename() []string { - if m != nil { - return m.Filename - } - return nil -} - -type DeleteAttachmentsResponse struct { - // ids of attachment deleted - AttachmentId []string `protobuf:"bytes,1,rep,name=attachment_id,json=attachmentId,proto3" json:"attachment_id,omitempty"` - // filename, attachment contain one more file - Filename []string `protobuf:"bytes,2,rep,name=filename,proto3" json:"filename,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *DeleteAttachmentsResponse) Reset() { *m = DeleteAttachmentsResponse{} } -func (m *DeleteAttachmentsResponse) String() string { return proto.CompactTextString(m) } -func (*DeleteAttachmentsResponse) ProtoMessage() {} -func (*DeleteAttachmentsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_50ce80bdd3ef17d6, []int{10} -} - -func (m *DeleteAttachmentsResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_DeleteAttachmentsResponse.Unmarshal(m, b) -} -func (m *DeleteAttachmentsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_DeleteAttachmentsResponse.Marshal(b, m, deterministic) -} -func (m *DeleteAttachmentsResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_DeleteAttachmentsResponse.Merge(m, src) -} -func (m *DeleteAttachmentsResponse) XXX_Size() int { - return xxx_messageInfo_DeleteAttachmentsResponse.Size(m) -} -func (m *DeleteAttachmentsResponse) XXX_DiscardUnknown() { - xxx_messageInfo_DeleteAttachmentsResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_DeleteAttachmentsResponse proto.InternalMessageInfo - -func (m *DeleteAttachmentsResponse) GetAttachmentId() []string { - if m != nil { - return m.AttachmentId - } - return nil -} - -func (m *DeleteAttachmentsResponse) GetFilename() []string { - if m != nil { - return m.Filename - } - return nil -} - -type GetAttachmentRequest struct { - // required, use attachment id to get attachment - AttachmentId string `protobuf:"bytes,1,opt,name=attachment_id,json=attachmentId,proto3" json:"attachment_id,omitempty"` - // filename, attachment contain one more file - Filename string `protobuf:"bytes,2,opt,name=filename,proto3" json:"filename,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *GetAttachmentRequest) Reset() { *m = GetAttachmentRequest{} } -func (m *GetAttachmentRequest) String() string { return proto.CompactTextString(m) } -func (*GetAttachmentRequest) ProtoMessage() {} -func (*GetAttachmentRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_50ce80bdd3ef17d6, []int{11} -} - -func (m *GetAttachmentRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_GetAttachmentRequest.Unmarshal(m, b) -} -func (m *GetAttachmentRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_GetAttachmentRequest.Marshal(b, m, deterministic) -} -func (m *GetAttachmentRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetAttachmentRequest.Merge(m, src) -} -func (m *GetAttachmentRequest) XXX_Size() int { - return xxx_messageInfo_GetAttachmentRequest.Size(m) -} -func (m *GetAttachmentRequest) XXX_DiscardUnknown() { - xxx_messageInfo_GetAttachmentRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_GetAttachmentRequest proto.InternalMessageInfo - -func (m *GetAttachmentRequest) GetAttachmentId() string { - if m != nil { - return m.AttachmentId - } - return "" -} - -func (m *GetAttachmentRequest) GetFilename() string { - if m != nil { - return m.Filename - } - return "" -} - -type GetAttachmentResponse struct { - // file content of attachment - Content []byte `protobuf:"bytes,1,opt,name=content,proto3" json:"content,omitempty"` - // tell server to pack file - Etag string `protobuf:"bytes,2,opt,name=etag,proto3" json:"etag,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *GetAttachmentResponse) Reset() { *m = GetAttachmentResponse{} } -func (m *GetAttachmentResponse) String() string { return proto.CompactTextString(m) } -func (*GetAttachmentResponse) ProtoMessage() {} -func (*GetAttachmentResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_50ce80bdd3ef17d6, []int{12} -} - -func (m *GetAttachmentResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_GetAttachmentResponse.Unmarshal(m, b) -} -func (m *GetAttachmentResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_GetAttachmentResponse.Marshal(b, m, deterministic) -} -func (m *GetAttachmentResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetAttachmentResponse.Merge(m, src) -} -func (m *GetAttachmentResponse) XXX_Size() int { - return xxx_messageInfo_GetAttachmentResponse.Size(m) -} -func (m *GetAttachmentResponse) XXX_DiscardUnknown() { - xxx_messageInfo_GetAttachmentResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_GetAttachmentResponse proto.InternalMessageInfo - -func (m *GetAttachmentResponse) GetContent() []byte { - if m != nil { - return m.Content - } - return nil -} - -func (m *GetAttachmentResponse) GetEtag() string { - if m != nil { - return m.Etag - } - return "" -} - -func init() { - proto.RegisterType((*GetAttachmentsRequest)(nil), "openpitrix.GetAttachmentsRequest") - proto.RegisterType((*GetAttachmentsResponse)(nil), "openpitrix.GetAttachmentsResponse") - proto.RegisterMapType((map[string]*Attachment)(nil), "openpitrix.GetAttachmentsResponse.AttachmentsEntry") - proto.RegisterType((*Attachment)(nil), "openpitrix.Attachment") - proto.RegisterMapType((map[string][]byte)(nil), "openpitrix.Attachment.AttachmentContentEntry") - proto.RegisterType((*CreateAttachmentRequest)(nil), "openpitrix.CreateAttachmentRequest") - proto.RegisterMapType((map[string][]byte)(nil), "openpitrix.CreateAttachmentRequest.AttachmentContentEntry") - proto.RegisterType((*CreateAttachmentResponse)(nil), "openpitrix.CreateAttachmentResponse") - proto.RegisterType((*AppendAttachmentRequest)(nil), "openpitrix.AppendAttachmentRequest") - proto.RegisterMapType((map[string][]byte)(nil), "openpitrix.AppendAttachmentRequest.AttachmentContentEntry") - proto.RegisterType((*AppendAttachmentResponse)(nil), "openpitrix.AppendAttachmentResponse") - proto.RegisterType((*ReplaceAttachmentRequest)(nil), "openpitrix.ReplaceAttachmentRequest") - proto.RegisterMapType((map[string][]byte)(nil), "openpitrix.ReplaceAttachmentRequest.AttachmentContentEntry") - proto.RegisterType((*ReplaceAttachmentResponse)(nil), "openpitrix.ReplaceAttachmentResponse") - proto.RegisterType((*DeleteAttachmentsRequest)(nil), "openpitrix.DeleteAttachmentsRequest") - proto.RegisterType((*DeleteAttachmentsResponse)(nil), "openpitrix.DeleteAttachmentsResponse") - proto.RegisterType((*GetAttachmentRequest)(nil), "openpitrix.GetAttachmentRequest") - proto.RegisterType((*GetAttachmentResponse)(nil), "openpitrix.GetAttachmentResponse") -} - -func init() { proto.RegisterFile("attachment.proto", fileDescriptor_50ce80bdd3ef17d6) } - -var fileDescriptor_50ce80bdd3ef17d6 = []byte{ - // 720 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x56, 0xdf, 0x4e, 0x13, 0x4f, - 0x18, 0xcd, 0xb4, 0xfc, 0x7e, 0xc2, 0x57, 0xc0, 0x76, 0x82, 0xb0, 0x6e, 0x4c, 0x5c, 0x0a, 0x24, - 0xbd, 0x80, 0x6d, 0x2c, 0x31, 0x31, 0x70, 0x85, 0x40, 0x88, 0x17, 0xc6, 0x64, 0xfd, 0x43, 0x22, - 0x10, 0x1c, 0xda, 0x8f, 0x75, 0xb5, 0x9d, 0x5d, 0x77, 0xa7, 0x28, 0x57, 0x26, 0x3e, 0x02, 0x3e, - 0x83, 0x4f, 0xe1, 0x03, 0x98, 0x78, 0xeb, 0x2b, 0x78, 0xad, 0xf1, 0x0d, 0xcc, 0xfe, 0x69, 0x77, - 0xb6, 0xbb, 0x5b, 0x8a, 0x69, 0xf4, 0xaa, 0xbb, 0x33, 0xa7, 0xe7, 0x3b, 0xdf, 0x99, 0x33, 0xb3, - 0x03, 0x65, 0x26, 0x04, 0x6b, 0xbe, 0xec, 0x20, 0x17, 0xba, 0xe3, 0xda, 0xc2, 0xa6, 0x60, 0x3b, - 0xc8, 0x1d, 0x4b, 0xb8, 0xd6, 0x3b, 0xf5, 0xb6, 0x69, 0xdb, 0x66, 0x1b, 0xeb, 0xc1, 0xcc, 0x49, - 0xf7, 0xb4, 0x2e, 0xac, 0x0e, 0x7a, 0x82, 0x75, 0x9c, 0x10, 0xac, 0xde, 0x8a, 0x00, 0xcc, 0xb1, - 0xea, 0x8c, 0x73, 0x5b, 0x30, 0x61, 0xd9, 0xdc, 0x8b, 0x66, 0x57, 0x83, 0x9f, 0xe6, 0x9a, 0x89, - 0x7c, 0xcd, 0x7b, 0xcb, 0x4c, 0x13, 0xdd, 0xba, 0xed, 0x04, 0x88, 0x34, 0xba, 0xfa, 0x1e, 0x6e, - 0xec, 0xa1, 0xd8, 0xea, 0xeb, 0xf1, 0x0c, 0x7c, 0xd3, 0x45, 0x4f, 0xd0, 0x25, 0x98, 0x89, 0x55, - 0x1e, 0x5b, 0x2d, 0x85, 0x68, 0xc5, 0xda, 0x94, 0x31, 0x1d, 0x0f, 0x3e, 0x68, 0x51, 0x15, 0x26, - 0x4f, 0xad, 0x36, 0x72, 0xd6, 0x41, 0xa5, 0x10, 0xcc, 0xf7, 0xdf, 0xe9, 0x0a, 0xcc, 0x5a, 0x26, - 0xb7, 0x5d, 0x3c, 0x6e, 0xda, 0x5c, 0x20, 0x17, 0x4a, 0x51, 0x23, 0xb5, 0x49, 0x63, 0x26, 0x1c, - 0xdd, 0x0e, 0x07, 0xab, 0x5f, 0x08, 0xcc, 0x0f, 0x2a, 0xf0, 0x1c, 0x9b, 0x7b, 0x48, 0x9f, 0x42, - 0x29, 0xae, 0xe6, 0x05, 0x02, 0x4a, 0x8d, 0x75, 0x3d, 0xb6, 0x4a, 0xcf, 0xfe, 0xa3, 0x2e, 0x8d, - 0xed, 0x72, 0xe1, 0x9e, 0x1b, 0x32, 0x8f, 0xfa, 0x0c, 0xca, 0x83, 0x00, 0x5a, 0x86, 0xe2, 0x6b, - 0x3c, 0x57, 0x88, 0x46, 0x6a, 0x53, 0x86, 0xff, 0x48, 0x57, 0xe1, 0xbf, 0x33, 0xd6, 0xee, 0xfa, - 0x7d, 0x91, 0x5a, 0xa9, 0x31, 0x2f, 0x97, 0x8d, 0xff, 0x6e, 0x84, 0xa0, 0x8d, 0xc2, 0x3d, 0x52, - 0xbd, 0x28, 0x00, 0xc4, 0x33, 0x59, 0x06, 0x92, 0x94, 0x81, 0x87, 0x40, 0x25, 0x50, 0xcf, 0xa8, - 0x42, 0xd0, 0xe9, 0x5a, 0x76, 0x49, 0xe9, 0x31, 0xf2, 0x30, 0xec, 0xb1, 0xc2, 0x06, 0xc7, 0xe9, - 0x26, 0x94, 0x9a, 0x2e, 0x32, 0x81, 0xc7, 0x7e, 0x84, 0x02, 0xff, 0x4b, 0x0d, 0x55, 0x0f, 0xe3, - 0xa3, 0xf7, 0xf2, 0xa5, 0x3f, 0xe9, 0xe5, 0xcb, 0x80, 0x10, 0xee, 0x0f, 0xa8, 0x3b, 0x30, 0x9f, - 0x5d, 0x29, 0xc3, 0xac, 0x39, 0xd9, 0xac, 0x69, 0xd9, 0x94, 0xaf, 0x04, 0x16, 0xb6, 0x03, 0x52, - 0xc9, 0xb4, 0x28, 0x62, 0x56, 0x66, 0xf3, 0xe1, 0x32, 0x6f, 0xc8, 0xcd, 0xe7, 0x10, 0x8c, 0xee, - 0xc4, 0x98, 0x9a, 0x39, 0x00, 0x25, 0x2d, 0x25, 0x0a, 0xeb, 0x48, 0xcb, 0x3d, 0x64, 0xbf, 0x54, - 0x7f, 0x12, 0x58, 0xd8, 0x72, 0x1c, 0xe4, 0xad, 0xb4, 0x53, 0x23, 0x91, 0x5b, 0x43, 0xb2, 0x94, - 0xb0, 0x33, 0xa7, 0xca, 0xbf, 0xb0, 0x33, 0x2d, 0x65, 0x5c, 0x76, 0xfe, 0x22, 0xa0, 0x18, 0xe8, - 0xb4, 0x59, 0x13, 0xff, 0xd0, 0xcf, 0x57, 0x43, 0xfc, 0xdc, 0x94, 0xfd, 0xcc, 0x2b, 0xf3, 0xd7, - 0x0d, 0x3d, 0x84, 0x9b, 0x19, 0x5a, 0xc6, 0xe5, 0xe8, 0x01, 0x28, 0x3b, 0xd8, 0x46, 0x39, 0xfd, - 0x63, 0xfb, 0x5a, 0xf8, 0xd2, 0x33, 0xc8, 0xf3, 0xa5, 0x5f, 0x8d, 0x7d, 0x1f, 0xe6, 0x12, 0x9f, - 0x8a, 0x2b, 0xe5, 0x20, 0x49, 0x4c, 0x12, 0xc4, 0xbb, 0x03, 0x9f, 0xcf, 0xbe, 0x64, 0x05, 0xae, - 0xc5, 0x07, 0x9a, 0xbf, 0x4c, 0xbd, 0x57, 0x4a, 0x61, 0x02, 0x05, 0x33, 0x23, 0xaa, 0xe0, 0xb9, - 0xf1, 0xa3, 0x08, 0x95, 0x98, 0xe4, 0x21, 0xe3, 0xcc, 0x44, 0x97, 0x1e, 0x41, 0x79, 0xf0, 0xb8, - 0xa1, 0x4b, 0x23, 0x9c, 0x8b, 0xea, 0xf2, 0x70, 0x50, 0x24, 0xf1, 0x08, 0xca, 0x83, 0xdb, 0x2f, - 0x49, 0x9f, 0x73, 0x4e, 0x24, 0xe9, 0x73, 0x77, 0xf0, 0x0b, 0xa8, 0xa4, 0xc2, 0x48, 0x97, 0x47, - 0xd9, 0x37, 0xea, 0xca, 0x25, 0xa8, 0xa8, 0xc2, 0x3e, 0xcc, 0x26, 0x2f, 0x00, 0x74, 0x71, 0xd8, - 0xe5, 0x20, 0xe4, 0xae, 0x5e, 0x7e, 0x7f, 0xf0, 0xa5, 0xa7, 0xc2, 0x98, 0x94, 0x9e, 0xb7, 0x11, - 0x92, 0xd2, 0x73, 0x13, 0xdd, 0xf8, 0x4c, 0xe4, 0x05, 0x7f, 0x8c, 0xee, 0x99, 0xd5, 0x44, 0xfa, - 0x89, 0xc0, 0x4c, 0x42, 0x12, 0xd5, 0x72, 0xd5, 0xf6, 0x0a, 0x2e, 0x0e, 0x41, 0x84, 0xc5, 0xaa, - 0x8f, 0x2e, 0xb6, 0xee, 0xd2, 0xf5, 0x3d, 0x14, 0x5a, 0x9c, 0xeb, 0x55, 0xad, 0xeb, 0xa1, 0xf4, - 0xae, 0x59, 0x2d, 0x4d, 0xd8, 0x9a, 0x99, 0x00, 0x7d, 0xf8, 0xf6, 0xfd, 0x63, 0xa1, 0x42, 0xaf, - 0xd7, 0xcf, 0xee, 0xd4, 0xa5, 0x1b, 0xd4, 0xfd, 0x89, 0xe7, 0x05, 0xe7, 0xe4, 0xe4, 0xff, 0xe0, - 0x02, 0xb1, 0xfe, 0x3b, 0x00, 0x00, 0xff, 0xff, 0xe8, 0x86, 0x4c, 0xd3, 0xce, 0x0a, 0x00, 0x00, -} - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConn - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion4 - -// AttachmentManagerClient is the client API for AttachmentManager service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type AttachmentManagerClient interface { - CreateAttachment(ctx context.Context, in *CreateAttachmentRequest, opts ...grpc.CallOption) (*CreateAttachmentResponse, error) - AppendAttachment(ctx context.Context, in *AppendAttachmentRequest, opts ...grpc.CallOption) (*AppendAttachmentResponse, error) - ReplaceAttachment(ctx context.Context, in *ReplaceAttachmentRequest, opts ...grpc.CallOption) (*ReplaceAttachmentResponse, error) - GetAttachments(ctx context.Context, in *GetAttachmentsRequest, opts ...grpc.CallOption) (*GetAttachmentsResponse, error) - DeleteAttachments(ctx context.Context, in *DeleteAttachmentsRequest, opts ...grpc.CallOption) (*DeleteAttachmentsResponse, error) -} - -type attachmentManagerClient struct { - cc *grpc.ClientConn -} - -func NewAttachmentManagerClient(cc *grpc.ClientConn) AttachmentManagerClient { - return &attachmentManagerClient{cc} -} - -func (c *attachmentManagerClient) CreateAttachment(ctx context.Context, in *CreateAttachmentRequest, opts ...grpc.CallOption) (*CreateAttachmentResponse, error) { - out := new(CreateAttachmentResponse) - err := c.cc.Invoke(ctx, "/openpitrix.AttachmentManager/CreateAttachment", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *attachmentManagerClient) AppendAttachment(ctx context.Context, in *AppendAttachmentRequest, opts ...grpc.CallOption) (*AppendAttachmentResponse, error) { - out := new(AppendAttachmentResponse) - err := c.cc.Invoke(ctx, "/openpitrix.AttachmentManager/AppendAttachment", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *attachmentManagerClient) ReplaceAttachment(ctx context.Context, in *ReplaceAttachmentRequest, opts ...grpc.CallOption) (*ReplaceAttachmentResponse, error) { - out := new(ReplaceAttachmentResponse) - err := c.cc.Invoke(ctx, "/openpitrix.AttachmentManager/ReplaceAttachment", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *attachmentManagerClient) GetAttachments(ctx context.Context, in *GetAttachmentsRequest, opts ...grpc.CallOption) (*GetAttachmentsResponse, error) { - out := new(GetAttachmentsResponse) - err := c.cc.Invoke(ctx, "/openpitrix.AttachmentManager/GetAttachments", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *attachmentManagerClient) DeleteAttachments(ctx context.Context, in *DeleteAttachmentsRequest, opts ...grpc.CallOption) (*DeleteAttachmentsResponse, error) { - out := new(DeleteAttachmentsResponse) - err := c.cc.Invoke(ctx, "/openpitrix.AttachmentManager/DeleteAttachments", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// AttachmentManagerServer is the server API for AttachmentManager service. -type AttachmentManagerServer interface { - CreateAttachment(context.Context, *CreateAttachmentRequest) (*CreateAttachmentResponse, error) - AppendAttachment(context.Context, *AppendAttachmentRequest) (*AppendAttachmentResponse, error) - ReplaceAttachment(context.Context, *ReplaceAttachmentRequest) (*ReplaceAttachmentResponse, error) - GetAttachments(context.Context, *GetAttachmentsRequest) (*GetAttachmentsResponse, error) - DeleteAttachments(context.Context, *DeleteAttachmentsRequest) (*DeleteAttachmentsResponse, error) -} - -// UnimplementedAttachmentManagerServer can be embedded to have forward compatible implementations. -type UnimplementedAttachmentManagerServer struct { -} - -func (*UnimplementedAttachmentManagerServer) CreateAttachment(ctx context.Context, req *CreateAttachmentRequest) (*CreateAttachmentResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method CreateAttachment not implemented") -} -func (*UnimplementedAttachmentManagerServer) AppendAttachment(ctx context.Context, req *AppendAttachmentRequest) (*AppendAttachmentResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method AppendAttachment not implemented") -} -func (*UnimplementedAttachmentManagerServer) ReplaceAttachment(ctx context.Context, req *ReplaceAttachmentRequest) (*ReplaceAttachmentResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ReplaceAttachment not implemented") -} -func (*UnimplementedAttachmentManagerServer) GetAttachments(ctx context.Context, req *GetAttachmentsRequest) (*GetAttachmentsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetAttachments not implemented") -} -func (*UnimplementedAttachmentManagerServer) DeleteAttachments(ctx context.Context, req *DeleteAttachmentsRequest) (*DeleteAttachmentsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method DeleteAttachments not implemented") -} - -func RegisterAttachmentManagerServer(s *grpc.Server, srv AttachmentManagerServer) { - s.RegisterService(&_AttachmentManager_serviceDesc, srv) -} - -func _AttachmentManager_CreateAttachment_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CreateAttachmentRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AttachmentManagerServer).CreateAttachment(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/openpitrix.AttachmentManager/CreateAttachment", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AttachmentManagerServer).CreateAttachment(ctx, req.(*CreateAttachmentRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _AttachmentManager_AppendAttachment_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(AppendAttachmentRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AttachmentManagerServer).AppendAttachment(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/openpitrix.AttachmentManager/AppendAttachment", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AttachmentManagerServer).AppendAttachment(ctx, req.(*AppendAttachmentRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _AttachmentManager_ReplaceAttachment_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ReplaceAttachmentRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AttachmentManagerServer).ReplaceAttachment(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/openpitrix.AttachmentManager/ReplaceAttachment", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AttachmentManagerServer).ReplaceAttachment(ctx, req.(*ReplaceAttachmentRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _AttachmentManager_GetAttachments_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetAttachmentsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AttachmentManagerServer).GetAttachments(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/openpitrix.AttachmentManager/GetAttachments", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AttachmentManagerServer).GetAttachments(ctx, req.(*GetAttachmentsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _AttachmentManager_DeleteAttachments_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DeleteAttachmentsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AttachmentManagerServer).DeleteAttachments(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/openpitrix.AttachmentManager/DeleteAttachments", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AttachmentManagerServer).DeleteAttachments(ctx, req.(*DeleteAttachmentsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _AttachmentManager_serviceDesc = grpc.ServiceDesc{ - ServiceName: "openpitrix.AttachmentManager", - HandlerType: (*AttachmentManagerServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "CreateAttachment", - Handler: _AttachmentManager_CreateAttachment_Handler, - }, - { - MethodName: "AppendAttachment", - Handler: _AttachmentManager_AppendAttachment_Handler, - }, - { - MethodName: "ReplaceAttachment", - Handler: _AttachmentManager_ReplaceAttachment_Handler, - }, - { - MethodName: "GetAttachments", - Handler: _AttachmentManager_GetAttachments_Handler, - }, - { - MethodName: "DeleteAttachments", - Handler: _AttachmentManager_DeleteAttachments_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "attachment.proto", -} - -// AttachmentServiceClient is the client API for AttachmentService service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type AttachmentServiceClient interface { - // Get attachment, use attachment id to get attachment - GetAttachment(ctx context.Context, in *GetAttachmentRequest, opts ...grpc.CallOption) (*GetAttachmentResponse, error) -} - -type attachmentServiceClient struct { - cc *grpc.ClientConn -} - -func NewAttachmentServiceClient(cc *grpc.ClientConn) AttachmentServiceClient { - return &attachmentServiceClient{cc} -} - -func (c *attachmentServiceClient) GetAttachment(ctx context.Context, in *GetAttachmentRequest, opts ...grpc.CallOption) (*GetAttachmentResponse, error) { - out := new(GetAttachmentResponse) - err := c.cc.Invoke(ctx, "/openpitrix.AttachmentService/GetAttachment", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// AttachmentServiceServer is the server API for AttachmentService service. -type AttachmentServiceServer interface { - // Get attachment, use attachment id to get attachment - GetAttachment(context.Context, *GetAttachmentRequest) (*GetAttachmentResponse, error) -} - -// UnimplementedAttachmentServiceServer can be embedded to have forward compatible implementations. -type UnimplementedAttachmentServiceServer struct { -} - -func (*UnimplementedAttachmentServiceServer) GetAttachment(ctx context.Context, req *GetAttachmentRequest) (*GetAttachmentResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetAttachment not implemented") -} - -func RegisterAttachmentServiceServer(s *grpc.Server, srv AttachmentServiceServer) { - s.RegisterService(&_AttachmentService_serviceDesc, srv) -} - -func _AttachmentService_GetAttachment_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetAttachmentRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AttachmentServiceServer).GetAttachment(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/openpitrix.AttachmentService/GetAttachment", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AttachmentServiceServer).GetAttachment(ctx, req.(*GetAttachmentRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _AttachmentService_serviceDesc = grpc.ServiceDesc{ - ServiceName: "openpitrix.AttachmentService", - HandlerType: (*AttachmentServiceServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "GetAttachment", - Handler: _AttachmentService_GetAttachment_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "attachment.proto", -} diff --git a/vendor/openpitrix.io/openpitrix/pkg/pb/attachment.pb.gw.go b/vendor/openpitrix.io/openpitrix/pkg/pb/attachment.pb.gw.go deleted file mode 100644 index cde4ef442d..0000000000 --- a/vendor/openpitrix.io/openpitrix/pkg/pb/attachment.pb.gw.go +++ /dev/null @@ -1,162 +0,0 @@ -// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: attachment.proto - -/* -Package pb is a reverse proxy. - -It translates gRPC into RESTful JSON APIs. -*/ -package pb - -import ( - "context" - "io" - "net/http" - - "github.com/golang/protobuf/descriptor" - "github.com/golang/protobuf/proto" - "github.com/grpc-ecosystem/grpc-gateway/runtime" - "github.com/grpc-ecosystem/grpc-gateway/utilities" - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/grpclog" - "google.golang.org/grpc/status" -) - -// Suppress "imported and not used" errors -var _ codes.Code -var _ io.Reader -var _ status.Status -var _ = runtime.String -var _ = utilities.NewDoubleArray -var _ = descriptor.ForMessage - -var ( - filter_AttachmentService_GetAttachment_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_AttachmentService_GetAttachment_0(ctx context.Context, marshaler runtime.Marshaler, client AttachmentServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq GetAttachmentRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_AttachmentService_GetAttachment_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.GetAttachment(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_AttachmentService_GetAttachment_0(ctx context.Context, marshaler runtime.Marshaler, server AttachmentServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq GetAttachmentRequest - var metadata runtime.ServerMetadata - - if err := runtime.PopulateQueryParameters(&protoReq, req.URL.Query(), filter_AttachmentService_GetAttachment_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.GetAttachment(ctx, &protoReq) - return msg, metadata, err - -} - -// RegisterAttachmentServiceHandlerServer registers the http handlers for service AttachmentService to "mux". -// UnaryRPC :call AttachmentServiceServer directly. -// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. -func RegisterAttachmentServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server AttachmentServiceServer) error { - - mux.Handle("GET", pattern_AttachmentService_GetAttachment_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_AttachmentService_GetAttachment_0(rctx, inboundMarshaler, server, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_AttachmentService_GetAttachment_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -// RegisterAttachmentServiceHandlerFromEndpoint is same as RegisterAttachmentServiceHandler but -// automatically dials to "endpoint" and closes the connection when "ctx" gets done. -func RegisterAttachmentServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { - conn, err := grpc.Dial(endpoint, opts...) - if err != nil { - return err - } - defer func() { - if err != nil { - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - return - } - go func() { - <-ctx.Done() - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - }() - }() - - return RegisterAttachmentServiceHandler(ctx, mux, conn) -} - -// RegisterAttachmentServiceHandler registers the http handlers for service AttachmentService to "mux". -// The handlers forward requests to the grpc endpoint over "conn". -func RegisterAttachmentServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { - return RegisterAttachmentServiceHandlerClient(ctx, mux, NewAttachmentServiceClient(conn)) -} - -// RegisterAttachmentServiceHandlerClient registers the http handlers for service AttachmentService -// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "AttachmentServiceClient". -// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "AttachmentServiceClient" -// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in -// "AttachmentServiceClient" to call the correct interceptors. -func RegisterAttachmentServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client AttachmentServiceClient) error { - - mux.Handle("GET", pattern_AttachmentService_GetAttachment_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_AttachmentService_GetAttachment_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_AttachmentService_GetAttachment_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -var ( - pattern_AttachmentService_GetAttachment_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "attachments"}, "", runtime.AssumeColonVerbOpt(true))) -) - -var ( - forward_AttachmentService_GetAttachment_0 = runtime.ForwardResponseMessage -) diff --git a/vendor/openpitrix.io/openpitrix/pkg/pb/category.pb.go b/vendor/openpitrix.io/openpitrix/pkg/pb/category.pb.go deleted file mode 100644 index 27aa838a44..0000000000 --- a/vendor/openpitrix.io/openpitrix/pkg/pb/category.pb.go +++ /dev/null @@ -1,884 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// source: category.proto - -package pb - -import ( - context "context" - fmt "fmt" - math "math" - - proto "github.com/golang/protobuf/proto" - timestamp "github.com/golang/protobuf/ptypes/timestamp" - wrappers "github.com/golang/protobuf/ptypes/wrappers" - _ "github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger/options" - _ "google.golang.org/genproto/googleapis/api/annotations" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" -) - -// 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 - -type Category struct { - // category id - CategoryId *wrappers.StringValue `protobuf:"bytes,1,opt,name=category_id,json=categoryId,proto3" json:"category_id,omitempty"` - // category name,app belong to a category,eg.[AI|Firewall|cache|...] - Name *wrappers.StringValue `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - // the i18n of this category, json format, sample: {"zh_cn": "数据库", "en": "database"} - Locale *wrappers.StringValue `protobuf:"bytes,3,opt,name=locale,proto3" json:"locale,omitempty"` - // owner path, concat string group_path:user_id - OwnerPath *wrappers.StringValue `protobuf:"bytes,4,opt,name=owner_path,json=ownerPath,proto3" json:"owner_path,omitempty"` - // the time when category create - CreateTime *timestamp.Timestamp `protobuf:"bytes,5,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty"` - // the time when category update - UpdateTime *timestamp.Timestamp `protobuf:"bytes,6,opt,name=update_time,json=updateTime,proto3" json:"update_time,omitempty"` - // category description - Description *wrappers.StringValue `protobuf:"bytes,7,opt,name=description,proto3" json:"description,omitempty"` - // category icon - Icon *wrappers.StringValue `protobuf:"bytes,8,opt,name=icon,proto3" json:"icon,omitempty"` - // owner - Owner *wrappers.StringValue `protobuf:"bytes,9,opt,name=owner,proto3" json:"owner,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Category) Reset() { *m = Category{} } -func (m *Category) String() string { return proto.CompactTextString(m) } -func (*Category) ProtoMessage() {} -func (*Category) Descriptor() ([]byte, []int) { - return fileDescriptor_1c6ef5ed29d8d1a1, []int{0} -} - -func (m *Category) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Category.Unmarshal(m, b) -} -func (m *Category) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Category.Marshal(b, m, deterministic) -} -func (m *Category) XXX_Merge(src proto.Message) { - xxx_messageInfo_Category.Merge(m, src) -} -func (m *Category) XXX_Size() int { - return xxx_messageInfo_Category.Size(m) -} -func (m *Category) XXX_DiscardUnknown() { - xxx_messageInfo_Category.DiscardUnknown(m) -} - -var xxx_messageInfo_Category proto.InternalMessageInfo - -func (m *Category) GetCategoryId() *wrappers.StringValue { - if m != nil { - return m.CategoryId - } - return nil -} - -func (m *Category) GetName() *wrappers.StringValue { - if m != nil { - return m.Name - } - return nil -} - -func (m *Category) GetLocale() *wrappers.StringValue { - if m != nil { - return m.Locale - } - return nil -} - -func (m *Category) GetOwnerPath() *wrappers.StringValue { - if m != nil { - return m.OwnerPath - } - return nil -} - -func (m *Category) GetCreateTime() *timestamp.Timestamp { - if m != nil { - return m.CreateTime - } - return nil -} - -func (m *Category) GetUpdateTime() *timestamp.Timestamp { - if m != nil { - return m.UpdateTime - } - return nil -} - -func (m *Category) GetDescription() *wrappers.StringValue { - if m != nil { - return m.Description - } - return nil -} - -func (m *Category) GetIcon() *wrappers.StringValue { - if m != nil { - return m.Icon - } - return nil -} - -func (m *Category) GetOwner() *wrappers.StringValue { - if m != nil { - return m.Owner - } - return nil -} - -type DescribeCategoriesRequest struct { - // query key, can fields with these fields(category_id, status, locale, owner, name), default return all categories - SearchWord *wrappers.StringValue `protobuf:"bytes,1,opt,name=search_word,json=searchWord,proto3" json:"search_word,omitempty"` - // sort key, order by sort_key, default create_time - SortKey *wrappers.StringValue `protobuf:"bytes,2,opt,name=sort_key,json=sortKey,proto3" json:"sort_key,omitempty"` - // value = 0 sort ASC, value = 1 sort DESC - Reverse *wrappers.BoolValue `protobuf:"bytes,3,opt,name=reverse,proto3" json:"reverse,omitempty"` - // data limit per page, default value 20, max value 200 - Limit uint32 `protobuf:"varint,4,opt,name=limit,proto3" json:"limit,omitempty"` - // data offset, default 0 - Offset uint32 `protobuf:"varint,5,opt,name=offset,proto3" json:"offset,omitempty"` - // select column to display - DisplayColumns []string `protobuf:"bytes,6,rep,name=display_columns,json=displayColumns,proto3" json:"display_columns,omitempty"` - // category ids - CategoryId []string `protobuf:"bytes,7,rep,name=category_id,json=categoryId,proto3" json:"category_id,omitempty"` - // category name - Name []string `protobuf:"bytes,8,rep,name=name,proto3" json:"name,omitempty"` - // owner - Owner []string `protobuf:"bytes,9,rep,name=owner,proto3" json:"owner,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *DescribeCategoriesRequest) Reset() { *m = DescribeCategoriesRequest{} } -func (m *DescribeCategoriesRequest) String() string { return proto.CompactTextString(m) } -func (*DescribeCategoriesRequest) ProtoMessage() {} -func (*DescribeCategoriesRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_1c6ef5ed29d8d1a1, []int{1} -} - -func (m *DescribeCategoriesRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_DescribeCategoriesRequest.Unmarshal(m, b) -} -func (m *DescribeCategoriesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_DescribeCategoriesRequest.Marshal(b, m, deterministic) -} -func (m *DescribeCategoriesRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_DescribeCategoriesRequest.Merge(m, src) -} -func (m *DescribeCategoriesRequest) XXX_Size() int { - return xxx_messageInfo_DescribeCategoriesRequest.Size(m) -} -func (m *DescribeCategoriesRequest) XXX_DiscardUnknown() { - xxx_messageInfo_DescribeCategoriesRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_DescribeCategoriesRequest proto.InternalMessageInfo - -func (m *DescribeCategoriesRequest) GetSearchWord() *wrappers.StringValue { - if m != nil { - return m.SearchWord - } - return nil -} - -func (m *DescribeCategoriesRequest) GetSortKey() *wrappers.StringValue { - if m != nil { - return m.SortKey - } - return nil -} - -func (m *DescribeCategoriesRequest) GetReverse() *wrappers.BoolValue { - if m != nil { - return m.Reverse - } - return nil -} - -func (m *DescribeCategoriesRequest) GetLimit() uint32 { - if m != nil { - return m.Limit - } - return 0 -} - -func (m *DescribeCategoriesRequest) GetOffset() uint32 { - if m != nil { - return m.Offset - } - return 0 -} - -func (m *DescribeCategoriesRequest) GetDisplayColumns() []string { - if m != nil { - return m.DisplayColumns - } - return nil -} - -func (m *DescribeCategoriesRequest) GetCategoryId() []string { - if m != nil { - return m.CategoryId - } - return nil -} - -func (m *DescribeCategoriesRequest) GetName() []string { - if m != nil { - return m.Name - } - return nil -} - -func (m *DescribeCategoriesRequest) GetOwner() []string { - if m != nil { - return m.Owner - } - return nil -} - -type DescribeCategoriesResponse struct { - // total count of qualified category - TotalCount uint32 `protobuf:"varint,1,opt,name=total_count,json=totalCount,proto3" json:"total_count,omitempty"` - // list of category - CategorySet []*Category `protobuf:"bytes,2,rep,name=category_set,json=categorySet,proto3" json:"category_set,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *DescribeCategoriesResponse) Reset() { *m = DescribeCategoriesResponse{} } -func (m *DescribeCategoriesResponse) String() string { return proto.CompactTextString(m) } -func (*DescribeCategoriesResponse) ProtoMessage() {} -func (*DescribeCategoriesResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_1c6ef5ed29d8d1a1, []int{2} -} - -func (m *DescribeCategoriesResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_DescribeCategoriesResponse.Unmarshal(m, b) -} -func (m *DescribeCategoriesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_DescribeCategoriesResponse.Marshal(b, m, deterministic) -} -func (m *DescribeCategoriesResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_DescribeCategoriesResponse.Merge(m, src) -} -func (m *DescribeCategoriesResponse) XXX_Size() int { - return xxx_messageInfo_DescribeCategoriesResponse.Size(m) -} -func (m *DescribeCategoriesResponse) XXX_DiscardUnknown() { - xxx_messageInfo_DescribeCategoriesResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_DescribeCategoriesResponse proto.InternalMessageInfo - -func (m *DescribeCategoriesResponse) GetTotalCount() uint32 { - if m != nil { - return m.TotalCount - } - return 0 -} - -func (m *DescribeCategoriesResponse) GetCategorySet() []*Category { - if m != nil { - return m.CategorySet - } - return nil -} - -type CreateCategoryRequest struct { - // required, category name - Name *wrappers.StringValue `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - // the i18n of this category, json format, sample: {"zh_cn": "数据库", "en": "database"} - Locale *wrappers.StringValue `protobuf:"bytes,3,opt,name=locale,proto3" json:"locale,omitempty"` - // category description - Description *wrappers.StringValue `protobuf:"bytes,4,opt,name=description,proto3" json:"description,omitempty"` - // category icon - Icon *wrappers.BytesValue `protobuf:"bytes,5,opt,name=icon,proto3" json:"icon,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *CreateCategoryRequest) Reset() { *m = CreateCategoryRequest{} } -func (m *CreateCategoryRequest) String() string { return proto.CompactTextString(m) } -func (*CreateCategoryRequest) ProtoMessage() {} -func (*CreateCategoryRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_1c6ef5ed29d8d1a1, []int{3} -} - -func (m *CreateCategoryRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_CreateCategoryRequest.Unmarshal(m, b) -} -func (m *CreateCategoryRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_CreateCategoryRequest.Marshal(b, m, deterministic) -} -func (m *CreateCategoryRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_CreateCategoryRequest.Merge(m, src) -} -func (m *CreateCategoryRequest) XXX_Size() int { - return xxx_messageInfo_CreateCategoryRequest.Size(m) -} -func (m *CreateCategoryRequest) XXX_DiscardUnknown() { - xxx_messageInfo_CreateCategoryRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_CreateCategoryRequest proto.InternalMessageInfo - -func (m *CreateCategoryRequest) GetName() *wrappers.StringValue { - if m != nil { - return m.Name - } - return nil -} - -func (m *CreateCategoryRequest) GetLocale() *wrappers.StringValue { - if m != nil { - return m.Locale - } - return nil -} - -func (m *CreateCategoryRequest) GetDescription() *wrappers.StringValue { - if m != nil { - return m.Description - } - return nil -} - -func (m *CreateCategoryRequest) GetIcon() *wrappers.BytesValue { - if m != nil { - return m.Icon - } - return nil -} - -type CreateCategoryResponse struct { - // id of category created - CategoryId *wrappers.StringValue `protobuf:"bytes,1,opt,name=category_id,json=categoryId,proto3" json:"category_id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *CreateCategoryResponse) Reset() { *m = CreateCategoryResponse{} } -func (m *CreateCategoryResponse) String() string { return proto.CompactTextString(m) } -func (*CreateCategoryResponse) ProtoMessage() {} -func (*CreateCategoryResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_1c6ef5ed29d8d1a1, []int{4} -} - -func (m *CreateCategoryResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_CreateCategoryResponse.Unmarshal(m, b) -} -func (m *CreateCategoryResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_CreateCategoryResponse.Marshal(b, m, deterministic) -} -func (m *CreateCategoryResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_CreateCategoryResponse.Merge(m, src) -} -func (m *CreateCategoryResponse) XXX_Size() int { - return xxx_messageInfo_CreateCategoryResponse.Size(m) -} -func (m *CreateCategoryResponse) XXX_DiscardUnknown() { - xxx_messageInfo_CreateCategoryResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_CreateCategoryResponse proto.InternalMessageInfo - -func (m *CreateCategoryResponse) GetCategoryId() *wrappers.StringValue { - if m != nil { - return m.CategoryId - } - return nil -} - -type ModifyCategoryRequest struct { - // required, id of category to modify - CategoryId *wrappers.StringValue `protobuf:"bytes,1,opt,name=category_id,json=categoryId,proto3" json:"category_id,omitempty"` - // category name - Name *wrappers.StringValue `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - // the i18n of this category, json format, sample: {"zh_cn": "数据库", "en": "database"} - Locale *wrappers.StringValue `protobuf:"bytes,3,opt,name=locale,proto3" json:"locale,omitempty"` - // category description - Description *wrappers.StringValue `protobuf:"bytes,4,opt,name=description,proto3" json:"description,omitempty"` - // category icon - Icon *wrappers.BytesValue `protobuf:"bytes,5,opt,name=icon,proto3" json:"icon,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ModifyCategoryRequest) Reset() { *m = ModifyCategoryRequest{} } -func (m *ModifyCategoryRequest) String() string { return proto.CompactTextString(m) } -func (*ModifyCategoryRequest) ProtoMessage() {} -func (*ModifyCategoryRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_1c6ef5ed29d8d1a1, []int{5} -} - -func (m *ModifyCategoryRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ModifyCategoryRequest.Unmarshal(m, b) -} -func (m *ModifyCategoryRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ModifyCategoryRequest.Marshal(b, m, deterministic) -} -func (m *ModifyCategoryRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_ModifyCategoryRequest.Merge(m, src) -} -func (m *ModifyCategoryRequest) XXX_Size() int { - return xxx_messageInfo_ModifyCategoryRequest.Size(m) -} -func (m *ModifyCategoryRequest) XXX_DiscardUnknown() { - xxx_messageInfo_ModifyCategoryRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_ModifyCategoryRequest proto.InternalMessageInfo - -func (m *ModifyCategoryRequest) GetCategoryId() *wrappers.StringValue { - if m != nil { - return m.CategoryId - } - return nil -} - -func (m *ModifyCategoryRequest) GetName() *wrappers.StringValue { - if m != nil { - return m.Name - } - return nil -} - -func (m *ModifyCategoryRequest) GetLocale() *wrappers.StringValue { - if m != nil { - return m.Locale - } - return nil -} - -func (m *ModifyCategoryRequest) GetDescription() *wrappers.StringValue { - if m != nil { - return m.Description - } - return nil -} - -func (m *ModifyCategoryRequest) GetIcon() *wrappers.BytesValue { - if m != nil { - return m.Icon - } - return nil -} - -type ModifyCategoryResponse struct { - // id of category modified - CategoryId *wrappers.StringValue `protobuf:"bytes,1,opt,name=category_id,json=categoryId,proto3" json:"category_id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ModifyCategoryResponse) Reset() { *m = ModifyCategoryResponse{} } -func (m *ModifyCategoryResponse) String() string { return proto.CompactTextString(m) } -func (*ModifyCategoryResponse) ProtoMessage() {} -func (*ModifyCategoryResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_1c6ef5ed29d8d1a1, []int{6} -} - -func (m *ModifyCategoryResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ModifyCategoryResponse.Unmarshal(m, b) -} -func (m *ModifyCategoryResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ModifyCategoryResponse.Marshal(b, m, deterministic) -} -func (m *ModifyCategoryResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_ModifyCategoryResponse.Merge(m, src) -} -func (m *ModifyCategoryResponse) XXX_Size() int { - return xxx_messageInfo_ModifyCategoryResponse.Size(m) -} -func (m *ModifyCategoryResponse) XXX_DiscardUnknown() { - xxx_messageInfo_ModifyCategoryResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_ModifyCategoryResponse proto.InternalMessageInfo - -func (m *ModifyCategoryResponse) GetCategoryId() *wrappers.StringValue { - if m != nil { - return m.CategoryId - } - return nil -} - -type DeleteCategoriesRequest struct { - // required, ids of category to delete - CategoryId []string `protobuf:"bytes,1,rep,name=category_id,json=categoryId,proto3" json:"category_id,omitempty"` - // if true force delete category - Force *wrappers.BoolValue `protobuf:"bytes,2,opt,name=force,proto3" json:"force,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *DeleteCategoriesRequest) Reset() { *m = DeleteCategoriesRequest{} } -func (m *DeleteCategoriesRequest) String() string { return proto.CompactTextString(m) } -func (*DeleteCategoriesRequest) ProtoMessage() {} -func (*DeleteCategoriesRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_1c6ef5ed29d8d1a1, []int{7} -} - -func (m *DeleteCategoriesRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_DeleteCategoriesRequest.Unmarshal(m, b) -} -func (m *DeleteCategoriesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_DeleteCategoriesRequest.Marshal(b, m, deterministic) -} -func (m *DeleteCategoriesRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_DeleteCategoriesRequest.Merge(m, src) -} -func (m *DeleteCategoriesRequest) XXX_Size() int { - return xxx_messageInfo_DeleteCategoriesRequest.Size(m) -} -func (m *DeleteCategoriesRequest) XXX_DiscardUnknown() { - xxx_messageInfo_DeleteCategoriesRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_DeleteCategoriesRequest proto.InternalMessageInfo - -func (m *DeleteCategoriesRequest) GetCategoryId() []string { - if m != nil { - return m.CategoryId - } - return nil -} - -func (m *DeleteCategoriesRequest) GetForce() *wrappers.BoolValue { - if m != nil { - return m.Force - } - return nil -} - -type DeleteCategoriesResponse struct { - // ids of category to deleted - CategoryId []string `protobuf:"bytes,1,rep,name=category_id,json=categoryId,proto3" json:"category_id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *DeleteCategoriesResponse) Reset() { *m = DeleteCategoriesResponse{} } -func (m *DeleteCategoriesResponse) String() string { return proto.CompactTextString(m) } -func (*DeleteCategoriesResponse) ProtoMessage() {} -func (*DeleteCategoriesResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_1c6ef5ed29d8d1a1, []int{8} -} - -func (m *DeleteCategoriesResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_DeleteCategoriesResponse.Unmarshal(m, b) -} -func (m *DeleteCategoriesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_DeleteCategoriesResponse.Marshal(b, m, deterministic) -} -func (m *DeleteCategoriesResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_DeleteCategoriesResponse.Merge(m, src) -} -func (m *DeleteCategoriesResponse) XXX_Size() int { - return xxx_messageInfo_DeleteCategoriesResponse.Size(m) -} -func (m *DeleteCategoriesResponse) XXX_DiscardUnknown() { - xxx_messageInfo_DeleteCategoriesResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_DeleteCategoriesResponse proto.InternalMessageInfo - -func (m *DeleteCategoriesResponse) GetCategoryId() []string { - if m != nil { - return m.CategoryId - } - return nil -} - -func init() { - proto.RegisterType((*Category)(nil), "openpitrix.Category") - proto.RegisterType((*DescribeCategoriesRequest)(nil), "openpitrix.DescribeCategoriesRequest") - proto.RegisterType((*DescribeCategoriesResponse)(nil), "openpitrix.DescribeCategoriesResponse") - proto.RegisterType((*CreateCategoryRequest)(nil), "openpitrix.CreateCategoryRequest") - proto.RegisterType((*CreateCategoryResponse)(nil), "openpitrix.CreateCategoryResponse") - proto.RegisterType((*ModifyCategoryRequest)(nil), "openpitrix.ModifyCategoryRequest") - proto.RegisterType((*ModifyCategoryResponse)(nil), "openpitrix.ModifyCategoryResponse") - proto.RegisterType((*DeleteCategoriesRequest)(nil), "openpitrix.DeleteCategoriesRequest") - proto.RegisterType((*DeleteCategoriesResponse)(nil), "openpitrix.DeleteCategoriesResponse") -} - -func init() { proto.RegisterFile("category.proto", fileDescriptor_1c6ef5ed29d8d1a1) } - -var fileDescriptor_1c6ef5ed29d8d1a1 = []byte{ - // 878 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x54, 0xcf, 0x6f, 0x1b, 0x45, - 0x14, 0x96, 0x1d, 0xdb, 0x49, 0x9e, 0x49, 0x52, 0xa6, 0x69, 0xbb, 0x35, 0x15, 0x19, 0x96, 0x5f, - 0xa1, 0x72, 0xec, 0x62, 0x8a, 0x2a, 0x11, 0x81, 0x94, 0xa4, 0x12, 0x42, 0xa8, 0x12, 0x72, 0x11, - 0x95, 0xb8, 0x58, 0x93, 0xdd, 0x67, 0x7b, 0xc4, 0x78, 0x67, 0x99, 0x99, 0x8d, 0xb1, 0xb8, 0x71, - 0xe0, 0xc8, 0x21, 0xf4, 0xff, 0xe0, 0xc8, 0x1f, 0xc2, 0xbf, 0xc0, 0x8d, 0x0b, 0x67, 0x4e, 0x68, - 0x67, 0x67, 0x1d, 0x7b, 0x6d, 0x1c, 0x23, 0x10, 0xa8, 0x27, 0x6b, 0xe7, 0x7d, 0x9f, 0xe7, 0x9b, - 0xf7, 0xbe, 0xef, 0xc1, 0x6e, 0xc0, 0x0c, 0x0e, 0xa4, 0x9a, 0xb4, 0x62, 0x25, 0x8d, 0x24, 0x20, - 0x63, 0x8c, 0x62, 0x6e, 0x14, 0xff, 0xa6, 0xf1, 0xea, 0x40, 0xca, 0x81, 0xc0, 0xb6, 0xad, 0x9c, - 0x27, 0xfd, 0xf6, 0x58, 0xb1, 0x38, 0x46, 0xa5, 0x33, 0x6c, 0xe3, 0xa0, 0x58, 0x37, 0x7c, 0x84, - 0xda, 0xb0, 0x51, 0xec, 0x00, 0xf7, 0x1c, 0x80, 0xc5, 0xbc, 0xcd, 0xa2, 0x48, 0x1a, 0x66, 0xb8, - 0x8c, 0x72, 0x7a, 0xd3, 0xfe, 0x04, 0x47, 0x03, 0x8c, 0x8e, 0xf4, 0x98, 0x0d, 0x06, 0xa8, 0xda, - 0x32, 0xb6, 0x88, 0x45, 0xb4, 0xff, 0x43, 0x05, 0xb6, 0xce, 0x9c, 0x56, 0xf2, 0x21, 0xd4, 0x73, - 0xdd, 0x3d, 0x1e, 0x7a, 0x25, 0x5a, 0x3a, 0xac, 0x77, 0xee, 0xb5, 0xb2, 0xeb, 0x5a, 0xb9, 0x9e, - 0xd6, 0x53, 0xa3, 0x78, 0x34, 0xf8, 0x82, 0x89, 0x04, 0xbb, 0x90, 0x13, 0x3e, 0x09, 0xc9, 0x03, - 0xa8, 0x44, 0x6c, 0x84, 0x5e, 0x79, 0x0d, 0x9e, 0x45, 0x92, 0x87, 0x50, 0x13, 0x32, 0x60, 0x02, - 0xbd, 0x8d, 0x35, 0x38, 0x0e, 0x4b, 0x8e, 0x01, 0xe4, 0x38, 0x42, 0xd5, 0x8b, 0x99, 0x19, 0x7a, - 0x95, 0x35, 0x98, 0xdb, 0x16, 0xff, 0x19, 0x33, 0x43, 0x72, 0x0c, 0xf5, 0x40, 0x21, 0x33, 0xd8, - 0x4b, 0xdb, 0xea, 0x55, 0x2d, 0xbb, 0xb1, 0xc0, 0xfe, 0x3c, 0xef, 0x79, 0x17, 0x32, 0x78, 0x7a, - 0x90, 0x92, 0x93, 0x38, 0x9c, 0x92, 0x6b, 0xd7, 0x93, 0x33, 0xb8, 0x25, 0x7f, 0x04, 0xf5, 0x10, - 0x75, 0xa0, 0xb8, 0x1d, 0x86, 0xb7, 0xb9, 0x86, 0xee, 0x59, 0x42, 0xda, 0x5e, 0x1e, 0xc8, 0xc8, - 0xdb, 0x5a, 0xa7, 0xbd, 0x29, 0x92, 0x74, 0xa0, 0x6a, 0x1f, 0xee, 0x6d, 0xaf, 0x41, 0xc9, 0xa0, - 0xfe, 0x6f, 0x65, 0xb8, 0xfb, 0xd8, 0xde, 0x7a, 0x8e, 0xce, 0x18, 0x1c, 0x75, 0x17, 0xbf, 0x4e, - 0x50, 0x9b, 0xd4, 0x21, 0x1a, 0x99, 0x0a, 0x86, 0xbd, 0xb1, 0x54, 0x6b, 0x3a, 0x24, 0x23, 0x3c, - 0x93, 0x2a, 0x24, 0x8f, 0x60, 0x4b, 0x4b, 0x65, 0x7a, 0x5f, 0xe1, 0x64, 0x2d, 0x97, 0x6c, 0xa6, - 0xe8, 0x4f, 0x71, 0x42, 0x1e, 0xc2, 0xa6, 0xc2, 0x0b, 0x54, 0x3a, 0x77, 0xca, 0x62, 0xd3, 0x4f, - 0xa5, 0x14, 0x8e, 0xe5, 0xa0, 0x64, 0x1f, 0xaa, 0x82, 0x8f, 0xb8, 0xb1, 0x1e, 0xd9, 0xe9, 0x66, - 0x1f, 0xe4, 0x36, 0xd4, 0x64, 0xbf, 0xaf, 0xd1, 0xd8, 0xe1, 0xef, 0x74, 0xdd, 0x17, 0x79, 0x1b, - 0xf6, 0x42, 0xae, 0x63, 0xc1, 0x26, 0xbd, 0x40, 0x8a, 0x64, 0x14, 0x69, 0xaf, 0x46, 0x37, 0x0e, - 0xb7, 0xbb, 0xbb, 0xee, 0xf8, 0x2c, 0x3b, 0x25, 0x07, 0xf3, 0x31, 0xd9, 0xb4, 0xa0, 0xd9, 0x20, - 0x10, 0x17, 0x84, 0x2d, 0x5b, 0xc9, 0xac, 0xbe, 0x7f, 0x35, 0x8b, 0xf4, 0xd0, 0x75, 0xfb, 0x02, - 0x1a, 0xcb, 0x9a, 0xad, 0x63, 0x19, 0x69, 0x4c, 0x2f, 0x32, 0xd2, 0x30, 0xd1, 0x0b, 0x64, 0x12, - 0x19, 0xdb, 0xed, 0x9d, 0x2e, 0xd8, 0xa3, 0xb3, 0xf4, 0x84, 0x3c, 0x82, 0x97, 0xa6, 0x4a, 0xd2, - 0x07, 0x95, 0xe9, 0xc6, 0x61, 0xbd, 0xb3, 0xdf, 0xba, 0xda, 0x36, 0xad, 0x3c, 0xdc, 0xdd, 0xa9, - 0xe6, 0xa7, 0x68, 0xfc, 0xdf, 0x4b, 0x70, 0xeb, 0xcc, 0xfa, 0x7a, 0x5a, 0x77, 0x13, 0xfe, 0xaf, - 0x42, 0x5c, 0x48, 0x43, 0xe5, 0xef, 0xa6, 0xa1, 0xed, 0xd2, 0x90, 0x05, 0xf8, 0x95, 0x45, 0x3b, - 0x4c, 0x0c, 0xea, 0x99, 0x30, 0xf8, 0xcf, 0xe0, 0x76, 0xf1, 0xc5, 0xae, 0xcd, 0xff, 0x6c, 0xed, - 0xf9, 0x3f, 0x95, 0xe1, 0xd6, 0x13, 0x19, 0xf2, 0xfe, 0xa4, 0xd8, 0xcb, 0x17, 0x64, 0x9f, 0xfe, - 0x1f, 0xa3, 0x28, 0x36, 0xec, 0xdf, 0x19, 0x85, 0x80, 0x3b, 0x8f, 0x51, 0xa0, 0x59, 0xb2, 0xb9, - 0x0e, 0x8a, 0xff, 0x5c, 0x0c, 0xed, 0x03, 0xa8, 0xf6, 0xa5, 0x0a, 0xf2, 0x76, 0xaf, 0x5a, 0x30, - 0x19, 0xd0, 0x3f, 0x06, 0x6f, 0xf1, 0xb6, 0xab, 0xe8, 0xae, 0xbc, 0xae, 0xf3, 0x73, 0x15, 0xf6, - 0xf2, 0xe7, 0x3f, 0x61, 0x11, 0x1b, 0xa0, 0x22, 0x7f, 0x94, 0x80, 0x2c, 0xae, 0x03, 0xf2, 0xe6, - 0x6c, 0x9e, 0xff, 0x72, 0x37, 0x37, 0xde, 0xba, 0x0e, 0x96, 0x49, 0xf3, 0x9f, 0x97, 0x2e, 0x4f, - 0xbe, 0x25, 0x93, 0x8f, 0xd1, 0xd0, 0x60, 0x5a, 0x6d, 0x52, 0x9d, 0xc4, 0xb1, 0x54, 0x86, 0xf6, - 0xb9, 0x30, 0xa8, 0xe8, 0x98, 0x9b, 0x21, 0x35, 0x43, 0xd4, 0x48, 0xfb, 0x1c, 0x45, 0xa8, 0x0f, - 0x67, 0xde, 0xd3, 0xa4, 0xda, 0x30, 0x93, 0xe8, 0x26, 0xcd, 0x2c, 0xd4, 0xa4, 0x76, 0x9d, 0x35, - 0x69, 0xea, 0xc2, 0x77, 0x9a, 0x34, 0xc4, 0x3e, 0x4b, 0x84, 0xa1, 0x0a, 0x4d, 0xa2, 0x22, 0xca, - 0x84, 0x98, 0xb9, 0xea, 0xbb, 0x5f, 0x7e, 0xfd, 0xb1, 0x7c, 0x83, 0xec, 0xb6, 0x2f, 0xde, 0x6d, - 0x5f, 0x9d, 0x92, 0xef, 0x4b, 0xb0, 0x3b, 0x1f, 0x50, 0xf2, 0xda, 0xdc, 0x22, 0x5b, 0xb6, 0xae, - 0x1a, 0xfe, 0x2a, 0x88, 0x7b, 0xf0, 0xd1, 0xe5, 0xc9, 0xcb, 0x64, 0x2f, 0x2b, 0xe6, 0x3a, 0x26, - 0x56, 0xc5, 0x4d, 0xbf, 0xa0, 0xe2, 0x83, 0xd2, 0x7d, 0x2b, 0x64, 0xde, 0x9e, 0xf3, 0x42, 0x96, - 0x66, 0x7d, 0x5e, 0xc8, 0x72, 0x77, 0x3b, 0x21, 0x59, 0xb1, 0x20, 0xa4, 0xb3, 0x44, 0xc8, 0xf3, - 0x12, 0xdc, 0x28, 0x1a, 0x8c, 0xbc, 0x3e, 0x3f, 0xe5, 0xa5, 0x66, 0x6f, 0xbc, 0xb1, 0x1a, 0xe4, - 0xe4, 0xbc, 0x7f, 0x79, 0x72, 0x97, 0xdc, 0x39, 0x65, 0x26, 0x18, 0xd2, 0xd0, 0x82, 0x8a, 0x53, - 0xba, 0x79, 0x7f, 0x51, 0xd6, 0x69, 0xe5, 0xcb, 0x72, 0x7c, 0x7e, 0x5e, 0xb3, 0xb9, 0x78, 0xef, - 0xcf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x3f, 0x15, 0x3d, 0x72, 0xea, 0x0a, 0x00, 0x00, -} - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConn - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion4 - -// CategoryManagerClient is the client API for CategoryManager service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type CategoryManagerClient interface { - // Get categories, support filter with these fields(category_id, status, locale, owner, name), default return all categories - DescribeCategories(ctx context.Context, in *DescribeCategoriesRequest, opts ...grpc.CallOption) (*DescribeCategoriesResponse, error) - // Create category - CreateCategory(ctx context.Context, in *CreateCategoryRequest, opts ...grpc.CallOption) (*CreateCategoryResponse, error) - // Modify category - ModifyCategory(ctx context.Context, in *ModifyCategoryRequest, opts ...grpc.CallOption) (*ModifyCategoryResponse, error) - // Batch delete categories - DeleteCategories(ctx context.Context, in *DeleteCategoriesRequest, opts ...grpc.CallOption) (*DeleteCategoriesResponse, error) -} - -type categoryManagerClient struct { - cc *grpc.ClientConn -} - -func NewCategoryManagerClient(cc *grpc.ClientConn) CategoryManagerClient { - return &categoryManagerClient{cc} -} - -func (c *categoryManagerClient) DescribeCategories(ctx context.Context, in *DescribeCategoriesRequest, opts ...grpc.CallOption) (*DescribeCategoriesResponse, error) { - out := new(DescribeCategoriesResponse) - err := c.cc.Invoke(ctx, "/openpitrix.CategoryManager/DescribeCategories", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *categoryManagerClient) CreateCategory(ctx context.Context, in *CreateCategoryRequest, opts ...grpc.CallOption) (*CreateCategoryResponse, error) { - out := new(CreateCategoryResponse) - err := c.cc.Invoke(ctx, "/openpitrix.CategoryManager/CreateCategory", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *categoryManagerClient) ModifyCategory(ctx context.Context, in *ModifyCategoryRequest, opts ...grpc.CallOption) (*ModifyCategoryResponse, error) { - out := new(ModifyCategoryResponse) - err := c.cc.Invoke(ctx, "/openpitrix.CategoryManager/ModifyCategory", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *categoryManagerClient) DeleteCategories(ctx context.Context, in *DeleteCategoriesRequest, opts ...grpc.CallOption) (*DeleteCategoriesResponse, error) { - out := new(DeleteCategoriesResponse) - err := c.cc.Invoke(ctx, "/openpitrix.CategoryManager/DeleteCategories", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// CategoryManagerServer is the server API for CategoryManager service. -type CategoryManagerServer interface { - // Get categories, support filter with these fields(category_id, status, locale, owner, name), default return all categories - DescribeCategories(context.Context, *DescribeCategoriesRequest) (*DescribeCategoriesResponse, error) - // Create category - CreateCategory(context.Context, *CreateCategoryRequest) (*CreateCategoryResponse, error) - // Modify category - ModifyCategory(context.Context, *ModifyCategoryRequest) (*ModifyCategoryResponse, error) - // Batch delete categories - DeleteCategories(context.Context, *DeleteCategoriesRequest) (*DeleteCategoriesResponse, error) -} - -// UnimplementedCategoryManagerServer can be embedded to have forward compatible implementations. -type UnimplementedCategoryManagerServer struct { -} - -func (*UnimplementedCategoryManagerServer) DescribeCategories(ctx context.Context, req *DescribeCategoriesRequest) (*DescribeCategoriesResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method DescribeCategories not implemented") -} -func (*UnimplementedCategoryManagerServer) CreateCategory(ctx context.Context, req *CreateCategoryRequest) (*CreateCategoryResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method CreateCategory not implemented") -} -func (*UnimplementedCategoryManagerServer) ModifyCategory(ctx context.Context, req *ModifyCategoryRequest) (*ModifyCategoryResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ModifyCategory not implemented") -} -func (*UnimplementedCategoryManagerServer) DeleteCategories(ctx context.Context, req *DeleteCategoriesRequest) (*DeleteCategoriesResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method DeleteCategories not implemented") -} - -func RegisterCategoryManagerServer(s *grpc.Server, srv CategoryManagerServer) { - s.RegisterService(&_CategoryManager_serviceDesc, srv) -} - -func _CategoryManager_DescribeCategories_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DescribeCategoriesRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(CategoryManagerServer).DescribeCategories(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/openpitrix.CategoryManager/DescribeCategories", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(CategoryManagerServer).DescribeCategories(ctx, req.(*DescribeCategoriesRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _CategoryManager_CreateCategory_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CreateCategoryRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(CategoryManagerServer).CreateCategory(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/openpitrix.CategoryManager/CreateCategory", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(CategoryManagerServer).CreateCategory(ctx, req.(*CreateCategoryRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _CategoryManager_ModifyCategory_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ModifyCategoryRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(CategoryManagerServer).ModifyCategory(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/openpitrix.CategoryManager/ModifyCategory", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(CategoryManagerServer).ModifyCategory(ctx, req.(*ModifyCategoryRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _CategoryManager_DeleteCategories_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DeleteCategoriesRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(CategoryManagerServer).DeleteCategories(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/openpitrix.CategoryManager/DeleteCategories", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(CategoryManagerServer).DeleteCategories(ctx, req.(*DeleteCategoriesRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _CategoryManager_serviceDesc = grpc.ServiceDesc{ - ServiceName: "openpitrix.CategoryManager", - HandlerType: (*CategoryManagerServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "DescribeCategories", - Handler: _CategoryManager_DescribeCategories_Handler, - }, - { - MethodName: "CreateCategory", - Handler: _CategoryManager_CreateCategory_Handler, - }, - { - MethodName: "ModifyCategory", - Handler: _CategoryManager_ModifyCategory_Handler, - }, - { - MethodName: "DeleteCategories", - Handler: _CategoryManager_DeleteCategories_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "category.proto", -} diff --git a/vendor/openpitrix.io/openpitrix/pkg/pb/category.pb.gw.go b/vendor/openpitrix.io/openpitrix/pkg/pb/category.pb.gw.go deleted file mode 100644 index 4b6856b686..0000000000 --- a/vendor/openpitrix.io/openpitrix/pkg/pb/category.pb.gw.go +++ /dev/null @@ -1,396 +0,0 @@ -// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: category.proto - -/* -Package pb is a reverse proxy. - -It translates gRPC into RESTful JSON APIs. -*/ -package pb - -import ( - "context" - "io" - "net/http" - - "github.com/golang/protobuf/descriptor" - "github.com/golang/protobuf/proto" - "github.com/grpc-ecosystem/grpc-gateway/runtime" - "github.com/grpc-ecosystem/grpc-gateway/utilities" - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/grpclog" - "google.golang.org/grpc/status" -) - -// Suppress "imported and not used" errors -var _ codes.Code -var _ io.Reader -var _ status.Status -var _ = runtime.String -var _ = utilities.NewDoubleArray -var _ = descriptor.ForMessage - -var ( - filter_CategoryManager_DescribeCategories_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_CategoryManager_DescribeCategories_0(ctx context.Context, marshaler runtime.Marshaler, client CategoryManagerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq DescribeCategoriesRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_CategoryManager_DescribeCategories_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.DescribeCategories(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_CategoryManager_DescribeCategories_0(ctx context.Context, marshaler runtime.Marshaler, server CategoryManagerServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq DescribeCategoriesRequest - var metadata runtime.ServerMetadata - - if err := runtime.PopulateQueryParameters(&protoReq, req.URL.Query(), filter_CategoryManager_DescribeCategories_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.DescribeCategories(ctx, &protoReq) - return msg, metadata, err - -} - -func request_CategoryManager_CreateCategory_0(ctx context.Context, marshaler runtime.Marshaler, client CategoryManagerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq CreateCategoryRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.CreateCategory(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_CategoryManager_CreateCategory_0(ctx context.Context, marshaler runtime.Marshaler, server CategoryManagerServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq CreateCategoryRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.CreateCategory(ctx, &protoReq) - return msg, metadata, err - -} - -func request_CategoryManager_ModifyCategory_0(ctx context.Context, marshaler runtime.Marshaler, client CategoryManagerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ModifyCategoryRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.ModifyCategory(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_CategoryManager_ModifyCategory_0(ctx context.Context, marshaler runtime.Marshaler, server CategoryManagerServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ModifyCategoryRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.ModifyCategory(ctx, &protoReq) - return msg, metadata, err - -} - -func request_CategoryManager_DeleteCategories_0(ctx context.Context, marshaler runtime.Marshaler, client CategoryManagerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq DeleteCategoriesRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.DeleteCategories(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_CategoryManager_DeleteCategories_0(ctx context.Context, marshaler runtime.Marshaler, server CategoryManagerServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq DeleteCategoriesRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.DeleteCategories(ctx, &protoReq) - return msg, metadata, err - -} - -// RegisterCategoryManagerHandlerServer registers the http handlers for service CategoryManager to "mux". -// UnaryRPC :call CategoryManagerServer directly. -// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. -func RegisterCategoryManagerHandlerServer(ctx context.Context, mux *runtime.ServeMux, server CategoryManagerServer) error { - - mux.Handle("GET", pattern_CategoryManager_DescribeCategories_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_CategoryManager_DescribeCategories_0(rctx, inboundMarshaler, server, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_CategoryManager_DescribeCategories_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_CategoryManager_CreateCategory_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_CategoryManager_CreateCategory_0(rctx, inboundMarshaler, server, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_CategoryManager_CreateCategory_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("PATCH", pattern_CategoryManager_ModifyCategory_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_CategoryManager_ModifyCategory_0(rctx, inboundMarshaler, server, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_CategoryManager_ModifyCategory_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("DELETE", pattern_CategoryManager_DeleteCategories_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_CategoryManager_DeleteCategories_0(rctx, inboundMarshaler, server, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_CategoryManager_DeleteCategories_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -// RegisterCategoryManagerHandlerFromEndpoint is same as RegisterCategoryManagerHandler but -// automatically dials to "endpoint" and closes the connection when "ctx" gets done. -func RegisterCategoryManagerHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { - conn, err := grpc.Dial(endpoint, opts...) - if err != nil { - return err - } - defer func() { - if err != nil { - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - return - } - go func() { - <-ctx.Done() - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - }() - }() - - return RegisterCategoryManagerHandler(ctx, mux, conn) -} - -// RegisterCategoryManagerHandler registers the http handlers for service CategoryManager to "mux". -// The handlers forward requests to the grpc endpoint over "conn". -func RegisterCategoryManagerHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { - return RegisterCategoryManagerHandlerClient(ctx, mux, NewCategoryManagerClient(conn)) -} - -// RegisterCategoryManagerHandlerClient registers the http handlers for service CategoryManager -// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "CategoryManagerClient". -// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "CategoryManagerClient" -// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in -// "CategoryManagerClient" to call the correct interceptors. -func RegisterCategoryManagerHandlerClient(ctx context.Context, mux *runtime.ServeMux, client CategoryManagerClient) error { - - mux.Handle("GET", pattern_CategoryManager_DescribeCategories_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_CategoryManager_DescribeCategories_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_CategoryManager_DescribeCategories_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_CategoryManager_CreateCategory_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_CategoryManager_CreateCategory_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_CategoryManager_CreateCategory_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("PATCH", pattern_CategoryManager_ModifyCategory_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_CategoryManager_ModifyCategory_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_CategoryManager_ModifyCategory_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("DELETE", pattern_CategoryManager_DeleteCategories_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_CategoryManager_DeleteCategories_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_CategoryManager_DeleteCategories_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -var ( - pattern_CategoryManager_DescribeCategories_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "categories"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_CategoryManager_CreateCategory_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "categories"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_CategoryManager_ModifyCategory_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "categories"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_CategoryManager_DeleteCategories_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "categories"}, "", runtime.AssumeColonVerbOpt(true))) -) - -var ( - forward_CategoryManager_DescribeCategories_0 = runtime.ForwardResponseMessage - - forward_CategoryManager_CreateCategory_0 = runtime.ForwardResponseMessage - - forward_CategoryManager_ModifyCategory_0 = runtime.ForwardResponseMessage - - forward_CategoryManager_DeleteCategories_0 = runtime.ForwardResponseMessage -) diff --git a/vendor/openpitrix.io/openpitrix/pkg/pb/cluster.pb.go b/vendor/openpitrix.io/openpitrix/pkg/pb/cluster.pb.go deleted file mode 100644 index e3a18b6c48..0000000000 --- a/vendor/openpitrix.io/openpitrix/pkg/pb/cluster.pb.go +++ /dev/null @@ -1,6745 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// source: cluster.proto - -package pb - -import ( - context "context" - fmt "fmt" - math "math" - - proto "github.com/golang/protobuf/proto" - empty "github.com/golang/protobuf/ptypes/empty" - timestamp "github.com/golang/protobuf/ptypes/timestamp" - wrappers "github.com/golang/protobuf/ptypes/wrappers" - _ "github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger/options" - _ "google.golang.org/genproto/googleapis/api/annotations" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" -) - -// 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 - -type DescribeSubnetsRequest struct { - // required, id of runtime that contain subnet - RuntimeId *wrappers.StringValue `protobuf:"bytes,1,opt,name=runtime_id,json=runtimeId,proto3" json:"runtime_id,omitempty"` - // data limit per page, default value 20, max value 200 - Limit uint32 `protobuf:"varint,2,opt,name=limit,proto3" json:"limit,omitempty"` - // data offset, default 0 - Offset uint32 `protobuf:"varint,3,opt,name=offset,proto3" json:"offset,omitempty"` - // subnet type - SubnetType *wrappers.UInt32Value `protobuf:"bytes,4,opt,name=subnet_type,json=subnetType,proto3" json:"subnet_type,omitempty"` - // subnet ids - SubnetId []string `protobuf:"bytes,5,rep,name=subnet_id,json=subnetId,proto3" json:"subnet_id,omitempty"` - // zone eg.[pek3a|pek3b|...] - Zone []string `protobuf:"bytes,6,rep,name=zone,proto3" json:"zone,omitempty"` - // advanced param - AdvancedParam []string `protobuf:"bytes,7,rep,name=advanced_param,json=advancedParam,proto3" json:"advanced_param,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *DescribeSubnetsRequest) Reset() { *m = DescribeSubnetsRequest{} } -func (m *DescribeSubnetsRequest) String() string { return proto.CompactTextString(m) } -func (*DescribeSubnetsRequest) ProtoMessage() {} -func (*DescribeSubnetsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_3cfb3b8ec240c376, []int{0} -} - -func (m *DescribeSubnetsRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_DescribeSubnetsRequest.Unmarshal(m, b) -} -func (m *DescribeSubnetsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_DescribeSubnetsRequest.Marshal(b, m, deterministic) -} -func (m *DescribeSubnetsRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_DescribeSubnetsRequest.Merge(m, src) -} -func (m *DescribeSubnetsRequest) XXX_Size() int { - return xxx_messageInfo_DescribeSubnetsRequest.Size(m) -} -func (m *DescribeSubnetsRequest) XXX_DiscardUnknown() { - xxx_messageInfo_DescribeSubnetsRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_DescribeSubnetsRequest proto.InternalMessageInfo - -func (m *DescribeSubnetsRequest) GetRuntimeId() *wrappers.StringValue { - if m != nil { - return m.RuntimeId - } - return nil -} - -func (m *DescribeSubnetsRequest) GetLimit() uint32 { - if m != nil { - return m.Limit - } - return 0 -} - -func (m *DescribeSubnetsRequest) GetOffset() uint32 { - if m != nil { - return m.Offset - } - return 0 -} - -func (m *DescribeSubnetsRequest) GetSubnetType() *wrappers.UInt32Value { - if m != nil { - return m.SubnetType - } - return nil -} - -func (m *DescribeSubnetsRequest) GetSubnetId() []string { - if m != nil { - return m.SubnetId - } - return nil -} - -func (m *DescribeSubnetsRequest) GetZone() []string { - if m != nil { - return m.Zone - } - return nil -} - -func (m *DescribeSubnetsRequest) GetAdvancedParam() []string { - if m != nil { - return m.AdvancedParam - } - return nil -} - -type Subnet struct { - // subnet id - SubnetId *wrappers.StringValue `protobuf:"bytes,1,opt,name=subnet_id,json=subnetId,proto3" json:"subnet_id,omitempty"` - // subnet name - Name *wrappers.StringValue `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - // subnet zone - Zone *wrappers.StringValue `protobuf:"bytes,3,opt,name=zone,proto3" json:"zone,omitempty"` - // the time when subnet create - CreateTime *timestamp.Timestamp `protobuf:"bytes,4,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty"` - // subnet description - Description *wrappers.StringValue `protobuf:"bytes,5,opt,name=description,proto3" json:"description,omitempty"` - // instance ids, subnet belong to one more instance - InstanceId []string `protobuf:"bytes,6,rep,name=instance_id,json=instanceId,proto3" json:"instance_id,omitempty"` - // vpc id, a vpc contain one more subnet - VpcId *wrappers.StringValue `protobuf:"bytes,7,opt,name=vpc_id,json=vpcId,proto3" json:"vpc_id,omitempty"` - // subnet type - SubnetType *wrappers.UInt32Value `protobuf:"bytes,8,opt,name=subnet_type,json=subnetType,proto3" json:"subnet_type,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Subnet) Reset() { *m = Subnet{} } -func (m *Subnet) String() string { return proto.CompactTextString(m) } -func (*Subnet) ProtoMessage() {} -func (*Subnet) Descriptor() ([]byte, []int) { - return fileDescriptor_3cfb3b8ec240c376, []int{1} -} - -func (m *Subnet) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Subnet.Unmarshal(m, b) -} -func (m *Subnet) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Subnet.Marshal(b, m, deterministic) -} -func (m *Subnet) XXX_Merge(src proto.Message) { - xxx_messageInfo_Subnet.Merge(m, src) -} -func (m *Subnet) XXX_Size() int { - return xxx_messageInfo_Subnet.Size(m) -} -func (m *Subnet) XXX_DiscardUnknown() { - xxx_messageInfo_Subnet.DiscardUnknown(m) -} - -var xxx_messageInfo_Subnet proto.InternalMessageInfo - -func (m *Subnet) GetSubnetId() *wrappers.StringValue { - if m != nil { - return m.SubnetId - } - return nil -} - -func (m *Subnet) GetName() *wrappers.StringValue { - if m != nil { - return m.Name - } - return nil -} - -func (m *Subnet) GetZone() *wrappers.StringValue { - if m != nil { - return m.Zone - } - return nil -} - -func (m *Subnet) GetCreateTime() *timestamp.Timestamp { - if m != nil { - return m.CreateTime - } - return nil -} - -func (m *Subnet) GetDescription() *wrappers.StringValue { - if m != nil { - return m.Description - } - return nil -} - -func (m *Subnet) GetInstanceId() []string { - if m != nil { - return m.InstanceId - } - return nil -} - -func (m *Subnet) GetVpcId() *wrappers.StringValue { - if m != nil { - return m.VpcId - } - return nil -} - -func (m *Subnet) GetSubnetType() *wrappers.UInt32Value { - if m != nil { - return m.SubnetType - } - return nil -} - -type DescribeSubnetsResponse struct { - // total count of subnet - TotalCount uint32 `protobuf:"varint,1,opt,name=total_count,json=totalCount,proto3" json:"total_count,omitempty"` - // list of subnet - SubnetSet []*Subnet `protobuf:"bytes,2,rep,name=subnet_set,json=subnetSet,proto3" json:"subnet_set,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *DescribeSubnetsResponse) Reset() { *m = DescribeSubnetsResponse{} } -func (m *DescribeSubnetsResponse) String() string { return proto.CompactTextString(m) } -func (*DescribeSubnetsResponse) ProtoMessage() {} -func (*DescribeSubnetsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_3cfb3b8ec240c376, []int{2} -} - -func (m *DescribeSubnetsResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_DescribeSubnetsResponse.Unmarshal(m, b) -} -func (m *DescribeSubnetsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_DescribeSubnetsResponse.Marshal(b, m, deterministic) -} -func (m *DescribeSubnetsResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_DescribeSubnetsResponse.Merge(m, src) -} -func (m *DescribeSubnetsResponse) XXX_Size() int { - return xxx_messageInfo_DescribeSubnetsResponse.Size(m) -} -func (m *DescribeSubnetsResponse) XXX_DiscardUnknown() { - xxx_messageInfo_DescribeSubnetsResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_DescribeSubnetsResponse proto.InternalMessageInfo - -func (m *DescribeSubnetsResponse) GetTotalCount() uint32 { - if m != nil { - return m.TotalCount - } - return 0 -} - -func (m *DescribeSubnetsResponse) GetSubnetSet() []*Subnet { - if m != nil { - return m.SubnetSet - } - return nil -} - -type DeleteClusterInRuntimeRequest struct { - RuntimeId []string `protobuf:"bytes,1,rep,name=runtime_id,json=runtimeId,proto3" json:"runtime_id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *DeleteClusterInRuntimeRequest) Reset() { *m = DeleteClusterInRuntimeRequest{} } -func (m *DeleteClusterInRuntimeRequest) String() string { return proto.CompactTextString(m) } -func (*DeleteClusterInRuntimeRequest) ProtoMessage() {} -func (*DeleteClusterInRuntimeRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_3cfb3b8ec240c376, []int{3} -} - -func (m *DeleteClusterInRuntimeRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_DeleteClusterInRuntimeRequest.Unmarshal(m, b) -} -func (m *DeleteClusterInRuntimeRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_DeleteClusterInRuntimeRequest.Marshal(b, m, deterministic) -} -func (m *DeleteClusterInRuntimeRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_DeleteClusterInRuntimeRequest.Merge(m, src) -} -func (m *DeleteClusterInRuntimeRequest) XXX_Size() int { - return xxx_messageInfo_DeleteClusterInRuntimeRequest.Size(m) -} -func (m *DeleteClusterInRuntimeRequest) XXX_DiscardUnknown() { - xxx_messageInfo_DeleteClusterInRuntimeRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_DeleteClusterInRuntimeRequest proto.InternalMessageInfo - -func (m *DeleteClusterInRuntimeRequest) GetRuntimeId() []string { - if m != nil { - return m.RuntimeId - } - return nil -} - -type DeleteClusterInRuntimeResponse struct { - RuntimeId []string `protobuf:"bytes,1,rep,name=runtime_id,json=runtimeId,proto3" json:"runtime_id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *DeleteClusterInRuntimeResponse) Reset() { *m = DeleteClusterInRuntimeResponse{} } -func (m *DeleteClusterInRuntimeResponse) String() string { return proto.CompactTextString(m) } -func (*DeleteClusterInRuntimeResponse) ProtoMessage() {} -func (*DeleteClusterInRuntimeResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_3cfb3b8ec240c376, []int{4} -} - -func (m *DeleteClusterInRuntimeResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_DeleteClusterInRuntimeResponse.Unmarshal(m, b) -} -func (m *DeleteClusterInRuntimeResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_DeleteClusterInRuntimeResponse.Marshal(b, m, deterministic) -} -func (m *DeleteClusterInRuntimeResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_DeleteClusterInRuntimeResponse.Merge(m, src) -} -func (m *DeleteClusterInRuntimeResponse) XXX_Size() int { - return xxx_messageInfo_DeleteClusterInRuntimeResponse.Size(m) -} -func (m *DeleteClusterInRuntimeResponse) XXX_DiscardUnknown() { - xxx_messageInfo_DeleteClusterInRuntimeResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_DeleteClusterInRuntimeResponse proto.InternalMessageInfo - -func (m *DeleteClusterInRuntimeResponse) GetRuntimeId() []string { - if m != nil { - return m.RuntimeId - } - return nil -} - -type MigrateClusterInRuntimeRequest struct { - FromRuntimeId string `protobuf:"bytes,1,opt,name=from_runtime_id,json=fromRuntimeId,proto3" json:"from_runtime_id,omitempty"` - ToRuntimeId string `protobuf:"bytes,2,opt,name=to_runtime_id,json=toRuntimeId,proto3" json:"to_runtime_id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *MigrateClusterInRuntimeRequest) Reset() { *m = MigrateClusterInRuntimeRequest{} } -func (m *MigrateClusterInRuntimeRequest) String() string { return proto.CompactTextString(m) } -func (*MigrateClusterInRuntimeRequest) ProtoMessage() {} -func (*MigrateClusterInRuntimeRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_3cfb3b8ec240c376, []int{5} -} - -func (m *MigrateClusterInRuntimeRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_MigrateClusterInRuntimeRequest.Unmarshal(m, b) -} -func (m *MigrateClusterInRuntimeRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_MigrateClusterInRuntimeRequest.Marshal(b, m, deterministic) -} -func (m *MigrateClusterInRuntimeRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_MigrateClusterInRuntimeRequest.Merge(m, src) -} -func (m *MigrateClusterInRuntimeRequest) XXX_Size() int { - return xxx_messageInfo_MigrateClusterInRuntimeRequest.Size(m) -} -func (m *MigrateClusterInRuntimeRequest) XXX_DiscardUnknown() { - xxx_messageInfo_MigrateClusterInRuntimeRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_MigrateClusterInRuntimeRequest proto.InternalMessageInfo - -func (m *MigrateClusterInRuntimeRequest) GetFromRuntimeId() string { - if m != nil { - return m.FromRuntimeId - } - return "" -} - -func (m *MigrateClusterInRuntimeRequest) GetToRuntimeId() string { - if m != nil { - return m.ToRuntimeId - } - return "" -} - -type MigrateClusterInRuntimeResponse struct { - FromRuntimeId string `protobuf:"bytes,1,opt,name=from_runtime_id,json=fromRuntimeId,proto3" json:"from_runtime_id,omitempty"` - ToRuntimeId string `protobuf:"bytes,2,opt,name=to_runtime_id,json=toRuntimeId,proto3" json:"to_runtime_id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *MigrateClusterInRuntimeResponse) Reset() { *m = MigrateClusterInRuntimeResponse{} } -func (m *MigrateClusterInRuntimeResponse) String() string { return proto.CompactTextString(m) } -func (*MigrateClusterInRuntimeResponse) ProtoMessage() {} -func (*MigrateClusterInRuntimeResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_3cfb3b8ec240c376, []int{6} -} - -func (m *MigrateClusterInRuntimeResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_MigrateClusterInRuntimeResponse.Unmarshal(m, b) -} -func (m *MigrateClusterInRuntimeResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_MigrateClusterInRuntimeResponse.Marshal(b, m, deterministic) -} -func (m *MigrateClusterInRuntimeResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MigrateClusterInRuntimeResponse.Merge(m, src) -} -func (m *MigrateClusterInRuntimeResponse) XXX_Size() int { - return xxx_messageInfo_MigrateClusterInRuntimeResponse.Size(m) -} -func (m *MigrateClusterInRuntimeResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MigrateClusterInRuntimeResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_MigrateClusterInRuntimeResponse proto.InternalMessageInfo - -func (m *MigrateClusterInRuntimeResponse) GetFromRuntimeId() string { - if m != nil { - return m.FromRuntimeId - } - return "" -} - -func (m *MigrateClusterInRuntimeResponse) GetToRuntimeId() string { - if m != nil { - return m.ToRuntimeId - } - return "" -} - -type CreateClusterRequest struct { - // required, id of app to run in cluster - AppId *wrappers.StringValue `protobuf:"bytes,1,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty"` - // required, id of app version - VersionId *wrappers.StringValue `protobuf:"bytes,2,opt,name=version_id,json=versionId,proto3" json:"version_id,omitempty"` - // required, id of runtime - RuntimeId *wrappers.StringValue `protobuf:"bytes,3,opt,name=runtime_id,json=runtimeId,proto3" json:"runtime_id,omitempty"` - // required, conf a json string, include cpu, memory info of cluster - Conf *wrappers.StringValue `protobuf:"bytes,4,opt,name=conf,proto3" json:"conf,omitempty"` - // advanced param - AdvancedParam []string `protobuf:"bytes,5,rep,name=advanced_param,json=advancedParam,proto3" json:"advanced_param,omitempty"` - // kubernetes namespace - Zone *wrappers.StringValue `protobuf:"bytes,6,opt,name=zone,proto3" json:"zone,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *CreateClusterRequest) Reset() { *m = CreateClusterRequest{} } -func (m *CreateClusterRequest) String() string { return proto.CompactTextString(m) } -func (*CreateClusterRequest) ProtoMessage() {} -func (*CreateClusterRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_3cfb3b8ec240c376, []int{7} -} - -func (m *CreateClusterRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_CreateClusterRequest.Unmarshal(m, b) -} -func (m *CreateClusterRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_CreateClusterRequest.Marshal(b, m, deterministic) -} -func (m *CreateClusterRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_CreateClusterRequest.Merge(m, src) -} -func (m *CreateClusterRequest) XXX_Size() int { - return xxx_messageInfo_CreateClusterRequest.Size(m) -} -func (m *CreateClusterRequest) XXX_DiscardUnknown() { - xxx_messageInfo_CreateClusterRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_CreateClusterRequest proto.InternalMessageInfo - -func (m *CreateClusterRequest) GetAppId() *wrappers.StringValue { - if m != nil { - return m.AppId - } - return nil -} - -func (m *CreateClusterRequest) GetVersionId() *wrappers.StringValue { - if m != nil { - return m.VersionId - } - return nil -} - -func (m *CreateClusterRequest) GetRuntimeId() *wrappers.StringValue { - if m != nil { - return m.RuntimeId - } - return nil -} - -func (m *CreateClusterRequest) GetConf() *wrappers.StringValue { - if m != nil { - return m.Conf - } - return nil -} - -func (m *CreateClusterRequest) GetAdvancedParam() []string { - if m != nil { - return m.AdvancedParam - } - return nil -} - -func (m *CreateClusterRequest) GetZone() *wrappers.StringValue { - if m != nil { - return m.Zone - } - return nil -} - -type CreateClusterResponse struct { - // id of cluster created - ClusterId *wrappers.StringValue `protobuf:"bytes,1,opt,name=cluster_id,json=clusterId,proto3" json:"cluster_id,omitempty"` - // id of job - JobId *wrappers.StringValue `protobuf:"bytes,2,opt,name=job_id,json=jobId,proto3" json:"job_id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *CreateClusterResponse) Reset() { *m = CreateClusterResponse{} } -func (m *CreateClusterResponse) String() string { return proto.CompactTextString(m) } -func (*CreateClusterResponse) ProtoMessage() {} -func (*CreateClusterResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_3cfb3b8ec240c376, []int{8} -} - -func (m *CreateClusterResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_CreateClusterResponse.Unmarshal(m, b) -} -func (m *CreateClusterResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_CreateClusterResponse.Marshal(b, m, deterministic) -} -func (m *CreateClusterResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_CreateClusterResponse.Merge(m, src) -} -func (m *CreateClusterResponse) XXX_Size() int { - return xxx_messageInfo_CreateClusterResponse.Size(m) -} -func (m *CreateClusterResponse) XXX_DiscardUnknown() { - xxx_messageInfo_CreateClusterResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_CreateClusterResponse proto.InternalMessageInfo - -func (m *CreateClusterResponse) GetClusterId() *wrappers.StringValue { - if m != nil { - return m.ClusterId - } - return nil -} - -func (m *CreateClusterResponse) GetJobId() *wrappers.StringValue { - if m != nil { - return m.JobId - } - return nil -} - -type ModifyClusterRequest struct { - // required, cluster to modify - Cluster *Cluster `protobuf:"bytes,1,opt,name=cluster,proto3" json:"cluster,omitempty"` - // list of cluster node - ClusterNodeSet []*ClusterNode `protobuf:"bytes,2,rep,name=cluster_node_set,json=clusterNodeSet,proto3" json:"cluster_node_set,omitempty"` - // list of cluster role - ClusterRoleSet []*ClusterRole `protobuf:"bytes,3,rep,name=cluster_role_set,json=clusterRoleSet,proto3" json:"cluster_role_set,omitempty"` - // list of cluster link - ClusterLinkSet []*ClusterLink `protobuf:"bytes,4,rep,name=cluster_link_set,json=clusterLinkSet,proto3" json:"cluster_link_set,omitempty"` - // list of cluster common - ClusterCommonSet []*ClusterCommon `protobuf:"bytes,5,rep,name=cluster_common_set,json=clusterCommonSet,proto3" json:"cluster_common_set,omitempty"` - // list of cluster loadbalancer - ClusterLoadbalancerSet []*ClusterLoadbalancer `protobuf:"bytes,6,rep,name=cluster_loadbalancer_set,json=clusterLoadbalancerSet,proto3" json:"cluster_loadbalancer_set,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ModifyClusterRequest) Reset() { *m = ModifyClusterRequest{} } -func (m *ModifyClusterRequest) String() string { return proto.CompactTextString(m) } -func (*ModifyClusterRequest) ProtoMessage() {} -func (*ModifyClusterRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_3cfb3b8ec240c376, []int{9} -} - -func (m *ModifyClusterRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ModifyClusterRequest.Unmarshal(m, b) -} -func (m *ModifyClusterRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ModifyClusterRequest.Marshal(b, m, deterministic) -} -func (m *ModifyClusterRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_ModifyClusterRequest.Merge(m, src) -} -func (m *ModifyClusterRequest) XXX_Size() int { - return xxx_messageInfo_ModifyClusterRequest.Size(m) -} -func (m *ModifyClusterRequest) XXX_DiscardUnknown() { - xxx_messageInfo_ModifyClusterRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_ModifyClusterRequest proto.InternalMessageInfo - -func (m *ModifyClusterRequest) GetCluster() *Cluster { - if m != nil { - return m.Cluster - } - return nil -} - -func (m *ModifyClusterRequest) GetClusterNodeSet() []*ClusterNode { - if m != nil { - return m.ClusterNodeSet - } - return nil -} - -func (m *ModifyClusterRequest) GetClusterRoleSet() []*ClusterRole { - if m != nil { - return m.ClusterRoleSet - } - return nil -} - -func (m *ModifyClusterRequest) GetClusterLinkSet() []*ClusterLink { - if m != nil { - return m.ClusterLinkSet - } - return nil -} - -func (m *ModifyClusterRequest) GetClusterCommonSet() []*ClusterCommon { - if m != nil { - return m.ClusterCommonSet - } - return nil -} - -func (m *ModifyClusterRequest) GetClusterLoadbalancerSet() []*ClusterLoadbalancer { - if m != nil { - return m.ClusterLoadbalancerSet - } - return nil -} - -type ModifyClusterResponse struct { - // id of cluster modified - ClusterId *wrappers.StringValue `protobuf:"bytes,1,opt,name=cluster_id,json=clusterId,proto3" json:"cluster_id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ModifyClusterResponse) Reset() { *m = ModifyClusterResponse{} } -func (m *ModifyClusterResponse) String() string { return proto.CompactTextString(m) } -func (*ModifyClusterResponse) ProtoMessage() {} -func (*ModifyClusterResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_3cfb3b8ec240c376, []int{10} -} - -func (m *ModifyClusterResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ModifyClusterResponse.Unmarshal(m, b) -} -func (m *ModifyClusterResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ModifyClusterResponse.Marshal(b, m, deterministic) -} -func (m *ModifyClusterResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_ModifyClusterResponse.Merge(m, src) -} -func (m *ModifyClusterResponse) XXX_Size() int { - return xxx_messageInfo_ModifyClusterResponse.Size(m) -} -func (m *ModifyClusterResponse) XXX_DiscardUnknown() { - xxx_messageInfo_ModifyClusterResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_ModifyClusterResponse proto.InternalMessageInfo - -func (m *ModifyClusterResponse) GetClusterId() *wrappers.StringValue { - if m != nil { - return m.ClusterId - } - return nil -} - -type ModifyClusterNodeRequest struct { - // required, cluster node to modify - ClusterNode *ClusterNode `protobuf:"bytes,1,opt,name=cluster_node,json=clusterNode,proto3" json:"cluster_node,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ModifyClusterNodeRequest) Reset() { *m = ModifyClusterNodeRequest{} } -func (m *ModifyClusterNodeRequest) String() string { return proto.CompactTextString(m) } -func (*ModifyClusterNodeRequest) ProtoMessage() {} -func (*ModifyClusterNodeRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_3cfb3b8ec240c376, []int{11} -} - -func (m *ModifyClusterNodeRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ModifyClusterNodeRequest.Unmarshal(m, b) -} -func (m *ModifyClusterNodeRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ModifyClusterNodeRequest.Marshal(b, m, deterministic) -} -func (m *ModifyClusterNodeRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_ModifyClusterNodeRequest.Merge(m, src) -} -func (m *ModifyClusterNodeRequest) XXX_Size() int { - return xxx_messageInfo_ModifyClusterNodeRequest.Size(m) -} -func (m *ModifyClusterNodeRequest) XXX_DiscardUnknown() { - xxx_messageInfo_ModifyClusterNodeRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_ModifyClusterNodeRequest proto.InternalMessageInfo - -func (m *ModifyClusterNodeRequest) GetClusterNode() *ClusterNode { - if m != nil { - return m.ClusterNode - } - return nil -} - -type ModifyClusterNodeResponse struct { - // id of cluster node modified - NodeId *wrappers.StringValue `protobuf:"bytes,1,opt,name=node_id,json=nodeId,proto3" json:"node_id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ModifyClusterNodeResponse) Reset() { *m = ModifyClusterNodeResponse{} } -func (m *ModifyClusterNodeResponse) String() string { return proto.CompactTextString(m) } -func (*ModifyClusterNodeResponse) ProtoMessage() {} -func (*ModifyClusterNodeResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_3cfb3b8ec240c376, []int{12} -} - -func (m *ModifyClusterNodeResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ModifyClusterNodeResponse.Unmarshal(m, b) -} -func (m *ModifyClusterNodeResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ModifyClusterNodeResponse.Marshal(b, m, deterministic) -} -func (m *ModifyClusterNodeResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_ModifyClusterNodeResponse.Merge(m, src) -} -func (m *ModifyClusterNodeResponse) XXX_Size() int { - return xxx_messageInfo_ModifyClusterNodeResponse.Size(m) -} -func (m *ModifyClusterNodeResponse) XXX_DiscardUnknown() { - xxx_messageInfo_ModifyClusterNodeResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_ModifyClusterNodeResponse proto.InternalMessageInfo - -func (m *ModifyClusterNodeResponse) GetNodeId() *wrappers.StringValue { - if m != nil { - return m.NodeId - } - return nil -} - -type ModifyClusterAttributesRequest struct { - // required, id of cluster to modify - ClusterId *wrappers.StringValue `protobuf:"bytes,1,opt,name=cluster_id,json=clusterId,proto3" json:"cluster_id,omitempty"` - // cluster name - Name *wrappers.StringValue `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - // cluster description - Description *wrappers.StringValue `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ModifyClusterAttributesRequest) Reset() { *m = ModifyClusterAttributesRequest{} } -func (m *ModifyClusterAttributesRequest) String() string { return proto.CompactTextString(m) } -func (*ModifyClusterAttributesRequest) ProtoMessage() {} -func (*ModifyClusterAttributesRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_3cfb3b8ec240c376, []int{13} -} - -func (m *ModifyClusterAttributesRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ModifyClusterAttributesRequest.Unmarshal(m, b) -} -func (m *ModifyClusterAttributesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ModifyClusterAttributesRequest.Marshal(b, m, deterministic) -} -func (m *ModifyClusterAttributesRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_ModifyClusterAttributesRequest.Merge(m, src) -} -func (m *ModifyClusterAttributesRequest) XXX_Size() int { - return xxx_messageInfo_ModifyClusterAttributesRequest.Size(m) -} -func (m *ModifyClusterAttributesRequest) XXX_DiscardUnknown() { - xxx_messageInfo_ModifyClusterAttributesRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_ModifyClusterAttributesRequest proto.InternalMessageInfo - -func (m *ModifyClusterAttributesRequest) GetClusterId() *wrappers.StringValue { - if m != nil { - return m.ClusterId - } - return nil -} - -func (m *ModifyClusterAttributesRequest) GetName() *wrappers.StringValue { - if m != nil { - return m.Name - } - return nil -} - -func (m *ModifyClusterAttributesRequest) GetDescription() *wrappers.StringValue { - if m != nil { - return m.Description - } - return nil -} - -type ModifyClusterAttributesResponse struct { - // id of cluster modified - ClusterId *wrappers.StringValue `protobuf:"bytes,1,opt,name=cluster_id,json=clusterId,proto3" json:"cluster_id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ModifyClusterAttributesResponse) Reset() { *m = ModifyClusterAttributesResponse{} } -func (m *ModifyClusterAttributesResponse) String() string { return proto.CompactTextString(m) } -func (*ModifyClusterAttributesResponse) ProtoMessage() {} -func (*ModifyClusterAttributesResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_3cfb3b8ec240c376, []int{14} -} - -func (m *ModifyClusterAttributesResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ModifyClusterAttributesResponse.Unmarshal(m, b) -} -func (m *ModifyClusterAttributesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ModifyClusterAttributesResponse.Marshal(b, m, deterministic) -} -func (m *ModifyClusterAttributesResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_ModifyClusterAttributesResponse.Merge(m, src) -} -func (m *ModifyClusterAttributesResponse) XXX_Size() int { - return xxx_messageInfo_ModifyClusterAttributesResponse.Size(m) -} -func (m *ModifyClusterAttributesResponse) XXX_DiscardUnknown() { - xxx_messageInfo_ModifyClusterAttributesResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_ModifyClusterAttributesResponse proto.InternalMessageInfo - -func (m *ModifyClusterAttributesResponse) GetClusterId() *wrappers.StringValue { - if m != nil { - return m.ClusterId - } - return nil -} - -type ModifyClusterNodeAttributesRequest struct { - // required, id of cluster node to modify - NodeId *wrappers.StringValue `protobuf:"bytes,1,opt,name=node_id,json=nodeId,proto3" json:"node_id,omitempty"` - // node name - Name *wrappers.StringValue `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ModifyClusterNodeAttributesRequest) Reset() { *m = ModifyClusterNodeAttributesRequest{} } -func (m *ModifyClusterNodeAttributesRequest) String() string { return proto.CompactTextString(m) } -func (*ModifyClusterNodeAttributesRequest) ProtoMessage() {} -func (*ModifyClusterNodeAttributesRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_3cfb3b8ec240c376, []int{15} -} - -func (m *ModifyClusterNodeAttributesRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ModifyClusterNodeAttributesRequest.Unmarshal(m, b) -} -func (m *ModifyClusterNodeAttributesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ModifyClusterNodeAttributesRequest.Marshal(b, m, deterministic) -} -func (m *ModifyClusterNodeAttributesRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_ModifyClusterNodeAttributesRequest.Merge(m, src) -} -func (m *ModifyClusterNodeAttributesRequest) XXX_Size() int { - return xxx_messageInfo_ModifyClusterNodeAttributesRequest.Size(m) -} -func (m *ModifyClusterNodeAttributesRequest) XXX_DiscardUnknown() { - xxx_messageInfo_ModifyClusterNodeAttributesRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_ModifyClusterNodeAttributesRequest proto.InternalMessageInfo - -func (m *ModifyClusterNodeAttributesRequest) GetNodeId() *wrappers.StringValue { - if m != nil { - return m.NodeId - } - return nil -} - -func (m *ModifyClusterNodeAttributesRequest) GetName() *wrappers.StringValue { - if m != nil { - return m.Name - } - return nil -} - -type ModifyClusterNodeAttributesResponse struct { - // id of cluster node modified - NodeId *wrappers.StringValue `protobuf:"bytes,1,opt,name=node_id,json=nodeId,proto3" json:"node_id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ModifyClusterNodeAttributesResponse) Reset() { *m = ModifyClusterNodeAttributesResponse{} } -func (m *ModifyClusterNodeAttributesResponse) String() string { return proto.CompactTextString(m) } -func (*ModifyClusterNodeAttributesResponse) ProtoMessage() {} -func (*ModifyClusterNodeAttributesResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_3cfb3b8ec240c376, []int{16} -} - -func (m *ModifyClusterNodeAttributesResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ModifyClusterNodeAttributesResponse.Unmarshal(m, b) -} -func (m *ModifyClusterNodeAttributesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ModifyClusterNodeAttributesResponse.Marshal(b, m, deterministic) -} -func (m *ModifyClusterNodeAttributesResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_ModifyClusterNodeAttributesResponse.Merge(m, src) -} -func (m *ModifyClusterNodeAttributesResponse) XXX_Size() int { - return xxx_messageInfo_ModifyClusterNodeAttributesResponse.Size(m) -} -func (m *ModifyClusterNodeAttributesResponse) XXX_DiscardUnknown() { - xxx_messageInfo_ModifyClusterNodeAttributesResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_ModifyClusterNodeAttributesResponse proto.InternalMessageInfo - -func (m *ModifyClusterNodeAttributesResponse) GetNodeId() *wrappers.StringValue { - if m != nil { - return m.NodeId - } - return nil -} - -type AddTableClusterNodesRequest struct { - // required, list of node to add to cluster - ClusterNodeSet []*ClusterNode `protobuf:"bytes,1,rep,name=cluster_node_set,json=clusterNodeSet,proto3" json:"cluster_node_set,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *AddTableClusterNodesRequest) Reset() { *m = AddTableClusterNodesRequest{} } -func (m *AddTableClusterNodesRequest) String() string { return proto.CompactTextString(m) } -func (*AddTableClusterNodesRequest) ProtoMessage() {} -func (*AddTableClusterNodesRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_3cfb3b8ec240c376, []int{17} -} - -func (m *AddTableClusterNodesRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_AddTableClusterNodesRequest.Unmarshal(m, b) -} -func (m *AddTableClusterNodesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_AddTableClusterNodesRequest.Marshal(b, m, deterministic) -} -func (m *AddTableClusterNodesRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_AddTableClusterNodesRequest.Merge(m, src) -} -func (m *AddTableClusterNodesRequest) XXX_Size() int { - return xxx_messageInfo_AddTableClusterNodesRequest.Size(m) -} -func (m *AddTableClusterNodesRequest) XXX_DiscardUnknown() { - xxx_messageInfo_AddTableClusterNodesRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_AddTableClusterNodesRequest proto.InternalMessageInfo - -func (m *AddTableClusterNodesRequest) GetClusterNodeSet() []*ClusterNode { - if m != nil { - return m.ClusterNodeSet - } - return nil -} - -type DeleteTableClusterNodesRequest struct { - // required, list of node to delete from cluster - NodeId []string `protobuf:"bytes,1,rep,name=node_id,json=nodeId,proto3" json:"node_id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *DeleteTableClusterNodesRequest) Reset() { *m = DeleteTableClusterNodesRequest{} } -func (m *DeleteTableClusterNodesRequest) String() string { return proto.CompactTextString(m) } -func (*DeleteTableClusterNodesRequest) ProtoMessage() {} -func (*DeleteTableClusterNodesRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_3cfb3b8ec240c376, []int{18} -} - -func (m *DeleteTableClusterNodesRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_DeleteTableClusterNodesRequest.Unmarshal(m, b) -} -func (m *DeleteTableClusterNodesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_DeleteTableClusterNodesRequest.Marshal(b, m, deterministic) -} -func (m *DeleteTableClusterNodesRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_DeleteTableClusterNodesRequest.Merge(m, src) -} -func (m *DeleteTableClusterNodesRequest) XXX_Size() int { - return xxx_messageInfo_DeleteTableClusterNodesRequest.Size(m) -} -func (m *DeleteTableClusterNodesRequest) XXX_DiscardUnknown() { - xxx_messageInfo_DeleteTableClusterNodesRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_DeleteTableClusterNodesRequest proto.InternalMessageInfo - -func (m *DeleteTableClusterNodesRequest) GetNodeId() []string { - if m != nil { - return m.NodeId - } - return nil -} - -type DeleteClustersRequest struct { - // required, ids of clusters to delete - ClusterId []string `protobuf:"bytes,1,rep,name=cluster_id,json=clusterId,proto3" json:"cluster_id,omitempty"` - // advanced param - AdvancedParam []string `protobuf:"bytes,2,rep,name=advanced_param,json=advancedParam,proto3" json:"advanced_param,omitempty"` - // whether force delete clusters or not - Force *wrappers.BoolValue `protobuf:"bytes,3,opt,name=force,proto3" json:"force,omitempty"` - // timeout(s), when delete clusters - GracePeriod uint32 `protobuf:"varint,4,opt,name=grace_period,json=gracePeriod,proto3" json:"grace_period,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *DeleteClustersRequest) Reset() { *m = DeleteClustersRequest{} } -func (m *DeleteClustersRequest) String() string { return proto.CompactTextString(m) } -func (*DeleteClustersRequest) ProtoMessage() {} -func (*DeleteClustersRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_3cfb3b8ec240c376, []int{19} -} - -func (m *DeleteClustersRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_DeleteClustersRequest.Unmarshal(m, b) -} -func (m *DeleteClustersRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_DeleteClustersRequest.Marshal(b, m, deterministic) -} -func (m *DeleteClustersRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_DeleteClustersRequest.Merge(m, src) -} -func (m *DeleteClustersRequest) XXX_Size() int { - return xxx_messageInfo_DeleteClustersRequest.Size(m) -} -func (m *DeleteClustersRequest) XXX_DiscardUnknown() { - xxx_messageInfo_DeleteClustersRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_DeleteClustersRequest proto.InternalMessageInfo - -func (m *DeleteClustersRequest) GetClusterId() []string { - if m != nil { - return m.ClusterId - } - return nil -} - -func (m *DeleteClustersRequest) GetAdvancedParam() []string { - if m != nil { - return m.AdvancedParam - } - return nil -} - -func (m *DeleteClustersRequest) GetForce() *wrappers.BoolValue { - if m != nil { - return m.Force - } - return nil -} - -func (m *DeleteClustersRequest) GetGracePeriod() uint32 { - if m != nil { - return m.GracePeriod - } - return 0 -} - -type DeleteClustersResponse struct { - // ids of clusters deleted - ClusterId []string `protobuf:"bytes,1,rep,name=cluster_id,json=clusterId,proto3" json:"cluster_id,omitempty"` - // ids of jobs - JobId []string `protobuf:"bytes,2,rep,name=job_id,json=jobId,proto3" json:"job_id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *DeleteClustersResponse) Reset() { *m = DeleteClustersResponse{} } -func (m *DeleteClustersResponse) String() string { return proto.CompactTextString(m) } -func (*DeleteClustersResponse) ProtoMessage() {} -func (*DeleteClustersResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_3cfb3b8ec240c376, []int{20} -} - -func (m *DeleteClustersResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_DeleteClustersResponse.Unmarshal(m, b) -} -func (m *DeleteClustersResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_DeleteClustersResponse.Marshal(b, m, deterministic) -} -func (m *DeleteClustersResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_DeleteClustersResponse.Merge(m, src) -} -func (m *DeleteClustersResponse) XXX_Size() int { - return xxx_messageInfo_DeleteClustersResponse.Size(m) -} -func (m *DeleteClustersResponse) XXX_DiscardUnknown() { - xxx_messageInfo_DeleteClustersResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_DeleteClustersResponse proto.InternalMessageInfo - -func (m *DeleteClustersResponse) GetClusterId() []string { - if m != nil { - return m.ClusterId - } - return nil -} - -func (m *DeleteClustersResponse) GetJobId() []string { - if m != nil { - return m.JobId - } - return nil -} - -type UpgradeClusterRequest struct { - // required, id of cluster to upgrade - ClusterId *wrappers.StringValue `protobuf:"bytes,1,opt,name=cluster_id,json=clusterId,proto3" json:"cluster_id,omitempty"` - // app version id - VersionId *wrappers.StringValue `protobuf:"bytes,2,opt,name=version_id,json=versionId,proto3" json:"version_id,omitempty"` - // advanced param - AdvancedParam []string `protobuf:"bytes,3,rep,name=advanced_param,json=advancedParam,proto3" json:"advanced_param,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *UpgradeClusterRequest) Reset() { *m = UpgradeClusterRequest{} } -func (m *UpgradeClusterRequest) String() string { return proto.CompactTextString(m) } -func (*UpgradeClusterRequest) ProtoMessage() {} -func (*UpgradeClusterRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_3cfb3b8ec240c376, []int{21} -} - -func (m *UpgradeClusterRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_UpgradeClusterRequest.Unmarshal(m, b) -} -func (m *UpgradeClusterRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_UpgradeClusterRequest.Marshal(b, m, deterministic) -} -func (m *UpgradeClusterRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_UpgradeClusterRequest.Merge(m, src) -} -func (m *UpgradeClusterRequest) XXX_Size() int { - return xxx_messageInfo_UpgradeClusterRequest.Size(m) -} -func (m *UpgradeClusterRequest) XXX_DiscardUnknown() { - xxx_messageInfo_UpgradeClusterRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_UpgradeClusterRequest proto.InternalMessageInfo - -func (m *UpgradeClusterRequest) GetClusterId() *wrappers.StringValue { - if m != nil { - return m.ClusterId - } - return nil -} - -func (m *UpgradeClusterRequest) GetVersionId() *wrappers.StringValue { - if m != nil { - return m.VersionId - } - return nil -} - -func (m *UpgradeClusterRequest) GetAdvancedParam() []string { - if m != nil { - return m.AdvancedParam - } - return nil -} - -type UpgradeClusterResponse struct { - // id of cluster upgraded - ClusterId *wrappers.StringValue `protobuf:"bytes,1,opt,name=cluster_id,json=clusterId,proto3" json:"cluster_id,omitempty"` - // job id - JobId *wrappers.StringValue `protobuf:"bytes,2,opt,name=job_id,json=jobId,proto3" json:"job_id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *UpgradeClusterResponse) Reset() { *m = UpgradeClusterResponse{} } -func (m *UpgradeClusterResponse) String() string { return proto.CompactTextString(m) } -func (*UpgradeClusterResponse) ProtoMessage() {} -func (*UpgradeClusterResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_3cfb3b8ec240c376, []int{22} -} - -func (m *UpgradeClusterResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_UpgradeClusterResponse.Unmarshal(m, b) -} -func (m *UpgradeClusterResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_UpgradeClusterResponse.Marshal(b, m, deterministic) -} -func (m *UpgradeClusterResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_UpgradeClusterResponse.Merge(m, src) -} -func (m *UpgradeClusterResponse) XXX_Size() int { - return xxx_messageInfo_UpgradeClusterResponse.Size(m) -} -func (m *UpgradeClusterResponse) XXX_DiscardUnknown() { - xxx_messageInfo_UpgradeClusterResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_UpgradeClusterResponse proto.InternalMessageInfo - -func (m *UpgradeClusterResponse) GetClusterId() *wrappers.StringValue { - if m != nil { - return m.ClusterId - } - return nil -} - -func (m *UpgradeClusterResponse) GetJobId() *wrappers.StringValue { - if m != nil { - return m.JobId - } - return nil -} - -type RollbackClusterRequest struct { - // required, id of cluster to rollback - ClusterId *wrappers.StringValue `protobuf:"bytes,1,opt,name=cluster_id,json=clusterId,proto3" json:"cluster_id,omitempty"` - // advanced param - AdvancedParam []string `protobuf:"bytes,2,rep,name=advanced_param,json=advancedParam,proto3" json:"advanced_param,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *RollbackClusterRequest) Reset() { *m = RollbackClusterRequest{} } -func (m *RollbackClusterRequest) String() string { return proto.CompactTextString(m) } -func (*RollbackClusterRequest) ProtoMessage() {} -func (*RollbackClusterRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_3cfb3b8ec240c376, []int{23} -} - -func (m *RollbackClusterRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_RollbackClusterRequest.Unmarshal(m, b) -} -func (m *RollbackClusterRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_RollbackClusterRequest.Marshal(b, m, deterministic) -} -func (m *RollbackClusterRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_RollbackClusterRequest.Merge(m, src) -} -func (m *RollbackClusterRequest) XXX_Size() int { - return xxx_messageInfo_RollbackClusterRequest.Size(m) -} -func (m *RollbackClusterRequest) XXX_DiscardUnknown() { - xxx_messageInfo_RollbackClusterRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_RollbackClusterRequest proto.InternalMessageInfo - -func (m *RollbackClusterRequest) GetClusterId() *wrappers.StringValue { - if m != nil { - return m.ClusterId - } - return nil -} - -func (m *RollbackClusterRequest) GetAdvancedParam() []string { - if m != nil { - return m.AdvancedParam - } - return nil -} - -type RollbackClusterResponse struct { - // id of cluster to rollbacked - ClusterId *wrappers.StringValue `protobuf:"bytes,1,opt,name=cluster_id,json=clusterId,proto3" json:"cluster_id,omitempty"` - // job id - JobId *wrappers.StringValue `protobuf:"bytes,2,opt,name=job_id,json=jobId,proto3" json:"job_id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *RollbackClusterResponse) Reset() { *m = RollbackClusterResponse{} } -func (m *RollbackClusterResponse) String() string { return proto.CompactTextString(m) } -func (*RollbackClusterResponse) ProtoMessage() {} -func (*RollbackClusterResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_3cfb3b8ec240c376, []int{24} -} - -func (m *RollbackClusterResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_RollbackClusterResponse.Unmarshal(m, b) -} -func (m *RollbackClusterResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_RollbackClusterResponse.Marshal(b, m, deterministic) -} -func (m *RollbackClusterResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_RollbackClusterResponse.Merge(m, src) -} -func (m *RollbackClusterResponse) XXX_Size() int { - return xxx_messageInfo_RollbackClusterResponse.Size(m) -} -func (m *RollbackClusterResponse) XXX_DiscardUnknown() { - xxx_messageInfo_RollbackClusterResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_RollbackClusterResponse proto.InternalMessageInfo - -func (m *RollbackClusterResponse) GetClusterId() *wrappers.StringValue { - if m != nil { - return m.ClusterId - } - return nil -} - -func (m *RollbackClusterResponse) GetJobId() *wrappers.StringValue { - if m != nil { - return m.JobId - } - return nil -} - -type RoleResource struct { - // role.eg:[mysql|wordpress] - Role *wrappers.StringValue `protobuf:"bytes,1,opt,name=role,proto3" json:"role,omitempty"` - // number of cpu - Cpu *wrappers.UInt32Value `protobuf:"bytes,2,opt,name=cpu,proto3" json:"cpu,omitempty"` - // number of gpu - Gpu *wrappers.UInt32Value `protobuf:"bytes,3,opt,name=gpu,proto3" json:"gpu,omitempty"` - // size of memory - Memory *wrappers.UInt32Value `protobuf:"bytes,4,opt,name=memory,proto3" json:"memory,omitempty"` - // size of instance - InstanceSize *wrappers.UInt32Value `protobuf:"bytes,5,opt,name=instance_size,json=instanceSize,proto3" json:"instance_size,omitempty"` - // size of storage - StorageSize *wrappers.UInt32Value `protobuf:"bytes,6,opt,name=storage_size,json=storageSize,proto3" json:"storage_size,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *RoleResource) Reset() { *m = RoleResource{} } -func (m *RoleResource) String() string { return proto.CompactTextString(m) } -func (*RoleResource) ProtoMessage() {} -func (*RoleResource) Descriptor() ([]byte, []int) { - return fileDescriptor_3cfb3b8ec240c376, []int{25} -} - -func (m *RoleResource) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_RoleResource.Unmarshal(m, b) -} -func (m *RoleResource) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_RoleResource.Marshal(b, m, deterministic) -} -func (m *RoleResource) XXX_Merge(src proto.Message) { - xxx_messageInfo_RoleResource.Merge(m, src) -} -func (m *RoleResource) XXX_Size() int { - return xxx_messageInfo_RoleResource.Size(m) -} -func (m *RoleResource) XXX_DiscardUnknown() { - xxx_messageInfo_RoleResource.DiscardUnknown(m) -} - -var xxx_messageInfo_RoleResource proto.InternalMessageInfo - -func (m *RoleResource) GetRole() *wrappers.StringValue { - if m != nil { - return m.Role - } - return nil -} - -func (m *RoleResource) GetCpu() *wrappers.UInt32Value { - if m != nil { - return m.Cpu - } - return nil -} - -func (m *RoleResource) GetGpu() *wrappers.UInt32Value { - if m != nil { - return m.Gpu - } - return nil -} - -func (m *RoleResource) GetMemory() *wrappers.UInt32Value { - if m != nil { - return m.Memory - } - return nil -} - -func (m *RoleResource) GetInstanceSize() *wrappers.UInt32Value { - if m != nil { - return m.InstanceSize - } - return nil -} - -func (m *RoleResource) GetStorageSize() *wrappers.UInt32Value { - if m != nil { - return m.StorageSize - } - return nil -} - -type ResizeClusterRequest struct { - // required, id of cluster to resize - ClusterId *wrappers.StringValue `protobuf:"bytes,1,opt,name=cluster_id,json=clusterId,proto3" json:"cluster_id,omitempty"` - // list of role resource - RoleResource []*RoleResource `protobuf:"bytes,2,rep,name=role_resource,json=roleResource,proto3" json:"role_resource,omitempty"` - // advanced param - AdvancedParam []string `protobuf:"bytes,5,rep,name=advanced_param,json=advancedParam,proto3" json:"advanced_param,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ResizeClusterRequest) Reset() { *m = ResizeClusterRequest{} } -func (m *ResizeClusterRequest) String() string { return proto.CompactTextString(m) } -func (*ResizeClusterRequest) ProtoMessage() {} -func (*ResizeClusterRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_3cfb3b8ec240c376, []int{26} -} - -func (m *ResizeClusterRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ResizeClusterRequest.Unmarshal(m, b) -} -func (m *ResizeClusterRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ResizeClusterRequest.Marshal(b, m, deterministic) -} -func (m *ResizeClusterRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_ResizeClusterRequest.Merge(m, src) -} -func (m *ResizeClusterRequest) XXX_Size() int { - return xxx_messageInfo_ResizeClusterRequest.Size(m) -} -func (m *ResizeClusterRequest) XXX_DiscardUnknown() { - xxx_messageInfo_ResizeClusterRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_ResizeClusterRequest proto.InternalMessageInfo - -func (m *ResizeClusterRequest) GetClusterId() *wrappers.StringValue { - if m != nil { - return m.ClusterId - } - return nil -} - -func (m *ResizeClusterRequest) GetRoleResource() []*RoleResource { - if m != nil { - return m.RoleResource - } - return nil -} - -func (m *ResizeClusterRequest) GetAdvancedParam() []string { - if m != nil { - return m.AdvancedParam - } - return nil -} - -type ResizeClusterResponse struct { - // id of cluster resized - ClusterId *wrappers.StringValue `protobuf:"bytes,1,opt,name=cluster_id,json=clusterId,proto3" json:"cluster_id,omitempty"` - // job id - JobId *wrappers.StringValue `protobuf:"bytes,2,opt,name=job_id,json=jobId,proto3" json:"job_id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ResizeClusterResponse) Reset() { *m = ResizeClusterResponse{} } -func (m *ResizeClusterResponse) String() string { return proto.CompactTextString(m) } -func (*ResizeClusterResponse) ProtoMessage() {} -func (*ResizeClusterResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_3cfb3b8ec240c376, []int{27} -} - -func (m *ResizeClusterResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ResizeClusterResponse.Unmarshal(m, b) -} -func (m *ResizeClusterResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ResizeClusterResponse.Marshal(b, m, deterministic) -} -func (m *ResizeClusterResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_ResizeClusterResponse.Merge(m, src) -} -func (m *ResizeClusterResponse) XXX_Size() int { - return xxx_messageInfo_ResizeClusterResponse.Size(m) -} -func (m *ResizeClusterResponse) XXX_DiscardUnknown() { - xxx_messageInfo_ResizeClusterResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_ResizeClusterResponse proto.InternalMessageInfo - -func (m *ResizeClusterResponse) GetClusterId() *wrappers.StringValue { - if m != nil { - return m.ClusterId - } - return nil -} - -func (m *ResizeClusterResponse) GetJobId() *wrappers.StringValue { - if m != nil { - return m.JobId - } - return nil -} - -type AddClusterNodesRequest struct { - // required, id of cluster to add node - ClusterId *wrappers.StringValue `protobuf:"bytes,1,opt,name=cluster_id,json=clusterId,proto3" json:"cluster_id,omitempty"` - // required, role eg:[mysql|wordpress|...] - Role *wrappers.StringValue `protobuf:"bytes,2,opt,name=role,proto3" json:"role,omitempty"` - // number of node added to cluster - NodeCount *wrappers.UInt32Value `protobuf:"bytes,3,opt,name=node_count,json=nodeCount,proto3" json:"node_count,omitempty"` - // advanced param - AdvancedParam []string `protobuf:"bytes,4,rep,name=advanced_param,json=advancedParam,proto3" json:"advanced_param,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *AddClusterNodesRequest) Reset() { *m = AddClusterNodesRequest{} } -func (m *AddClusterNodesRequest) String() string { return proto.CompactTextString(m) } -func (*AddClusterNodesRequest) ProtoMessage() {} -func (*AddClusterNodesRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_3cfb3b8ec240c376, []int{28} -} - -func (m *AddClusterNodesRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_AddClusterNodesRequest.Unmarshal(m, b) -} -func (m *AddClusterNodesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_AddClusterNodesRequest.Marshal(b, m, deterministic) -} -func (m *AddClusterNodesRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_AddClusterNodesRequest.Merge(m, src) -} -func (m *AddClusterNodesRequest) XXX_Size() int { - return xxx_messageInfo_AddClusterNodesRequest.Size(m) -} -func (m *AddClusterNodesRequest) XXX_DiscardUnknown() { - xxx_messageInfo_AddClusterNodesRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_AddClusterNodesRequest proto.InternalMessageInfo - -func (m *AddClusterNodesRequest) GetClusterId() *wrappers.StringValue { - if m != nil { - return m.ClusterId - } - return nil -} - -func (m *AddClusterNodesRequest) GetRole() *wrappers.StringValue { - if m != nil { - return m.Role - } - return nil -} - -func (m *AddClusterNodesRequest) GetNodeCount() *wrappers.UInt32Value { - if m != nil { - return m.NodeCount - } - return nil -} - -func (m *AddClusterNodesRequest) GetAdvancedParam() []string { - if m != nil { - return m.AdvancedParam - } - return nil -} - -type AddClusterNodesResponse struct { - // id of cluster added node - ClusterId *wrappers.StringValue `protobuf:"bytes,1,opt,name=cluster_id,json=clusterId,proto3" json:"cluster_id,omitempty"` - // id of job of add node to cluster - JobId *wrappers.StringValue `protobuf:"bytes,2,opt,name=job_id,json=jobId,proto3" json:"job_id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *AddClusterNodesResponse) Reset() { *m = AddClusterNodesResponse{} } -func (m *AddClusterNodesResponse) String() string { return proto.CompactTextString(m) } -func (*AddClusterNodesResponse) ProtoMessage() {} -func (*AddClusterNodesResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_3cfb3b8ec240c376, []int{29} -} - -func (m *AddClusterNodesResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_AddClusterNodesResponse.Unmarshal(m, b) -} -func (m *AddClusterNodesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_AddClusterNodesResponse.Marshal(b, m, deterministic) -} -func (m *AddClusterNodesResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_AddClusterNodesResponse.Merge(m, src) -} -func (m *AddClusterNodesResponse) XXX_Size() int { - return xxx_messageInfo_AddClusterNodesResponse.Size(m) -} -func (m *AddClusterNodesResponse) XXX_DiscardUnknown() { - xxx_messageInfo_AddClusterNodesResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_AddClusterNodesResponse proto.InternalMessageInfo - -func (m *AddClusterNodesResponse) GetClusterId() *wrappers.StringValue { - if m != nil { - return m.ClusterId - } - return nil -} - -func (m *AddClusterNodesResponse) GetJobId() *wrappers.StringValue { - if m != nil { - return m.JobId - } - return nil -} - -type DeleteClusterNodesRequest struct { - // required, id of cluster to delete node - ClusterId *wrappers.StringValue `protobuf:"bytes,1,opt,name=cluster_id,json=clusterId,proto3" json:"cluster_id,omitempty"` - // required, node ids - NodeId []string `protobuf:"bytes,2,rep,name=node_id,json=nodeId,proto3" json:"node_id,omitempty"` - // advanced param - AdvancedParam []string `protobuf:"bytes,3,rep,name=advanced_param,json=advancedParam,proto3" json:"advanced_param,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *DeleteClusterNodesRequest) Reset() { *m = DeleteClusterNodesRequest{} } -func (m *DeleteClusterNodesRequest) String() string { return proto.CompactTextString(m) } -func (*DeleteClusterNodesRequest) ProtoMessage() {} -func (*DeleteClusterNodesRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_3cfb3b8ec240c376, []int{30} -} - -func (m *DeleteClusterNodesRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_DeleteClusterNodesRequest.Unmarshal(m, b) -} -func (m *DeleteClusterNodesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_DeleteClusterNodesRequest.Marshal(b, m, deterministic) -} -func (m *DeleteClusterNodesRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_DeleteClusterNodesRequest.Merge(m, src) -} -func (m *DeleteClusterNodesRequest) XXX_Size() int { - return xxx_messageInfo_DeleteClusterNodesRequest.Size(m) -} -func (m *DeleteClusterNodesRequest) XXX_DiscardUnknown() { - xxx_messageInfo_DeleteClusterNodesRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_DeleteClusterNodesRequest proto.InternalMessageInfo - -func (m *DeleteClusterNodesRequest) GetClusterId() *wrappers.StringValue { - if m != nil { - return m.ClusterId - } - return nil -} - -func (m *DeleteClusterNodesRequest) GetNodeId() []string { - if m != nil { - return m.NodeId - } - return nil -} - -func (m *DeleteClusterNodesRequest) GetAdvancedParam() []string { - if m != nil { - return m.AdvancedParam - } - return nil -} - -type DeleteClusterNodesResponse struct { - // id of cluster deleted node - ClusterId *wrappers.StringValue `protobuf:"bytes,1,opt,name=cluster_id,json=clusterId,proto3" json:"cluster_id,omitempty"` - // job id - JobId *wrappers.StringValue `protobuf:"bytes,2,opt,name=job_id,json=jobId,proto3" json:"job_id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *DeleteClusterNodesResponse) Reset() { *m = DeleteClusterNodesResponse{} } -func (m *DeleteClusterNodesResponse) String() string { return proto.CompactTextString(m) } -func (*DeleteClusterNodesResponse) ProtoMessage() {} -func (*DeleteClusterNodesResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_3cfb3b8ec240c376, []int{31} -} - -func (m *DeleteClusterNodesResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_DeleteClusterNodesResponse.Unmarshal(m, b) -} -func (m *DeleteClusterNodesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_DeleteClusterNodesResponse.Marshal(b, m, deterministic) -} -func (m *DeleteClusterNodesResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_DeleteClusterNodesResponse.Merge(m, src) -} -func (m *DeleteClusterNodesResponse) XXX_Size() int { - return xxx_messageInfo_DeleteClusterNodesResponse.Size(m) -} -func (m *DeleteClusterNodesResponse) XXX_DiscardUnknown() { - xxx_messageInfo_DeleteClusterNodesResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_DeleteClusterNodesResponse proto.InternalMessageInfo - -func (m *DeleteClusterNodesResponse) GetClusterId() *wrappers.StringValue { - if m != nil { - return m.ClusterId - } - return nil -} - -func (m *DeleteClusterNodesResponse) GetJobId() *wrappers.StringValue { - if m != nil { - return m.JobId - } - return nil -} - -type UpdateClusterEnvRequest struct { - // id of cluster to update env - ClusterId *wrappers.StringValue `protobuf:"bytes,1,opt,name=cluster_id,json=clusterId,proto3" json:"cluster_id,omitempty"` - // env - Env *wrappers.StringValue `protobuf:"bytes,2,opt,name=env,proto3" json:"env,omitempty"` - // advanced param - AdvancedParam []string `protobuf:"bytes,3,rep,name=advanced_param,json=advancedParam,proto3" json:"advanced_param,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *UpdateClusterEnvRequest) Reset() { *m = UpdateClusterEnvRequest{} } -func (m *UpdateClusterEnvRequest) String() string { return proto.CompactTextString(m) } -func (*UpdateClusterEnvRequest) ProtoMessage() {} -func (*UpdateClusterEnvRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_3cfb3b8ec240c376, []int{32} -} - -func (m *UpdateClusterEnvRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_UpdateClusterEnvRequest.Unmarshal(m, b) -} -func (m *UpdateClusterEnvRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_UpdateClusterEnvRequest.Marshal(b, m, deterministic) -} -func (m *UpdateClusterEnvRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_UpdateClusterEnvRequest.Merge(m, src) -} -func (m *UpdateClusterEnvRequest) XXX_Size() int { - return xxx_messageInfo_UpdateClusterEnvRequest.Size(m) -} -func (m *UpdateClusterEnvRequest) XXX_DiscardUnknown() { - xxx_messageInfo_UpdateClusterEnvRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_UpdateClusterEnvRequest proto.InternalMessageInfo - -func (m *UpdateClusterEnvRequest) GetClusterId() *wrappers.StringValue { - if m != nil { - return m.ClusterId - } - return nil -} - -func (m *UpdateClusterEnvRequest) GetEnv() *wrappers.StringValue { - if m != nil { - return m.Env - } - return nil -} - -func (m *UpdateClusterEnvRequest) GetAdvancedParam() []string { - if m != nil { - return m.AdvancedParam - } - return nil -} - -type UpdateClusterEnvResponse struct { - // id of cluster to updated env - ClusterId *wrappers.StringValue `protobuf:"bytes,1,opt,name=cluster_id,json=clusterId,proto3" json:"cluster_id,omitempty"` - // job id - JobId *wrappers.StringValue `protobuf:"bytes,2,opt,name=job_id,json=jobId,proto3" json:"job_id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *UpdateClusterEnvResponse) Reset() { *m = UpdateClusterEnvResponse{} } -func (m *UpdateClusterEnvResponse) String() string { return proto.CompactTextString(m) } -func (*UpdateClusterEnvResponse) ProtoMessage() {} -func (*UpdateClusterEnvResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_3cfb3b8ec240c376, []int{33} -} - -func (m *UpdateClusterEnvResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_UpdateClusterEnvResponse.Unmarshal(m, b) -} -func (m *UpdateClusterEnvResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_UpdateClusterEnvResponse.Marshal(b, m, deterministic) -} -func (m *UpdateClusterEnvResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_UpdateClusterEnvResponse.Merge(m, src) -} -func (m *UpdateClusterEnvResponse) XXX_Size() int { - return xxx_messageInfo_UpdateClusterEnvResponse.Size(m) -} -func (m *UpdateClusterEnvResponse) XXX_DiscardUnknown() { - xxx_messageInfo_UpdateClusterEnvResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_UpdateClusterEnvResponse proto.InternalMessageInfo - -func (m *UpdateClusterEnvResponse) GetClusterId() *wrappers.StringValue { - if m != nil { - return m.ClusterId - } - return nil -} - -func (m *UpdateClusterEnvResponse) GetJobId() *wrappers.StringValue { - if m != nil { - return m.JobId - } - return nil -} - -type ClusterCommon struct { - // cluster id - ClusterId *wrappers.StringValue `protobuf:"bytes,1,opt,name=cluster_id,json=clusterId,proto3" json:"cluster_id,omitempty"` - // cluster role - Role *wrappers.StringValue `protobuf:"bytes,2,opt,name=role,proto3" json:"role,omitempty"` - // bound of server id(index number), some service(zookeeper) need the index to be bounded - ServerIdUpperBound *wrappers.UInt32Value `protobuf:"bytes,3,opt,name=server_id_upper_bound,json=serverIdUpperBound,proto3" json:"server_id_upper_bound,omitempty"` - // action of cluster support.eg.[change_vxnet|scale_horizontal] - AdvancedActions *wrappers.StringValue `protobuf:"bytes,4,opt,name=advanced_actions,json=advancedActions,proto3" json:"advanced_actions,omitempty"` - // init service config, a json string - InitService *wrappers.StringValue `protobuf:"bytes,5,opt,name=init_service,json=initService,proto3" json:"init_service,omitempty"` - // start service config, a json string - StartService *wrappers.StringValue `protobuf:"bytes,6,opt,name=start_service,json=startService,proto3" json:"start_service,omitempty"` - // stop service config, a json string - StopService *wrappers.StringValue `protobuf:"bytes,7,opt,name=stop_service,json=stopService,proto3" json:"stop_service,omitempty"` - // scale out service config, a json string - ScaleOutService *wrappers.StringValue `protobuf:"bytes,8,opt,name=scale_out_service,json=scaleOutService,proto3" json:"scale_out_service,omitempty"` - // scale in service config, a json string - ScaleInService *wrappers.StringValue `protobuf:"bytes,9,opt,name=scale_in_service,json=scaleInService,proto3" json:"scale_in_service,omitempty"` - // restart service config, a json string - RestartService *wrappers.StringValue `protobuf:"bytes,10,opt,name=restart_service,json=restartService,proto3" json:"restart_service,omitempty"` - // destroy service config, a json string - DestroyService *wrappers.StringValue `protobuf:"bytes,11,opt,name=destroy_service,json=destroyService,proto3" json:"destroy_service,omitempty"` - // upgrade service config, a json string - UpgradeService *wrappers.StringValue `protobuf:"bytes,12,opt,name=upgrade_service,json=upgradeService,proto3" json:"upgrade_service,omitempty"` - // custom service config, a json string - CustomService *wrappers.StringValue `protobuf:"bytes,13,opt,name=custom_service,json=customService,proto3" json:"custom_service,omitempty"` - // backup service config, a json string - BackupService *wrappers.StringValue `protobuf:"bytes,14,opt,name=backup_service,json=backupService,proto3" json:"backup_service,omitempty"` - // restore service config, a json string - RestoreService *wrappers.StringValue `protobuf:"bytes,15,opt,name=restore_service,json=restoreService,proto3" json:"restore_service,omitempty"` - // delete snapshot service config, a json string - DeleteSnapshotService *wrappers.StringValue `protobuf:"bytes,16,opt,name=delete_snapshot_service,json=deleteSnapshotService,proto3" json:"delete_snapshot_service,omitempty"` - // health check config,a json string - HealthCheck *wrappers.StringValue `protobuf:"bytes,17,opt,name=health_check,json=healthCheck,proto3" json:"health_check,omitempty"` - // monitor config,a json string - Monitor *wrappers.StringValue `protobuf:"bytes,18,opt,name=monitor,proto3" json:"monitor,omitempty"` - Passphraseless *wrappers.StringValue `protobuf:"bytes,19,opt,name=passphraseless,proto3" json:"passphraseless,omitempty"` - // vertical scaling policy.eg.[parallel|sequential] - VerticalScalingPolicy *wrappers.StringValue `protobuf:"bytes,20,opt,name=vertical_scaling_policy,json=verticalScalingPolicy,proto3" json:"vertical_scaling_policy,omitempty"` - // agent install or not - AgentInstalled *wrappers.BoolValue `protobuf:"bytes,21,opt,name=agent_installed,json=agentInstalled,proto3" json:"agent_installed,omitempty"` - // custom metadata script, a json string - CustomMetadataScript *wrappers.StringValue `protobuf:"bytes,22,opt,name=custom_metadata_script,json=customMetadataScript,proto3" json:"custom_metadata_script,omitempty"` - // image id - ImageId *wrappers.StringValue `protobuf:"bytes,23,opt,name=image_id,json=imageId,proto3" json:"image_id,omitempty"` - // policy of backup - BackupPolicy *wrappers.StringValue `protobuf:"bytes,24,opt,name=backup_policy,json=backupPolicy,proto3" json:"backup_policy,omitempty"` - // support incremental backup or not - IncrementalBackupSupported *wrappers.BoolValue `protobuf:"bytes,25,opt,name=incremental_backup_supported,json=incrementalBackupSupported,proto3" json:"incremental_backup_supported,omitempty"` - // hypervisor.eg.[docker|kvm|...] - Hypervisor *wrappers.StringValue `protobuf:"bytes,26,opt,name=hypervisor,proto3" json:"hypervisor,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ClusterCommon) Reset() { *m = ClusterCommon{} } -func (m *ClusterCommon) String() string { return proto.CompactTextString(m) } -func (*ClusterCommon) ProtoMessage() {} -func (*ClusterCommon) Descriptor() ([]byte, []int) { - return fileDescriptor_3cfb3b8ec240c376, []int{34} -} - -func (m *ClusterCommon) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ClusterCommon.Unmarshal(m, b) -} -func (m *ClusterCommon) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ClusterCommon.Marshal(b, m, deterministic) -} -func (m *ClusterCommon) XXX_Merge(src proto.Message) { - xxx_messageInfo_ClusterCommon.Merge(m, src) -} -func (m *ClusterCommon) XXX_Size() int { - return xxx_messageInfo_ClusterCommon.Size(m) -} -func (m *ClusterCommon) XXX_DiscardUnknown() { - xxx_messageInfo_ClusterCommon.DiscardUnknown(m) -} - -var xxx_messageInfo_ClusterCommon proto.InternalMessageInfo - -func (m *ClusterCommon) GetClusterId() *wrappers.StringValue { - if m != nil { - return m.ClusterId - } - return nil -} - -func (m *ClusterCommon) GetRole() *wrappers.StringValue { - if m != nil { - return m.Role - } - return nil -} - -func (m *ClusterCommon) GetServerIdUpperBound() *wrappers.UInt32Value { - if m != nil { - return m.ServerIdUpperBound - } - return nil -} - -func (m *ClusterCommon) GetAdvancedActions() *wrappers.StringValue { - if m != nil { - return m.AdvancedActions - } - return nil -} - -func (m *ClusterCommon) GetInitService() *wrappers.StringValue { - if m != nil { - return m.InitService - } - return nil -} - -func (m *ClusterCommon) GetStartService() *wrappers.StringValue { - if m != nil { - return m.StartService - } - return nil -} - -func (m *ClusterCommon) GetStopService() *wrappers.StringValue { - if m != nil { - return m.StopService - } - return nil -} - -func (m *ClusterCommon) GetScaleOutService() *wrappers.StringValue { - if m != nil { - return m.ScaleOutService - } - return nil -} - -func (m *ClusterCommon) GetScaleInService() *wrappers.StringValue { - if m != nil { - return m.ScaleInService - } - return nil -} - -func (m *ClusterCommon) GetRestartService() *wrappers.StringValue { - if m != nil { - return m.RestartService - } - return nil -} - -func (m *ClusterCommon) GetDestroyService() *wrappers.StringValue { - if m != nil { - return m.DestroyService - } - return nil -} - -func (m *ClusterCommon) GetUpgradeService() *wrappers.StringValue { - if m != nil { - return m.UpgradeService - } - return nil -} - -func (m *ClusterCommon) GetCustomService() *wrappers.StringValue { - if m != nil { - return m.CustomService - } - return nil -} - -func (m *ClusterCommon) GetBackupService() *wrappers.StringValue { - if m != nil { - return m.BackupService - } - return nil -} - -func (m *ClusterCommon) GetRestoreService() *wrappers.StringValue { - if m != nil { - return m.RestoreService - } - return nil -} - -func (m *ClusterCommon) GetDeleteSnapshotService() *wrappers.StringValue { - if m != nil { - return m.DeleteSnapshotService - } - return nil -} - -func (m *ClusterCommon) GetHealthCheck() *wrappers.StringValue { - if m != nil { - return m.HealthCheck - } - return nil -} - -func (m *ClusterCommon) GetMonitor() *wrappers.StringValue { - if m != nil { - return m.Monitor - } - return nil -} - -func (m *ClusterCommon) GetPassphraseless() *wrappers.StringValue { - if m != nil { - return m.Passphraseless - } - return nil -} - -func (m *ClusterCommon) GetVerticalScalingPolicy() *wrappers.StringValue { - if m != nil { - return m.VerticalScalingPolicy - } - return nil -} - -func (m *ClusterCommon) GetAgentInstalled() *wrappers.BoolValue { - if m != nil { - return m.AgentInstalled - } - return nil -} - -func (m *ClusterCommon) GetCustomMetadataScript() *wrappers.StringValue { - if m != nil { - return m.CustomMetadataScript - } - return nil -} - -func (m *ClusterCommon) GetImageId() *wrappers.StringValue { - if m != nil { - return m.ImageId - } - return nil -} - -func (m *ClusterCommon) GetBackupPolicy() *wrappers.StringValue { - if m != nil { - return m.BackupPolicy - } - return nil -} - -func (m *ClusterCommon) GetIncrementalBackupSupported() *wrappers.BoolValue { - if m != nil { - return m.IncrementalBackupSupported - } - return nil -} - -func (m *ClusterCommon) GetHypervisor() *wrappers.StringValue { - if m != nil { - return m.Hypervisor - } - return nil -} - -type ClusterNode struct { - // cluster node(cluster contain one more node) id - NodeId *wrappers.StringValue `protobuf:"bytes,1,opt,name=node_id,json=nodeId,proto3" json:"node_id,omitempty"` - // cluster id - ClusterId *wrappers.StringValue `protobuf:"bytes,2,opt,name=cluster_id,json=clusterId,proto3" json:"cluster_id,omitempty"` - // name, default empty - Name *wrappers.StringValue `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` - // instance id - InstanceId *wrappers.StringValue `protobuf:"bytes,4,opt,name=instance_id,json=instanceId,proto3" json:"instance_id,omitempty"` - // volume id, if mount volume - VolumeId *wrappers.StringValue `protobuf:"bytes,5,opt,name=volume_id,json=volumeId,proto3" json:"volume_id,omitempty"` - // device - Device *wrappers.StringValue `protobuf:"bytes,6,opt,name=device,proto3" json:"device,omitempty"` - // subnet id - SubnetId *wrappers.StringValue `protobuf:"bytes,7,opt,name=subnet_id,json=subnetId,proto3" json:"subnet_id,omitempty"` - // private ip - PrivateIp *wrappers.StringValue `protobuf:"bytes,8,opt,name=private_ip,json=privateIp,proto3" json:"private_ip,omitempty"` - // elastic ip, if attach ip - Eip *wrappers.StringValue `protobuf:"bytes,9,opt,name=eip,proto3" json:"eip,omitempty"` - // server id - ServerId *wrappers.UInt32Value `protobuf:"bytes,10,opt,name=server_id,json=serverId,proto3" json:"server_id,omitempty"` - // role eg.[wordpress|mysql|...] - Role *wrappers.StringValue `protobuf:"bytes,11,opt,name=role,proto3" json:"role,omitempty"` - // status eg.[active|used|enabled|disabled|deleted|stopped|ceased|successful|failed] - Status *wrappers.StringValue `protobuf:"bytes,12,opt,name=status,proto3" json:"status,omitempty"` - // transition status eg.[creating|deleting|upgrading|updating|rollbacking|stopping|starting|recovering|ceasing|resizing|scaling] - TransitionStatus *wrappers.StringValue `protobuf:"bytes,13,opt,name=transition_status,json=transitionStatus,proto3" json:"transition_status,omitempty"` - // group id - GroupId *wrappers.UInt32Value `protobuf:"bytes,14,opt,name=group_id,json=groupId,proto3" json:"group_id,omitempty"` - // own path, concat string group_path:user_id - OwnerPath *wrappers.StringValue `protobuf:"bytes,15,opt,name=owner_path,json=ownerPath,proto3" json:"owner_path,omitempty"` - // global server id - GlobalServerId *wrappers.UInt32Value `protobuf:"bytes,16,opt,name=global_server_id,json=globalServerId,proto3" json:"global_server_id,omitempty"` - // custom metadata - CustomMetadata *wrappers.StringValue `protobuf:"bytes,17,opt,name=custom_metadata,json=customMetadata,proto3" json:"custom_metadata,omitempty"` - // public key - PubKey *wrappers.StringValue `protobuf:"bytes,18,opt,name=pub_key,json=pubKey,proto3" json:"pub_key,omitempty"` - // health status default empty eg.[healthy|unhealthy|""] - HealthStatus *wrappers.StringValue `protobuf:"bytes,19,opt,name=health_status,json=healthStatus,proto3" json:"health_status,omitempty"` - // backup or not - IsBackup *wrappers.BoolValue `protobuf:"bytes,20,opt,name=is_backup,json=isBackup,proto3" json:"is_backup,omitempty"` - // auto backup or not - AutoBackup *wrappers.BoolValue `protobuf:"bytes,21,opt,name=auto_backup,json=autoBackup,proto3" json:"auto_backup,omitempty"` - // the time when cluster node create - CreateTime *timestamp.Timestamp `protobuf:"bytes,22,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty"` - // record cluster node status changed time - StatusTime *timestamp.Timestamp `protobuf:"bytes,23,opt,name=status_time,json=statusTime,proto3" json:"status_time,omitempty"` - // host id - HostId *wrappers.StringValue `protobuf:"bytes,24,opt,name=host_id,json=hostId,proto3" json:"host_id,omitempty"` - // host ip - HostIp *wrappers.StringValue `protobuf:"bytes,25,opt,name=host_ip,json=hostIp,proto3" json:"host_ip,omitempty"` - // cluster role - ClusterRole *ClusterRole `protobuf:"bytes,26,opt,name=cluster_role,json=clusterRole,proto3" json:"cluster_role,omitempty"` - // cluster common info - ClusterCommon *ClusterCommon `protobuf:"bytes,27,opt,name=cluster_common,json=clusterCommon,proto3" json:"cluster_common,omitempty"` - // list of ssh key pair id - KeyPairId []string `protobuf:"bytes,28,rep,name=key_pair_id,json=keyPairId,proto3" json:"key_pair_id,omitempty"` - // owner - Owner *wrappers.StringValue `protobuf:"bytes,29,opt,name=owner,proto3" json:"owner,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ClusterNode) Reset() { *m = ClusterNode{} } -func (m *ClusterNode) String() string { return proto.CompactTextString(m) } -func (*ClusterNode) ProtoMessage() {} -func (*ClusterNode) Descriptor() ([]byte, []int) { - return fileDescriptor_3cfb3b8ec240c376, []int{35} -} - -func (m *ClusterNode) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ClusterNode.Unmarshal(m, b) -} -func (m *ClusterNode) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ClusterNode.Marshal(b, m, deterministic) -} -func (m *ClusterNode) XXX_Merge(src proto.Message) { - xxx_messageInfo_ClusterNode.Merge(m, src) -} -func (m *ClusterNode) XXX_Size() int { - return xxx_messageInfo_ClusterNode.Size(m) -} -func (m *ClusterNode) XXX_DiscardUnknown() { - xxx_messageInfo_ClusterNode.DiscardUnknown(m) -} - -var xxx_messageInfo_ClusterNode proto.InternalMessageInfo - -func (m *ClusterNode) GetNodeId() *wrappers.StringValue { - if m != nil { - return m.NodeId - } - return nil -} - -func (m *ClusterNode) GetClusterId() *wrappers.StringValue { - if m != nil { - return m.ClusterId - } - return nil -} - -func (m *ClusterNode) GetName() *wrappers.StringValue { - if m != nil { - return m.Name - } - return nil -} - -func (m *ClusterNode) GetInstanceId() *wrappers.StringValue { - if m != nil { - return m.InstanceId - } - return nil -} - -func (m *ClusterNode) GetVolumeId() *wrappers.StringValue { - if m != nil { - return m.VolumeId - } - return nil -} - -func (m *ClusterNode) GetDevice() *wrappers.StringValue { - if m != nil { - return m.Device - } - return nil -} - -func (m *ClusterNode) GetSubnetId() *wrappers.StringValue { - if m != nil { - return m.SubnetId - } - return nil -} - -func (m *ClusterNode) GetPrivateIp() *wrappers.StringValue { - if m != nil { - return m.PrivateIp - } - return nil -} - -func (m *ClusterNode) GetEip() *wrappers.StringValue { - if m != nil { - return m.Eip - } - return nil -} - -func (m *ClusterNode) GetServerId() *wrappers.UInt32Value { - if m != nil { - return m.ServerId - } - return nil -} - -func (m *ClusterNode) GetRole() *wrappers.StringValue { - if m != nil { - return m.Role - } - return nil -} - -func (m *ClusterNode) GetStatus() *wrappers.StringValue { - if m != nil { - return m.Status - } - return nil -} - -func (m *ClusterNode) GetTransitionStatus() *wrappers.StringValue { - if m != nil { - return m.TransitionStatus - } - return nil -} - -func (m *ClusterNode) GetGroupId() *wrappers.UInt32Value { - if m != nil { - return m.GroupId - } - return nil -} - -func (m *ClusterNode) GetOwnerPath() *wrappers.StringValue { - if m != nil { - return m.OwnerPath - } - return nil -} - -func (m *ClusterNode) GetGlobalServerId() *wrappers.UInt32Value { - if m != nil { - return m.GlobalServerId - } - return nil -} - -func (m *ClusterNode) GetCustomMetadata() *wrappers.StringValue { - if m != nil { - return m.CustomMetadata - } - return nil -} - -func (m *ClusterNode) GetPubKey() *wrappers.StringValue { - if m != nil { - return m.PubKey - } - return nil -} - -func (m *ClusterNode) GetHealthStatus() *wrappers.StringValue { - if m != nil { - return m.HealthStatus - } - return nil -} - -func (m *ClusterNode) GetIsBackup() *wrappers.BoolValue { - if m != nil { - return m.IsBackup - } - return nil -} - -func (m *ClusterNode) GetAutoBackup() *wrappers.BoolValue { - if m != nil { - return m.AutoBackup - } - return nil -} - -func (m *ClusterNode) GetCreateTime() *timestamp.Timestamp { - if m != nil { - return m.CreateTime - } - return nil -} - -func (m *ClusterNode) GetStatusTime() *timestamp.Timestamp { - if m != nil { - return m.StatusTime - } - return nil -} - -func (m *ClusterNode) GetHostId() *wrappers.StringValue { - if m != nil { - return m.HostId - } - return nil -} - -func (m *ClusterNode) GetHostIp() *wrappers.StringValue { - if m != nil { - return m.HostIp - } - return nil -} - -func (m *ClusterNode) GetClusterRole() *ClusterRole { - if m != nil { - return m.ClusterRole - } - return nil -} - -func (m *ClusterNode) GetClusterCommon() *ClusterCommon { - if m != nil { - return m.ClusterCommon - } - return nil -} - -func (m *ClusterNode) GetKeyPairId() []string { - if m != nil { - return m.KeyPairId - } - return nil -} - -func (m *ClusterNode) GetOwner() *wrappers.StringValue { - if m != nil { - return m.Owner - } - return nil -} - -type ClusterRole struct { - // cluster id - ClusterId *wrappers.StringValue `protobuf:"bytes,1,opt,name=cluster_id,json=clusterId,proto3" json:"cluster_id,omitempty"` - // role.eg.[wordpress|mysql|...] - Role *wrappers.StringValue `protobuf:"bytes,2,opt,name=role,proto3" json:"role,omitempty"` - // number of cpu - Cpu *wrappers.UInt32Value `protobuf:"bytes,3,opt,name=cpu,proto3" json:"cpu,omitempty"` - // number of gpu - Gpu *wrappers.UInt32Value `protobuf:"bytes,4,opt,name=gpu,proto3" json:"gpu,omitempty"` - // size of memory - Memory *wrappers.UInt32Value `protobuf:"bytes,5,opt,name=memory,proto3" json:"memory,omitempty"` - // size of instance - InstanceSize *wrappers.UInt32Value `protobuf:"bytes,6,opt,name=instance_size,json=instanceSize,proto3" json:"instance_size,omitempty"` - // size of storage - StorageSize *wrappers.UInt32Value `protobuf:"bytes,7,opt,name=storage_size,json=storageSize,proto3" json:"storage_size,omitempty"` - // mount point, a dir.eg.[/data] - MountPoint *wrappers.StringValue `protobuf:"bytes,8,opt,name=mount_point,json=mountPoint,proto3" json:"mount_point,omitempty"` - // mount_options - MountOptions *wrappers.StringValue `protobuf:"bytes,9,opt,name=mount_options,json=mountOptions,proto3" json:"mount_options,omitempty"` - // file system eg.[ext|ext4|...] - FileSystem *wrappers.StringValue `protobuf:"bytes,10,opt,name=file_system,json=fileSystem,proto3" json:"file_system,omitempty"` - // env of cluster - Env *wrappers.StringValue `protobuf:"bytes,11,opt,name=env,proto3" json:"env,omitempty"` - // number of replica - Replicas *wrappers.UInt32Value `protobuf:"bytes,12,opt,name=replicas,proto3" json:"replicas,omitempty"` - // number of replica on ready - ReadyReplicas *wrappers.UInt32Value `protobuf:"bytes,13,opt,name=ready_replicas,json=readyReplicas,proto3" json:"ready_replicas,omitempty"` - // api version - ApiVersion *wrappers.StringValue `protobuf:"bytes,14,opt,name=api_version,json=apiVersion,proto3" json:"api_version,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ClusterRole) Reset() { *m = ClusterRole{} } -func (m *ClusterRole) String() string { return proto.CompactTextString(m) } -func (*ClusterRole) ProtoMessage() {} -func (*ClusterRole) Descriptor() ([]byte, []int) { - return fileDescriptor_3cfb3b8ec240c376, []int{36} -} - -func (m *ClusterRole) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ClusterRole.Unmarshal(m, b) -} -func (m *ClusterRole) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ClusterRole.Marshal(b, m, deterministic) -} -func (m *ClusterRole) XXX_Merge(src proto.Message) { - xxx_messageInfo_ClusterRole.Merge(m, src) -} -func (m *ClusterRole) XXX_Size() int { - return xxx_messageInfo_ClusterRole.Size(m) -} -func (m *ClusterRole) XXX_DiscardUnknown() { - xxx_messageInfo_ClusterRole.DiscardUnknown(m) -} - -var xxx_messageInfo_ClusterRole proto.InternalMessageInfo - -func (m *ClusterRole) GetClusterId() *wrappers.StringValue { - if m != nil { - return m.ClusterId - } - return nil -} - -func (m *ClusterRole) GetRole() *wrappers.StringValue { - if m != nil { - return m.Role - } - return nil -} - -func (m *ClusterRole) GetCpu() *wrappers.UInt32Value { - if m != nil { - return m.Cpu - } - return nil -} - -func (m *ClusterRole) GetGpu() *wrappers.UInt32Value { - if m != nil { - return m.Gpu - } - return nil -} - -func (m *ClusterRole) GetMemory() *wrappers.UInt32Value { - if m != nil { - return m.Memory - } - return nil -} - -func (m *ClusterRole) GetInstanceSize() *wrappers.UInt32Value { - if m != nil { - return m.InstanceSize - } - return nil -} - -func (m *ClusterRole) GetStorageSize() *wrappers.UInt32Value { - if m != nil { - return m.StorageSize - } - return nil -} - -func (m *ClusterRole) GetMountPoint() *wrappers.StringValue { - if m != nil { - return m.MountPoint - } - return nil -} - -func (m *ClusterRole) GetMountOptions() *wrappers.StringValue { - if m != nil { - return m.MountOptions - } - return nil -} - -func (m *ClusterRole) GetFileSystem() *wrappers.StringValue { - if m != nil { - return m.FileSystem - } - return nil -} - -func (m *ClusterRole) GetEnv() *wrappers.StringValue { - if m != nil { - return m.Env - } - return nil -} - -func (m *ClusterRole) GetReplicas() *wrappers.UInt32Value { - if m != nil { - return m.Replicas - } - return nil -} - -func (m *ClusterRole) GetReadyReplicas() *wrappers.UInt32Value { - if m != nil { - return m.ReadyReplicas - } - return nil -} - -func (m *ClusterRole) GetApiVersion() *wrappers.StringValue { - if m != nil { - return m.ApiVersion - } - return nil -} - -type ClusterLoadbalancer struct { - // cluster id - ClusterId *wrappers.StringValue `protobuf:"bytes,1,opt,name=cluster_id,json=clusterId,proto3" json:"cluster_id,omitempty"` - // role of balancer - Role *wrappers.StringValue `protobuf:"bytes,2,opt,name=role,proto3" json:"role,omitempty"` - // listener id - LoadbalancerListenerId *wrappers.StringValue `protobuf:"bytes,3,opt,name=loadbalancer_listener_id,json=loadbalancerListenerId,proto3" json:"loadbalancer_listener_id,omitempty"` - // port - LoadbalancerPort *wrappers.UInt32Value `protobuf:"bytes,4,opt,name=loadbalancer_port,json=loadbalancerPort,proto3" json:"loadbalancer_port,omitempty"` - // policy id - LoadbalancerPolicyId *wrappers.StringValue `protobuf:"bytes,5,opt,name=loadbalancer_policy_id,json=loadbalancerPolicyId,proto3" json:"loadbalancer_policy_id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ClusterLoadbalancer) Reset() { *m = ClusterLoadbalancer{} } -func (m *ClusterLoadbalancer) String() string { return proto.CompactTextString(m) } -func (*ClusterLoadbalancer) ProtoMessage() {} -func (*ClusterLoadbalancer) Descriptor() ([]byte, []int) { - return fileDescriptor_3cfb3b8ec240c376, []int{37} -} - -func (m *ClusterLoadbalancer) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ClusterLoadbalancer.Unmarshal(m, b) -} -func (m *ClusterLoadbalancer) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ClusterLoadbalancer.Marshal(b, m, deterministic) -} -func (m *ClusterLoadbalancer) XXX_Merge(src proto.Message) { - xxx_messageInfo_ClusterLoadbalancer.Merge(m, src) -} -func (m *ClusterLoadbalancer) XXX_Size() int { - return xxx_messageInfo_ClusterLoadbalancer.Size(m) -} -func (m *ClusterLoadbalancer) XXX_DiscardUnknown() { - xxx_messageInfo_ClusterLoadbalancer.DiscardUnknown(m) -} - -var xxx_messageInfo_ClusterLoadbalancer proto.InternalMessageInfo - -func (m *ClusterLoadbalancer) GetClusterId() *wrappers.StringValue { - if m != nil { - return m.ClusterId - } - return nil -} - -func (m *ClusterLoadbalancer) GetRole() *wrappers.StringValue { - if m != nil { - return m.Role - } - return nil -} - -func (m *ClusterLoadbalancer) GetLoadbalancerListenerId() *wrappers.StringValue { - if m != nil { - return m.LoadbalancerListenerId - } - return nil -} - -func (m *ClusterLoadbalancer) GetLoadbalancerPort() *wrappers.UInt32Value { - if m != nil { - return m.LoadbalancerPort - } - return nil -} - -func (m *ClusterLoadbalancer) GetLoadbalancerPolicyId() *wrappers.StringValue { - if m != nil { - return m.LoadbalancerPolicyId - } - return nil -} - -type ClusterLink struct { - // cluster id - ClusterId *wrappers.StringValue `protobuf:"bytes,1,opt,name=cluster_id,json=clusterId,proto3" json:"cluster_id,omitempty"` - // cluster link name eg.[mysql|wordpress|...] - Name *wrappers.StringValue `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - // external cluster id - ExternalClusterId *wrappers.StringValue `protobuf:"bytes,3,opt,name=external_cluster_id,json=externalClusterId,proto3" json:"external_cluster_id,omitempty"` - // owner path, concat string group_path:user_id - OwnerPath *wrappers.StringValue `protobuf:"bytes,4,opt,name=owner_path,json=ownerPath,proto3" json:"owner_path,omitempty"` - // owner - Owner *wrappers.StringValue `protobuf:"bytes,5,opt,name=owner,proto3" json:"owner,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ClusterLink) Reset() { *m = ClusterLink{} } -func (m *ClusterLink) String() string { return proto.CompactTextString(m) } -func (*ClusterLink) ProtoMessage() {} -func (*ClusterLink) Descriptor() ([]byte, []int) { - return fileDescriptor_3cfb3b8ec240c376, []int{38} -} - -func (m *ClusterLink) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ClusterLink.Unmarshal(m, b) -} -func (m *ClusterLink) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ClusterLink.Marshal(b, m, deterministic) -} -func (m *ClusterLink) XXX_Merge(src proto.Message) { - xxx_messageInfo_ClusterLink.Merge(m, src) -} -func (m *ClusterLink) XXX_Size() int { - return xxx_messageInfo_ClusterLink.Size(m) -} -func (m *ClusterLink) XXX_DiscardUnknown() { - xxx_messageInfo_ClusterLink.DiscardUnknown(m) -} - -var xxx_messageInfo_ClusterLink proto.InternalMessageInfo - -func (m *ClusterLink) GetClusterId() *wrappers.StringValue { - if m != nil { - return m.ClusterId - } - return nil -} - -func (m *ClusterLink) GetName() *wrappers.StringValue { - if m != nil { - return m.Name - } - return nil -} - -func (m *ClusterLink) GetExternalClusterId() *wrappers.StringValue { - if m != nil { - return m.ExternalClusterId - } - return nil -} - -func (m *ClusterLink) GetOwnerPath() *wrappers.StringValue { - if m != nil { - return m.OwnerPath - } - return nil -} - -func (m *ClusterLink) GetOwner() *wrappers.StringValue { - if m != nil { - return m.Owner - } - return nil -} - -type Cluster struct { - // cluster id - ClusterId *wrappers.StringValue `protobuf:"bytes,1,opt,name=cluster_id,json=clusterId,proto3" json:"cluster_id,omitempty"` - // cluster name - Name *wrappers.StringValue `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - // cluster description - Description *wrappers.StringValue `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` - // id of app run in cluster - AppId *wrappers.StringValue `protobuf:"bytes,4,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty"` - // id of version of app run in cluster - VersionId *wrappers.StringValue `protobuf:"bytes,5,opt,name=version_id,json=versionId,proto3" json:"version_id,omitempty"` - // subnet id, cluster run in a subnet - SubnetId *wrappers.StringValue `protobuf:"bytes,6,opt,name=subnet_id,json=subnetId,proto3" json:"subnet_id,omitempty"` - // vpc id, a vpc contain one more subnet - VpcId *wrappers.StringValue `protobuf:"bytes,7,opt,name=vpc_id,json=vpcId,proto3" json:"vpc_id,omitempty"` - // frontgate id, a proxy for vpc to communicate - FrontgateId *wrappers.StringValue `protobuf:"bytes,8,opt,name=frontgate_id,json=frontgateId,proto3" json:"frontgate_id,omitempty"` - // cluster type, frontgate or normal cluster - ClusterType *wrappers.UInt32Value `protobuf:"bytes,9,opt,name=cluster_type,json=clusterType,proto3" json:"cluster_type,omitempty"` - // endpoint of cluster - Endpoints *wrappers.StringValue `protobuf:"bytes,10,opt,name=endpoints,proto3" json:"endpoints,omitempty"` - // cluster status eg.[active|used|enabled|disabled|deleted|stopped|ceased] - Status *wrappers.StringValue `protobuf:"bytes,11,opt,name=status,proto3" json:"status,omitempty"` - // cluster transition status eg.[creating|deleting|upgrading|updating|rollbacking|stopping|starting|recovering|ceasing|resizing|scaling] - TransitionStatus *wrappers.StringValue `protobuf:"bytes,12,opt,name=transition_status,json=transitionStatus,proto3" json:"transition_status,omitempty"` - // metadata root access - MetadataRootAccess *wrappers.BoolValue `protobuf:"bytes,13,opt,name=metadata_root_access,json=metadataRootAccess,proto3" json:"metadata_root_access,omitempty"` - // owner path, concat string group_path:user_id - OwnerPath *wrappers.StringValue `protobuf:"bytes,14,opt,name=owner_path,json=ownerPath,proto3" json:"owner_path,omitempty"` - // global uuid - GlobalUuid *wrappers.StringValue `protobuf:"bytes,15,opt,name=global_uuid,json=globalUuid,proto3" json:"global_uuid,omitempty"` - // upgrade status, unused - UpgradeStatus *wrappers.StringValue `protobuf:"bytes,16,opt,name=upgrade_status,json=upgradeStatus,proto3" json:"upgrade_status,omitempty"` - // cluster upgraded time - UpgradeTime *timestamp.Timestamp `protobuf:"bytes,17,opt,name=upgrade_time,json=upgradeTime,proto3" json:"upgrade_time,omitempty"` - // cluster runtime id - RuntimeId *wrappers.StringValue `protobuf:"bytes,18,opt,name=runtime_id,json=runtimeId,proto3" json:"runtime_id,omitempty"` - // the time when cluster create - CreateTime *timestamp.Timestamp `protobuf:"bytes,19,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty"` - // record status changed time - StatusTime *timestamp.Timestamp `protobuf:"bytes,20,opt,name=status_time,json=statusTime,proto3" json:"status_time,omitempty"` - AdditionalInfo *wrappers.StringValue `protobuf:"bytes,21,opt,name=additional_info,json=additionalInfo,proto3" json:"additional_info,omitempty"` - // cluster env - Env *wrappers.StringValue `protobuf:"bytes,22,opt,name=env,proto3" json:"env,omitempty"` - // cluster used to debug or not - Debug *wrappers.BoolValue `protobuf:"bytes,23,opt,name=debug,proto3" json:"debug,omitempty"` - // zone of cluster eg.[pek3a|pek3b] - Zone *wrappers.StringValue `protobuf:"bytes,24,opt,name=zone,proto3" json:"zone,omitempty"` - // list of cluster node - ClusterNodeSet []*ClusterNode `protobuf:"bytes,25,rep,name=cluster_node_set,json=clusterNodeSet,proto3" json:"cluster_node_set,omitempty"` - // list of cluster role - ClusterRoleSet []*ClusterRole `protobuf:"bytes,26,rep,name=cluster_role_set,json=clusterRoleSet,proto3" json:"cluster_role_set,omitempty"` - // list of cluster link - ClusterLinkSet []*ClusterLink `protobuf:"bytes,27,rep,name=cluster_link_set,json=clusterLinkSet,proto3" json:"cluster_link_set,omitempty"` - // list of cluster common - ClusterCommonSet []*ClusterCommon `protobuf:"bytes,28,rep,name=cluster_common_set,json=clusterCommonSet,proto3" json:"cluster_common_set,omitempty"` - // lister of cluster loadbalancer - ClusterLoadbalancerSet []*ClusterLoadbalancer `protobuf:"bytes,29,rep,name=cluster_loadbalancer_set,json=clusterLoadbalancerSet,proto3" json:"cluster_loadbalancer_set,omitempty"` - // owner - Owner *wrappers.StringValue `protobuf:"bytes,30,opt,name=owner,proto3" json:"owner,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Cluster) Reset() { *m = Cluster{} } -func (m *Cluster) String() string { return proto.CompactTextString(m) } -func (*Cluster) ProtoMessage() {} -func (*Cluster) Descriptor() ([]byte, []int) { - return fileDescriptor_3cfb3b8ec240c376, []int{39} -} - -func (m *Cluster) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Cluster.Unmarshal(m, b) -} -func (m *Cluster) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Cluster.Marshal(b, m, deterministic) -} -func (m *Cluster) XXX_Merge(src proto.Message) { - xxx_messageInfo_Cluster.Merge(m, src) -} -func (m *Cluster) XXX_Size() int { - return xxx_messageInfo_Cluster.Size(m) -} -func (m *Cluster) XXX_DiscardUnknown() { - xxx_messageInfo_Cluster.DiscardUnknown(m) -} - -var xxx_messageInfo_Cluster proto.InternalMessageInfo - -func (m *Cluster) GetClusterId() *wrappers.StringValue { - if m != nil { - return m.ClusterId - } - return nil -} - -func (m *Cluster) GetName() *wrappers.StringValue { - if m != nil { - return m.Name - } - return nil -} - -func (m *Cluster) GetDescription() *wrappers.StringValue { - if m != nil { - return m.Description - } - return nil -} - -func (m *Cluster) GetAppId() *wrappers.StringValue { - if m != nil { - return m.AppId - } - return nil -} - -func (m *Cluster) GetVersionId() *wrappers.StringValue { - if m != nil { - return m.VersionId - } - return nil -} - -func (m *Cluster) GetSubnetId() *wrappers.StringValue { - if m != nil { - return m.SubnetId - } - return nil -} - -func (m *Cluster) GetVpcId() *wrappers.StringValue { - if m != nil { - return m.VpcId - } - return nil -} - -func (m *Cluster) GetFrontgateId() *wrappers.StringValue { - if m != nil { - return m.FrontgateId - } - return nil -} - -func (m *Cluster) GetClusterType() *wrappers.UInt32Value { - if m != nil { - return m.ClusterType - } - return nil -} - -func (m *Cluster) GetEndpoints() *wrappers.StringValue { - if m != nil { - return m.Endpoints - } - return nil -} - -func (m *Cluster) GetStatus() *wrappers.StringValue { - if m != nil { - return m.Status - } - return nil -} - -func (m *Cluster) GetTransitionStatus() *wrappers.StringValue { - if m != nil { - return m.TransitionStatus - } - return nil -} - -func (m *Cluster) GetMetadataRootAccess() *wrappers.BoolValue { - if m != nil { - return m.MetadataRootAccess - } - return nil -} - -func (m *Cluster) GetOwnerPath() *wrappers.StringValue { - if m != nil { - return m.OwnerPath - } - return nil -} - -func (m *Cluster) GetGlobalUuid() *wrappers.StringValue { - if m != nil { - return m.GlobalUuid - } - return nil -} - -func (m *Cluster) GetUpgradeStatus() *wrappers.StringValue { - if m != nil { - return m.UpgradeStatus - } - return nil -} - -func (m *Cluster) GetUpgradeTime() *timestamp.Timestamp { - if m != nil { - return m.UpgradeTime - } - return nil -} - -func (m *Cluster) GetRuntimeId() *wrappers.StringValue { - if m != nil { - return m.RuntimeId - } - return nil -} - -func (m *Cluster) GetCreateTime() *timestamp.Timestamp { - if m != nil { - return m.CreateTime - } - return nil -} - -func (m *Cluster) GetStatusTime() *timestamp.Timestamp { - if m != nil { - return m.StatusTime - } - return nil -} - -func (m *Cluster) GetAdditionalInfo() *wrappers.StringValue { - if m != nil { - return m.AdditionalInfo - } - return nil -} - -func (m *Cluster) GetEnv() *wrappers.StringValue { - if m != nil { - return m.Env - } - return nil -} - -func (m *Cluster) GetDebug() *wrappers.BoolValue { - if m != nil { - return m.Debug - } - return nil -} - -func (m *Cluster) GetZone() *wrappers.StringValue { - if m != nil { - return m.Zone - } - return nil -} - -func (m *Cluster) GetClusterNodeSet() []*ClusterNode { - if m != nil { - return m.ClusterNodeSet - } - return nil -} - -func (m *Cluster) GetClusterRoleSet() []*ClusterRole { - if m != nil { - return m.ClusterRoleSet - } - return nil -} - -func (m *Cluster) GetClusterLinkSet() []*ClusterLink { - if m != nil { - return m.ClusterLinkSet - } - return nil -} - -func (m *Cluster) GetClusterCommonSet() []*ClusterCommon { - if m != nil { - return m.ClusterCommonSet - } - return nil -} - -func (m *Cluster) GetClusterLoadbalancerSet() []*ClusterLoadbalancer { - if m != nil { - return m.ClusterLoadbalancerSet - } - return nil -} - -func (m *Cluster) GetOwner() *wrappers.StringValue { - if m != nil { - return m.Owner - } - return nil -} - -type DescribeClustersRequest struct { - // cluster ids - ClusterId []string `protobuf:"bytes,1,rep,name=cluster_id,json=clusterId,proto3" json:"cluster_id,omitempty"` - // app ids - AppId []string `protobuf:"bytes,2,rep,name=app_id,json=appId,proto3" json:"app_id,omitempty"` - // version ids - VersionId []string `protobuf:"bytes,3,rep,name=version_id,json=versionId,proto3" json:"version_id,omitempty"` - // cluster status eg.[active|used|enabled|disabled|deleted|stopped|ceased] - Status []string `protobuf:"bytes,4,rep,name=status,proto3" json:"status,omitempty"` - // runtime ids - RuntimeId []string `protobuf:"bytes,5,rep,name=runtime_id,json=runtimeId,proto3" json:"runtime_id,omitempty"` - // frontgate ids - FrontgateId []string `protobuf:"bytes,6,rep,name=frontgate_id,json=frontgateId,proto3" json:"frontgate_id,omitempty"` - // external cluster id - ExternalClusterId *wrappers.StringValue `protobuf:"bytes,7,opt,name=external_cluster_id,json=externalClusterId,proto3" json:"external_cluster_id,omitempty"` - // data limit per page, default value 20, max value 200 - Limit uint32 `protobuf:"varint,8,opt,name=limit,proto3" json:"limit,omitempty"` - // data offset, default 0 - Offset uint32 `protobuf:"varint,9,opt,name=offset,proto3" json:"offset,omitempty"` - // query key, support these fields(cluster_id, app_id, version_id, status, runtime_id, frontgate_id, owner, cluster_type) - SearchWord *wrappers.StringValue `protobuf:"bytes,10,opt,name=search_word,json=searchWord,proto3" json:"search_word,omitempty"` - // sort key, order by sort_key, default create_time - SortKey *wrappers.StringValue `protobuf:"bytes,11,opt,name=sort_key,json=sortKey,proto3" json:"sort_key,omitempty"` - // value = 0 sort ASC, value = 1 sort DESC - Reverse *wrappers.BoolValue `protobuf:"bytes,12,opt,name=reverse,proto3" json:"reverse,omitempty"` - // owner - Owner []string `protobuf:"bytes,13,rep,name=owner,proto3" json:"owner,omitempty"` - // cluster type, frontgate or normal cluster - ClusterType *wrappers.StringValue `protobuf:"bytes,14,opt,name=cluster_type,json=clusterType,proto3" json:"cluster_type,omitempty"` - // get cluster detail info or not - WithDetail *wrappers.BoolValue `protobuf:"bytes,15,opt,name=with_detail,json=withDetail,proto3" json:"with_detail,omitempty"` - // cluster created duration eg.[1 day] - CreatedDate *wrappers.UInt32Value `protobuf:"bytes,16,opt,name=created_date,json=createdDate,proto3" json:"created_date,omitempty"` - // select column to display - DisplayColumns []string `protobuf:"bytes,17,rep,name=display_columns,json=displayColumns,proto3" json:"display_columns,omitempty"` - // namespace - Zone []string `protobuf:"bytes,18,rep,name=zone,proto3" json:"zone,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *DescribeClustersRequest) Reset() { *m = DescribeClustersRequest{} } -func (m *DescribeClustersRequest) String() string { return proto.CompactTextString(m) } -func (*DescribeClustersRequest) ProtoMessage() {} -func (*DescribeClustersRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_3cfb3b8ec240c376, []int{40} -} - -func (m *DescribeClustersRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_DescribeClustersRequest.Unmarshal(m, b) -} -func (m *DescribeClustersRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_DescribeClustersRequest.Marshal(b, m, deterministic) -} -func (m *DescribeClustersRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_DescribeClustersRequest.Merge(m, src) -} -func (m *DescribeClustersRequest) XXX_Size() int { - return xxx_messageInfo_DescribeClustersRequest.Size(m) -} -func (m *DescribeClustersRequest) XXX_DiscardUnknown() { - xxx_messageInfo_DescribeClustersRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_DescribeClustersRequest proto.InternalMessageInfo - -func (m *DescribeClustersRequest) GetClusterId() []string { - if m != nil { - return m.ClusterId - } - return nil -} - -func (m *DescribeClustersRequest) GetAppId() []string { - if m != nil { - return m.AppId - } - return nil -} - -func (m *DescribeClustersRequest) GetVersionId() []string { - if m != nil { - return m.VersionId - } - return nil -} - -func (m *DescribeClustersRequest) GetStatus() []string { - if m != nil { - return m.Status - } - return nil -} - -func (m *DescribeClustersRequest) GetRuntimeId() []string { - if m != nil { - return m.RuntimeId - } - return nil -} - -func (m *DescribeClustersRequest) GetFrontgateId() []string { - if m != nil { - return m.FrontgateId - } - return nil -} - -func (m *DescribeClustersRequest) GetExternalClusterId() *wrappers.StringValue { - if m != nil { - return m.ExternalClusterId - } - return nil -} - -func (m *DescribeClustersRequest) GetLimit() uint32 { - if m != nil { - return m.Limit - } - return 0 -} - -func (m *DescribeClustersRequest) GetOffset() uint32 { - if m != nil { - return m.Offset - } - return 0 -} - -func (m *DescribeClustersRequest) GetSearchWord() *wrappers.StringValue { - if m != nil { - return m.SearchWord - } - return nil -} - -func (m *DescribeClustersRequest) GetSortKey() *wrappers.StringValue { - if m != nil { - return m.SortKey - } - return nil -} - -func (m *DescribeClustersRequest) GetReverse() *wrappers.BoolValue { - if m != nil { - return m.Reverse - } - return nil -} - -func (m *DescribeClustersRequest) GetOwner() []string { - if m != nil { - return m.Owner - } - return nil -} - -func (m *DescribeClustersRequest) GetClusterType() *wrappers.StringValue { - if m != nil { - return m.ClusterType - } - return nil -} - -func (m *DescribeClustersRequest) GetWithDetail() *wrappers.BoolValue { - if m != nil { - return m.WithDetail - } - return nil -} - -func (m *DescribeClustersRequest) GetCreatedDate() *wrappers.UInt32Value { - if m != nil { - return m.CreatedDate - } - return nil -} - -func (m *DescribeClustersRequest) GetDisplayColumns() []string { - if m != nil { - return m.DisplayColumns - } - return nil -} - -func (m *DescribeClustersRequest) GetZone() []string { - if m != nil { - return m.Zone - } - return nil -} - -type DescribeClustersResponse struct { - // total count of qualified cluster - TotalCount uint32 `protobuf:"varint,1,opt,name=total_count,json=totalCount,proto3" json:"total_count,omitempty"` - // list of cluster - ClusterSet []*Cluster `protobuf:"bytes,2,rep,name=cluster_set,json=clusterSet,proto3" json:"cluster_set,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *DescribeClustersResponse) Reset() { *m = DescribeClustersResponse{} } -func (m *DescribeClustersResponse) String() string { return proto.CompactTextString(m) } -func (*DescribeClustersResponse) ProtoMessage() {} -func (*DescribeClustersResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_3cfb3b8ec240c376, []int{41} -} - -func (m *DescribeClustersResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_DescribeClustersResponse.Unmarshal(m, b) -} -func (m *DescribeClustersResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_DescribeClustersResponse.Marshal(b, m, deterministic) -} -func (m *DescribeClustersResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_DescribeClustersResponse.Merge(m, src) -} -func (m *DescribeClustersResponse) XXX_Size() int { - return xxx_messageInfo_DescribeClustersResponse.Size(m) -} -func (m *DescribeClustersResponse) XXX_DiscardUnknown() { - xxx_messageInfo_DescribeClustersResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_DescribeClustersResponse proto.InternalMessageInfo - -func (m *DescribeClustersResponse) GetTotalCount() uint32 { - if m != nil { - return m.TotalCount - } - return 0 -} - -func (m *DescribeClustersResponse) GetClusterSet() []*Cluster { - if m != nil { - return m.ClusterSet - } - return nil -} - -type DescribeAppClustersRequest struct { - // app ids - AppId []string `protobuf:"bytes,1,rep,name=app_id,json=appId,proto3" json:"app_id,omitempty"` - // status eg.[active|used|enabled|disabled|deleted|stopped|ceased] - Status []string `protobuf:"bytes,2,rep,name=status,proto3" json:"status,omitempty"` - // data limit per page, default value 20, max value 200 - Limit uint32 `protobuf:"varint,3,opt,name=limit,proto3" json:"limit,omitempty"` - // data offset, default 0 - Offset uint32 `protobuf:"varint,4,opt,name=offset,proto3" json:"offset,omitempty"` - // query key, support these fields(cluster_id, app_id, version_id, status, runtime_id, frontgate_id, owner, cluster_type) - SearchWord *wrappers.StringValue `protobuf:"bytes,5,opt,name=search_word,json=searchWord,proto3" json:"search_word,omitempty"` - // sort key, order by sort_key, default create_time - SortKey *wrappers.StringValue `protobuf:"bytes,6,opt,name=sort_key,json=sortKey,proto3" json:"sort_key,omitempty"` - // value = 0 sort ASC, value = 1 sort DESC - Reverse *wrappers.BoolValue `protobuf:"bytes,7,opt,name=reverse,proto3" json:"reverse,omitempty"` - // owner - Owner []string `protobuf:"bytes,8,rep,name=owner,proto3" json:"owner,omitempty"` - // get cluster with detail - WithDetail *wrappers.BoolValue `protobuf:"bytes,9,opt,name=with_detail,json=withDetail,proto3" json:"with_detail,omitempty"` - // cluster created duration eg.[1 day] - CreatedDate *wrappers.UInt32Value `protobuf:"bytes,10,opt,name=created_date,json=createdDate,proto3" json:"created_date,omitempty"` - // select columns to display - DisplayColumns []string `protobuf:"bytes,11,rep,name=display_columns,json=displayColumns,proto3" json:"display_columns,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *DescribeAppClustersRequest) Reset() { *m = DescribeAppClustersRequest{} } -func (m *DescribeAppClustersRequest) String() string { return proto.CompactTextString(m) } -func (*DescribeAppClustersRequest) ProtoMessage() {} -func (*DescribeAppClustersRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_3cfb3b8ec240c376, []int{42} -} - -func (m *DescribeAppClustersRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_DescribeAppClustersRequest.Unmarshal(m, b) -} -func (m *DescribeAppClustersRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_DescribeAppClustersRequest.Marshal(b, m, deterministic) -} -func (m *DescribeAppClustersRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_DescribeAppClustersRequest.Merge(m, src) -} -func (m *DescribeAppClustersRequest) XXX_Size() int { - return xxx_messageInfo_DescribeAppClustersRequest.Size(m) -} -func (m *DescribeAppClustersRequest) XXX_DiscardUnknown() { - xxx_messageInfo_DescribeAppClustersRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_DescribeAppClustersRequest proto.InternalMessageInfo - -func (m *DescribeAppClustersRequest) GetAppId() []string { - if m != nil { - return m.AppId - } - return nil -} - -func (m *DescribeAppClustersRequest) GetStatus() []string { - if m != nil { - return m.Status - } - return nil -} - -func (m *DescribeAppClustersRequest) GetLimit() uint32 { - if m != nil { - return m.Limit - } - return 0 -} - -func (m *DescribeAppClustersRequest) GetOffset() uint32 { - if m != nil { - return m.Offset - } - return 0 -} - -func (m *DescribeAppClustersRequest) GetSearchWord() *wrappers.StringValue { - if m != nil { - return m.SearchWord - } - return nil -} - -func (m *DescribeAppClustersRequest) GetSortKey() *wrappers.StringValue { - if m != nil { - return m.SortKey - } - return nil -} - -func (m *DescribeAppClustersRequest) GetReverse() *wrappers.BoolValue { - if m != nil { - return m.Reverse - } - return nil -} - -func (m *DescribeAppClustersRequest) GetOwner() []string { - if m != nil { - return m.Owner - } - return nil -} - -func (m *DescribeAppClustersRequest) GetWithDetail() *wrappers.BoolValue { - if m != nil { - return m.WithDetail - } - return nil -} - -func (m *DescribeAppClustersRequest) GetCreatedDate() *wrappers.UInt32Value { - if m != nil { - return m.CreatedDate - } - return nil -} - -func (m *DescribeAppClustersRequest) GetDisplayColumns() []string { - if m != nil { - return m.DisplayColumns - } - return nil -} - -type DescribeAppClustersResponse struct { - // total count of cluster of app - TotalCount uint32 `protobuf:"varint,1,opt,name=total_count,json=totalCount,proto3" json:"total_count,omitempty"` - // list of cluster - ClusterSet []*Cluster `protobuf:"bytes,2,rep,name=cluster_set,json=clusterSet,proto3" json:"cluster_set,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *DescribeAppClustersResponse) Reset() { *m = DescribeAppClustersResponse{} } -func (m *DescribeAppClustersResponse) String() string { return proto.CompactTextString(m) } -func (*DescribeAppClustersResponse) ProtoMessage() {} -func (*DescribeAppClustersResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_3cfb3b8ec240c376, []int{43} -} - -func (m *DescribeAppClustersResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_DescribeAppClustersResponse.Unmarshal(m, b) -} -func (m *DescribeAppClustersResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_DescribeAppClustersResponse.Marshal(b, m, deterministic) -} -func (m *DescribeAppClustersResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_DescribeAppClustersResponse.Merge(m, src) -} -func (m *DescribeAppClustersResponse) XXX_Size() int { - return xxx_messageInfo_DescribeAppClustersResponse.Size(m) -} -func (m *DescribeAppClustersResponse) XXX_DiscardUnknown() { - xxx_messageInfo_DescribeAppClustersResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_DescribeAppClustersResponse proto.InternalMessageInfo - -func (m *DescribeAppClustersResponse) GetTotalCount() uint32 { - if m != nil { - return m.TotalCount - } - return 0 -} - -func (m *DescribeAppClustersResponse) GetClusterSet() []*Cluster { - if m != nil { - return m.ClusterSet - } - return nil -} - -type DescribeClusterNodesRequest struct { - // cluster id - ClusterId *wrappers.StringValue `protobuf:"bytes,1,opt,name=cluster_id,json=clusterId,proto3" json:"cluster_id,omitempty"` - // node ids - NodeId []string `protobuf:"bytes,2,rep,name=node_id,json=nodeId,proto3" json:"node_id,omitempty"` - // status eg.[active|used|enabled|disabled|deleted|stopped|ceased] - Status []string `protobuf:"bytes,3,rep,name=status,proto3" json:"status,omitempty"` - // data limit per page, default value 20, max value 200 - Limit uint32 `protobuf:"varint,4,opt,name=limit,proto3" json:"limit,omitempty"` - // data offset, default 0 - Offset uint32 `protobuf:"varint,5,opt,name=offset,proto3" json:"offset,omitempty"` - // query key, support these fields(cluster_id, node_id, status, owner) - SearchWord *wrappers.StringValue `protobuf:"bytes,6,opt,name=search_word,json=searchWord,proto3" json:"search_word,omitempty"` - // sort key, order by sort_key, default create_time - SortKey *wrappers.StringValue `protobuf:"bytes,7,opt,name=sort_key,json=sortKey,proto3" json:"sort_key,omitempty"` - // value = 0 sort ASC, value = 1 sort DESC - Reverse *wrappers.BoolValue `protobuf:"bytes,8,opt,name=reverse,proto3" json:"reverse,omitempty"` - // owner - Owner []string `protobuf:"bytes,9,rep,name=owner,proto3" json:"owner,omitempty"` - // select columns to display - DisplayColumns []string `protobuf:"bytes,10,rep,name=display_columns,json=displayColumns,proto3" json:"display_columns,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *DescribeClusterNodesRequest) Reset() { *m = DescribeClusterNodesRequest{} } -func (m *DescribeClusterNodesRequest) String() string { return proto.CompactTextString(m) } -func (*DescribeClusterNodesRequest) ProtoMessage() {} -func (*DescribeClusterNodesRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_3cfb3b8ec240c376, []int{44} -} - -func (m *DescribeClusterNodesRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_DescribeClusterNodesRequest.Unmarshal(m, b) -} -func (m *DescribeClusterNodesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_DescribeClusterNodesRequest.Marshal(b, m, deterministic) -} -func (m *DescribeClusterNodesRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_DescribeClusterNodesRequest.Merge(m, src) -} -func (m *DescribeClusterNodesRequest) XXX_Size() int { - return xxx_messageInfo_DescribeClusterNodesRequest.Size(m) -} -func (m *DescribeClusterNodesRequest) XXX_DiscardUnknown() { - xxx_messageInfo_DescribeClusterNodesRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_DescribeClusterNodesRequest proto.InternalMessageInfo - -func (m *DescribeClusterNodesRequest) GetClusterId() *wrappers.StringValue { - if m != nil { - return m.ClusterId - } - return nil -} - -func (m *DescribeClusterNodesRequest) GetNodeId() []string { - if m != nil { - return m.NodeId - } - return nil -} - -func (m *DescribeClusterNodesRequest) GetStatus() []string { - if m != nil { - return m.Status - } - return nil -} - -func (m *DescribeClusterNodesRequest) GetLimit() uint32 { - if m != nil { - return m.Limit - } - return 0 -} - -func (m *DescribeClusterNodesRequest) GetOffset() uint32 { - if m != nil { - return m.Offset - } - return 0 -} - -func (m *DescribeClusterNodesRequest) GetSearchWord() *wrappers.StringValue { - if m != nil { - return m.SearchWord - } - return nil -} - -func (m *DescribeClusterNodesRequest) GetSortKey() *wrappers.StringValue { - if m != nil { - return m.SortKey - } - return nil -} - -func (m *DescribeClusterNodesRequest) GetReverse() *wrappers.BoolValue { - if m != nil { - return m.Reverse - } - return nil -} - -func (m *DescribeClusterNodesRequest) GetOwner() []string { - if m != nil { - return m.Owner - } - return nil -} - -func (m *DescribeClusterNodesRequest) GetDisplayColumns() []string { - if m != nil { - return m.DisplayColumns - } - return nil -} - -type DescribeClusterNodesResponse struct { - // total count of node in the cluster - TotalCount uint32 `protobuf:"varint,1,opt,name=total_count,json=totalCount,proto3" json:"total_count,omitempty"` - // list of cluster node - ClusterNodeSet []*ClusterNode `protobuf:"bytes,2,rep,name=cluster_node_set,json=clusterNodeSet,proto3" json:"cluster_node_set,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *DescribeClusterNodesResponse) Reset() { *m = DescribeClusterNodesResponse{} } -func (m *DescribeClusterNodesResponse) String() string { return proto.CompactTextString(m) } -func (*DescribeClusterNodesResponse) ProtoMessage() {} -func (*DescribeClusterNodesResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_3cfb3b8ec240c376, []int{45} -} - -func (m *DescribeClusterNodesResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_DescribeClusterNodesResponse.Unmarshal(m, b) -} -func (m *DescribeClusterNodesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_DescribeClusterNodesResponse.Marshal(b, m, deterministic) -} -func (m *DescribeClusterNodesResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_DescribeClusterNodesResponse.Merge(m, src) -} -func (m *DescribeClusterNodesResponse) XXX_Size() int { - return xxx_messageInfo_DescribeClusterNodesResponse.Size(m) -} -func (m *DescribeClusterNodesResponse) XXX_DiscardUnknown() { - xxx_messageInfo_DescribeClusterNodesResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_DescribeClusterNodesResponse proto.InternalMessageInfo - -func (m *DescribeClusterNodesResponse) GetTotalCount() uint32 { - if m != nil { - return m.TotalCount - } - return 0 -} - -func (m *DescribeClusterNodesResponse) GetClusterNodeSet() []*ClusterNode { - if m != nil { - return m.ClusterNodeSet - } - return nil -} - -type StopClustersRequest struct { - // required, ids of cluster to stop - ClusterId []string `protobuf:"bytes,1,rep,name=cluster_id,json=clusterId,proto3" json:"cluster_id,omitempty"` - // advanced param - AdvancedParam []string `protobuf:"bytes,2,rep,name=advanced_param,json=advancedParam,proto3" json:"advanced_param,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *StopClustersRequest) Reset() { *m = StopClustersRequest{} } -func (m *StopClustersRequest) String() string { return proto.CompactTextString(m) } -func (*StopClustersRequest) ProtoMessage() {} -func (*StopClustersRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_3cfb3b8ec240c376, []int{46} -} - -func (m *StopClustersRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_StopClustersRequest.Unmarshal(m, b) -} -func (m *StopClustersRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_StopClustersRequest.Marshal(b, m, deterministic) -} -func (m *StopClustersRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_StopClustersRequest.Merge(m, src) -} -func (m *StopClustersRequest) XXX_Size() int { - return xxx_messageInfo_StopClustersRequest.Size(m) -} -func (m *StopClustersRequest) XXX_DiscardUnknown() { - xxx_messageInfo_StopClustersRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_StopClustersRequest proto.InternalMessageInfo - -func (m *StopClustersRequest) GetClusterId() []string { - if m != nil { - return m.ClusterId - } - return nil -} - -func (m *StopClustersRequest) GetAdvancedParam() []string { - if m != nil { - return m.AdvancedParam - } - return nil -} - -type StopClustersResponse struct { - // ids of clusters stopped - ClusterId []string `protobuf:"bytes,1,rep,name=cluster_id,json=clusterId,proto3" json:"cluster_id,omitempty"` - // job ids - JobId []string `protobuf:"bytes,2,rep,name=job_id,json=jobId,proto3" json:"job_id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *StopClustersResponse) Reset() { *m = StopClustersResponse{} } -func (m *StopClustersResponse) String() string { return proto.CompactTextString(m) } -func (*StopClustersResponse) ProtoMessage() {} -func (*StopClustersResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_3cfb3b8ec240c376, []int{47} -} - -func (m *StopClustersResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_StopClustersResponse.Unmarshal(m, b) -} -func (m *StopClustersResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_StopClustersResponse.Marshal(b, m, deterministic) -} -func (m *StopClustersResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_StopClustersResponse.Merge(m, src) -} -func (m *StopClustersResponse) XXX_Size() int { - return xxx_messageInfo_StopClustersResponse.Size(m) -} -func (m *StopClustersResponse) XXX_DiscardUnknown() { - xxx_messageInfo_StopClustersResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_StopClustersResponse proto.InternalMessageInfo - -func (m *StopClustersResponse) GetClusterId() []string { - if m != nil { - return m.ClusterId - } - return nil -} - -func (m *StopClustersResponse) GetJobId() []string { - if m != nil { - return m.JobId - } - return nil -} - -type StartClustersRequest struct { - // required, ids of cluster to start - ClusterId []string `protobuf:"bytes,1,rep,name=cluster_id,json=clusterId,proto3" json:"cluster_id,omitempty"` - // advanced param - AdvancedParam []string `protobuf:"bytes,2,rep,name=advanced_param,json=advancedParam,proto3" json:"advanced_param,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *StartClustersRequest) Reset() { *m = StartClustersRequest{} } -func (m *StartClustersRequest) String() string { return proto.CompactTextString(m) } -func (*StartClustersRequest) ProtoMessage() {} -func (*StartClustersRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_3cfb3b8ec240c376, []int{48} -} - -func (m *StartClustersRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_StartClustersRequest.Unmarshal(m, b) -} -func (m *StartClustersRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_StartClustersRequest.Marshal(b, m, deterministic) -} -func (m *StartClustersRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_StartClustersRequest.Merge(m, src) -} -func (m *StartClustersRequest) XXX_Size() int { - return xxx_messageInfo_StartClustersRequest.Size(m) -} -func (m *StartClustersRequest) XXX_DiscardUnknown() { - xxx_messageInfo_StartClustersRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_StartClustersRequest proto.InternalMessageInfo - -func (m *StartClustersRequest) GetClusterId() []string { - if m != nil { - return m.ClusterId - } - return nil -} - -func (m *StartClustersRequest) GetAdvancedParam() []string { - if m != nil { - return m.AdvancedParam - } - return nil -} - -type StartClustersResponse struct { - // ids of clusters started - ClusterId []string `protobuf:"bytes,1,rep,name=cluster_id,json=clusterId,proto3" json:"cluster_id,omitempty"` - // job ids - JobId []string `protobuf:"bytes,2,rep,name=job_id,json=jobId,proto3" json:"job_id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *StartClustersResponse) Reset() { *m = StartClustersResponse{} } -func (m *StartClustersResponse) String() string { return proto.CompactTextString(m) } -func (*StartClustersResponse) ProtoMessage() {} -func (*StartClustersResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_3cfb3b8ec240c376, []int{49} -} - -func (m *StartClustersResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_StartClustersResponse.Unmarshal(m, b) -} -func (m *StartClustersResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_StartClustersResponse.Marshal(b, m, deterministic) -} -func (m *StartClustersResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_StartClustersResponse.Merge(m, src) -} -func (m *StartClustersResponse) XXX_Size() int { - return xxx_messageInfo_StartClustersResponse.Size(m) -} -func (m *StartClustersResponse) XXX_DiscardUnknown() { - xxx_messageInfo_StartClustersResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_StartClustersResponse proto.InternalMessageInfo - -func (m *StartClustersResponse) GetClusterId() []string { - if m != nil { - return m.ClusterId - } - return nil -} - -func (m *StartClustersResponse) GetJobId() []string { - if m != nil { - return m.JobId - } - return nil -} - -type RecoverClustersRequest struct { - // required, ids of clusters to recover - ClusterId []string `protobuf:"bytes,1,rep,name=cluster_id,json=clusterId,proto3" json:"cluster_id,omitempty"` - // advanced param - AdvancedParam []string `protobuf:"bytes,2,rep,name=advanced_param,json=advancedParam,proto3" json:"advanced_param,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *RecoverClustersRequest) Reset() { *m = RecoverClustersRequest{} } -func (m *RecoverClustersRequest) String() string { return proto.CompactTextString(m) } -func (*RecoverClustersRequest) ProtoMessage() {} -func (*RecoverClustersRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_3cfb3b8ec240c376, []int{50} -} - -func (m *RecoverClustersRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_RecoverClustersRequest.Unmarshal(m, b) -} -func (m *RecoverClustersRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_RecoverClustersRequest.Marshal(b, m, deterministic) -} -func (m *RecoverClustersRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_RecoverClustersRequest.Merge(m, src) -} -func (m *RecoverClustersRequest) XXX_Size() int { - return xxx_messageInfo_RecoverClustersRequest.Size(m) -} -func (m *RecoverClustersRequest) XXX_DiscardUnknown() { - xxx_messageInfo_RecoverClustersRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_RecoverClustersRequest proto.InternalMessageInfo - -func (m *RecoverClustersRequest) GetClusterId() []string { - if m != nil { - return m.ClusterId - } - return nil -} - -func (m *RecoverClustersRequest) GetAdvancedParam() []string { - if m != nil { - return m.AdvancedParam - } - return nil -} - -type RecoverClustersResponse struct { - // ids of cluster recovered - ClusterId []string `protobuf:"bytes,1,rep,name=cluster_id,json=clusterId,proto3" json:"cluster_id,omitempty"` - // ids of job of recover cluster - JobId []string `protobuf:"bytes,2,rep,name=job_id,json=jobId,proto3" json:"job_id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *RecoverClustersResponse) Reset() { *m = RecoverClustersResponse{} } -func (m *RecoverClustersResponse) String() string { return proto.CompactTextString(m) } -func (*RecoverClustersResponse) ProtoMessage() {} -func (*RecoverClustersResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_3cfb3b8ec240c376, []int{51} -} - -func (m *RecoverClustersResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_RecoverClustersResponse.Unmarshal(m, b) -} -func (m *RecoverClustersResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_RecoverClustersResponse.Marshal(b, m, deterministic) -} -func (m *RecoverClustersResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_RecoverClustersResponse.Merge(m, src) -} -func (m *RecoverClustersResponse) XXX_Size() int { - return xxx_messageInfo_RecoverClustersResponse.Size(m) -} -func (m *RecoverClustersResponse) XXX_DiscardUnknown() { - xxx_messageInfo_RecoverClustersResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_RecoverClustersResponse proto.InternalMessageInfo - -func (m *RecoverClustersResponse) GetClusterId() []string { - if m != nil { - return m.ClusterId - } - return nil -} - -func (m *RecoverClustersResponse) GetJobId() []string { - if m != nil { - return m.JobId - } - return nil -} - -type CeaseClustersRequest struct { - // required, ids of cluster to cease - ClusterId []string `protobuf:"bytes,1,rep,name=cluster_id,json=clusterId,proto3" json:"cluster_id,omitempty"` - // advanced param - AdvancedParam []string `protobuf:"bytes,2,rep,name=advanced_param,json=advancedParam,proto3" json:"advanced_param,omitempty"` - // whether force delete clusters or not - Force *wrappers.BoolValue `protobuf:"bytes,3,opt,name=force,proto3" json:"force,omitempty"` - // timeout(s), when delete clusters - GracePeriod uint32 `protobuf:"varint,4,opt,name=grace_period,json=gracePeriod,proto3" json:"grace_period,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *CeaseClustersRequest) Reset() { *m = CeaseClustersRequest{} } -func (m *CeaseClustersRequest) String() string { return proto.CompactTextString(m) } -func (*CeaseClustersRequest) ProtoMessage() {} -func (*CeaseClustersRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_3cfb3b8ec240c376, []int{52} -} - -func (m *CeaseClustersRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_CeaseClustersRequest.Unmarshal(m, b) -} -func (m *CeaseClustersRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_CeaseClustersRequest.Marshal(b, m, deterministic) -} -func (m *CeaseClustersRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_CeaseClustersRequest.Merge(m, src) -} -func (m *CeaseClustersRequest) XXX_Size() int { - return xxx_messageInfo_CeaseClustersRequest.Size(m) -} -func (m *CeaseClustersRequest) XXX_DiscardUnknown() { - xxx_messageInfo_CeaseClustersRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_CeaseClustersRequest proto.InternalMessageInfo - -func (m *CeaseClustersRequest) GetClusterId() []string { - if m != nil { - return m.ClusterId - } - return nil -} - -func (m *CeaseClustersRequest) GetAdvancedParam() []string { - if m != nil { - return m.AdvancedParam - } - return nil -} - -func (m *CeaseClustersRequest) GetForce() *wrappers.BoolValue { - if m != nil { - return m.Force - } - return nil -} - -func (m *CeaseClustersRequest) GetGracePeriod() uint32 { - if m != nil { - return m.GracePeriod - } - return 0 -} - -type CeaseClustersResponse struct { - // ids of cluster ceased - ClusterId []string `protobuf:"bytes,1,rep,name=cluster_id,json=clusterId,proto3" json:"cluster_id,omitempty"` - // ids of job of cease cluster - JobId []string `protobuf:"bytes,2,rep,name=job_id,json=jobId,proto3" json:"job_id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *CeaseClustersResponse) Reset() { *m = CeaseClustersResponse{} } -func (m *CeaseClustersResponse) String() string { return proto.CompactTextString(m) } -func (*CeaseClustersResponse) ProtoMessage() {} -func (*CeaseClustersResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_3cfb3b8ec240c376, []int{53} -} - -func (m *CeaseClustersResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_CeaseClustersResponse.Unmarshal(m, b) -} -func (m *CeaseClustersResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_CeaseClustersResponse.Marshal(b, m, deterministic) -} -func (m *CeaseClustersResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_CeaseClustersResponse.Merge(m, src) -} -func (m *CeaseClustersResponse) XXX_Size() int { - return xxx_messageInfo_CeaseClustersResponse.Size(m) -} -func (m *CeaseClustersResponse) XXX_DiscardUnknown() { - xxx_messageInfo_CeaseClustersResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_CeaseClustersResponse proto.InternalMessageInfo - -func (m *CeaseClustersResponse) GetClusterId() []string { - if m != nil { - return m.ClusterId - } - return nil -} - -func (m *CeaseClustersResponse) GetJobId() []string { - if m != nil { - return m.JobId - } - return nil -} - -type GetClusterStatisticsRequest struct { - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *GetClusterStatisticsRequest) Reset() { *m = GetClusterStatisticsRequest{} } -func (m *GetClusterStatisticsRequest) String() string { return proto.CompactTextString(m) } -func (*GetClusterStatisticsRequest) ProtoMessage() {} -func (*GetClusterStatisticsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_3cfb3b8ec240c376, []int{54} -} - -func (m *GetClusterStatisticsRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_GetClusterStatisticsRequest.Unmarshal(m, b) -} -func (m *GetClusterStatisticsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_GetClusterStatisticsRequest.Marshal(b, m, deterministic) -} -func (m *GetClusterStatisticsRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetClusterStatisticsRequest.Merge(m, src) -} -func (m *GetClusterStatisticsRequest) XXX_Size() int { - return xxx_messageInfo_GetClusterStatisticsRequest.Size(m) -} -func (m *GetClusterStatisticsRequest) XXX_DiscardUnknown() { - xxx_messageInfo_GetClusterStatisticsRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_GetClusterStatisticsRequest proto.InternalMessageInfo - -type GetClusterStatisticsResponse struct { - // cluster create time range map to cluster count, max length is 14 - LastTwoWeekCreated map[string]uint32 `protobuf:"bytes,1,rep,name=last_two_week_created,json=lastTwoWeekCreated,proto3" json:"last_two_week_created,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` - // runtime id map to cluster count, max length is 10 - TopTenRuntimes map[string]uint32 `protobuf:"bytes,2,rep,name=top_ten_runtimes,json=topTenRuntimes,proto3" json:"top_ten_runtimes,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` - // number of cluster - ClusterCount uint32 `protobuf:"varint,3,opt,name=cluster_count,json=clusterCount,proto3" json:"cluster_count,omitempty"` - // number of runtime - RuntimeCount uint32 `protobuf:"varint,4,opt,name=runtime_count,json=runtimeCount,proto3" json:"runtime_count,omitempty"` - // app id map to cluster count, max length is 10 - TopTenApps map[string]uint32 `protobuf:"bytes,5,rep,name=top_ten_apps,json=topTenApps,proto3" json:"top_ten_apps,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *GetClusterStatisticsResponse) Reset() { *m = GetClusterStatisticsResponse{} } -func (m *GetClusterStatisticsResponse) String() string { return proto.CompactTextString(m) } -func (*GetClusterStatisticsResponse) ProtoMessage() {} -func (*GetClusterStatisticsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_3cfb3b8ec240c376, []int{55} -} - -func (m *GetClusterStatisticsResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_GetClusterStatisticsResponse.Unmarshal(m, b) -} -func (m *GetClusterStatisticsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_GetClusterStatisticsResponse.Marshal(b, m, deterministic) -} -func (m *GetClusterStatisticsResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetClusterStatisticsResponse.Merge(m, src) -} -func (m *GetClusterStatisticsResponse) XXX_Size() int { - return xxx_messageInfo_GetClusterStatisticsResponse.Size(m) -} -func (m *GetClusterStatisticsResponse) XXX_DiscardUnknown() { - xxx_messageInfo_GetClusterStatisticsResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_GetClusterStatisticsResponse proto.InternalMessageInfo - -func (m *GetClusterStatisticsResponse) GetLastTwoWeekCreated() map[string]uint32 { - if m != nil { - return m.LastTwoWeekCreated - } - return nil -} - -func (m *GetClusterStatisticsResponse) GetTopTenRuntimes() map[string]uint32 { - if m != nil { - return m.TopTenRuntimes - } - return nil -} - -func (m *GetClusterStatisticsResponse) GetClusterCount() uint32 { - if m != nil { - return m.ClusterCount - } - return 0 -} - -func (m *GetClusterStatisticsResponse) GetRuntimeCount() uint32 { - if m != nil { - return m.RuntimeCount - } - return 0 -} - -func (m *GetClusterStatisticsResponse) GetTopTenApps() map[string]uint32 { - if m != nil { - return m.TopTenApps - } - return nil -} - -type KeyPair struct { - // ssh key pair id - KeyPairId *wrappers.StringValue `protobuf:"bytes,1,opt,name=key_pair_id,json=keyPairId,proto3" json:"key_pair_id,omitempty"` - // key pair name - Name *wrappers.StringValue `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - // key pair description - Description *wrappers.StringValue `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` - // public key - PubKey *wrappers.StringValue `protobuf:"bytes,4,opt,name=pub_key,json=pubKey,proto3" json:"pub_key,omitempty"` - // owner path, concat string group_path:user_id - OwnerPath *wrappers.StringValue `protobuf:"bytes,5,opt,name=owner_path,json=ownerPath,proto3" json:"owner_path,omitempty"` - // the time when key pair create - CreateTime *timestamp.Timestamp `protobuf:"bytes,6,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty"` - // record status changed time - StatusTime *timestamp.Timestamp `protobuf:"bytes,7,opt,name=status_time,json=statusTime,proto3" json:"status_time,omitempty"` - // list of node used the keypair - NodeId []string `protobuf:"bytes,8,rep,name=node_id,json=nodeId,proto3" json:"node_id,omitempty"` - // owner - Owner *wrappers.StringValue `protobuf:"bytes,9,opt,name=owner,proto3" json:"owner,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *KeyPair) Reset() { *m = KeyPair{} } -func (m *KeyPair) String() string { return proto.CompactTextString(m) } -func (*KeyPair) ProtoMessage() {} -func (*KeyPair) Descriptor() ([]byte, []int) { - return fileDescriptor_3cfb3b8ec240c376, []int{56} -} - -func (m *KeyPair) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_KeyPair.Unmarshal(m, b) -} -func (m *KeyPair) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_KeyPair.Marshal(b, m, deterministic) -} -func (m *KeyPair) XXX_Merge(src proto.Message) { - xxx_messageInfo_KeyPair.Merge(m, src) -} -func (m *KeyPair) XXX_Size() int { - return xxx_messageInfo_KeyPair.Size(m) -} -func (m *KeyPair) XXX_DiscardUnknown() { - xxx_messageInfo_KeyPair.DiscardUnknown(m) -} - -var xxx_messageInfo_KeyPair proto.InternalMessageInfo - -func (m *KeyPair) GetKeyPairId() *wrappers.StringValue { - if m != nil { - return m.KeyPairId - } - return nil -} - -func (m *KeyPair) GetName() *wrappers.StringValue { - if m != nil { - return m.Name - } - return nil -} - -func (m *KeyPair) GetDescription() *wrappers.StringValue { - if m != nil { - return m.Description - } - return nil -} - -func (m *KeyPair) GetPubKey() *wrappers.StringValue { - if m != nil { - return m.PubKey - } - return nil -} - -func (m *KeyPair) GetOwnerPath() *wrappers.StringValue { - if m != nil { - return m.OwnerPath - } - return nil -} - -func (m *KeyPair) GetCreateTime() *timestamp.Timestamp { - if m != nil { - return m.CreateTime - } - return nil -} - -func (m *KeyPair) GetStatusTime() *timestamp.Timestamp { - if m != nil { - return m.StatusTime - } - return nil -} - -func (m *KeyPair) GetNodeId() []string { - if m != nil { - return m.NodeId - } - return nil -} - -func (m *KeyPair) GetOwner() *wrappers.StringValue { - if m != nil { - return m.Owner - } - return nil -} - -type CreateKeyPairRequest struct { - // keypair name - Name *wrappers.StringValue `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - // keypair description - Description *wrappers.StringValue `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` - // public key - PubKey *wrappers.StringValue `protobuf:"bytes,3,opt,name=pub_key,json=pubKey,proto3" json:"pub_key,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *CreateKeyPairRequest) Reset() { *m = CreateKeyPairRequest{} } -func (m *CreateKeyPairRequest) String() string { return proto.CompactTextString(m) } -func (*CreateKeyPairRequest) ProtoMessage() {} -func (*CreateKeyPairRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_3cfb3b8ec240c376, []int{57} -} - -func (m *CreateKeyPairRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_CreateKeyPairRequest.Unmarshal(m, b) -} -func (m *CreateKeyPairRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_CreateKeyPairRequest.Marshal(b, m, deterministic) -} -func (m *CreateKeyPairRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_CreateKeyPairRequest.Merge(m, src) -} -func (m *CreateKeyPairRequest) XXX_Size() int { - return xxx_messageInfo_CreateKeyPairRequest.Size(m) -} -func (m *CreateKeyPairRequest) XXX_DiscardUnknown() { - xxx_messageInfo_CreateKeyPairRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_CreateKeyPairRequest proto.InternalMessageInfo - -func (m *CreateKeyPairRequest) GetName() *wrappers.StringValue { - if m != nil { - return m.Name - } - return nil -} - -func (m *CreateKeyPairRequest) GetDescription() *wrappers.StringValue { - if m != nil { - return m.Description - } - return nil -} - -func (m *CreateKeyPairRequest) GetPubKey() *wrappers.StringValue { - if m != nil { - return m.PubKey - } - return nil -} - -type CreateKeyPairResponse struct { - // id of key pair created - KeyPairId *wrappers.StringValue `protobuf:"bytes,1,opt,name=key_pair_id,json=keyPairId,proto3" json:"key_pair_id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *CreateKeyPairResponse) Reset() { *m = CreateKeyPairResponse{} } -func (m *CreateKeyPairResponse) String() string { return proto.CompactTextString(m) } -func (*CreateKeyPairResponse) ProtoMessage() {} -func (*CreateKeyPairResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_3cfb3b8ec240c376, []int{58} -} - -func (m *CreateKeyPairResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_CreateKeyPairResponse.Unmarshal(m, b) -} -func (m *CreateKeyPairResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_CreateKeyPairResponse.Marshal(b, m, deterministic) -} -func (m *CreateKeyPairResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_CreateKeyPairResponse.Merge(m, src) -} -func (m *CreateKeyPairResponse) XXX_Size() int { - return xxx_messageInfo_CreateKeyPairResponse.Size(m) -} -func (m *CreateKeyPairResponse) XXX_DiscardUnknown() { - xxx_messageInfo_CreateKeyPairResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_CreateKeyPairResponse proto.InternalMessageInfo - -func (m *CreateKeyPairResponse) GetKeyPairId() *wrappers.StringValue { - if m != nil { - return m.KeyPairId - } - return nil -} - -type DescribeKeyPairsRequest struct { - // key pair id - KeyPairId *wrappers.StringValue `protobuf:"bytes,1,opt,name=key_pair_id,json=keyPairId,proto3" json:"key_pair_id,omitempty"` - // key pair name - Name *wrappers.StringValue `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - // key pair description - Description *wrappers.StringValue `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` - // public key - PubKey *wrappers.StringValue `protobuf:"bytes,4,opt,name=pub_key,json=pubKey,proto3" json:"pub_key,omitempty"` - // owner - Owner []string `protobuf:"bytes,5,rep,name=owner,proto3" json:"owner,omitempty"` - // query key, can filter with these fields(key_pair_id, name, owner) - SearchWord *wrappers.StringValue `protobuf:"bytes,6,opt,name=search_word,json=searchWord,proto3" json:"search_word,omitempty"` - // data limit per page, default value 20, max value 200 - Limit uint32 `protobuf:"varint,7,opt,name=limit,proto3" json:"limit,omitempty"` - // data offset, default 0 - Offset uint32 `protobuf:"varint,8,opt,name=offset,proto3" json:"offset,omitempty"` - // select columns to display - DisplayColumns []string `protobuf:"bytes,9,rep,name=display_columns,json=displayColumns,proto3" json:"display_columns,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *DescribeKeyPairsRequest) Reset() { *m = DescribeKeyPairsRequest{} } -func (m *DescribeKeyPairsRequest) String() string { return proto.CompactTextString(m) } -func (*DescribeKeyPairsRequest) ProtoMessage() {} -func (*DescribeKeyPairsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_3cfb3b8ec240c376, []int{59} -} - -func (m *DescribeKeyPairsRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_DescribeKeyPairsRequest.Unmarshal(m, b) -} -func (m *DescribeKeyPairsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_DescribeKeyPairsRequest.Marshal(b, m, deterministic) -} -func (m *DescribeKeyPairsRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_DescribeKeyPairsRequest.Merge(m, src) -} -func (m *DescribeKeyPairsRequest) XXX_Size() int { - return xxx_messageInfo_DescribeKeyPairsRequest.Size(m) -} -func (m *DescribeKeyPairsRequest) XXX_DiscardUnknown() { - xxx_messageInfo_DescribeKeyPairsRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_DescribeKeyPairsRequest proto.InternalMessageInfo - -func (m *DescribeKeyPairsRequest) GetKeyPairId() *wrappers.StringValue { - if m != nil { - return m.KeyPairId - } - return nil -} - -func (m *DescribeKeyPairsRequest) GetName() *wrappers.StringValue { - if m != nil { - return m.Name - } - return nil -} - -func (m *DescribeKeyPairsRequest) GetDescription() *wrappers.StringValue { - if m != nil { - return m.Description - } - return nil -} - -func (m *DescribeKeyPairsRequest) GetPubKey() *wrappers.StringValue { - if m != nil { - return m.PubKey - } - return nil -} - -func (m *DescribeKeyPairsRequest) GetOwner() []string { - if m != nil { - return m.Owner - } - return nil -} - -func (m *DescribeKeyPairsRequest) GetSearchWord() *wrappers.StringValue { - if m != nil { - return m.SearchWord - } - return nil -} - -func (m *DescribeKeyPairsRequest) GetLimit() uint32 { - if m != nil { - return m.Limit - } - return 0 -} - -func (m *DescribeKeyPairsRequest) GetOffset() uint32 { - if m != nil { - return m.Offset - } - return 0 -} - -func (m *DescribeKeyPairsRequest) GetDisplayColumns() []string { - if m != nil { - return m.DisplayColumns - } - return nil -} - -type DescribeKeyPairsResponse struct { - // total count of qualified key pair - TotalCount uint32 `protobuf:"varint,1,opt,name=total_count,json=totalCount,proto3" json:"total_count,omitempty"` - // list of key pair - KeyPairSet []*KeyPair `protobuf:"bytes,2,rep,name=key_pair_set,json=keyPairSet,proto3" json:"key_pair_set,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *DescribeKeyPairsResponse) Reset() { *m = DescribeKeyPairsResponse{} } -func (m *DescribeKeyPairsResponse) String() string { return proto.CompactTextString(m) } -func (*DescribeKeyPairsResponse) ProtoMessage() {} -func (*DescribeKeyPairsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_3cfb3b8ec240c376, []int{60} -} - -func (m *DescribeKeyPairsResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_DescribeKeyPairsResponse.Unmarshal(m, b) -} -func (m *DescribeKeyPairsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_DescribeKeyPairsResponse.Marshal(b, m, deterministic) -} -func (m *DescribeKeyPairsResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_DescribeKeyPairsResponse.Merge(m, src) -} -func (m *DescribeKeyPairsResponse) XXX_Size() int { - return xxx_messageInfo_DescribeKeyPairsResponse.Size(m) -} -func (m *DescribeKeyPairsResponse) XXX_DiscardUnknown() { - xxx_messageInfo_DescribeKeyPairsResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_DescribeKeyPairsResponse proto.InternalMessageInfo - -func (m *DescribeKeyPairsResponse) GetTotalCount() uint32 { - if m != nil { - return m.TotalCount - } - return 0 -} - -func (m *DescribeKeyPairsResponse) GetKeyPairSet() []*KeyPair { - if m != nil { - return m.KeyPairSet - } - return nil -} - -type DeleteKeyPairsRequest struct { - // required, ids of key pairs to delete - KeyPairId []string `protobuf:"bytes,1,rep,name=key_pair_id,json=keyPairId,proto3" json:"key_pair_id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *DeleteKeyPairsRequest) Reset() { *m = DeleteKeyPairsRequest{} } -func (m *DeleteKeyPairsRequest) String() string { return proto.CompactTextString(m) } -func (*DeleteKeyPairsRequest) ProtoMessage() {} -func (*DeleteKeyPairsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_3cfb3b8ec240c376, []int{61} -} - -func (m *DeleteKeyPairsRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_DeleteKeyPairsRequest.Unmarshal(m, b) -} -func (m *DeleteKeyPairsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_DeleteKeyPairsRequest.Marshal(b, m, deterministic) -} -func (m *DeleteKeyPairsRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_DeleteKeyPairsRequest.Merge(m, src) -} -func (m *DeleteKeyPairsRequest) XXX_Size() int { - return xxx_messageInfo_DeleteKeyPairsRequest.Size(m) -} -func (m *DeleteKeyPairsRequest) XXX_DiscardUnknown() { - xxx_messageInfo_DeleteKeyPairsRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_DeleteKeyPairsRequest proto.InternalMessageInfo - -func (m *DeleteKeyPairsRequest) GetKeyPairId() []string { - if m != nil { - return m.KeyPairId - } - return nil -} - -type DeleteKeyPairsResponse struct { - // ids of key pairs deleted - KeyPairId []string `protobuf:"bytes,1,rep,name=key_pair_id,json=keyPairId,proto3" json:"key_pair_id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *DeleteKeyPairsResponse) Reset() { *m = DeleteKeyPairsResponse{} } -func (m *DeleteKeyPairsResponse) String() string { return proto.CompactTextString(m) } -func (*DeleteKeyPairsResponse) ProtoMessage() {} -func (*DeleteKeyPairsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_3cfb3b8ec240c376, []int{62} -} - -func (m *DeleteKeyPairsResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_DeleteKeyPairsResponse.Unmarshal(m, b) -} -func (m *DeleteKeyPairsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_DeleteKeyPairsResponse.Marshal(b, m, deterministic) -} -func (m *DeleteKeyPairsResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_DeleteKeyPairsResponse.Merge(m, src) -} -func (m *DeleteKeyPairsResponse) XXX_Size() int { - return xxx_messageInfo_DeleteKeyPairsResponse.Size(m) -} -func (m *DeleteKeyPairsResponse) XXX_DiscardUnknown() { - xxx_messageInfo_DeleteKeyPairsResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_DeleteKeyPairsResponse proto.InternalMessageInfo - -func (m *DeleteKeyPairsResponse) GetKeyPairId() []string { - if m != nil { - return m.KeyPairId - } - return nil -} - -type AttachKeyPairsRequest struct { - // ids of key pairs to attach - KeyPairId []string `protobuf:"bytes,1,rep,name=key_pair_id,json=keyPairId,proto3" json:"key_pair_id,omitempty"` - // ids of node to attached - NodeId []string `protobuf:"bytes,2,rep,name=node_id,json=nodeId,proto3" json:"node_id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *AttachKeyPairsRequest) Reset() { *m = AttachKeyPairsRequest{} } -func (m *AttachKeyPairsRequest) String() string { return proto.CompactTextString(m) } -func (*AttachKeyPairsRequest) ProtoMessage() {} -func (*AttachKeyPairsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_3cfb3b8ec240c376, []int{63} -} - -func (m *AttachKeyPairsRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_AttachKeyPairsRequest.Unmarshal(m, b) -} -func (m *AttachKeyPairsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_AttachKeyPairsRequest.Marshal(b, m, deterministic) -} -func (m *AttachKeyPairsRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_AttachKeyPairsRequest.Merge(m, src) -} -func (m *AttachKeyPairsRequest) XXX_Size() int { - return xxx_messageInfo_AttachKeyPairsRequest.Size(m) -} -func (m *AttachKeyPairsRequest) XXX_DiscardUnknown() { - xxx_messageInfo_AttachKeyPairsRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_AttachKeyPairsRequest proto.InternalMessageInfo - -func (m *AttachKeyPairsRequest) GetKeyPairId() []string { - if m != nil { - return m.KeyPairId - } - return nil -} - -func (m *AttachKeyPairsRequest) GetNodeId() []string { - if m != nil { - return m.NodeId - } - return nil -} - -type AttachKeyPairsResponse struct { - // ids of jobs of attach key pair - JobId []string `protobuf:"bytes,1,rep,name=job_id,json=jobId,proto3" json:"job_id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *AttachKeyPairsResponse) Reset() { *m = AttachKeyPairsResponse{} } -func (m *AttachKeyPairsResponse) String() string { return proto.CompactTextString(m) } -func (*AttachKeyPairsResponse) ProtoMessage() {} -func (*AttachKeyPairsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_3cfb3b8ec240c376, []int{64} -} - -func (m *AttachKeyPairsResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_AttachKeyPairsResponse.Unmarshal(m, b) -} -func (m *AttachKeyPairsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_AttachKeyPairsResponse.Marshal(b, m, deterministic) -} -func (m *AttachKeyPairsResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_AttachKeyPairsResponse.Merge(m, src) -} -func (m *AttachKeyPairsResponse) XXX_Size() int { - return xxx_messageInfo_AttachKeyPairsResponse.Size(m) -} -func (m *AttachKeyPairsResponse) XXX_DiscardUnknown() { - xxx_messageInfo_AttachKeyPairsResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_AttachKeyPairsResponse proto.InternalMessageInfo - -func (m *AttachKeyPairsResponse) GetJobId() []string { - if m != nil { - return m.JobId - } - return nil -} - -type DetachKeyPairsRequest struct { - // ids of key pairs to detach - KeyPairId []string `protobuf:"bytes,1,rep,name=key_pair_id,json=keyPairId,proto3" json:"key_pair_id,omitempty"` - // ids of nodes to detached - NodeId []string `protobuf:"bytes,2,rep,name=node_id,json=nodeId,proto3" json:"node_id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *DetachKeyPairsRequest) Reset() { *m = DetachKeyPairsRequest{} } -func (m *DetachKeyPairsRequest) String() string { return proto.CompactTextString(m) } -func (*DetachKeyPairsRequest) ProtoMessage() {} -func (*DetachKeyPairsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_3cfb3b8ec240c376, []int{65} -} - -func (m *DetachKeyPairsRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_DetachKeyPairsRequest.Unmarshal(m, b) -} -func (m *DetachKeyPairsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_DetachKeyPairsRequest.Marshal(b, m, deterministic) -} -func (m *DetachKeyPairsRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_DetachKeyPairsRequest.Merge(m, src) -} -func (m *DetachKeyPairsRequest) XXX_Size() int { - return xxx_messageInfo_DetachKeyPairsRequest.Size(m) -} -func (m *DetachKeyPairsRequest) XXX_DiscardUnknown() { - xxx_messageInfo_DetachKeyPairsRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_DetachKeyPairsRequest proto.InternalMessageInfo - -func (m *DetachKeyPairsRequest) GetKeyPairId() []string { - if m != nil { - return m.KeyPairId - } - return nil -} - -func (m *DetachKeyPairsRequest) GetNodeId() []string { - if m != nil { - return m.NodeId - } - return nil -} - -type DetachKeyPairsResponse struct { - // ids of jobs of detach key pair - JobId []string `protobuf:"bytes,1,rep,name=job_id,json=jobId,proto3" json:"job_id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *DetachKeyPairsResponse) Reset() { *m = DetachKeyPairsResponse{} } -func (m *DetachKeyPairsResponse) String() string { return proto.CompactTextString(m) } -func (*DetachKeyPairsResponse) ProtoMessage() {} -func (*DetachKeyPairsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_3cfb3b8ec240c376, []int{66} -} - -func (m *DetachKeyPairsResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_DetachKeyPairsResponse.Unmarshal(m, b) -} -func (m *DetachKeyPairsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_DetachKeyPairsResponse.Marshal(b, m, deterministic) -} -func (m *DetachKeyPairsResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_DetachKeyPairsResponse.Merge(m, src) -} -func (m *DetachKeyPairsResponse) XXX_Size() int { - return xxx_messageInfo_DetachKeyPairsResponse.Size(m) -} -func (m *DetachKeyPairsResponse) XXX_DiscardUnknown() { - xxx_messageInfo_DetachKeyPairsResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_DetachKeyPairsResponse proto.InternalMessageInfo - -func (m *DetachKeyPairsResponse) GetJobId() []string { - if m != nil { - return m.JobId - } - return nil -} - -type NodeKeyPair struct { - // id of node with key pair - NodeId *wrappers.StringValue `protobuf:"bytes,1,opt,name=node_id,json=nodeId,proto3" json:"node_id,omitempty"` - // id of key pair in node - KeyPairId *wrappers.StringValue `protobuf:"bytes,2,opt,name=key_pair_id,json=keyPairId,proto3" json:"key_pair_id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *NodeKeyPair) Reset() { *m = NodeKeyPair{} } -func (m *NodeKeyPair) String() string { return proto.CompactTextString(m) } -func (*NodeKeyPair) ProtoMessage() {} -func (*NodeKeyPair) Descriptor() ([]byte, []int) { - return fileDescriptor_3cfb3b8ec240c376, []int{67} -} - -func (m *NodeKeyPair) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_NodeKeyPair.Unmarshal(m, b) -} -func (m *NodeKeyPair) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_NodeKeyPair.Marshal(b, m, deterministic) -} -func (m *NodeKeyPair) XXX_Merge(src proto.Message) { - xxx_messageInfo_NodeKeyPair.Merge(m, src) -} -func (m *NodeKeyPair) XXX_Size() int { - return xxx_messageInfo_NodeKeyPair.Size(m) -} -func (m *NodeKeyPair) XXX_DiscardUnknown() { - xxx_messageInfo_NodeKeyPair.DiscardUnknown(m) -} - -var xxx_messageInfo_NodeKeyPair proto.InternalMessageInfo - -func (m *NodeKeyPair) GetNodeId() *wrappers.StringValue { - if m != nil { - return m.NodeId - } - return nil -} - -func (m *NodeKeyPair) GetKeyPairId() *wrappers.StringValue { - if m != nil { - return m.KeyPairId - } - return nil -} - -type AddNodeKeyPairsRequest struct { - // list of node with key pair to add - NodeKeyPair []*NodeKeyPair `protobuf:"bytes,1,rep,name=node_key_pair,json=nodeKeyPair,proto3" json:"node_key_pair,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *AddNodeKeyPairsRequest) Reset() { *m = AddNodeKeyPairsRequest{} } -func (m *AddNodeKeyPairsRequest) String() string { return proto.CompactTextString(m) } -func (*AddNodeKeyPairsRequest) ProtoMessage() {} -func (*AddNodeKeyPairsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_3cfb3b8ec240c376, []int{68} -} - -func (m *AddNodeKeyPairsRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_AddNodeKeyPairsRequest.Unmarshal(m, b) -} -func (m *AddNodeKeyPairsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_AddNodeKeyPairsRequest.Marshal(b, m, deterministic) -} -func (m *AddNodeKeyPairsRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_AddNodeKeyPairsRequest.Merge(m, src) -} -func (m *AddNodeKeyPairsRequest) XXX_Size() int { - return xxx_messageInfo_AddNodeKeyPairsRequest.Size(m) -} -func (m *AddNodeKeyPairsRequest) XXX_DiscardUnknown() { - xxx_messageInfo_AddNodeKeyPairsRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_AddNodeKeyPairsRequest proto.InternalMessageInfo - -func (m *AddNodeKeyPairsRequest) GetNodeKeyPair() []*NodeKeyPair { - if m != nil { - return m.NodeKeyPair - } - return nil -} - -type AddNodeKeyPairsResponse struct { - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *AddNodeKeyPairsResponse) Reset() { *m = AddNodeKeyPairsResponse{} } -func (m *AddNodeKeyPairsResponse) String() string { return proto.CompactTextString(m) } -func (*AddNodeKeyPairsResponse) ProtoMessage() {} -func (*AddNodeKeyPairsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_3cfb3b8ec240c376, []int{69} -} - -func (m *AddNodeKeyPairsResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_AddNodeKeyPairsResponse.Unmarshal(m, b) -} -func (m *AddNodeKeyPairsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_AddNodeKeyPairsResponse.Marshal(b, m, deterministic) -} -func (m *AddNodeKeyPairsResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_AddNodeKeyPairsResponse.Merge(m, src) -} -func (m *AddNodeKeyPairsResponse) XXX_Size() int { - return xxx_messageInfo_AddNodeKeyPairsResponse.Size(m) -} -func (m *AddNodeKeyPairsResponse) XXX_DiscardUnknown() { - xxx_messageInfo_AddNodeKeyPairsResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_AddNodeKeyPairsResponse proto.InternalMessageInfo - -type DeleteNodeKeyPairsRequest struct { - // list of node with key pair to delete - NodeKeyPair []*NodeKeyPair `protobuf:"bytes,1,rep,name=node_key_pair,json=nodeKeyPair,proto3" json:"node_key_pair,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *DeleteNodeKeyPairsRequest) Reset() { *m = DeleteNodeKeyPairsRequest{} } -func (m *DeleteNodeKeyPairsRequest) String() string { return proto.CompactTextString(m) } -func (*DeleteNodeKeyPairsRequest) ProtoMessage() {} -func (*DeleteNodeKeyPairsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_3cfb3b8ec240c376, []int{70} -} - -func (m *DeleteNodeKeyPairsRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_DeleteNodeKeyPairsRequest.Unmarshal(m, b) -} -func (m *DeleteNodeKeyPairsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_DeleteNodeKeyPairsRequest.Marshal(b, m, deterministic) -} -func (m *DeleteNodeKeyPairsRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_DeleteNodeKeyPairsRequest.Merge(m, src) -} -func (m *DeleteNodeKeyPairsRequest) XXX_Size() int { - return xxx_messageInfo_DeleteNodeKeyPairsRequest.Size(m) -} -func (m *DeleteNodeKeyPairsRequest) XXX_DiscardUnknown() { - xxx_messageInfo_DeleteNodeKeyPairsRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_DeleteNodeKeyPairsRequest proto.InternalMessageInfo - -func (m *DeleteNodeKeyPairsRequest) GetNodeKeyPair() []*NodeKeyPair { - if m != nil { - return m.NodeKeyPair - } - return nil -} - -type DeleteNodeKeyPairsResponse struct { - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *DeleteNodeKeyPairsResponse) Reset() { *m = DeleteNodeKeyPairsResponse{} } -func (m *DeleteNodeKeyPairsResponse) String() string { return proto.CompactTextString(m) } -func (*DeleteNodeKeyPairsResponse) ProtoMessage() {} -func (*DeleteNodeKeyPairsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_3cfb3b8ec240c376, []int{71} -} - -func (m *DeleteNodeKeyPairsResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_DeleteNodeKeyPairsResponse.Unmarshal(m, b) -} -func (m *DeleteNodeKeyPairsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_DeleteNodeKeyPairsResponse.Marshal(b, m, deterministic) -} -func (m *DeleteNodeKeyPairsResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_DeleteNodeKeyPairsResponse.Merge(m, src) -} -func (m *DeleteNodeKeyPairsResponse) XXX_Size() int { - return xxx_messageInfo_DeleteNodeKeyPairsResponse.Size(m) -} -func (m *DeleteNodeKeyPairsResponse) XXX_DiscardUnknown() { - xxx_messageInfo_DeleteNodeKeyPairsResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_DeleteNodeKeyPairsResponse proto.InternalMessageInfo - -func init() { - proto.RegisterType((*DescribeSubnetsRequest)(nil), "openpitrix.DescribeSubnetsRequest") - proto.RegisterType((*Subnet)(nil), "openpitrix.Subnet") - proto.RegisterType((*DescribeSubnetsResponse)(nil), "openpitrix.DescribeSubnetsResponse") - proto.RegisterType((*DeleteClusterInRuntimeRequest)(nil), "openpitrix.DeleteClusterInRuntimeRequest") - proto.RegisterType((*DeleteClusterInRuntimeResponse)(nil), "openpitrix.DeleteClusterInRuntimeResponse") - proto.RegisterType((*MigrateClusterInRuntimeRequest)(nil), "openpitrix.MigrateClusterInRuntimeRequest") - proto.RegisterType((*MigrateClusterInRuntimeResponse)(nil), "openpitrix.MigrateClusterInRuntimeResponse") - proto.RegisterType((*CreateClusterRequest)(nil), "openpitrix.CreateClusterRequest") - proto.RegisterType((*CreateClusterResponse)(nil), "openpitrix.CreateClusterResponse") - proto.RegisterType((*ModifyClusterRequest)(nil), "openpitrix.ModifyClusterRequest") - proto.RegisterType((*ModifyClusterResponse)(nil), "openpitrix.ModifyClusterResponse") - proto.RegisterType((*ModifyClusterNodeRequest)(nil), "openpitrix.ModifyClusterNodeRequest") - proto.RegisterType((*ModifyClusterNodeResponse)(nil), "openpitrix.ModifyClusterNodeResponse") - proto.RegisterType((*ModifyClusterAttributesRequest)(nil), "openpitrix.ModifyClusterAttributesRequest") - proto.RegisterType((*ModifyClusterAttributesResponse)(nil), "openpitrix.ModifyClusterAttributesResponse") - proto.RegisterType((*ModifyClusterNodeAttributesRequest)(nil), "openpitrix.ModifyClusterNodeAttributesRequest") - proto.RegisterType((*ModifyClusterNodeAttributesResponse)(nil), "openpitrix.ModifyClusterNodeAttributesResponse") - proto.RegisterType((*AddTableClusterNodesRequest)(nil), "openpitrix.AddTableClusterNodesRequest") - proto.RegisterType((*DeleteTableClusterNodesRequest)(nil), "openpitrix.DeleteTableClusterNodesRequest") - proto.RegisterType((*DeleteClustersRequest)(nil), "openpitrix.DeleteClustersRequest") - proto.RegisterType((*DeleteClustersResponse)(nil), "openpitrix.DeleteClustersResponse") - proto.RegisterType((*UpgradeClusterRequest)(nil), "openpitrix.UpgradeClusterRequest") - proto.RegisterType((*UpgradeClusterResponse)(nil), "openpitrix.UpgradeClusterResponse") - proto.RegisterType((*RollbackClusterRequest)(nil), "openpitrix.RollbackClusterRequest") - proto.RegisterType((*RollbackClusterResponse)(nil), "openpitrix.RollbackClusterResponse") - proto.RegisterType((*RoleResource)(nil), "openpitrix.RoleResource") - proto.RegisterType((*ResizeClusterRequest)(nil), "openpitrix.ResizeClusterRequest") - proto.RegisterType((*ResizeClusterResponse)(nil), "openpitrix.ResizeClusterResponse") - proto.RegisterType((*AddClusterNodesRequest)(nil), "openpitrix.AddClusterNodesRequest") - proto.RegisterType((*AddClusterNodesResponse)(nil), "openpitrix.AddClusterNodesResponse") - proto.RegisterType((*DeleteClusterNodesRequest)(nil), "openpitrix.DeleteClusterNodesRequest") - proto.RegisterType((*DeleteClusterNodesResponse)(nil), "openpitrix.DeleteClusterNodesResponse") - proto.RegisterType((*UpdateClusterEnvRequest)(nil), "openpitrix.UpdateClusterEnvRequest") - proto.RegisterType((*UpdateClusterEnvResponse)(nil), "openpitrix.UpdateClusterEnvResponse") - proto.RegisterType((*ClusterCommon)(nil), "openpitrix.ClusterCommon") - proto.RegisterType((*ClusterNode)(nil), "openpitrix.ClusterNode") - proto.RegisterType((*ClusterRole)(nil), "openpitrix.ClusterRole") - proto.RegisterType((*ClusterLoadbalancer)(nil), "openpitrix.ClusterLoadbalancer") - proto.RegisterType((*ClusterLink)(nil), "openpitrix.ClusterLink") - proto.RegisterType((*Cluster)(nil), "openpitrix.Cluster") - proto.RegisterType((*DescribeClustersRequest)(nil), "openpitrix.DescribeClustersRequest") - proto.RegisterType((*DescribeClustersResponse)(nil), "openpitrix.DescribeClustersResponse") - proto.RegisterType((*DescribeAppClustersRequest)(nil), "openpitrix.DescribeAppClustersRequest") - proto.RegisterType((*DescribeAppClustersResponse)(nil), "openpitrix.DescribeAppClustersResponse") - proto.RegisterType((*DescribeClusterNodesRequest)(nil), "openpitrix.DescribeClusterNodesRequest") - proto.RegisterType((*DescribeClusterNodesResponse)(nil), "openpitrix.DescribeClusterNodesResponse") - proto.RegisterType((*StopClustersRequest)(nil), "openpitrix.StopClustersRequest") - proto.RegisterType((*StopClustersResponse)(nil), "openpitrix.StopClustersResponse") - proto.RegisterType((*StartClustersRequest)(nil), "openpitrix.StartClustersRequest") - proto.RegisterType((*StartClustersResponse)(nil), "openpitrix.StartClustersResponse") - proto.RegisterType((*RecoverClustersRequest)(nil), "openpitrix.RecoverClustersRequest") - proto.RegisterType((*RecoverClustersResponse)(nil), "openpitrix.RecoverClustersResponse") - proto.RegisterType((*CeaseClustersRequest)(nil), "openpitrix.CeaseClustersRequest") - proto.RegisterType((*CeaseClustersResponse)(nil), "openpitrix.CeaseClustersResponse") - proto.RegisterType((*GetClusterStatisticsRequest)(nil), "openpitrix.GetClusterStatisticsRequest") - proto.RegisterType((*GetClusterStatisticsResponse)(nil), "openpitrix.GetClusterStatisticsResponse") - proto.RegisterMapType((map[string]uint32)(nil), "openpitrix.GetClusterStatisticsResponse.LastTwoWeekCreatedEntry") - proto.RegisterMapType((map[string]uint32)(nil), "openpitrix.GetClusterStatisticsResponse.TopTenAppsEntry") - proto.RegisterMapType((map[string]uint32)(nil), "openpitrix.GetClusterStatisticsResponse.TopTenRuntimesEntry") - proto.RegisterType((*KeyPair)(nil), "openpitrix.KeyPair") - proto.RegisterType((*CreateKeyPairRequest)(nil), "openpitrix.CreateKeyPairRequest") - proto.RegisterType((*CreateKeyPairResponse)(nil), "openpitrix.CreateKeyPairResponse") - proto.RegisterType((*DescribeKeyPairsRequest)(nil), "openpitrix.DescribeKeyPairsRequest") - proto.RegisterType((*DescribeKeyPairsResponse)(nil), "openpitrix.DescribeKeyPairsResponse") - proto.RegisterType((*DeleteKeyPairsRequest)(nil), "openpitrix.DeleteKeyPairsRequest") - proto.RegisterType((*DeleteKeyPairsResponse)(nil), "openpitrix.DeleteKeyPairsResponse") - proto.RegisterType((*AttachKeyPairsRequest)(nil), "openpitrix.AttachKeyPairsRequest") - proto.RegisterType((*AttachKeyPairsResponse)(nil), "openpitrix.AttachKeyPairsResponse") - proto.RegisterType((*DetachKeyPairsRequest)(nil), "openpitrix.DetachKeyPairsRequest") - proto.RegisterType((*DetachKeyPairsResponse)(nil), "openpitrix.DetachKeyPairsResponse") - proto.RegisterType((*NodeKeyPair)(nil), "openpitrix.NodeKeyPair") - proto.RegisterType((*AddNodeKeyPairsRequest)(nil), "openpitrix.AddNodeKeyPairsRequest") - proto.RegisterType((*AddNodeKeyPairsResponse)(nil), "openpitrix.AddNodeKeyPairsResponse") - proto.RegisterType((*DeleteNodeKeyPairsRequest)(nil), "openpitrix.DeleteNodeKeyPairsRequest") - proto.RegisterType((*DeleteNodeKeyPairsResponse)(nil), "openpitrix.DeleteNodeKeyPairsResponse") -} - -func init() { proto.RegisterFile("cluster.proto", fileDescriptor_3cfb3b8ec240c376) } - -var fileDescriptor_3cfb3b8ec240c376 = []byte{ - // 4950 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe4, 0x5c, 0x4d, 0x6c, 0x24, 0xc7, - 0x75, 0x76, 0xcf, 0x90, 0x43, 0xf2, 0x0d, 0x67, 0xc8, 0x2d, 0xfe, 0xcd, 0x0e, 0xb9, 0xbb, 0xb3, - 0xbd, 0x96, 0xb4, 0x56, 0xa8, 0x5d, 0x69, 0x25, 0x59, 0x3f, 0xab, 0xb5, 0x34, 0xe2, 0x6e, 0xe4, - 0x89, 0x76, 0xa5, 0xc5, 0x70, 0x57, 0x72, 0x14, 0xc5, 0xed, 0xe6, 0x74, 0x71, 0xd8, 0x66, 0x4f, - 0x77, 0xab, 0xbb, 0x86, 0x6b, 0x0a, 0x39, 0x09, 0x41, 0x7e, 0x6c, 0x27, 0x80, 0x19, 0x24, 0x70, - 0x7e, 0x10, 0x20, 0x08, 0x62, 0x38, 0x41, 0x84, 0xd8, 0x02, 0x02, 0x44, 0xc8, 0x21, 0xa7, 0xf8, - 0x12, 0x20, 0x09, 0x90, 0x4b, 0xe0, 0x53, 0x0e, 0x3e, 0x39, 0xd7, 0xdc, 0x72, 0x09, 0xea, 0xa7, - 0x7f, 0xaa, 0xa7, 0x67, 0x58, 0xc3, 0xa1, 0x76, 0x65, 0xe4, 0x44, 0x4e, 0xf7, 0x7b, 0xaf, 0xbe, - 0x7e, 0xf5, 0xea, 0xbd, 0x57, 0x55, 0xaf, 0x0a, 0x2a, 0x1d, 0xa7, 0x1f, 0x12, 0x1c, 0x5c, 0xf1, - 0x03, 0x8f, 0x78, 0x08, 0x3c, 0x1f, 0xbb, 0xbe, 0x4d, 0x02, 0xfb, 0x5b, 0xf5, 0xf5, 0xae, 0xe7, - 0x75, 0x1d, 0x7c, 0x95, 0xbd, 0xd9, 0xe9, 0xef, 0x5e, 0xc5, 0x3d, 0x9f, 0x1c, 0x72, 0xc2, 0xfa, - 0xf9, 0xec, 0xcb, 0x07, 0x81, 0xe9, 0xfb, 0x38, 0x08, 0xc5, 0xfb, 0x0b, 0xd9, 0xf7, 0xc4, 0xee, - 0xe1, 0x90, 0x98, 0x3d, 0x5f, 0x10, 0x6c, 0x08, 0x02, 0xd3, 0xb7, 0xaf, 0x9a, 0xae, 0xeb, 0x11, - 0x93, 0xd8, 0x9e, 0x1b, 0xb1, 0x6f, 0xb2, 0x3f, 0x9d, 0xa7, 0xba, 0xd8, 0x7d, 0x2a, 0x7c, 0x60, - 0x76, 0xbb, 0x38, 0xb8, 0xea, 0xf9, 0x8c, 0x62, 0x90, 0x5a, 0xff, 0x93, 0x02, 0xac, 0xde, 0xc4, - 0x61, 0x27, 0xb0, 0x77, 0xf0, 0x76, 0x7f, 0xc7, 0xc5, 0x24, 0x6c, 0xe3, 0x0f, 0xfa, 0x38, 0x24, - 0xe8, 0x3a, 0x40, 0xd0, 0x77, 0x69, 0xe3, 0x86, 0x6d, 0xd5, 0xb4, 0x86, 0x76, 0xb9, 0x7c, 0x6d, - 0xe3, 0x0a, 0x6f, 0xfb, 0x4a, 0x04, 0xee, 0xca, 0x36, 0x09, 0x6c, 0xb7, 0xfb, 0x8e, 0xe9, 0xf4, - 0x71, 0x7b, 0x4e, 0xd0, 0xb7, 0x2c, 0xb4, 0x0c, 0xd3, 0x8e, 0xdd, 0xb3, 0x49, 0xad, 0xd0, 0xd0, - 0x2e, 0x57, 0xda, 0xfc, 0x07, 0x5a, 0x85, 0x92, 0xb7, 0xbb, 0x1b, 0x62, 0x52, 0x2b, 0xb2, 0xc7, - 0xe2, 0x17, 0xba, 0x01, 0xe5, 0x90, 0x35, 0x6e, 0x90, 0x43, 0x1f, 0xd7, 0xa6, 0x86, 0xb4, 0x75, - 0xbf, 0xe5, 0x92, 0x67, 0xaf, 0xf1, 0xb6, 0x80, 0x33, 0xdc, 0x3b, 0xf4, 0x31, 0x5a, 0x87, 0x39, - 0xc1, 0x6e, 0x5b, 0xb5, 0xe9, 0x46, 0xf1, 0xf2, 0x5c, 0x7b, 0x96, 0x3f, 0x68, 0x59, 0x08, 0xc1, - 0xd4, 0x87, 0x9e, 0x8b, 0x6b, 0x25, 0xf6, 0x9c, 0xfd, 0x8f, 0x1e, 0x83, 0xaa, 0x69, 0x1d, 0x98, - 0x6e, 0x07, 0x5b, 0x86, 0x6f, 0x06, 0x66, 0xaf, 0x36, 0xc3, 0xde, 0x56, 0xa2, 0xa7, 0x77, 0xe9, - 0x43, 0xfd, 0xd3, 0x22, 0x94, 0xb8, 0x52, 0xd0, 0x4b, 0xe9, 0x26, 0x54, 0x74, 0x91, 0x00, 0x78, - 0x1a, 0xa6, 0x5c, 0xb3, 0x87, 0x99, 0x26, 0x8e, 0xe3, 0x62, 0x94, 0x94, 0x83, 0x41, 0x2e, 0xaa, - 0x70, 0xb0, 0x0f, 0xba, 0x0e, 0xe5, 0x4e, 0x80, 0x4d, 0x82, 0x0d, 0xaa, 0x7f, 0xa1, 0xc0, 0xfa, - 0x00, 0xe3, 0xbd, 0xc8, 0x92, 0xda, 0xc0, 0xc9, 0xe9, 0x03, 0xf4, 0x15, 0x28, 0x5b, 0xcc, 0x04, - 0x98, 0x95, 0xd4, 0xa6, 0x15, 0x5a, 0x4d, 0x33, 0xa0, 0x0b, 0x50, 0xb6, 0xdd, 0x90, 0x50, 0xc5, - 0x51, 0xed, 0x70, 0x45, 0x43, 0xf4, 0xa8, 0x65, 0xa1, 0x67, 0xa1, 0x74, 0xe0, 0x77, 0xe8, 0xbb, - 0x19, 0x05, 0xd9, 0xd3, 0x07, 0x7e, 0xa7, 0x65, 0x65, 0x6d, 0x62, 0x76, 0x3c, 0x9b, 0xd0, 0x7b, - 0xb0, 0x36, 0x60, 0xd7, 0xa1, 0xef, 0xb9, 0x21, 0xa6, 0x78, 0x89, 0x47, 0x4c, 0xc7, 0xe8, 0x78, - 0x7d, 0x97, 0xb0, 0xde, 0xac, 0xb4, 0x81, 0x3d, 0xda, 0xa2, 0x4f, 0xd0, 0x33, 0x20, 0x24, 0x19, - 0xd4, 0x54, 0x0b, 0x8d, 0xe2, 0xe5, 0xf2, 0x35, 0x74, 0x25, 0x19, 0xdf, 0x57, 0xb8, 0xc4, 0xb6, - 0x30, 0x89, 0x6d, 0x4c, 0xf4, 0xaf, 0xc0, 0xb9, 0x9b, 0xd8, 0xc1, 0x04, 0x6f, 0x71, 0xa7, 0xd0, - 0x72, 0xdb, 0x7c, 0x2c, 0x44, 0xa3, 0xe9, 0x5c, 0x66, 0x34, 0x51, 0x1d, 0x25, 0xe3, 0x45, 0x7f, - 0x15, 0xce, 0x0f, 0xe3, 0x17, 0xa8, 0x8f, 0x11, 0xe0, 0xc0, 0xf9, 0x3b, 0x76, 0x37, 0x30, 0x87, - 0x23, 0x78, 0x1c, 0x16, 0x76, 0x03, 0xaf, 0x67, 0x64, 0x06, 0xf5, 0x5c, 0xbb, 0x42, 0x1f, 0xb7, - 0xe3, 0xa1, 0xab, 0x43, 0x85, 0x78, 0x69, 0xaa, 0x02, 0xa3, 0x2a, 0x13, 0x2f, 0xa6, 0xd1, 0x7b, - 0x70, 0x61, 0x68, 0x6b, 0x02, 0xef, 0x69, 0x36, 0xf7, 0xef, 0x05, 0x58, 0xde, 0x62, 0x06, 0x2b, - 0x9a, 0x8b, 0xbe, 0xe9, 0x59, 0x28, 0x99, 0xbe, 0xaf, 0x3a, 0x26, 0xa7, 0x4d, 0xdf, 0x6f, 0x59, - 0xd4, 0xb1, 0x1d, 0xe0, 0x20, 0xb4, 0x3d, 0x37, 0x6a, 0xee, 0x58, 0xc7, 0x26, 0xe8, 0x39, 0x73, - 0x0a, 0x6b, 0x71, 0x3c, 0xaf, 0xf8, 0x34, 0x4c, 0x75, 0x3c, 0x77, 0x77, 0xa8, 0x83, 0x93, 0x06, - 0x36, 0xa5, 0xcc, 0xf1, 0x54, 0xd3, 0x39, 0x9e, 0x2a, 0xf6, 0x18, 0x25, 0x55, 0x8f, 0xa1, 0xff, - 0xae, 0x06, 0x2b, 0x19, 0x95, 0x8a, 0x8e, 0xbb, 0x0e, 0x20, 0x22, 0x9b, 0xb2, 0xdf, 0x17, 0xf4, - 0x7c, 0xa8, 0x7f, 0xd3, 0xdb, 0x51, 0xd5, 0xeb, 0xf4, 0x37, 0xbd, 0x9d, 0x96, 0xa5, 0x7f, 0x52, - 0x84, 0xe5, 0x3b, 0x9e, 0x65, 0xef, 0x1e, 0x66, 0xba, 0xf7, 0x29, 0x98, 0x11, 0xa2, 0x05, 0x8e, - 0xa5, 0xf4, 0x28, 0x8c, 0x88, 0x23, 0x1a, 0xd4, 0x84, 0xc5, 0x08, 0xb9, 0xeb, 0x59, 0x38, 0x35, - 0x7a, 0xd7, 0x72, 0xf8, 0xde, 0xf2, 0x2c, 0xdc, 0xae, 0x76, 0x92, 0x1f, 0xdb, 0x98, 0xa4, 0x45, - 0x04, 0x9e, 0xc3, 0x45, 0x14, 0x87, 0x8a, 0x68, 0x7b, 0x4e, 0x22, 0x82, 0xfe, 0xc8, 0x88, 0x70, - 0x6c, 0x77, 0x9f, 0x89, 0x98, 0x1a, 0x2a, 0xe2, 0xb6, 0xed, 0xee, 0xc7, 0x22, 0xe8, 0x0f, 0x2a, - 0xe2, 0x0d, 0x40, 0x91, 0x88, 0x8e, 0xd7, 0xeb, 0x79, 0x2e, 0x13, 0x32, 0xcd, 0x84, 0x9c, 0xcd, - 0x11, 0xb2, 0xc5, 0x88, 0xda, 0x51, 0xbb, 0xfc, 0x27, 0x15, 0xf4, 0xab, 0x50, 0x8b, 0xb1, 0x78, - 0xa6, 0xb5, 0x63, 0x3a, 0xd4, 0x68, 0x02, 0x26, 0xae, 0xc4, 0xc4, 0x5d, 0xc8, 0xc3, 0x94, 0x22, - 0x6d, 0xaf, 0x76, 0x06, 0x1f, 0x52, 0x8f, 0x77, 0x0f, 0x56, 0x32, 0x7d, 0x76, 0x0a, 0xf6, 0xa3, - 0xbf, 0x03, 0x35, 0x49, 0x2a, 0xeb, 0x24, 0x61, 0x0d, 0x2f, 0xc3, 0x7c, 0xba, 0x7b, 0x85, 0xe8, - 0xa1, 0x5d, 0x5b, 0x4e, 0x75, 0xad, 0xde, 0x86, 0xb3, 0x39, 0x72, 0x05, 0xe2, 0xe7, 0x61, 0x86, - 0xd9, 0x8b, 0x22, 0xdc, 0x12, 0x25, 0x6e, 0x59, 0xfa, 0xbf, 0x69, 0x70, 0x5e, 0x12, 0xda, 0x24, - 0x24, 0xb0, 0x77, 0xfa, 0x04, 0xa7, 0x73, 0xa8, 0x93, 0x8f, 0xa5, 0xf1, 0x13, 0x87, 0x4c, 0x24, - 0x2f, 0x8e, 0x19, 0xc9, 0xf5, 0xaf, 0xc3, 0x85, 0xa1, 0x1f, 0x74, 0x1a, 0xbd, 0xfb, 0x7b, 0x1a, - 0xe8, 0x03, 0xdd, 0x30, 0xa8, 0xb5, 0x93, 0xf5, 0xc7, 0xf8, 0xfa, 0xd2, 0xdf, 0x87, 0x4b, 0x23, - 0xe1, 0x4c, 0x66, 0x1f, 0xdf, 0x80, 0xf5, 0xa6, 0x65, 0xdd, 0x33, 0x77, 0x1c, 0x9c, 0x92, 0x1f, - 0x7f, 0x65, 0x9e, 0xb7, 0xd2, 0xc6, 0xf2, 0x56, 0xfa, 0x4b, 0x51, 0xd6, 0x30, 0xb4, 0x91, 0xb5, - 0x34, 0x74, 0x1a, 0x38, 0x22, 0x70, 0x9f, 0x68, 0xb0, 0x22, 0x65, 0x1c, 0x61, 0x2a, 0x53, 0x91, - 0x7a, 0x98, 0x25, 0x1a, 0x89, 0x55, 0x0e, 0x46, 0xa4, 0x42, 0x7e, 0x44, 0x9a, 0xde, 0xf5, 0x82, - 0x4e, 0x94, 0xc4, 0x0e, 0xe6, 0xa2, 0xaf, 0x7b, 0x9e, 0x23, 0xa2, 0x00, 0x23, 0x44, 0x17, 0x61, - 0xbe, 0x1b, 0x98, 0x1d, 0x6c, 0xf8, 0x38, 0xb0, 0x3d, 0x8b, 0x05, 0xc9, 0x4a, 0xbb, 0xcc, 0x9e, - 0xdd, 0x65, 0x8f, 0xf4, 0xb7, 0xe8, 0x64, 0x45, 0xc6, 0x9c, 0x64, 0x47, 0xa3, 0x40, 0xaf, 0xa4, - 0xc2, 0x12, 0x7d, 0x25, 0x02, 0xcf, 0x3f, 0x68, 0xb0, 0x72, 0xdf, 0xef, 0x06, 0xa6, 0x95, 0x4d, - 0x2c, 0x26, 0x1a, 0xb8, 0x13, 0x25, 0x18, 0x83, 0xfa, 0x2d, 0xe6, 0xcd, 0x4d, 0xbe, 0xad, 0xc1, - 0x6a, 0x16, 0xfa, 0x23, 0x0b, 0xe0, 0xbf, 0x01, 0xab, 0x6d, 0xcf, 0x71, 0x76, 0xcc, 0xce, 0xfe, - 0x69, 0xea, 0x51, 0xcd, 0xd4, 0xf4, 0xef, 0x68, 0xb0, 0x36, 0xd0, 0xfc, 0x23, 0xd3, 0xc5, 0x4f, - 0x0b, 0x30, 0xcf, 0xf2, 0x02, 0x1c, 0x7a, 0x7d, 0x6a, 0xd7, 0x4f, 0xc3, 0x14, 0x4d, 0x25, 0x94, - 0x1a, 0x67, 0x94, 0xe8, 0x0a, 0x14, 0x3b, 0x7e, 0x7f, 0x68, 0xa3, 0xe9, 0x29, 0x0f, 0x25, 0xa4, - 0xf4, 0x5d, 0xbf, 0x3f, 0xd4, 0xdd, 0x4b, 0xf4, 0x5d, 0xbf, 0x8f, 0x9e, 0x83, 0x52, 0x0f, 0xf7, - 0xbc, 0xe0, 0x50, 0x69, 0xa6, 0x2d, 0x68, 0x51, 0x13, 0x2a, 0xf1, 0x34, 0x2f, 0xb4, 0x3f, 0xc4, - 0x43, 0x27, 0x8a, 0x69, 0xe6, 0xf9, 0x88, 0x65, 0xdb, 0xfe, 0x10, 0xa3, 0x57, 0x61, 0x3e, 0x24, - 0x5e, 0x60, 0x76, 0x85, 0x84, 0x92, 0x82, 0x84, 0xb2, 0xe0, 0xa0, 0x02, 0xf4, 0x4f, 0x35, 0x58, - 0x6e, 0x63, 0xca, 0x7b, 0x9a, 0x76, 0x76, 0x03, 0x2a, 0x2c, 0xd9, 0x0b, 0x44, 0x97, 0x89, 0xa4, - 0xb1, 0x96, 0x76, 0xc3, 0xe9, 0x2e, 0x6d, 0xcf, 0x07, 0xe9, 0x0e, 0x56, 0xcb, 0xd1, 0x59, 0xc6, - 0x9d, 0xc1, 0xfe, 0xc8, 0x8c, 0xf4, 0xbf, 0x35, 0x58, 0x6d, 0x5a, 0x56, 0x5e, 0xc4, 0x98, 0x34, - 0x65, 0x61, 0xb6, 0x5e, 0x50, 0xb6, 0xf5, 0xeb, 0x00, 0x2c, 0x40, 0xf1, 0xb9, 0xb8, 0x8a, 0x09, - 0xcf, 0x51, 0x7a, 0x3e, 0x51, 0x1f, 0xd4, 0xfc, 0xd4, 0x30, 0x07, 0x31, 0xf0, 0xb5, 0x8f, 0x4c, - 0xf7, 0xdf, 0xd7, 0xe0, 0xac, 0x14, 0xc5, 0x4e, 0x4f, 0xfd, 0xa9, 0x68, 0x5f, 0x48, 0x47, 0x7b, - 0xd5, 0xa0, 0xf2, 0xfb, 0x1a, 0xd4, 0xf3, 0xa0, 0x3d, 0x32, 0x5d, 0x7d, 0xac, 0xc1, 0xda, 0x7d, - 0xdf, 0x4a, 0x66, 0xa9, 0xb7, 0xdc, 0x83, 0x53, 0xd1, 0xd4, 0x15, 0x28, 0x62, 0xf7, 0x40, 0x09, - 0x0a, 0x25, 0x54, 0x55, 0xe0, 0x77, 0x35, 0xa8, 0x0d, 0xe2, 0x7d, 0x64, 0xea, 0xfb, 0x71, 0x15, - 0x2a, 0xd2, 0x14, 0xf1, 0x61, 0x8f, 0xee, 0xb7, 0x61, 0x25, 0xc4, 0xc1, 0x01, 0x6b, 0xcd, 0xe8, - 0xfb, 0x3e, 0x0e, 0x8c, 0x1d, 0xaf, 0xef, 0x5a, 0x4a, 0x03, 0x1d, 0x71, 0xd6, 0x96, 0x75, 0x9f, - 0x32, 0xbe, 0x4e, 0xf9, 0xd0, 0x1b, 0xb0, 0x18, 0xf7, 0x83, 0xd9, 0x61, 0x2b, 0xd9, 0x4a, 0xab, - 0x29, 0x0b, 0x11, 0x57, 0x93, 0x33, 0xd1, 0x50, 0x64, 0xbb, 0x36, 0x31, 0x68, 0x1b, 0x76, 0x07, - 0xab, 0xad, 0x7a, 0x52, 0x8e, 0x6d, 0xce, 0x40, 0xc3, 0x61, 0x48, 0xcc, 0x20, 0x91, 0xa0, 0xb2, - 0xf6, 0x32, 0xcf, 0x58, 0x22, 0x11, 0x3c, 0x1c, 0xfa, 0xb1, 0x04, 0x95, 0xd5, 0x51, 0x1a, 0x0e, - 0xfd, 0x48, 0xc0, 0x57, 0xe1, 0x4c, 0xd8, 0x31, 0x1d, 0x6c, 0x78, 0xfd, 0x04, 0xc7, 0xac, 0x8a, - 0x3a, 0x18, 0xdb, 0xdb, 0xfd, 0x18, 0xca, 0x2f, 0xc3, 0x22, 0x97, 0x64, 0xbb, 0xb1, 0xa0, 0x39, - 0x05, 0x41, 0x55, 0xc6, 0xd5, 0x72, 0x23, 0x39, 0xb7, 0x60, 0x21, 0xc0, 0xb2, 0x5e, 0x40, 0x45, - 0x8c, 0x60, 0x4a, 0x89, 0xb1, 0x70, 0x48, 0x02, 0xef, 0x30, 0x16, 0x53, 0x56, 0x11, 0x23, 0x98, - 0x52, 0x62, 0xfa, 0x3c, 0x47, 0x8e, 0xc5, 0xcc, 0xab, 0x88, 0x11, 0x4c, 0x91, 0x98, 0x2d, 0xa8, - 0x76, 0xfa, 0x21, 0xf1, 0x7a, 0xb1, 0x94, 0x8a, 0x82, 0x94, 0x0a, 0xe7, 0x49, 0x09, 0xa1, 0x09, - 0x6a, 0x3f, 0xe9, 0xee, 0xaa, 0x8a, 0x10, 0xce, 0x93, 0x51, 0xaf, 0x17, 0x24, 0x1f, 0xb4, 0xa0, - 0xaa, 0x5e, 0x2f, 0x88, 0x3f, 0xe8, 0x1e, 0xac, 0x59, 0xcc, 0xcd, 0x1b, 0xa1, 0x6b, 0xfa, 0xe1, - 0x9e, 0x97, 0xf4, 0xd6, 0xa2, 0x82, 0xb8, 0x15, 0xce, 0xbc, 0x2d, 0x78, 0x53, 0xe6, 0xbc, 0x87, - 0x4d, 0x87, 0xec, 0x19, 0x9d, 0x3d, 0xdc, 0xd9, 0xaf, 0x9d, 0x51, 0x31, 0x67, 0xce, 0xb1, 0x45, - 0x19, 0xd0, 0x97, 0x61, 0xa6, 0xe7, 0xb9, 0x36, 0xf1, 0x82, 0x1a, 0x52, 0xe0, 0x8d, 0x88, 0xd1, - 0x4d, 0xa8, 0xfa, 0x66, 0x18, 0xfa, 0x7b, 0x81, 0x19, 0x62, 0x07, 0x87, 0x61, 0x6d, 0x49, 0x45, - 0x29, 0x32, 0x0f, 0x55, 0xca, 0x01, 0x0e, 0x88, 0xdd, 0x31, 0x1d, 0x83, 0x5a, 0xb5, 0xed, 0x76, - 0x0d, 0xdf, 0x73, 0xec, 0xce, 0x61, 0x6d, 0x59, 0x45, 0x29, 0x11, 0xf3, 0x36, 0xe7, 0xbd, 0xcb, - 0x58, 0xd1, 0x16, 0x2c, 0x98, 0x5d, 0xec, 0x12, 0x83, 0x25, 0xc2, 0x8e, 0x83, 0xad, 0xda, 0xca, - 0xb1, 0x33, 0xe2, 0x2a, 0x63, 0x69, 0x45, 0x1c, 0xa8, 0x0d, 0xab, 0xc2, 0x00, 0x7b, 0x98, 0x98, - 0x96, 0x49, 0x4c, 0x83, 0x2f, 0xda, 0xd4, 0x56, 0x15, 0x90, 0x2d, 0x73, 0xde, 0x3b, 0x82, 0x75, - 0x9b, 0x71, 0xa2, 0x17, 0x60, 0xd6, 0xee, 0xd1, 0x4c, 0xdc, 0xb6, 0x6a, 0x6b, 0x2a, 0xda, 0x66, - 0xd4, 0x2d, 0x8b, 0x3a, 0x3e, 0x61, 0xc8, 0x42, 0x3b, 0x35, 0x15, 0xc7, 0xc7, 0x59, 0x84, 0x52, - 0xde, 0x87, 0x0d, 0xdb, 0xed, 0x04, 0xb8, 0x87, 0x5d, 0x62, 0x3a, 0x46, 0x34, 0x2e, 0xfa, 0xbe, - 0xef, 0x05, 0x04, 0x5b, 0xb5, 0xb3, 0xc7, 0x6a, 0xa8, 0x9e, 0xe2, 0x7f, 0x9d, 0x0f, 0x91, 0x88, - 0x1b, 0xbd, 0x02, 0xb0, 0x77, 0xe8, 0x53, 0xa3, 0x0c, 0xbd, 0xa0, 0x56, 0x57, 0x40, 0x97, 0xa2, - 0xd7, 0x7f, 0x58, 0x81, 0x72, 0x2a, 0xfb, 0x39, 0xe9, 0x62, 0x94, 0x1c, 0x68, 0x0b, 0x27, 0x5b, - 0xf9, 0x2b, 0x2a, 0xaf, 0xfc, 0xdd, 0x90, 0xf7, 0xe0, 0x54, 0x42, 0x62, 0x7a, 0x87, 0xee, 0x25, - 0x98, 0x3b, 0xf0, 0x9c, 0x3e, 0xdf, 0xd4, 0x50, 0x09, 0x85, 0xb3, 0x9c, 0xbc, 0x65, 0xd1, 0xc9, - 0xa4, 0x85, 0x95, 0x03, 0xa0, 0xa0, 0x95, 0xf7, 0x53, 0x67, 0xc6, 0xda, 0x4f, 0xbd, 0x0e, 0xe0, - 0x07, 0xf6, 0x81, 0x49, 0xb0, 0x61, 0xfb, 0x4a, 0xd1, 0x6e, 0x4e, 0xd0, 0xb7, 0x7c, 0x96, 0xf7, - 0xd9, 0xbe, 0x52, 0x68, 0xa3, 0x84, 0x0c, 0x67, 0x94, 0xc0, 0x0c, 0x8d, 0x64, 0xe9, 0xa4, 0x65, - 0x36, 0x4a, 0x5a, 0xe2, 0x6c, 0xa9, 0xac, 0x9c, 0x2d, 0x3d, 0x07, 0xa5, 0x90, 0x98, 0xa4, 0x1f, - 0x2a, 0x45, 0x29, 0x41, 0x8b, 0x5a, 0x70, 0x86, 0x04, 0xa6, 0x1b, 0xda, 0x34, 0xb1, 0x31, 0x84, - 0x00, 0x95, 0x00, 0xb5, 0x98, 0xb0, 0x6d, 0x73, 0x51, 0x2f, 0xc0, 0x6c, 0x37, 0xf0, 0xfa, 0x6c, - 0x43, 0xad, 0xaa, 0xf0, 0xb1, 0x33, 0x8c, 0x9a, 0xf7, 0x89, 0xf7, 0xc0, 0xc5, 0x81, 0xe1, 0x9b, - 0x64, 0x4f, 0x29, 0x24, 0xcd, 0x31, 0xfa, 0xbb, 0x26, 0xd9, 0xa3, 0xb9, 0x47, 0xd7, 0xf1, 0x76, - 0xa8, 0xdb, 0x8d, 0x55, 0xbd, 0xa8, 0xd0, 0x7a, 0x95, 0x73, 0x6d, 0x47, 0x0a, 0xbf, 0x05, 0x0b, - 0x19, 0x2f, 0xa9, 0x14, 0x82, 0xaa, 0xb2, 0x7b, 0xa4, 0x03, 0xde, 0xef, 0xef, 0x18, 0xfb, 0xf8, - 0x50, 0x29, 0x0a, 0x95, 0xfc, 0xfe, 0xce, 0x9b, 0x98, 0x2d, 0x8f, 0x88, 0xe8, 0x27, 0xba, 0x40, - 0x25, 0x06, 0x89, 0x80, 0x19, 0xab, 0x7f, 0xce, 0x0e, 0x85, 0x37, 0x14, 0x31, 0x67, 0x94, 0x0f, - 0x9c, 0xb5, 0x43, 0xee, 0xfa, 0xd0, 0x75, 0x28, 0x9b, 0x7d, 0xe2, 0x45, 0xac, 0xc7, 0x07, 0x18, - 0xa0, 0xe4, 0x09, 0x73, 0xba, 0x76, 0x60, 0x75, 0xac, 0xda, 0x81, 0xeb, 0x50, 0xe6, 0x9f, 0xcb, - 0x99, 0xd7, 0x8e, 0x67, 0xe6, 0xe4, 0x8c, 0xf9, 0x79, 0x98, 0xd9, 0xf3, 0x42, 0xe6, 0x02, 0x54, - 0x62, 0x48, 0x89, 0x12, 0xb7, 0xac, 0x84, 0xcd, 0x17, 0x81, 0x42, 0x85, 0xcd, 0x4f, 0x6f, 0x1f, - 0xb1, 0x71, 0x59, 0x1f, 0xba, 0x7d, 0xc4, 0xd6, 0x7a, 0xca, 0xa9, 0x6d, 0x3d, 0xf4, 0x1a, 0x54, - 0xe5, 0x0d, 0xb9, 0xda, 0x3a, 0xe3, 0x1e, 0xb1, 0x19, 0x57, 0x91, 0x36, 0xe3, 0xd0, 0x79, 0x28, - 0xef, 0xe3, 0x43, 0xc3, 0x37, 0x6d, 0x66, 0xdf, 0x1b, 0x7c, 0x85, 0x7a, 0x1f, 0x1f, 0xde, 0x35, - 0x6d, 0x6a, 0xbc, 0xd7, 0x60, 0x9a, 0x8d, 0x88, 0xda, 0x39, 0x95, 0xe9, 0x1d, 0x23, 0xd5, 0xff, - 0xb9, 0x14, 0x87, 0xaa, 0xb6, 0x58, 0x4b, 0x79, 0x98, 0x93, 0x3b, 0xb1, 0x4c, 0x59, 0x1c, 0x73, - 0x99, 0x72, 0x6a, 0xfc, 0x65, 0xca, 0xe9, 0x49, 0x96, 0x29, 0x4b, 0x13, 0x2f, 0x53, 0xce, 0x8c, - 0xb9, 0x4c, 0x49, 0xa3, 0x71, 0xcf, 0xeb, 0xbb, 0xc4, 0xf0, 0x3d, 0xdb, 0x25, 0x4a, 0x31, 0x0a, - 0x18, 0xc3, 0x5d, 0x4a, 0x4f, 0x3f, 0x81, 0xb3, 0x8b, 0xba, 0x2d, 0xa5, 0x70, 0x35, 0xcf, 0x58, - 0xde, 0xe6, 0x1c, 0x14, 0xc1, 0xae, 0xed, 0x60, 0x23, 0x3c, 0x0c, 0x09, 0xee, 0x29, 0xcd, 0xc1, - 0x80, 0x32, 0x6c, 0x33, 0xfa, 0x68, 0x79, 0xa4, 0xac, 0xba, 0x3c, 0xf2, 0x22, 0xcc, 0x06, 0xd8, - 0x77, 0xec, 0x8e, 0x39, 0x3c, 0x76, 0x49, 0x51, 0x32, 0xa2, 0xa6, 0xd3, 0xa2, 0x00, 0x9b, 0xd6, - 0xa1, 0x11, 0xf3, 0x57, 0x14, 0xf8, 0x2b, 0x8c, 0xa7, 0x1d, 0x09, 0xb9, 0x01, 0x65, 0xd3, 0xb7, - 0x0d, 0xb1, 0x89, 0xa2, 0x34, 0xb1, 0x02, 0xd3, 0xb7, 0xdf, 0xe1, 0xf4, 0xfa, 0xff, 0x16, 0x60, - 0x29, 0x67, 0xeb, 0xfb, 0x61, 0x8f, 0xa7, 0x77, 0xa0, 0x26, 0x6d, 0xd2, 0x3b, 0x76, 0x48, 0xb0, - 0xcb, 0x1b, 0x57, 0xc9, 0x04, 0x57, 0xd3, 0xdc, 0xb7, 0x05, 0x73, 0xcb, 0xa2, 0x09, 0x82, 0x24, - 0x97, 0xa6, 0xc9, 0x4a, 0xa3, 0x70, 0x31, 0xcd, 0x76, 0xd7, 0x0b, 0x08, 0x9d, 0x88, 0x64, 0x44, - 0xd1, 0x7c, 0x5e, 0x35, 0x69, 0x5c, 0x96, 0xe5, 0x51, 0xd6, 0x96, 0xa5, 0xff, 0x63, 0x21, 0xf6, - 0x62, 0xb7, 0x6d, 0x77, 0xff, 0x61, 0xef, 0x99, 0xdf, 0x86, 0x25, 0xfc, 0x2d, 0x82, 0x03, 0xd7, - 0x74, 0x8c, 0x54, 0xbb, 0x2a, 0x0a, 0x3f, 0x13, 0x31, 0x6e, 0xa5, 0xb7, 0xfe, 0x52, 0x89, 0xd0, - 0xd4, 0x78, 0x89, 0x50, 0x1c, 0x03, 0xa6, 0xd5, 0x63, 0xc0, 0x4f, 0xab, 0x30, 0x23, 0x9a, 0xff, - 0x05, 0xab, 0x36, 0x48, 0x15, 0x6f, 0x4d, 0x9d, 0xb4, 0x78, 0x6b, 0x7a, 0xbc, 0xbd, 0x55, 0x69, - 0xd6, 0x51, 0x1a, 0x6b, 0xd6, 0x71, 0xa2, 0x1a, 0xc6, 0x57, 0x61, 0x7e, 0x37, 0xf0, 0x5c, 0xd2, - 0x65, 0x93, 0x15, 0x4b, 0x29, 0x10, 0x94, 0x63, 0x0e, 0x2e, 0x20, 0xea, 0x51, 0x56, 0x05, 0x39, - 0xa7, 0x12, 0x89, 0x04, 0x07, 0x2b, 0x8d, 0x7d, 0x19, 0xe6, 0xb0, 0x6b, 0xb1, 0x30, 0x14, 0x2a, - 0x45, 0x81, 0x84, 0x3c, 0x35, 0x1d, 0x29, 0x4f, 0x3a, 0x1d, 0x99, 0x3f, 0xd1, 0x74, 0xe4, 0x36, - 0x2c, 0xc7, 0xeb, 0x1d, 0x81, 0xe7, 0x11, 0xc3, 0xec, 0x74, 0x70, 0x18, 0x45, 0x88, 0x51, 0xf9, - 0x2d, 0x8a, 0xf8, 0xda, 0x9e, 0x47, 0x9a, 0x8c, 0x2b, 0x33, 0x34, 0xab, 0xe3, 0x0d, 0xcd, 0x1b, - 0x50, 0x16, 0x73, 0x94, 0x7e, 0xdf, 0xb6, 0x94, 0x66, 0x38, 0xc0, 0x19, 0xee, 0xf7, 0x6d, 0x8b, - 0x46, 0xb9, 0x78, 0x21, 0x92, 0x6b, 0x44, 0x65, 0x9d, 0xad, 0x12, 0xad, 0x43, 0x72, 0x75, 0xdc, - 0x80, 0xf9, 0x48, 0x08, 0x4b, 0xb6, 0xcf, 0x1c, 0x9b, 0x6c, 0x97, 0x05, 0xbd, 0x48, 0xd5, 0xd3, - 0x95, 0x8b, 0x68, 0xbc, 0xca, 0xc5, 0xcc, 0x24, 0x61, 0x69, 0x92, 0x49, 0xc2, 0xf2, 0x58, 0x93, - 0x84, 0x5b, 0xb0, 0x60, 0x5a, 0x16, 0x33, 0x0b, 0xd3, 0x31, 0x6c, 0x77, 0xd7, 0x13, 0xf3, 0x9b, - 0x63, 0x66, 0x75, 0x09, 0x53, 0xcb, 0xdd, 0xf5, 0xa2, 0x8c, 0x66, 0x55, 0x35, 0xa3, 0x79, 0x1a, - 0xa6, 0x2d, 0xbc, 0xd3, 0xef, 0x0e, 0x9d, 0xd2, 0xa4, 0xea, 0x57, 0x18, 0x61, 0x5c, 0x83, 0x59, - 0x53, 0xae, 0xda, 0xce, 0xab, 0x00, 0x3a, 0x3b, 0x79, 0xbd, 0x62, 0x7d, 0xf2, 0x7a, 0xc5, 0xf5, - 0xd3, 0xa8, 0x57, 0xdc, 0x38, 0xdd, 0x7a, 0xc5, 0x73, 0x13, 0xd5, 0x2b, 0x26, 0xc1, 0xf5, 0xbc, - 0x7a, 0x70, 0xfd, 0xcd, 0x52, 0x52, 0x45, 0x3e, 0x66, 0x99, 0xd4, 0x4a, 0x1c, 0xdc, 0x44, 0xc5, - 0x11, 0x0f, 0x5f, 0xe7, 0xa4, 0xf0, 0xc5, 0xf7, 0x10, 0x53, 0x01, 0x6a, 0x35, 0x76, 0xb9, 0x7c, - 0x23, 0x3b, 0x72, 0xaa, 0x72, 0xf1, 0xf7, 0x74, 0xa6, 0xf8, 0x1b, 0x5d, 0xcc, 0xc4, 0x19, 0x5e, - 0x82, 0x2f, 0x45, 0x92, 0x21, 0x69, 0xce, 0xcc, 0xc9, 0xd2, 0x9c, 0xf8, 0x78, 0xc7, 0x6c, 0xfe, - 0xf1, 0x8e, 0xb9, 0x81, 0xe3, 0x1d, 0xd8, 0x0c, 0x3a, 0x7b, 0xc6, 0x03, 0x2f, 0xb0, 0xd4, 0x26, - 0x23, 0x9c, 0xe1, 0x5d, 0x2f, 0xb0, 0xd0, 0x0b, 0x30, 0x1b, 0x7a, 0x01, 0x61, 0x2b, 0x32, 0x2a, - 0x91, 0x68, 0x86, 0x52, 0xbf, 0x89, 0x0f, 0xd1, 0x73, 0x30, 0x13, 0x60, 0xaa, 0xdc, 0x68, 0xdb, - 0x67, 0xd4, 0x28, 0x8e, 0x48, 0xe9, 0xb7, 0x71, 0x43, 0xa9, 0xf0, 0x8e, 0x63, 0x3f, 0x06, 0x22, - 0xb1, 0x4a, 0xfc, 0x90, 0x22, 0xf1, 0x75, 0x28, 0x3f, 0xb0, 0xc9, 0x9e, 0x61, 0x61, 0x62, 0xda, - 0x8e, 0x88, 0x20, 0x23, 0xd7, 0x68, 0x28, 0xf9, 0x4d, 0x46, 0xcd, 0x5a, 0x67, 0xfe, 0xd4, 0x32, - 0x2c, 0x93, 0x60, 0xa5, 0xe5, 0x31, 0xe1, 0xb0, 0xad, 0x9b, 0x26, 0xc1, 0xe8, 0x09, 0x58, 0xb0, - 0xec, 0xd0, 0x77, 0xcc, 0x43, 0xa3, 0xe3, 0x39, 0xfd, 0x9e, 0x1b, 0xd6, 0xce, 0xb0, 0xcf, 0xab, - 0x8a, 0xc7, 0x5b, 0xfc, 0x69, 0x7c, 0x5c, 0x06, 0x25, 0xc7, 0x65, 0xf4, 0x0f, 0xa0, 0x36, 0x38, - 0x0a, 0x54, 0x0f, 0x53, 0x3c, 0x07, 0x91, 0x1a, 0x52, 0xf5, 0xd8, 0xb9, 0x75, 0xdc, 0xd1, 0x78, - 0xda, 0xc6, 0x44, 0xff, 0x59, 0x11, 0xea, 0x51, 0x9b, 0x4d, 0xdf, 0xcf, 0x0e, 0xbe, 0x95, 0x54, - 0xdd, 0x7f, 0x6a, 0x74, 0x25, 0xc3, 0xa7, 0x20, 0x0d, 0x9f, 0xd8, 0x5c, 0x8b, 0xf9, 0xe6, 0x3a, - 0x35, 0xca, 0x5c, 0xa7, 0x27, 0x30, 0xd7, 0xd2, 0x09, 0xcd, 0x75, 0xe6, 0x04, 0xe6, 0x3a, 0x9b, - 0x36, 0xd7, 0x8c, 0xb5, 0xcd, 0x4d, 0x64, 0x6d, 0x70, 0x0a, 0xd6, 0x56, 0xce, 0xb3, 0x36, 0x9d, - 0xc0, 0x7a, 0x6e, 0x2f, 0x7f, 0xb6, 0xc6, 0xf5, 0x83, 0x62, 0xd2, 0xec, 0xc3, 0xab, 0xc1, 0x49, - 0x8c, 0xb3, 0x98, 0x6f, 0x9c, 0x53, 0xf9, 0xc6, 0x39, 0x3d, 0xca, 0x38, 0x4b, 0x13, 0x18, 0xe7, - 0xcc, 0x09, 0x8d, 0x73, 0xf6, 0x04, 0xc6, 0x39, 0x97, 0x36, 0xce, 0x1c, 0xf3, 0x80, 0x5c, 0xf3, - 0xf8, 0x48, 0x83, 0x8d, 0xfc, 0x8e, 0x52, 0x35, 0x90, 0xc9, 0x8f, 0x84, 0xe8, 0xbf, 0x06, 0x4b, - 0xdb, 0xc4, 0xf3, 0x3f, 0x93, 0x32, 0x69, 0xfd, 0x36, 0x2c, 0xcb, 0xc2, 0x27, 0xaa, 0x67, 0x7e, - 0x9f, 0x4a, 0x33, 0x03, 0xf2, 0xd9, 0x60, 0xbd, 0x03, 0x2b, 0x19, 0xe9, 0x13, 0x81, 0xfd, 0x3a, - 0xac, 0xb6, 0x71, 0xc7, 0x3b, 0xc0, 0xc1, 0x67, 0x03, 0xf7, 0x6d, 0x58, 0x1b, 0x90, 0x3f, 0x11, - 0xe0, 0x1f, 0x6b, 0xb0, 0xbc, 0x85, 0xcd, 0xf0, 0x17, 0xa9, 0x62, 0xfe, 0x0e, 0xac, 0x64, 0x20, - 0x4f, 0xa4, 0x82, 0x73, 0xb0, 0xfe, 0x06, 0x8e, 0x0c, 0x80, 0x4e, 0x4b, 0xed, 0x90, 0xd8, 0x9d, - 0x48, 0x11, 0xfa, 0xcf, 0xa7, 0x60, 0x23, 0xff, 0xbd, 0x68, 0x35, 0x84, 0x15, 0xc7, 0x0c, 0x89, - 0x41, 0x1e, 0x78, 0xc6, 0x03, 0x8c, 0xf7, 0x0d, 0x11, 0x35, 0xc4, 0xc1, 0x87, 0xd7, 0xd2, 0x63, - 0x72, 0x94, 0xa0, 0x2b, 0xb7, 0xcd, 0x90, 0xdc, 0x7b, 0xe0, 0xbd, 0x8b, 0xf1, 0x3e, 0x3f, 0xc5, - 0x66, 0xdd, 0x72, 0x49, 0x70, 0xd8, 0x46, 0xce, 0xc0, 0x0b, 0xb4, 0x0b, 0x8b, 0xc4, 0xf3, 0x0d, - 0x82, 0xdd, 0xe8, 0x98, 0x61, 0x28, 0x7c, 0xc0, 0x2b, 0xca, 0xed, 0xdd, 0xf3, 0xfc, 0x7b, 0x38, - 0x3a, 0xe3, 0x18, 0xf2, 0xb6, 0xaa, 0x44, 0x7a, 0x88, 0x2e, 0xc5, 0x47, 0xc2, 0x53, 0xd5, 0xac, - 0x95, 0xf6, 0x7c, 0x3c, 0xcb, 0xa1, 0x0e, 0xe9, 0x12, 0x54, 0xa2, 0x4c, 0x9e, 0x13, 0xf1, 0x4e, - 0x9b, 0x17, 0x0f, 0x39, 0xd1, 0x7b, 0x30, 0x1f, 0x21, 0x36, 0x7d, 0x3f, 0x14, 0x27, 0xbf, 0x5e, - 0x1c, 0x13, 0x6d, 0xd3, 0xf7, 0x05, 0x52, 0x20, 0xf1, 0x83, 0xfa, 0x2d, 0x58, 0x1b, 0xa2, 0x3c, - 0xb4, 0x08, 0x45, 0x1a, 0x17, 0xf8, 0x31, 0x4d, 0xfa, 0x2f, 0xf5, 0xdf, 0x07, 0xd4, 0xe2, 0xa2, - 0x63, 0xdc, 0xec, 0xc7, 0xcb, 0x85, 0x17, 0xb5, 0x7a, 0x13, 0x96, 0x72, 0x74, 0x32, 0x96, 0x88, - 0x1b, 0xb0, 0x90, 0x01, 0x3a, 0x0e, 0xbb, 0xfe, 0x3f, 0x45, 0x98, 0x79, 0x93, 0xef, 0x9f, 0xa1, - 0x57, 0xe4, 0xdd, 0x35, 0xa5, 0x90, 0x9d, 0xec, 0xbd, 0x3d, 0xfc, 0xa5, 0xcf, 0xd4, 0x1e, 0xf3, - 0xd4, 0x18, 0x7b, 0xcc, 0xf2, 0x12, 0xd6, 0xf4, 0x78, 0x4b, 0x58, 0x99, 0x25, 0x9c, 0xd2, 0x24, - 0x4b, 0x38, 0x33, 0x63, 0x2d, 0xe1, 0xa4, 0x52, 0xa2, 0x59, 0x29, 0x25, 0xba, 0x96, 0xa4, 0x07, - 0xca, 0x73, 0xf2, 0x7f, 0xd2, 0xa2, 0xb3, 0xc0, 0xa2, 0xf3, 0x23, 0x2f, 0x1c, 0xf5, 0xa2, 0x76, - 0xd2, 0x5e, 0x2c, 0x4c, 0xd0, 0x8b, 0x45, 0xf5, 0x5e, 0xd4, 0xef, 0x47, 0x27, 0x6f, 0xe3, 0x0f, - 0x10, 0xde, 0x71, 0x22, 0x2b, 0xd6, 0xff, 0xb6, 0x98, 0x2c, 0x56, 0x08, 0xc9, 0x71, 0x84, 0xfa, - 0x7f, 0x32, 0x3e, 0x96, 0x93, 0x0d, 0x94, 0x54, 0xba, 0x39, 0x61, 0xca, 0x1c, 0xe7, 0xe7, 0x33, - 0xf9, 0xf9, 0xf9, 0xac, 0x94, 0x9f, 0xe7, 0xe4, 0xb6, 0x73, 0xb9, 0xb9, 0x6d, 0x90, 0x4c, 0xaa, - 0x93, 0xde, 0x52, 0x4d, 0x6b, 0x9f, 0x87, 0xf9, 0xb8, 0x3f, 0x87, 0x4c, 0x7c, 0x22, 0xe3, 0x02, - 0xd1, 0x8f, 0x34, 0x95, 0x7d, 0x21, 0x3a, 0xf3, 0x97, 0xb5, 0x8f, 0xf3, 0x59, 0xfb, 0x90, 0xab, - 0x13, 0xf4, 0x17, 0xa3, 0x83, 0x77, 0x03, 0x50, 0x8f, 0xe3, 0xbc, 0x0b, 0x2b, 0x4d, 0x42, 0xcc, - 0xce, 0xde, 0x98, 0x4d, 0x0e, 0x9d, 0x47, 0xe9, 0x57, 0x61, 0x35, 0x2b, 0x51, 0x60, 0x49, 0x92, - 0x16, 0x2d, 0x9d, 0xb4, 0xdc, 0xa5, 0x5f, 0x7d, 0xda, 0x10, 0xb2, 0x12, 0x47, 0x43, 0xf8, 0x48, - 0x83, 0x32, 0x9d, 0x4f, 0x44, 0xf1, 0xea, 0x84, 0x45, 0x85, 0x99, 0x61, 0x5c, 0x18, 0xcf, 0x41, - 0xdc, 0x67, 0x67, 0x7e, 0x52, 0x30, 0x52, 0x13, 0xde, 0x0a, 0x83, 0x13, 0x09, 0xcf, 0x3b, 0x87, - 0x9a, 0xe2, 0x6b, 0x97, 0xdd, 0xe4, 0x87, 0x7e, 0x96, 0x1d, 0xae, 0x91, 0xc5, 0x72, 0x6d, 0xe8, - 0x5f, 0x8b, 0x4e, 0xba, 0x9c, 0x7a, 0xa3, 0x1b, 0xd1, 0x41, 0x95, 0xbc, 0x76, 0xaf, 0xfd, 0xd6, - 0x53, 0x50, 0x15, 0xd9, 0xd1, 0x1d, 0xd3, 0x35, 0xbb, 0x38, 0x40, 0xef, 0xc1, 0x42, 0x06, 0x25, - 0xd2, 0xd3, 0x2d, 0xe5, 0x6b, 0xa6, 0x7e, 0x69, 0x24, 0x8d, 0xe8, 0xf4, 0x0e, 0xa0, 0x41, 0x30, - 0xe8, 0xb1, 0x34, 0xeb, 0x50, 0x35, 0xd4, 0x1f, 0x3f, 0x8e, 0x4c, 0x34, 0xf2, 0x1d, 0x0d, 0x2a, - 0x52, 0xd8, 0x40, 0x0d, 0x69, 0x06, 0x9b, 0x13, 0x12, 0xeb, 0x17, 0x47, 0x50, 0x88, 0x2e, 0x7a, - 0xfe, 0xa8, 0x79, 0x06, 0x2d, 0xf0, 0x77, 0x8d, 0x7d, 0x7c, 0xd8, 0xa0, 0x5d, 0xf1, 0xd1, 0x7f, - 0xfc, 0xec, 0x0f, 0x0a, 0xeb, 0xfa, 0xea, 0xd5, 0x83, 0x67, 0xae, 0x8a, 0xec, 0x35, 0xbc, 0x1a, - 0xf5, 0x53, 0xf8, 0xb2, 0xf6, 0x24, 0xfa, 0xb9, 0x06, 0x8b, 0x59, 0xf7, 0x85, 0x2e, 0xc9, 0x9f, - 0x92, 0x1b, 0x8a, 0xea, 0x5f, 0x1c, 0x4d, 0x24, 0x60, 0x7d, 0x5b, 0x3b, 0x6a, 0xda, 0xa8, 0xfb, - 0x06, 0x26, 0x31, 0xa8, 0x70, 0xb3, 0x21, 0x2a, 0x84, 0x1b, 0xbb, 0xb6, 0x43, 0x70, 0xd0, 0x78, - 0x60, 0x93, 0xbd, 0x06, 0xd9, 0xc3, 0x21, 0x6e, 0xec, 0xda, 0xd8, 0xb1, 0xc2, 0xcb, 0xa9, 0xd1, - 0xb1, 0xd9, 0xa0, 0x91, 0x68, 0xb3, 0xc1, 0x62, 0xc0, 0x97, 0x36, 0x1b, 0x16, 0xde, 0x35, 0xfb, - 0x0e, 0x69, 0x04, 0x98, 0xf4, 0x03, 0xb7, 0x61, 0x3a, 0x4e, 0x22, 0x99, 0x7d, 0x6f, 0x0d, 0x0d, - 0xf9, 0x5e, 0xf4, 0x87, 0x1a, 0x54, 0x65, 0xf7, 0x87, 0x2e, 0x0e, 0xf6, 0x5a, 0xf6, 0x43, 0xf5, - 0x51, 0x24, 0xe2, 0x33, 0x5f, 0x39, 0x6a, 0xd6, 0xd0, 0xea, 0xeb, 0x26, 0xe9, 0xec, 0x35, 0x78, - 0x51, 0x7d, 0x06, 0xd4, 0xfa, 0x93, 0x23, 0x3a, 0xe1, 0x2f, 0x35, 0xa8, 0xca, 0xae, 0x50, 0xc6, - 0x95, 0xeb, 0x78, 0x65, 0x5c, 0xf9, 0x9e, 0x54, 0xff, 0x95, 0xa3, 0x66, 0x03, 0x9d, 0xe7, 0xb8, - 0x4c, 0x46, 0x92, 0xe0, 0x6a, 0x10, 0xaf, 0x41, 0x87, 0x22, 0xc3, 0x77, 0x51, 0xdf, 0xc8, 0xc5, - 0x77, 0x95, 0x73, 0x51, 0x94, 0x7f, 0xc5, 0xb4, 0x37, 0x1c, 0x65, 0xae, 0x6f, 0xce, 0x6a, 0x2f, - 0x17, 0xe5, 0xed, 0xa3, 0xa6, 0x8e, 0x1a, 0x91, 0xf6, 0x32, 0x28, 0x77, 0x03, 0xaf, 0xa7, 0x80, - 0x93, 0xf3, 0x51, 0x9c, 0xbf, 0xa3, 0xc1, 0x42, 0xe6, 0xca, 0x20, 0xa4, 0xe7, 0x19, 0xab, 0x7c, - 0x4f, 0x56, 0xfd, 0xd2, 0x48, 0x1a, 0x01, 0x75, 0xf3, 0xa8, 0x59, 0x41, 0x65, 0x6a, 0xce, 0xbc, - 0xa2, 0x80, 0xf7, 0xee, 0x2a, 0x5a, 0x96, 0x50, 0x89, 0x77, 0xe8, 0xb7, 0xe3, 0xb1, 0x1e, 0x95, - 0x76, 0xe4, 0x8c, 0x75, 0xf9, 0x04, 0x6c, 0xde, 0x58, 0xcf, 0x9c, 0x33, 0xd5, 0x9f, 0x39, 0x6a, - 0x2e, 0xa2, 0xaa, 0x18, 0xeb, 0xa2, 0x51, 0x6e, 0xfa, 0xfa, 0x92, 0x84, 0x83, 0x27, 0xfe, 0x54, - 0x29, 0xdf, 0xd7, 0x00, 0x71, 0x86, 0x9b, 0x78, 0xa7, 0xdf, 0x3d, 0x55, 0x38, 0x37, 0x8e, 0x9a, - 0xab, 0x48, 0xe4, 0xf2, 0x0d, 0xb6, 0x87, 0x2a, 0x81, 0x3a, 0xaf, 0x9f, 0xa5, 0xa0, 0xd8, 0x0b, - 0x23, 0x07, 0xda, 0x3d, 0xa8, 0x48, 0x97, 0x37, 0xc8, 0xa0, 0xf2, 0xee, 0x93, 0x91, 0x41, 0xe5, - 0xdf, 0x5e, 0xf2, 0x0d, 0x38, 0x33, 0x70, 0x25, 0x04, 0xfa, 0xe2, 0x50, 0xbe, 0xd4, 0xfd, 0x24, - 0xf5, 0xc7, 0x8e, 0xa1, 0x12, 0x2d, 0xfc, 0x48, 0x83, 0xb5, 0x21, 0xb7, 0x6c, 0xa0, 0x27, 0x87, - 0x8a, 0x18, 0xb8, 0x25, 0xa3, 0xfe, 0x4b, 0x4a, 0xb4, 0x89, 0xa3, 0x59, 0x47, 0xe2, 0x0a, 0x94, - 0x48, 0xcb, 0x74, 0x64, 0x0b, 0xba, 0x5c, 0x2b, 0xe8, 0x31, 0x6a, 0xaa, 0xea, 0x7f, 0xd5, 0x60, - 0x7d, 0xc4, 0x45, 0x19, 0xe8, 0xca, 0xc8, 0x2f, 0x1f, 0x84, 0x7e, 0x55, 0x99, 0x5e, 0xc0, 0x7f, - 0xeb, 0xa8, 0xf9, 0x04, 0x7a, 0x4c, 0xc0, 0xa7, 0x83, 0x3a, 0x85, 0xbd, 0x61, 0xbb, 0x34, 0x08, - 0xe4, 0xd9, 0x4e, 0xe6, 0x53, 0xd8, 0x12, 0x30, 0xf3, 0x9c, 0xef, 0xc2, 0x72, 0xde, 0xd5, 0x1c, - 0xe8, 0x89, 0x4c, 0xb8, 0x1f, 0x76, 0xaf, 0x46, 0x7d, 0x75, 0x20, 0xe9, 0xba, 0xd5, 0xf3, 0xc9, - 0x21, 0xfa, 0x75, 0x3a, 0x07, 0xcb, 0xbd, 0x91, 0x43, 0xee, 0xdb, 0xd1, 0xd7, 0x76, 0x0c, 0x15, - 0xff, 0xbd, 0x38, 0x12, 0x45, 0x0b, 0x7a, 0x79, 0x91, 0x28, 0xb3, 0x3e, 0x99, 0x17, 0x89, 0xb2, - 0xeb, 0x81, 0xfa, 0x8b, 0x47, 0xcd, 0x35, 0xb4, 0x22, 0x45, 0xa2, 0x48, 0x7b, 0xb9, 0xc6, 0xc1, - 0x69, 0xa8, 0x2e, 0xbf, 0xab, 0x41, 0x55, 0xbe, 0x89, 0x42, 0xc6, 0x94, 0x7b, 0xc1, 0x86, 0x8c, - 0x29, 0xff, 0x22, 0x0b, 0xfd, 0x59, 0x96, 0x9b, 0x88, 0x97, 0x52, 0xff, 0x9e, 0xd5, 0x65, 0xc7, - 0x29, 0xea, 0x5c, 0x28, 0x9c, 0xef, 0x69, 0xb0, 0x90, 0xb9, 0x0d, 0x42, 0x76, 0xe3, 0xf9, 0x37, - 0x55, 0xc8, 0x6e, 0x7c, 0xc8, 0x75, 0x12, 0x34, 0x5b, 0x42, 0x68, 0x31, 0x7a, 0x2b, 0x41, 0xaa, - 0xeb, 0x2b, 0x12, 0xa4, 0x40, 0x10, 0x51, 0x4c, 0xd4, 0x9f, 0x4b, 0x47, 0xff, 0x65, 0x5f, 0x95, - 0x77, 0xa3, 0x81, 0xec, 0xab, 0x72, 0xef, 0x0d, 0x10, 0xfe, 0x9c, 0xbf, 0x1b, 0xe9, 0xcf, 0x03, - 0x46, 0x42, 0x91, 0xfc, 0x99, 0xc6, 0xf2, 0x60, 0xc9, 0x30, 0xb3, 0x79, 0x70, 0x9e, 0x41, 0x5e, - 0x1a, 0x49, 0x23, 0xf0, 0xbc, 0x76, 0xd4, 0xdc, 0x40, 0x75, 0x91, 0x35, 0x58, 0x16, 0x1b, 0xa8, - 0x2c, 0x5d, 0x48, 0x63, 0xcb, 0xa6, 0x95, 0xa6, 0x65, 0x25, 0xe3, 0xf2, 0x63, 0x2d, 0x4a, 0xa5, - 0x25, 0x84, 0x8f, 0x0d, 0x35, 0x60, 0x09, 0xe4, 0xe3, 0xc7, 0x91, 0x09, 0x9c, 0x5f, 0x3d, 0x6a, - 0x5e, 0x44, 0x17, 0x24, 0x5b, 0xe7, 0x50, 0x59, 0xce, 0x30, 0xca, 0x8f, 0x88, 0x53, 0x93, 0x31, - 0xde, 0x3f, 0xd5, 0x60, 0x31, 0x7b, 0xde, 0x5b, 0x4e, 0x83, 0x87, 0x9c, 0x5e, 0x97, 0xd3, 0xe0, - 0x61, 0x47, 0xc6, 0xa9, 0xdb, 0x5e, 0x43, 0x2b, 0xfc, 0x75, 0x03, 0xbb, 0x07, 0x0d, 0x6f, 0x57, - 0xc2, 0xb7, 0x71, 0x6d, 0x2d, 0x33, 0x0e, 0x28, 0xa5, 0x81, 0xdd, 0x03, 0x8a, 0xee, 0x8f, 0x0b, - 0x49, 0x92, 0x1e, 0xfb, 0x8b, 0xdc, 0x74, 0x25, 0xeb, 0x31, 0xbe, 0x38, 0x9a, 0x48, 0xa0, 0xfb, - 0x54, 0x3b, 0x6a, 0xfe, 0x85, 0x86, 0xfe, 0x5c, 0xa3, 0x79, 0x4d, 0x84, 0x61, 0xb3, 0xd1, 0x31, - 0xdd, 0xe1, 0x19, 0x7a, 0xb2, 0xe9, 0xb0, 0xd9, 0xe0, 0x5b, 0xf8, 0x9b, 0x8d, 0xa4, 0x22, 0x66, - 0xb3, 0xc1, 0x97, 0x0d, 0x37, 0x1b, 0x49, 0xb9, 0xcb, 0x66, 0x23, 0x5d, 0xdb, 0x22, 0x12, 0xfa, - 0xcd, 0x46, 0xba, 0x1a, 0x23, 0x3f, 0xbd, 0x97, 0xfc, 0x57, 0x15, 0xcd, 0xa7, 0x35, 0x85, 0x7e, - 0x54, 0x80, 0x95, 0xe8, 0xc3, 0xd2, 0xa9, 0xcd, 0xa9, 0x2a, 0xe8, 0x5f, 0xb4, 0xa3, 0xe6, 0xc7, - 0x1a, 0xfa, 0x1b, 0xa6, 0x20, 0x29, 0xc3, 0xf9, 0x1c, 0xa9, 0x49, 0xc6, 0xc5, 0x94, 0xb5, 0x8c, - 0xd0, 0x60, 0xea, 0x85, 0xfe, 0xae, 0x00, 0x4b, 0x39, 0xbb, 0xf5, 0xe8, 0xf1, 0x3c, 0x5d, 0x0c, - 0x16, 0x6d, 0xd4, 0x9f, 0x38, 0x96, 0x4e, 0xa8, 0xed, 0x27, 0xda, 0x51, 0xf3, 0xaf, 0x35, 0xf4, - 0x03, 0xa6, 0x36, 0xd3, 0xf7, 0x3f, 0x87, 0x4a, 0x4b, 0xa3, 0x62, 0x2a, 0x5b, 0x42, 0x67, 0x64, - 0xb7, 0xe6, 0xfb, 0x21, 0xfa, 0x49, 0x21, 0x59, 0xe4, 0x63, 0x46, 0xf6, 0x99, 0xaa, 0xed, 0x3f, - 0xb5, 0xa3, 0xe6, 0xdf, 0x6b, 0xe8, 0x93, 0x94, 0xb5, 0x7d, 0x3e, 0x95, 0x37, 0x88, 0x8d, 0x07, - 0x75, 0xb4, 0x96, 0x93, 0xf0, 0x33, 0x45, 0xfe, 0x97, 0x06, 0xcb, 0x79, 0x85, 0x00, 0xe8, 0x89, - 0x11, 0xe3, 0x50, 0x8a, 0x0d, 0x97, 0x8f, 0x27, 0x14, 0x6a, 0xec, 0x1f, 0x35, 0xbf, 0x86, 0xde, - 0xa1, 0x3a, 0xe4, 0x41, 0xc1, 0x76, 0x23, 0x98, 0x63, 0x68, 0x50, 0xac, 0xee, 0x25, 0x6a, 0xe3, - 0xcb, 0x10, 0xe9, 0xd1, 0x15, 0x7f, 0x21, 0x6b, 0x86, 0xe6, 0x08, 0xf3, 0xe9, 0x52, 0x00, 0x24, - 0x55, 0x3a, 0xe6, 0x54, 0x20, 0xd4, 0x1b, 0xc3, 0x09, 0xc4, 0xa7, 0x3c, 0x77, 0xd4, 0x5c, 0x41, - 0x4b, 0x3c, 0xd0, 0x85, 0xc4, 0xcb, 0xe8, 0x7b, 0x55, 0x97, 0x4d, 0x96, 0x52, 0x88, 0x84, 0xae, - 0x22, 0x6d, 0xf4, 0xa3, 0x4c, 0x4b, 0x83, 0x15, 0x06, 0x72, 0xb6, 0x92, 0x5b, 0x25, 0xa0, 0x7f, - 0x99, 0x4d, 0xf7, 0x22, 0x30, 0x66, 0x40, 0x64, 0x34, 0x6b, 0x3a, 0xca, 0xa0, 0x31, 0x03, 0x42, - 0xe1, 0xfc, 0x11, 0x4d, 0xe8, 0xe4, 0x8d, 0xfc, 0x4c, 0x42, 0x97, 0x5b, 0x45, 0x90, 0x49, 0xe8, - 0xf2, 0x2b, 0x01, 0xf4, 0x97, 0x53, 0x0b, 0x30, 0x01, 0xa7, 0xc9, 0x18, 0x65, 0x26, 0xd3, 0x14, - 0x44, 0x91, 0x9e, 0xa4, 0xcd, 0xf5, 0xcc, 0xb4, 0x38, 0xa7, 0x54, 0x20, 0x33, 0x2d, 0xce, 0xdb, - 0x99, 0x97, 0xf4, 0xd4, 0xa1, 0x14, 0xa3, 0xf5, 0xc4, 0x48, 0x28, 0x9c, 0x1f, 0x6a, 0xb0, 0x9c, - 0xb7, 0x2b, 0x2c, 0x8f, 0x91, 0x11, 0xdb, 0xf7, 0xf2, 0x18, 0x19, 0xb5, 0xc1, 0x4c, 0xa7, 0xee, - 0xeb, 0xe8, 0x2c, 0x5b, 0xce, 0x88, 0x5f, 0x66, 0x73, 0x13, 0x31, 0x9c, 0xd3, 0x1d, 0x1a, 0x21, - 0xfa, 0x20, 0x73, 0x8f, 0x5f, 0x7c, 0x7b, 0x30, 0xfa, 0xd2, 0xd0, 0x14, 0x2e, 0x7b, 0x9f, 0x71, - 0xfd, 0x49, 0x15, 0x52, 0x81, 0xf7, 0x0b, 0x88, 0xc0, 0xda, 0x90, 0x1b, 0x8b, 0x33, 0x93, 0xee, - 0x91, 0x97, 0x28, 0x67, 0x26, 0xdd, 0xa3, 0xaf, 0x40, 0xd6, 0xbf, 0xf0, 0xfa, 0xd4, 0x7b, 0x05, - 0x7f, 0x67, 0xa7, 0xc4, 0x66, 0x71, 0xcf, 0xfe, 0x5f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x55, 0xa6, - 0x56, 0x00, 0x32, 0x5e, 0x00, 0x00, -} - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConn - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion4 - -// ClusterManagerClient is the client API for ClusterManager service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type ClusterManagerClient interface { - AddNodeKeyPairs(ctx context.Context, in *AddNodeKeyPairsRequest, opts ...grpc.CallOption) (*AddNodeKeyPairsResponse, error) - DeleteNodeKeyPairs(ctx context.Context, in *DeleteNodeKeyPairsRequest, opts ...grpc.CallOption) (*DeleteNodeKeyPairsResponse, error) - // Create key pair - CreateKeyPair(ctx context.Context, in *CreateKeyPairRequest, opts ...grpc.CallOption) (*CreateKeyPairResponse, error) - // Get key pairs, support filter with these fields(key_pair_id, name, owner), default return all key pairs - DescribeKeyPairs(ctx context.Context, in *DescribeKeyPairsRequest, opts ...grpc.CallOption) (*DescribeKeyPairsResponse, error) - // Batch delete key pairs - DeleteKeyPairs(ctx context.Context, in *DeleteKeyPairsRequest, opts ...grpc.CallOption) (*DeleteKeyPairsResponse, error) - // Batch attach key pairs to node - AttachKeyPairs(ctx context.Context, in *AttachKeyPairsRequest, opts ...grpc.CallOption) (*AttachKeyPairsResponse, error) - //Batch detach key pairs from node - DetachKeyPairs(ctx context.Context, in *DetachKeyPairsRequest, opts ...grpc.CallOption) (*DetachKeyPairsResponse, error) - // Get subnets - DescribeSubnets(ctx context.Context, in *DescribeSubnetsRequest, opts ...grpc.CallOption) (*DescribeSubnetsResponse, error) - // Create cluster - CreateCluster(ctx context.Context, in *CreateClusterRequest, opts ...grpc.CallOption) (*CreateClusterResponse, error) - // Create debug cluster - CreateDebugCluster(ctx context.Context, in *CreateClusterRequest, opts ...grpc.CallOption) (*CreateClusterResponse, error) - ModifyCluster(ctx context.Context, in *ModifyClusterRequest, opts ...grpc.CallOption) (*ModifyClusterResponse, error) - ModifyClusterNode(ctx context.Context, in *ModifyClusterNodeRequest, opts ...grpc.CallOption) (*ModifyClusterNodeResponse, error) - // Modify cluster attributes - ModifyClusterAttributes(ctx context.Context, in *ModifyClusterAttributesRequest, opts ...grpc.CallOption) (*ModifyClusterAttributesResponse, error) - // Modify node attributes in the cluster - ModifyClusterNodeAttributes(ctx context.Context, in *ModifyClusterNodeAttributesRequest, opts ...grpc.CallOption) (*ModifyClusterNodeAttributesResponse, error) - AddTableClusterNodes(ctx context.Context, in *AddTableClusterNodesRequest, opts ...grpc.CallOption) (*empty.Empty, error) - DeleteTableClusterNodes(ctx context.Context, in *DeleteTableClusterNodesRequest, opts ...grpc.CallOption) (*empty.Empty, error) - // Batch delete clusters - DeleteClusters(ctx context.Context, in *DeleteClustersRequest, opts ...grpc.CallOption) (*DeleteClustersResponse, error) - // Upgrade cluster - UpgradeCluster(ctx context.Context, in *UpgradeClusterRequest, opts ...grpc.CallOption) (*UpgradeClusterResponse, error) - // Rollback cluster - RollbackCluster(ctx context.Context, in *RollbackClusterRequest, opts ...grpc.CallOption) (*RollbackClusterResponse, error) - // Resize cluster - ResizeCluster(ctx context.Context, in *ResizeClusterRequest, opts ...grpc.CallOption) (*ResizeClusterResponse, error) - // Batch add nodes to cluster - AddClusterNodes(ctx context.Context, in *AddClusterNodesRequest, opts ...grpc.CallOption) (*AddClusterNodesResponse, error) - // Batch delete nodes from cluster - DeleteClusterNodes(ctx context.Context, in *DeleteClusterNodesRequest, opts ...grpc.CallOption) (*DeleteClusterNodesResponse, error) - // Update env of cluster - UpdateClusterEnv(ctx context.Context, in *UpdateClusterEnvRequest, opts ...grpc.CallOption) (*UpdateClusterEnvResponse, error) - // Get clusters, can filter with these fields(cluster_id, app_id, version_id, status, runtime_id, frontgate_id, owner, cluster_type), default return all clusters - DescribeClusters(ctx context.Context, in *DescribeClustersRequest, opts ...grpc.CallOption) (*DescribeClustersResponse, error) - // Get debug clusters, can filter with these fields(cluster_id, app_id, version_id, status, runtime_id, frontgate_id, owner, cluster_type), default return all debug clusters - DescribeDebugClusters(ctx context.Context, in *DescribeClustersRequest, opts ...grpc.CallOption) (*DescribeClustersResponse, error) - // Get app clusters, can filter with these fields(cluster_id, app_id, version_id, status, runtime_id, frontgate_id, owner, cluster_type), default return all app clusters - DescribeAppClusters(ctx context.Context, in *DescribeAppClustersRequest, opts ...grpc.CallOption) (*DescribeAppClustersResponse, error) - // Get debug app clusters, can filter with these fields(cluster_id, app_id, version_id, status, runtime_id, frontgate_id, owner, cluster_type), default return all debug app clusters - DescribeDebugAppClusters(ctx context.Context, in *DescribeAppClustersRequest, opts ...grpc.CallOption) (*DescribeAppClustersResponse, error) - // Get nodes in cluster, can filter with these fields(cluster_id, node_id, status, owner) - DescribeClusterNodes(ctx context.Context, in *DescribeClusterNodesRequest, opts ...grpc.CallOption) (*DescribeClusterNodesResponse, error) - // Batch stop clusters - StopClusters(ctx context.Context, in *StopClustersRequest, opts ...grpc.CallOption) (*StopClustersResponse, error) - // Batch start cluster - StartClusters(ctx context.Context, in *StartClustersRequest, opts ...grpc.CallOption) (*StartClustersResponse, error) - // Batch recover clusters - RecoverClusters(ctx context.Context, in *RecoverClustersRequest, opts ...grpc.CallOption) (*RecoverClustersResponse, error) - // Batch cease clusters - CeaseClusters(ctx context.Context, in *CeaseClustersRequest, opts ...grpc.CallOption) (*CeaseClustersResponse, error) - // Get statistics of cluster - GetClusterStatistics(ctx context.Context, in *GetClusterStatisticsRequest, opts ...grpc.CallOption) (*GetClusterStatisticsResponse, error) - // for kubesphere - DeleteClusterInRuntime(ctx context.Context, in *DeleteClusterInRuntimeRequest, opts ...grpc.CallOption) (*DeleteClusterInRuntimeResponse, error) - MigrateClusterInRuntime(ctx context.Context, in *MigrateClusterInRuntimeRequest, opts ...grpc.CallOption) (*MigrateClusterInRuntimeResponse, error) -} - -type clusterManagerClient struct { - cc *grpc.ClientConn -} - -func NewClusterManagerClient(cc *grpc.ClientConn) ClusterManagerClient { - return &clusterManagerClient{cc} -} - -func (c *clusterManagerClient) AddNodeKeyPairs(ctx context.Context, in *AddNodeKeyPairsRequest, opts ...grpc.CallOption) (*AddNodeKeyPairsResponse, error) { - out := new(AddNodeKeyPairsResponse) - err := c.cc.Invoke(ctx, "/openpitrix.ClusterManager/AddNodeKeyPairs", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *clusterManagerClient) DeleteNodeKeyPairs(ctx context.Context, in *DeleteNodeKeyPairsRequest, opts ...grpc.CallOption) (*DeleteNodeKeyPairsResponse, error) { - out := new(DeleteNodeKeyPairsResponse) - err := c.cc.Invoke(ctx, "/openpitrix.ClusterManager/DeleteNodeKeyPairs", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *clusterManagerClient) CreateKeyPair(ctx context.Context, in *CreateKeyPairRequest, opts ...grpc.CallOption) (*CreateKeyPairResponse, error) { - out := new(CreateKeyPairResponse) - err := c.cc.Invoke(ctx, "/openpitrix.ClusterManager/CreateKeyPair", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *clusterManagerClient) DescribeKeyPairs(ctx context.Context, in *DescribeKeyPairsRequest, opts ...grpc.CallOption) (*DescribeKeyPairsResponse, error) { - out := new(DescribeKeyPairsResponse) - err := c.cc.Invoke(ctx, "/openpitrix.ClusterManager/DescribeKeyPairs", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *clusterManagerClient) DeleteKeyPairs(ctx context.Context, in *DeleteKeyPairsRequest, opts ...grpc.CallOption) (*DeleteKeyPairsResponse, error) { - out := new(DeleteKeyPairsResponse) - err := c.cc.Invoke(ctx, "/openpitrix.ClusterManager/DeleteKeyPairs", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *clusterManagerClient) AttachKeyPairs(ctx context.Context, in *AttachKeyPairsRequest, opts ...grpc.CallOption) (*AttachKeyPairsResponse, error) { - out := new(AttachKeyPairsResponse) - err := c.cc.Invoke(ctx, "/openpitrix.ClusterManager/AttachKeyPairs", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *clusterManagerClient) DetachKeyPairs(ctx context.Context, in *DetachKeyPairsRequest, opts ...grpc.CallOption) (*DetachKeyPairsResponse, error) { - out := new(DetachKeyPairsResponse) - err := c.cc.Invoke(ctx, "/openpitrix.ClusterManager/DetachKeyPairs", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *clusterManagerClient) DescribeSubnets(ctx context.Context, in *DescribeSubnetsRequest, opts ...grpc.CallOption) (*DescribeSubnetsResponse, error) { - out := new(DescribeSubnetsResponse) - err := c.cc.Invoke(ctx, "/openpitrix.ClusterManager/DescribeSubnets", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *clusterManagerClient) CreateCluster(ctx context.Context, in *CreateClusterRequest, opts ...grpc.CallOption) (*CreateClusterResponse, error) { - out := new(CreateClusterResponse) - err := c.cc.Invoke(ctx, "/openpitrix.ClusterManager/CreateCluster", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *clusterManagerClient) CreateDebugCluster(ctx context.Context, in *CreateClusterRequest, opts ...grpc.CallOption) (*CreateClusterResponse, error) { - out := new(CreateClusterResponse) - err := c.cc.Invoke(ctx, "/openpitrix.ClusterManager/CreateDebugCluster", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *clusterManagerClient) ModifyCluster(ctx context.Context, in *ModifyClusterRequest, opts ...grpc.CallOption) (*ModifyClusterResponse, error) { - out := new(ModifyClusterResponse) - err := c.cc.Invoke(ctx, "/openpitrix.ClusterManager/ModifyCluster", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *clusterManagerClient) ModifyClusterNode(ctx context.Context, in *ModifyClusterNodeRequest, opts ...grpc.CallOption) (*ModifyClusterNodeResponse, error) { - out := new(ModifyClusterNodeResponse) - err := c.cc.Invoke(ctx, "/openpitrix.ClusterManager/ModifyClusterNode", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *clusterManagerClient) ModifyClusterAttributes(ctx context.Context, in *ModifyClusterAttributesRequest, opts ...grpc.CallOption) (*ModifyClusterAttributesResponse, error) { - out := new(ModifyClusterAttributesResponse) - err := c.cc.Invoke(ctx, "/openpitrix.ClusterManager/ModifyClusterAttributes", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *clusterManagerClient) ModifyClusterNodeAttributes(ctx context.Context, in *ModifyClusterNodeAttributesRequest, opts ...grpc.CallOption) (*ModifyClusterNodeAttributesResponse, error) { - out := new(ModifyClusterNodeAttributesResponse) - err := c.cc.Invoke(ctx, "/openpitrix.ClusterManager/ModifyClusterNodeAttributes", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *clusterManagerClient) AddTableClusterNodes(ctx context.Context, in *AddTableClusterNodesRequest, opts ...grpc.CallOption) (*empty.Empty, error) { - out := new(empty.Empty) - err := c.cc.Invoke(ctx, "/openpitrix.ClusterManager/AddTableClusterNodes", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *clusterManagerClient) DeleteTableClusterNodes(ctx context.Context, in *DeleteTableClusterNodesRequest, opts ...grpc.CallOption) (*empty.Empty, error) { - out := new(empty.Empty) - err := c.cc.Invoke(ctx, "/openpitrix.ClusterManager/DeleteTableClusterNodes", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *clusterManagerClient) DeleteClusters(ctx context.Context, in *DeleteClustersRequest, opts ...grpc.CallOption) (*DeleteClustersResponse, error) { - out := new(DeleteClustersResponse) - err := c.cc.Invoke(ctx, "/openpitrix.ClusterManager/DeleteClusters", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *clusterManagerClient) UpgradeCluster(ctx context.Context, in *UpgradeClusterRequest, opts ...grpc.CallOption) (*UpgradeClusterResponse, error) { - out := new(UpgradeClusterResponse) - err := c.cc.Invoke(ctx, "/openpitrix.ClusterManager/UpgradeCluster", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *clusterManagerClient) RollbackCluster(ctx context.Context, in *RollbackClusterRequest, opts ...grpc.CallOption) (*RollbackClusterResponse, error) { - out := new(RollbackClusterResponse) - err := c.cc.Invoke(ctx, "/openpitrix.ClusterManager/RollbackCluster", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *clusterManagerClient) ResizeCluster(ctx context.Context, in *ResizeClusterRequest, opts ...grpc.CallOption) (*ResizeClusterResponse, error) { - out := new(ResizeClusterResponse) - err := c.cc.Invoke(ctx, "/openpitrix.ClusterManager/ResizeCluster", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *clusterManagerClient) AddClusterNodes(ctx context.Context, in *AddClusterNodesRequest, opts ...grpc.CallOption) (*AddClusterNodesResponse, error) { - out := new(AddClusterNodesResponse) - err := c.cc.Invoke(ctx, "/openpitrix.ClusterManager/AddClusterNodes", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *clusterManagerClient) DeleteClusterNodes(ctx context.Context, in *DeleteClusterNodesRequest, opts ...grpc.CallOption) (*DeleteClusterNodesResponse, error) { - out := new(DeleteClusterNodesResponse) - err := c.cc.Invoke(ctx, "/openpitrix.ClusterManager/DeleteClusterNodes", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *clusterManagerClient) UpdateClusterEnv(ctx context.Context, in *UpdateClusterEnvRequest, opts ...grpc.CallOption) (*UpdateClusterEnvResponse, error) { - out := new(UpdateClusterEnvResponse) - err := c.cc.Invoke(ctx, "/openpitrix.ClusterManager/UpdateClusterEnv", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *clusterManagerClient) DescribeClusters(ctx context.Context, in *DescribeClustersRequest, opts ...grpc.CallOption) (*DescribeClustersResponse, error) { - out := new(DescribeClustersResponse) - err := c.cc.Invoke(ctx, "/openpitrix.ClusterManager/DescribeClusters", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *clusterManagerClient) DescribeDebugClusters(ctx context.Context, in *DescribeClustersRequest, opts ...grpc.CallOption) (*DescribeClustersResponse, error) { - out := new(DescribeClustersResponse) - err := c.cc.Invoke(ctx, "/openpitrix.ClusterManager/DescribeDebugClusters", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *clusterManagerClient) DescribeAppClusters(ctx context.Context, in *DescribeAppClustersRequest, opts ...grpc.CallOption) (*DescribeAppClustersResponse, error) { - out := new(DescribeAppClustersResponse) - err := c.cc.Invoke(ctx, "/openpitrix.ClusterManager/DescribeAppClusters", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *clusterManagerClient) DescribeDebugAppClusters(ctx context.Context, in *DescribeAppClustersRequest, opts ...grpc.CallOption) (*DescribeAppClustersResponse, error) { - out := new(DescribeAppClustersResponse) - err := c.cc.Invoke(ctx, "/openpitrix.ClusterManager/DescribeDebugAppClusters", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *clusterManagerClient) DescribeClusterNodes(ctx context.Context, in *DescribeClusterNodesRequest, opts ...grpc.CallOption) (*DescribeClusterNodesResponse, error) { - out := new(DescribeClusterNodesResponse) - err := c.cc.Invoke(ctx, "/openpitrix.ClusterManager/DescribeClusterNodes", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *clusterManagerClient) StopClusters(ctx context.Context, in *StopClustersRequest, opts ...grpc.CallOption) (*StopClustersResponse, error) { - out := new(StopClustersResponse) - err := c.cc.Invoke(ctx, "/openpitrix.ClusterManager/StopClusters", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *clusterManagerClient) StartClusters(ctx context.Context, in *StartClustersRequest, opts ...grpc.CallOption) (*StartClustersResponse, error) { - out := new(StartClustersResponse) - err := c.cc.Invoke(ctx, "/openpitrix.ClusterManager/StartClusters", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *clusterManagerClient) RecoverClusters(ctx context.Context, in *RecoverClustersRequest, opts ...grpc.CallOption) (*RecoverClustersResponse, error) { - out := new(RecoverClustersResponse) - err := c.cc.Invoke(ctx, "/openpitrix.ClusterManager/RecoverClusters", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *clusterManagerClient) CeaseClusters(ctx context.Context, in *CeaseClustersRequest, opts ...grpc.CallOption) (*CeaseClustersResponse, error) { - out := new(CeaseClustersResponse) - err := c.cc.Invoke(ctx, "/openpitrix.ClusterManager/CeaseClusters", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *clusterManagerClient) GetClusterStatistics(ctx context.Context, in *GetClusterStatisticsRequest, opts ...grpc.CallOption) (*GetClusterStatisticsResponse, error) { - out := new(GetClusterStatisticsResponse) - err := c.cc.Invoke(ctx, "/openpitrix.ClusterManager/GetClusterStatistics", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *clusterManagerClient) DeleteClusterInRuntime(ctx context.Context, in *DeleteClusterInRuntimeRequest, opts ...grpc.CallOption) (*DeleteClusterInRuntimeResponse, error) { - out := new(DeleteClusterInRuntimeResponse) - err := c.cc.Invoke(ctx, "/openpitrix.ClusterManager/DeleteClusterInRuntime", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *clusterManagerClient) MigrateClusterInRuntime(ctx context.Context, in *MigrateClusterInRuntimeRequest, opts ...grpc.CallOption) (*MigrateClusterInRuntimeResponse, error) { - out := new(MigrateClusterInRuntimeResponse) - err := c.cc.Invoke(ctx, "/openpitrix.ClusterManager/MigrateClusterInRuntime", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// ClusterManagerServer is the server API for ClusterManager service. -type ClusterManagerServer interface { - AddNodeKeyPairs(context.Context, *AddNodeKeyPairsRequest) (*AddNodeKeyPairsResponse, error) - DeleteNodeKeyPairs(context.Context, *DeleteNodeKeyPairsRequest) (*DeleteNodeKeyPairsResponse, error) - // Create key pair - CreateKeyPair(context.Context, *CreateKeyPairRequest) (*CreateKeyPairResponse, error) - // Get key pairs, support filter with these fields(key_pair_id, name, owner), default return all key pairs - DescribeKeyPairs(context.Context, *DescribeKeyPairsRequest) (*DescribeKeyPairsResponse, error) - // Batch delete key pairs - DeleteKeyPairs(context.Context, *DeleteKeyPairsRequest) (*DeleteKeyPairsResponse, error) - // Batch attach key pairs to node - AttachKeyPairs(context.Context, *AttachKeyPairsRequest) (*AttachKeyPairsResponse, error) - //Batch detach key pairs from node - DetachKeyPairs(context.Context, *DetachKeyPairsRequest) (*DetachKeyPairsResponse, error) - // Get subnets - DescribeSubnets(context.Context, *DescribeSubnetsRequest) (*DescribeSubnetsResponse, error) - // Create cluster - CreateCluster(context.Context, *CreateClusterRequest) (*CreateClusterResponse, error) - // Create debug cluster - CreateDebugCluster(context.Context, *CreateClusterRequest) (*CreateClusterResponse, error) - ModifyCluster(context.Context, *ModifyClusterRequest) (*ModifyClusterResponse, error) - ModifyClusterNode(context.Context, *ModifyClusterNodeRequest) (*ModifyClusterNodeResponse, error) - // Modify cluster attributes - ModifyClusterAttributes(context.Context, *ModifyClusterAttributesRequest) (*ModifyClusterAttributesResponse, error) - // Modify node attributes in the cluster - ModifyClusterNodeAttributes(context.Context, *ModifyClusterNodeAttributesRequest) (*ModifyClusterNodeAttributesResponse, error) - AddTableClusterNodes(context.Context, *AddTableClusterNodesRequest) (*empty.Empty, error) - DeleteTableClusterNodes(context.Context, *DeleteTableClusterNodesRequest) (*empty.Empty, error) - // Batch delete clusters - DeleteClusters(context.Context, *DeleteClustersRequest) (*DeleteClustersResponse, error) - // Upgrade cluster - UpgradeCluster(context.Context, *UpgradeClusterRequest) (*UpgradeClusterResponse, error) - // Rollback cluster - RollbackCluster(context.Context, *RollbackClusterRequest) (*RollbackClusterResponse, error) - // Resize cluster - ResizeCluster(context.Context, *ResizeClusterRequest) (*ResizeClusterResponse, error) - // Batch add nodes to cluster - AddClusterNodes(context.Context, *AddClusterNodesRequest) (*AddClusterNodesResponse, error) - // Batch delete nodes from cluster - DeleteClusterNodes(context.Context, *DeleteClusterNodesRequest) (*DeleteClusterNodesResponse, error) - // Update env of cluster - UpdateClusterEnv(context.Context, *UpdateClusterEnvRequest) (*UpdateClusterEnvResponse, error) - // Get clusters, can filter with these fields(cluster_id, app_id, version_id, status, runtime_id, frontgate_id, owner, cluster_type), default return all clusters - DescribeClusters(context.Context, *DescribeClustersRequest) (*DescribeClustersResponse, error) - // Get debug clusters, can filter with these fields(cluster_id, app_id, version_id, status, runtime_id, frontgate_id, owner, cluster_type), default return all debug clusters - DescribeDebugClusters(context.Context, *DescribeClustersRequest) (*DescribeClustersResponse, error) - // Get app clusters, can filter with these fields(cluster_id, app_id, version_id, status, runtime_id, frontgate_id, owner, cluster_type), default return all app clusters - DescribeAppClusters(context.Context, *DescribeAppClustersRequest) (*DescribeAppClustersResponse, error) - // Get debug app clusters, can filter with these fields(cluster_id, app_id, version_id, status, runtime_id, frontgate_id, owner, cluster_type), default return all debug app clusters - DescribeDebugAppClusters(context.Context, *DescribeAppClustersRequest) (*DescribeAppClustersResponse, error) - // Get nodes in cluster, can filter with these fields(cluster_id, node_id, status, owner) - DescribeClusterNodes(context.Context, *DescribeClusterNodesRequest) (*DescribeClusterNodesResponse, error) - // Batch stop clusters - StopClusters(context.Context, *StopClustersRequest) (*StopClustersResponse, error) - // Batch start cluster - StartClusters(context.Context, *StartClustersRequest) (*StartClustersResponse, error) - // Batch recover clusters - RecoverClusters(context.Context, *RecoverClustersRequest) (*RecoverClustersResponse, error) - // Batch cease clusters - CeaseClusters(context.Context, *CeaseClustersRequest) (*CeaseClustersResponse, error) - // Get statistics of cluster - GetClusterStatistics(context.Context, *GetClusterStatisticsRequest) (*GetClusterStatisticsResponse, error) - // for kubesphere - DeleteClusterInRuntime(context.Context, *DeleteClusterInRuntimeRequest) (*DeleteClusterInRuntimeResponse, error) - MigrateClusterInRuntime(context.Context, *MigrateClusterInRuntimeRequest) (*MigrateClusterInRuntimeResponse, error) -} - -// UnimplementedClusterManagerServer can be embedded to have forward compatible implementations. -type UnimplementedClusterManagerServer struct { -} - -func (*UnimplementedClusterManagerServer) AddNodeKeyPairs(ctx context.Context, req *AddNodeKeyPairsRequest) (*AddNodeKeyPairsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method AddNodeKeyPairs not implemented") -} -func (*UnimplementedClusterManagerServer) DeleteNodeKeyPairs(ctx context.Context, req *DeleteNodeKeyPairsRequest) (*DeleteNodeKeyPairsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method DeleteNodeKeyPairs not implemented") -} -func (*UnimplementedClusterManagerServer) CreateKeyPair(ctx context.Context, req *CreateKeyPairRequest) (*CreateKeyPairResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method CreateKeyPair not implemented") -} -func (*UnimplementedClusterManagerServer) DescribeKeyPairs(ctx context.Context, req *DescribeKeyPairsRequest) (*DescribeKeyPairsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method DescribeKeyPairs not implemented") -} -func (*UnimplementedClusterManagerServer) DeleteKeyPairs(ctx context.Context, req *DeleteKeyPairsRequest) (*DeleteKeyPairsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method DeleteKeyPairs not implemented") -} -func (*UnimplementedClusterManagerServer) AttachKeyPairs(ctx context.Context, req *AttachKeyPairsRequest) (*AttachKeyPairsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method AttachKeyPairs not implemented") -} -func (*UnimplementedClusterManagerServer) DetachKeyPairs(ctx context.Context, req *DetachKeyPairsRequest) (*DetachKeyPairsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method DetachKeyPairs not implemented") -} -func (*UnimplementedClusterManagerServer) DescribeSubnets(ctx context.Context, req *DescribeSubnetsRequest) (*DescribeSubnetsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method DescribeSubnets not implemented") -} -func (*UnimplementedClusterManagerServer) CreateCluster(ctx context.Context, req *CreateClusterRequest) (*CreateClusterResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method CreateCluster not implemented") -} -func (*UnimplementedClusterManagerServer) CreateDebugCluster(ctx context.Context, req *CreateClusterRequest) (*CreateClusterResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method CreateDebugCluster not implemented") -} -func (*UnimplementedClusterManagerServer) ModifyCluster(ctx context.Context, req *ModifyClusterRequest) (*ModifyClusterResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ModifyCluster not implemented") -} -func (*UnimplementedClusterManagerServer) ModifyClusterNode(ctx context.Context, req *ModifyClusterNodeRequest) (*ModifyClusterNodeResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ModifyClusterNode not implemented") -} -func (*UnimplementedClusterManagerServer) ModifyClusterAttributes(ctx context.Context, req *ModifyClusterAttributesRequest) (*ModifyClusterAttributesResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ModifyClusterAttributes not implemented") -} -func (*UnimplementedClusterManagerServer) ModifyClusterNodeAttributes(ctx context.Context, req *ModifyClusterNodeAttributesRequest) (*ModifyClusterNodeAttributesResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ModifyClusterNodeAttributes not implemented") -} -func (*UnimplementedClusterManagerServer) AddTableClusterNodes(ctx context.Context, req *AddTableClusterNodesRequest) (*empty.Empty, error) { - return nil, status.Errorf(codes.Unimplemented, "method AddTableClusterNodes not implemented") -} -func (*UnimplementedClusterManagerServer) DeleteTableClusterNodes(ctx context.Context, req *DeleteTableClusterNodesRequest) (*empty.Empty, error) { - return nil, status.Errorf(codes.Unimplemented, "method DeleteTableClusterNodes not implemented") -} -func (*UnimplementedClusterManagerServer) DeleteClusters(ctx context.Context, req *DeleteClustersRequest) (*DeleteClustersResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method DeleteClusters not implemented") -} -func (*UnimplementedClusterManagerServer) UpgradeCluster(ctx context.Context, req *UpgradeClusterRequest) (*UpgradeClusterResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method UpgradeCluster not implemented") -} -func (*UnimplementedClusterManagerServer) RollbackCluster(ctx context.Context, req *RollbackClusterRequest) (*RollbackClusterResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method RollbackCluster not implemented") -} -func (*UnimplementedClusterManagerServer) ResizeCluster(ctx context.Context, req *ResizeClusterRequest) (*ResizeClusterResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ResizeCluster not implemented") -} -func (*UnimplementedClusterManagerServer) AddClusterNodes(ctx context.Context, req *AddClusterNodesRequest) (*AddClusterNodesResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method AddClusterNodes not implemented") -} -func (*UnimplementedClusterManagerServer) DeleteClusterNodes(ctx context.Context, req *DeleteClusterNodesRequest) (*DeleteClusterNodesResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method DeleteClusterNodes not implemented") -} -func (*UnimplementedClusterManagerServer) UpdateClusterEnv(ctx context.Context, req *UpdateClusterEnvRequest) (*UpdateClusterEnvResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method UpdateClusterEnv not implemented") -} -func (*UnimplementedClusterManagerServer) DescribeClusters(ctx context.Context, req *DescribeClustersRequest) (*DescribeClustersResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method DescribeClusters not implemented") -} -func (*UnimplementedClusterManagerServer) DescribeDebugClusters(ctx context.Context, req *DescribeClustersRequest) (*DescribeClustersResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method DescribeDebugClusters not implemented") -} -func (*UnimplementedClusterManagerServer) DescribeAppClusters(ctx context.Context, req *DescribeAppClustersRequest) (*DescribeAppClustersResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method DescribeAppClusters not implemented") -} -func (*UnimplementedClusterManagerServer) DescribeDebugAppClusters(ctx context.Context, req *DescribeAppClustersRequest) (*DescribeAppClustersResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method DescribeDebugAppClusters not implemented") -} -func (*UnimplementedClusterManagerServer) DescribeClusterNodes(ctx context.Context, req *DescribeClusterNodesRequest) (*DescribeClusterNodesResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method DescribeClusterNodes not implemented") -} -func (*UnimplementedClusterManagerServer) StopClusters(ctx context.Context, req *StopClustersRequest) (*StopClustersResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method StopClusters not implemented") -} -func (*UnimplementedClusterManagerServer) StartClusters(ctx context.Context, req *StartClustersRequest) (*StartClustersResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method StartClusters not implemented") -} -func (*UnimplementedClusterManagerServer) RecoverClusters(ctx context.Context, req *RecoverClustersRequest) (*RecoverClustersResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method RecoverClusters not implemented") -} -func (*UnimplementedClusterManagerServer) CeaseClusters(ctx context.Context, req *CeaseClustersRequest) (*CeaseClustersResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method CeaseClusters not implemented") -} -func (*UnimplementedClusterManagerServer) GetClusterStatistics(ctx context.Context, req *GetClusterStatisticsRequest) (*GetClusterStatisticsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetClusterStatistics not implemented") -} -func (*UnimplementedClusterManagerServer) DeleteClusterInRuntime(ctx context.Context, req *DeleteClusterInRuntimeRequest) (*DeleteClusterInRuntimeResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method DeleteClusterInRuntime not implemented") -} -func (*UnimplementedClusterManagerServer) MigrateClusterInRuntime(ctx context.Context, req *MigrateClusterInRuntimeRequest) (*MigrateClusterInRuntimeResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method MigrateClusterInRuntime not implemented") -} - -func RegisterClusterManagerServer(s *grpc.Server, srv ClusterManagerServer) { - s.RegisterService(&_ClusterManager_serviceDesc, srv) -} - -func _ClusterManager_AddNodeKeyPairs_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(AddNodeKeyPairsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ClusterManagerServer).AddNodeKeyPairs(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/openpitrix.ClusterManager/AddNodeKeyPairs", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ClusterManagerServer).AddNodeKeyPairs(ctx, req.(*AddNodeKeyPairsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _ClusterManager_DeleteNodeKeyPairs_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DeleteNodeKeyPairsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ClusterManagerServer).DeleteNodeKeyPairs(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/openpitrix.ClusterManager/DeleteNodeKeyPairs", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ClusterManagerServer).DeleteNodeKeyPairs(ctx, req.(*DeleteNodeKeyPairsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _ClusterManager_CreateKeyPair_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CreateKeyPairRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ClusterManagerServer).CreateKeyPair(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/openpitrix.ClusterManager/CreateKeyPair", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ClusterManagerServer).CreateKeyPair(ctx, req.(*CreateKeyPairRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _ClusterManager_DescribeKeyPairs_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DescribeKeyPairsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ClusterManagerServer).DescribeKeyPairs(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/openpitrix.ClusterManager/DescribeKeyPairs", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ClusterManagerServer).DescribeKeyPairs(ctx, req.(*DescribeKeyPairsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _ClusterManager_DeleteKeyPairs_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DeleteKeyPairsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ClusterManagerServer).DeleteKeyPairs(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/openpitrix.ClusterManager/DeleteKeyPairs", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ClusterManagerServer).DeleteKeyPairs(ctx, req.(*DeleteKeyPairsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _ClusterManager_AttachKeyPairs_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(AttachKeyPairsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ClusterManagerServer).AttachKeyPairs(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/openpitrix.ClusterManager/AttachKeyPairs", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ClusterManagerServer).AttachKeyPairs(ctx, req.(*AttachKeyPairsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _ClusterManager_DetachKeyPairs_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DetachKeyPairsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ClusterManagerServer).DetachKeyPairs(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/openpitrix.ClusterManager/DetachKeyPairs", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ClusterManagerServer).DetachKeyPairs(ctx, req.(*DetachKeyPairsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _ClusterManager_DescribeSubnets_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DescribeSubnetsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ClusterManagerServer).DescribeSubnets(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/openpitrix.ClusterManager/DescribeSubnets", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ClusterManagerServer).DescribeSubnets(ctx, req.(*DescribeSubnetsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _ClusterManager_CreateCluster_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CreateClusterRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ClusterManagerServer).CreateCluster(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/openpitrix.ClusterManager/CreateCluster", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ClusterManagerServer).CreateCluster(ctx, req.(*CreateClusterRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _ClusterManager_CreateDebugCluster_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CreateClusterRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ClusterManagerServer).CreateDebugCluster(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/openpitrix.ClusterManager/CreateDebugCluster", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ClusterManagerServer).CreateDebugCluster(ctx, req.(*CreateClusterRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _ClusterManager_ModifyCluster_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ModifyClusterRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ClusterManagerServer).ModifyCluster(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/openpitrix.ClusterManager/ModifyCluster", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ClusterManagerServer).ModifyCluster(ctx, req.(*ModifyClusterRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _ClusterManager_ModifyClusterNode_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ModifyClusterNodeRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ClusterManagerServer).ModifyClusterNode(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/openpitrix.ClusterManager/ModifyClusterNode", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ClusterManagerServer).ModifyClusterNode(ctx, req.(*ModifyClusterNodeRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _ClusterManager_ModifyClusterAttributes_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ModifyClusterAttributesRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ClusterManagerServer).ModifyClusterAttributes(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/openpitrix.ClusterManager/ModifyClusterAttributes", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ClusterManagerServer).ModifyClusterAttributes(ctx, req.(*ModifyClusterAttributesRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _ClusterManager_ModifyClusterNodeAttributes_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ModifyClusterNodeAttributesRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ClusterManagerServer).ModifyClusterNodeAttributes(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/openpitrix.ClusterManager/ModifyClusterNodeAttributes", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ClusterManagerServer).ModifyClusterNodeAttributes(ctx, req.(*ModifyClusterNodeAttributesRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _ClusterManager_AddTableClusterNodes_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(AddTableClusterNodesRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ClusterManagerServer).AddTableClusterNodes(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/openpitrix.ClusterManager/AddTableClusterNodes", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ClusterManagerServer).AddTableClusterNodes(ctx, req.(*AddTableClusterNodesRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _ClusterManager_DeleteTableClusterNodes_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DeleteTableClusterNodesRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ClusterManagerServer).DeleteTableClusterNodes(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/openpitrix.ClusterManager/DeleteTableClusterNodes", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ClusterManagerServer).DeleteTableClusterNodes(ctx, req.(*DeleteTableClusterNodesRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _ClusterManager_DeleteClusters_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DeleteClustersRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ClusterManagerServer).DeleteClusters(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/openpitrix.ClusterManager/DeleteClusters", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ClusterManagerServer).DeleteClusters(ctx, req.(*DeleteClustersRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _ClusterManager_UpgradeCluster_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(UpgradeClusterRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ClusterManagerServer).UpgradeCluster(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/openpitrix.ClusterManager/UpgradeCluster", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ClusterManagerServer).UpgradeCluster(ctx, req.(*UpgradeClusterRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _ClusterManager_RollbackCluster_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(RollbackClusterRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ClusterManagerServer).RollbackCluster(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/openpitrix.ClusterManager/RollbackCluster", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ClusterManagerServer).RollbackCluster(ctx, req.(*RollbackClusterRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _ClusterManager_ResizeCluster_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ResizeClusterRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ClusterManagerServer).ResizeCluster(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/openpitrix.ClusterManager/ResizeCluster", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ClusterManagerServer).ResizeCluster(ctx, req.(*ResizeClusterRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _ClusterManager_AddClusterNodes_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(AddClusterNodesRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ClusterManagerServer).AddClusterNodes(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/openpitrix.ClusterManager/AddClusterNodes", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ClusterManagerServer).AddClusterNodes(ctx, req.(*AddClusterNodesRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _ClusterManager_DeleteClusterNodes_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DeleteClusterNodesRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ClusterManagerServer).DeleteClusterNodes(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/openpitrix.ClusterManager/DeleteClusterNodes", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ClusterManagerServer).DeleteClusterNodes(ctx, req.(*DeleteClusterNodesRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _ClusterManager_UpdateClusterEnv_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(UpdateClusterEnvRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ClusterManagerServer).UpdateClusterEnv(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/openpitrix.ClusterManager/UpdateClusterEnv", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ClusterManagerServer).UpdateClusterEnv(ctx, req.(*UpdateClusterEnvRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _ClusterManager_DescribeClusters_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DescribeClustersRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ClusterManagerServer).DescribeClusters(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/openpitrix.ClusterManager/DescribeClusters", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ClusterManagerServer).DescribeClusters(ctx, req.(*DescribeClustersRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _ClusterManager_DescribeDebugClusters_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DescribeClustersRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ClusterManagerServer).DescribeDebugClusters(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/openpitrix.ClusterManager/DescribeDebugClusters", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ClusterManagerServer).DescribeDebugClusters(ctx, req.(*DescribeClustersRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _ClusterManager_DescribeAppClusters_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DescribeAppClustersRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ClusterManagerServer).DescribeAppClusters(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/openpitrix.ClusterManager/DescribeAppClusters", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ClusterManagerServer).DescribeAppClusters(ctx, req.(*DescribeAppClustersRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _ClusterManager_DescribeDebugAppClusters_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DescribeAppClustersRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ClusterManagerServer).DescribeDebugAppClusters(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/openpitrix.ClusterManager/DescribeDebugAppClusters", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ClusterManagerServer).DescribeDebugAppClusters(ctx, req.(*DescribeAppClustersRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _ClusterManager_DescribeClusterNodes_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DescribeClusterNodesRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ClusterManagerServer).DescribeClusterNodes(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/openpitrix.ClusterManager/DescribeClusterNodes", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ClusterManagerServer).DescribeClusterNodes(ctx, req.(*DescribeClusterNodesRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _ClusterManager_StopClusters_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(StopClustersRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ClusterManagerServer).StopClusters(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/openpitrix.ClusterManager/StopClusters", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ClusterManagerServer).StopClusters(ctx, req.(*StopClustersRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _ClusterManager_StartClusters_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(StartClustersRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ClusterManagerServer).StartClusters(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/openpitrix.ClusterManager/StartClusters", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ClusterManagerServer).StartClusters(ctx, req.(*StartClustersRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _ClusterManager_RecoverClusters_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(RecoverClustersRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ClusterManagerServer).RecoverClusters(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/openpitrix.ClusterManager/RecoverClusters", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ClusterManagerServer).RecoverClusters(ctx, req.(*RecoverClustersRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _ClusterManager_CeaseClusters_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CeaseClustersRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ClusterManagerServer).CeaseClusters(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/openpitrix.ClusterManager/CeaseClusters", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ClusterManagerServer).CeaseClusters(ctx, req.(*CeaseClustersRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _ClusterManager_GetClusterStatistics_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetClusterStatisticsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ClusterManagerServer).GetClusterStatistics(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/openpitrix.ClusterManager/GetClusterStatistics", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ClusterManagerServer).GetClusterStatistics(ctx, req.(*GetClusterStatisticsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _ClusterManager_DeleteClusterInRuntime_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DeleteClusterInRuntimeRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ClusterManagerServer).DeleteClusterInRuntime(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/openpitrix.ClusterManager/DeleteClusterInRuntime", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ClusterManagerServer).DeleteClusterInRuntime(ctx, req.(*DeleteClusterInRuntimeRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _ClusterManager_MigrateClusterInRuntime_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MigrateClusterInRuntimeRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ClusterManagerServer).MigrateClusterInRuntime(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/openpitrix.ClusterManager/MigrateClusterInRuntime", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ClusterManagerServer).MigrateClusterInRuntime(ctx, req.(*MigrateClusterInRuntimeRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _ClusterManager_serviceDesc = grpc.ServiceDesc{ - ServiceName: "openpitrix.ClusterManager", - HandlerType: (*ClusterManagerServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "AddNodeKeyPairs", - Handler: _ClusterManager_AddNodeKeyPairs_Handler, - }, - { - MethodName: "DeleteNodeKeyPairs", - Handler: _ClusterManager_DeleteNodeKeyPairs_Handler, - }, - { - MethodName: "CreateKeyPair", - Handler: _ClusterManager_CreateKeyPair_Handler, - }, - { - MethodName: "DescribeKeyPairs", - Handler: _ClusterManager_DescribeKeyPairs_Handler, - }, - { - MethodName: "DeleteKeyPairs", - Handler: _ClusterManager_DeleteKeyPairs_Handler, - }, - { - MethodName: "AttachKeyPairs", - Handler: _ClusterManager_AttachKeyPairs_Handler, - }, - { - MethodName: "DetachKeyPairs", - Handler: _ClusterManager_DetachKeyPairs_Handler, - }, - { - MethodName: "DescribeSubnets", - Handler: _ClusterManager_DescribeSubnets_Handler, - }, - { - MethodName: "CreateCluster", - Handler: _ClusterManager_CreateCluster_Handler, - }, - { - MethodName: "CreateDebugCluster", - Handler: _ClusterManager_CreateDebugCluster_Handler, - }, - { - MethodName: "ModifyCluster", - Handler: _ClusterManager_ModifyCluster_Handler, - }, - { - MethodName: "ModifyClusterNode", - Handler: _ClusterManager_ModifyClusterNode_Handler, - }, - { - MethodName: "ModifyClusterAttributes", - Handler: _ClusterManager_ModifyClusterAttributes_Handler, - }, - { - MethodName: "ModifyClusterNodeAttributes", - Handler: _ClusterManager_ModifyClusterNodeAttributes_Handler, - }, - { - MethodName: "AddTableClusterNodes", - Handler: _ClusterManager_AddTableClusterNodes_Handler, - }, - { - MethodName: "DeleteTableClusterNodes", - Handler: _ClusterManager_DeleteTableClusterNodes_Handler, - }, - { - MethodName: "DeleteClusters", - Handler: _ClusterManager_DeleteClusters_Handler, - }, - { - MethodName: "UpgradeCluster", - Handler: _ClusterManager_UpgradeCluster_Handler, - }, - { - MethodName: "RollbackCluster", - Handler: _ClusterManager_RollbackCluster_Handler, - }, - { - MethodName: "ResizeCluster", - Handler: _ClusterManager_ResizeCluster_Handler, - }, - { - MethodName: "AddClusterNodes", - Handler: _ClusterManager_AddClusterNodes_Handler, - }, - { - MethodName: "DeleteClusterNodes", - Handler: _ClusterManager_DeleteClusterNodes_Handler, - }, - { - MethodName: "UpdateClusterEnv", - Handler: _ClusterManager_UpdateClusterEnv_Handler, - }, - { - MethodName: "DescribeClusters", - Handler: _ClusterManager_DescribeClusters_Handler, - }, - { - MethodName: "DescribeDebugClusters", - Handler: _ClusterManager_DescribeDebugClusters_Handler, - }, - { - MethodName: "DescribeAppClusters", - Handler: _ClusterManager_DescribeAppClusters_Handler, - }, - { - MethodName: "DescribeDebugAppClusters", - Handler: _ClusterManager_DescribeDebugAppClusters_Handler, - }, - { - MethodName: "DescribeClusterNodes", - Handler: _ClusterManager_DescribeClusterNodes_Handler, - }, - { - MethodName: "StopClusters", - Handler: _ClusterManager_StopClusters_Handler, - }, - { - MethodName: "StartClusters", - Handler: _ClusterManager_StartClusters_Handler, - }, - { - MethodName: "RecoverClusters", - Handler: _ClusterManager_RecoverClusters_Handler, - }, - { - MethodName: "CeaseClusters", - Handler: _ClusterManager_CeaseClusters_Handler, - }, - { - MethodName: "GetClusterStatistics", - Handler: _ClusterManager_GetClusterStatistics_Handler, - }, - { - MethodName: "DeleteClusterInRuntime", - Handler: _ClusterManager_DeleteClusterInRuntime_Handler, - }, - { - MethodName: "MigrateClusterInRuntime", - Handler: _ClusterManager_MigrateClusterInRuntime_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "cluster.proto", -} diff --git a/vendor/openpitrix.io/openpitrix/pkg/pb/cluster.pb.gw.go b/vendor/openpitrix.io/openpitrix/pkg/pb/cluster.pb.gw.go deleted file mode 100644 index 38bf77e41c..0000000000 --- a/vendor/openpitrix.io/openpitrix/pkg/pb/cluster.pb.gw.go +++ /dev/null @@ -1,2168 +0,0 @@ -// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: cluster.proto - -/* -Package pb is a reverse proxy. - -It translates gRPC into RESTful JSON APIs. -*/ -package pb - -import ( - "context" - "io" - "net/http" - - "github.com/golang/protobuf/descriptor" - "github.com/golang/protobuf/proto" - "github.com/grpc-ecosystem/grpc-gateway/runtime" - "github.com/grpc-ecosystem/grpc-gateway/utilities" - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/grpclog" - "google.golang.org/grpc/status" -) - -// Suppress "imported and not used" errors -var _ codes.Code -var _ io.Reader -var _ status.Status -var _ = runtime.String -var _ = utilities.NewDoubleArray -var _ = descriptor.ForMessage - -func request_ClusterManager_CreateKeyPair_0(ctx context.Context, marshaler runtime.Marshaler, client ClusterManagerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq CreateKeyPairRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.CreateKeyPair(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_ClusterManager_CreateKeyPair_0(ctx context.Context, marshaler runtime.Marshaler, server ClusterManagerServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq CreateKeyPairRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.CreateKeyPair(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_ClusterManager_DescribeKeyPairs_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_ClusterManager_DescribeKeyPairs_0(ctx context.Context, marshaler runtime.Marshaler, client ClusterManagerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq DescribeKeyPairsRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_ClusterManager_DescribeKeyPairs_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.DescribeKeyPairs(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_ClusterManager_DescribeKeyPairs_0(ctx context.Context, marshaler runtime.Marshaler, server ClusterManagerServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq DescribeKeyPairsRequest - var metadata runtime.ServerMetadata - - if err := runtime.PopulateQueryParameters(&protoReq, req.URL.Query(), filter_ClusterManager_DescribeKeyPairs_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.DescribeKeyPairs(ctx, &protoReq) - return msg, metadata, err - -} - -func request_ClusterManager_DeleteKeyPairs_0(ctx context.Context, marshaler runtime.Marshaler, client ClusterManagerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq DeleteKeyPairsRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.DeleteKeyPairs(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_ClusterManager_DeleteKeyPairs_0(ctx context.Context, marshaler runtime.Marshaler, server ClusterManagerServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq DeleteKeyPairsRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.DeleteKeyPairs(ctx, &protoReq) - return msg, metadata, err - -} - -func request_ClusterManager_AttachKeyPairs_0(ctx context.Context, marshaler runtime.Marshaler, client ClusterManagerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq AttachKeyPairsRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.AttachKeyPairs(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_ClusterManager_AttachKeyPairs_0(ctx context.Context, marshaler runtime.Marshaler, server ClusterManagerServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq AttachKeyPairsRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.AttachKeyPairs(ctx, &protoReq) - return msg, metadata, err - -} - -func request_ClusterManager_DetachKeyPairs_0(ctx context.Context, marshaler runtime.Marshaler, client ClusterManagerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq DetachKeyPairsRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.DetachKeyPairs(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_ClusterManager_DetachKeyPairs_0(ctx context.Context, marshaler runtime.Marshaler, server ClusterManagerServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq DetachKeyPairsRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.DetachKeyPairs(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_ClusterManager_DescribeSubnets_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_ClusterManager_DescribeSubnets_0(ctx context.Context, marshaler runtime.Marshaler, client ClusterManagerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq DescribeSubnetsRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_ClusterManager_DescribeSubnets_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.DescribeSubnets(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_ClusterManager_DescribeSubnets_0(ctx context.Context, marshaler runtime.Marshaler, server ClusterManagerServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq DescribeSubnetsRequest - var metadata runtime.ServerMetadata - - if err := runtime.PopulateQueryParameters(&protoReq, req.URL.Query(), filter_ClusterManager_DescribeSubnets_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.DescribeSubnets(ctx, &protoReq) - return msg, metadata, err - -} - -func request_ClusterManager_CreateCluster_0(ctx context.Context, marshaler runtime.Marshaler, client ClusterManagerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq CreateClusterRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.CreateCluster(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_ClusterManager_CreateCluster_0(ctx context.Context, marshaler runtime.Marshaler, server ClusterManagerServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq CreateClusterRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.CreateCluster(ctx, &protoReq) - return msg, metadata, err - -} - -func request_ClusterManager_CreateDebugCluster_0(ctx context.Context, marshaler runtime.Marshaler, client ClusterManagerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq CreateClusterRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.CreateDebugCluster(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_ClusterManager_CreateDebugCluster_0(ctx context.Context, marshaler runtime.Marshaler, server ClusterManagerServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq CreateClusterRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.CreateDebugCluster(ctx, &protoReq) - return msg, metadata, err - -} - -func request_ClusterManager_ModifyClusterAttributes_0(ctx context.Context, marshaler runtime.Marshaler, client ClusterManagerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ModifyClusterAttributesRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.ModifyClusterAttributes(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_ClusterManager_ModifyClusterAttributes_0(ctx context.Context, marshaler runtime.Marshaler, server ClusterManagerServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ModifyClusterAttributesRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.ModifyClusterAttributes(ctx, &protoReq) - return msg, metadata, err - -} - -func request_ClusterManager_ModifyClusterNodeAttributes_0(ctx context.Context, marshaler runtime.Marshaler, client ClusterManagerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ModifyClusterNodeAttributesRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.ModifyClusterNodeAttributes(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_ClusterManager_ModifyClusterNodeAttributes_0(ctx context.Context, marshaler runtime.Marshaler, server ClusterManagerServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ModifyClusterNodeAttributesRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.ModifyClusterNodeAttributes(ctx, &protoReq) - return msg, metadata, err - -} - -func request_ClusterManager_DeleteClusters_0(ctx context.Context, marshaler runtime.Marshaler, client ClusterManagerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq DeleteClustersRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.DeleteClusters(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_ClusterManager_DeleteClusters_0(ctx context.Context, marshaler runtime.Marshaler, server ClusterManagerServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq DeleteClustersRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.DeleteClusters(ctx, &protoReq) - return msg, metadata, err - -} - -func request_ClusterManager_UpgradeCluster_0(ctx context.Context, marshaler runtime.Marshaler, client ClusterManagerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq UpgradeClusterRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.UpgradeCluster(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_ClusterManager_UpgradeCluster_0(ctx context.Context, marshaler runtime.Marshaler, server ClusterManagerServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq UpgradeClusterRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.UpgradeCluster(ctx, &protoReq) - return msg, metadata, err - -} - -func request_ClusterManager_RollbackCluster_0(ctx context.Context, marshaler runtime.Marshaler, client ClusterManagerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq RollbackClusterRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.RollbackCluster(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_ClusterManager_RollbackCluster_0(ctx context.Context, marshaler runtime.Marshaler, server ClusterManagerServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq RollbackClusterRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.RollbackCluster(ctx, &protoReq) - return msg, metadata, err - -} - -func request_ClusterManager_ResizeCluster_0(ctx context.Context, marshaler runtime.Marshaler, client ClusterManagerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ResizeClusterRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.ResizeCluster(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_ClusterManager_ResizeCluster_0(ctx context.Context, marshaler runtime.Marshaler, server ClusterManagerServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ResizeClusterRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.ResizeCluster(ctx, &protoReq) - return msg, metadata, err - -} - -func request_ClusterManager_AddClusterNodes_0(ctx context.Context, marshaler runtime.Marshaler, client ClusterManagerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq AddClusterNodesRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.AddClusterNodes(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_ClusterManager_AddClusterNodes_0(ctx context.Context, marshaler runtime.Marshaler, server ClusterManagerServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq AddClusterNodesRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.AddClusterNodes(ctx, &protoReq) - return msg, metadata, err - -} - -func request_ClusterManager_DeleteClusterNodes_0(ctx context.Context, marshaler runtime.Marshaler, client ClusterManagerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq DeleteClusterNodesRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.DeleteClusterNodes(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_ClusterManager_DeleteClusterNodes_0(ctx context.Context, marshaler runtime.Marshaler, server ClusterManagerServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq DeleteClusterNodesRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.DeleteClusterNodes(ctx, &protoReq) - return msg, metadata, err - -} - -func request_ClusterManager_UpdateClusterEnv_0(ctx context.Context, marshaler runtime.Marshaler, client ClusterManagerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq UpdateClusterEnvRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.UpdateClusterEnv(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_ClusterManager_UpdateClusterEnv_0(ctx context.Context, marshaler runtime.Marshaler, server ClusterManagerServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq UpdateClusterEnvRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.UpdateClusterEnv(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_ClusterManager_DescribeClusters_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_ClusterManager_DescribeClusters_0(ctx context.Context, marshaler runtime.Marshaler, client ClusterManagerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq DescribeClustersRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_ClusterManager_DescribeClusters_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.DescribeClusters(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_ClusterManager_DescribeClusters_0(ctx context.Context, marshaler runtime.Marshaler, server ClusterManagerServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq DescribeClustersRequest - var metadata runtime.ServerMetadata - - if err := runtime.PopulateQueryParameters(&protoReq, req.URL.Query(), filter_ClusterManager_DescribeClusters_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.DescribeClusters(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_ClusterManager_DescribeDebugClusters_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_ClusterManager_DescribeDebugClusters_0(ctx context.Context, marshaler runtime.Marshaler, client ClusterManagerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq DescribeClustersRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_ClusterManager_DescribeDebugClusters_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.DescribeDebugClusters(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_ClusterManager_DescribeDebugClusters_0(ctx context.Context, marshaler runtime.Marshaler, server ClusterManagerServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq DescribeClustersRequest - var metadata runtime.ServerMetadata - - if err := runtime.PopulateQueryParameters(&protoReq, req.URL.Query(), filter_ClusterManager_DescribeDebugClusters_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.DescribeDebugClusters(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_ClusterManager_DescribeAppClusters_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_ClusterManager_DescribeAppClusters_0(ctx context.Context, marshaler runtime.Marshaler, client ClusterManagerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq DescribeAppClustersRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_ClusterManager_DescribeAppClusters_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.DescribeAppClusters(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_ClusterManager_DescribeAppClusters_0(ctx context.Context, marshaler runtime.Marshaler, server ClusterManagerServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq DescribeAppClustersRequest - var metadata runtime.ServerMetadata - - if err := runtime.PopulateQueryParameters(&protoReq, req.URL.Query(), filter_ClusterManager_DescribeAppClusters_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.DescribeAppClusters(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_ClusterManager_DescribeDebugAppClusters_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_ClusterManager_DescribeDebugAppClusters_0(ctx context.Context, marshaler runtime.Marshaler, client ClusterManagerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq DescribeAppClustersRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_ClusterManager_DescribeDebugAppClusters_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.DescribeDebugAppClusters(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_ClusterManager_DescribeDebugAppClusters_0(ctx context.Context, marshaler runtime.Marshaler, server ClusterManagerServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq DescribeAppClustersRequest - var metadata runtime.ServerMetadata - - if err := runtime.PopulateQueryParameters(&protoReq, req.URL.Query(), filter_ClusterManager_DescribeDebugAppClusters_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.DescribeDebugAppClusters(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_ClusterManager_DescribeClusterNodes_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_ClusterManager_DescribeClusterNodes_0(ctx context.Context, marshaler runtime.Marshaler, client ClusterManagerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq DescribeClusterNodesRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_ClusterManager_DescribeClusterNodes_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.DescribeClusterNodes(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_ClusterManager_DescribeClusterNodes_0(ctx context.Context, marshaler runtime.Marshaler, server ClusterManagerServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq DescribeClusterNodesRequest - var metadata runtime.ServerMetadata - - if err := runtime.PopulateQueryParameters(&protoReq, req.URL.Query(), filter_ClusterManager_DescribeClusterNodes_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.DescribeClusterNodes(ctx, &protoReq) - return msg, metadata, err - -} - -func request_ClusterManager_StopClusters_0(ctx context.Context, marshaler runtime.Marshaler, client ClusterManagerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq StopClustersRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.StopClusters(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_ClusterManager_StopClusters_0(ctx context.Context, marshaler runtime.Marshaler, server ClusterManagerServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq StopClustersRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.StopClusters(ctx, &protoReq) - return msg, metadata, err - -} - -func request_ClusterManager_StartClusters_0(ctx context.Context, marshaler runtime.Marshaler, client ClusterManagerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq StartClustersRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.StartClusters(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_ClusterManager_StartClusters_0(ctx context.Context, marshaler runtime.Marshaler, server ClusterManagerServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq StartClustersRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.StartClusters(ctx, &protoReq) - return msg, metadata, err - -} - -func request_ClusterManager_RecoverClusters_0(ctx context.Context, marshaler runtime.Marshaler, client ClusterManagerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq RecoverClustersRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.RecoverClusters(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_ClusterManager_RecoverClusters_0(ctx context.Context, marshaler runtime.Marshaler, server ClusterManagerServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq RecoverClustersRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.RecoverClusters(ctx, &protoReq) - return msg, metadata, err - -} - -func request_ClusterManager_CeaseClusters_0(ctx context.Context, marshaler runtime.Marshaler, client ClusterManagerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq CeaseClustersRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.CeaseClusters(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_ClusterManager_CeaseClusters_0(ctx context.Context, marshaler runtime.Marshaler, server ClusterManagerServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq CeaseClustersRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.CeaseClusters(ctx, &protoReq) - return msg, metadata, err - -} - -func request_ClusterManager_GetClusterStatistics_0(ctx context.Context, marshaler runtime.Marshaler, client ClusterManagerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq GetClusterStatisticsRequest - var metadata runtime.ServerMetadata - - msg, err := client.GetClusterStatistics(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_ClusterManager_GetClusterStatistics_0(ctx context.Context, marshaler runtime.Marshaler, server ClusterManagerServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq GetClusterStatisticsRequest - var metadata runtime.ServerMetadata - - msg, err := server.GetClusterStatistics(ctx, &protoReq) - return msg, metadata, err - -} - -// RegisterClusterManagerHandlerServer registers the http handlers for service ClusterManager to "mux". -// UnaryRPC :call ClusterManagerServer directly. -// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. -func RegisterClusterManagerHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ClusterManagerServer) error { - - mux.Handle("POST", pattern_ClusterManager_CreateKeyPair_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_ClusterManager_CreateKeyPair_0(rctx, inboundMarshaler, server, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_ClusterManager_CreateKeyPair_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_ClusterManager_DescribeKeyPairs_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_ClusterManager_DescribeKeyPairs_0(rctx, inboundMarshaler, server, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_ClusterManager_DescribeKeyPairs_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("DELETE", pattern_ClusterManager_DeleteKeyPairs_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_ClusterManager_DeleteKeyPairs_0(rctx, inboundMarshaler, server, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_ClusterManager_DeleteKeyPairs_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_ClusterManager_AttachKeyPairs_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_ClusterManager_AttachKeyPairs_0(rctx, inboundMarshaler, server, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_ClusterManager_AttachKeyPairs_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_ClusterManager_DetachKeyPairs_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_ClusterManager_DetachKeyPairs_0(rctx, inboundMarshaler, server, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_ClusterManager_DetachKeyPairs_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_ClusterManager_DescribeSubnets_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_ClusterManager_DescribeSubnets_0(rctx, inboundMarshaler, server, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_ClusterManager_DescribeSubnets_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_ClusterManager_CreateCluster_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_ClusterManager_CreateCluster_0(rctx, inboundMarshaler, server, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_ClusterManager_CreateCluster_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_ClusterManager_CreateDebugCluster_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_ClusterManager_CreateDebugCluster_0(rctx, inboundMarshaler, server, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_ClusterManager_CreateDebugCluster_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_ClusterManager_ModifyClusterAttributes_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_ClusterManager_ModifyClusterAttributes_0(rctx, inboundMarshaler, server, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_ClusterManager_ModifyClusterAttributes_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_ClusterManager_ModifyClusterNodeAttributes_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_ClusterManager_ModifyClusterNodeAttributes_0(rctx, inboundMarshaler, server, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_ClusterManager_ModifyClusterNodeAttributes_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_ClusterManager_DeleteClusters_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_ClusterManager_DeleteClusters_0(rctx, inboundMarshaler, server, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_ClusterManager_DeleteClusters_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_ClusterManager_UpgradeCluster_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_ClusterManager_UpgradeCluster_0(rctx, inboundMarshaler, server, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_ClusterManager_UpgradeCluster_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_ClusterManager_RollbackCluster_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_ClusterManager_RollbackCluster_0(rctx, inboundMarshaler, server, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_ClusterManager_RollbackCluster_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_ClusterManager_ResizeCluster_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_ClusterManager_ResizeCluster_0(rctx, inboundMarshaler, server, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_ClusterManager_ResizeCluster_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_ClusterManager_AddClusterNodes_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_ClusterManager_AddClusterNodes_0(rctx, inboundMarshaler, server, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_ClusterManager_AddClusterNodes_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_ClusterManager_DeleteClusterNodes_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_ClusterManager_DeleteClusterNodes_0(rctx, inboundMarshaler, server, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_ClusterManager_DeleteClusterNodes_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("PATCH", pattern_ClusterManager_UpdateClusterEnv_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_ClusterManager_UpdateClusterEnv_0(rctx, inboundMarshaler, server, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_ClusterManager_UpdateClusterEnv_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_ClusterManager_DescribeClusters_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_ClusterManager_DescribeClusters_0(rctx, inboundMarshaler, server, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_ClusterManager_DescribeClusters_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_ClusterManager_DescribeDebugClusters_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_ClusterManager_DescribeDebugClusters_0(rctx, inboundMarshaler, server, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_ClusterManager_DescribeDebugClusters_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_ClusterManager_DescribeAppClusters_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_ClusterManager_DescribeAppClusters_0(rctx, inboundMarshaler, server, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_ClusterManager_DescribeAppClusters_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_ClusterManager_DescribeDebugAppClusters_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_ClusterManager_DescribeDebugAppClusters_0(rctx, inboundMarshaler, server, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_ClusterManager_DescribeDebugAppClusters_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_ClusterManager_DescribeClusterNodes_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_ClusterManager_DescribeClusterNodes_0(rctx, inboundMarshaler, server, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_ClusterManager_DescribeClusterNodes_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_ClusterManager_StopClusters_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_ClusterManager_StopClusters_0(rctx, inboundMarshaler, server, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_ClusterManager_StopClusters_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_ClusterManager_StartClusters_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_ClusterManager_StartClusters_0(rctx, inboundMarshaler, server, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_ClusterManager_StartClusters_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_ClusterManager_RecoverClusters_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_ClusterManager_RecoverClusters_0(rctx, inboundMarshaler, server, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_ClusterManager_RecoverClusters_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_ClusterManager_CeaseClusters_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_ClusterManager_CeaseClusters_0(rctx, inboundMarshaler, server, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_ClusterManager_CeaseClusters_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_ClusterManager_GetClusterStatistics_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_ClusterManager_GetClusterStatistics_0(rctx, inboundMarshaler, server, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_ClusterManager_GetClusterStatistics_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -// RegisterClusterManagerHandlerFromEndpoint is same as RegisterClusterManagerHandler but -// automatically dials to "endpoint" and closes the connection when "ctx" gets done. -func RegisterClusterManagerHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { - conn, err := grpc.Dial(endpoint, opts...) - if err != nil { - return err - } - defer func() { - if err != nil { - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - return - } - go func() { - <-ctx.Done() - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - }() - }() - - return RegisterClusterManagerHandler(ctx, mux, conn) -} - -// RegisterClusterManagerHandler registers the http handlers for service ClusterManager to "mux". -// The handlers forward requests to the grpc endpoint over "conn". -func RegisterClusterManagerHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { - return RegisterClusterManagerHandlerClient(ctx, mux, NewClusterManagerClient(conn)) -} - -// RegisterClusterManagerHandlerClient registers the http handlers for service ClusterManager -// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "ClusterManagerClient". -// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "ClusterManagerClient" -// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in -// "ClusterManagerClient" to call the correct interceptors. -func RegisterClusterManagerHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ClusterManagerClient) error { - - mux.Handle("POST", pattern_ClusterManager_CreateKeyPair_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_ClusterManager_CreateKeyPair_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_ClusterManager_CreateKeyPair_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_ClusterManager_DescribeKeyPairs_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_ClusterManager_DescribeKeyPairs_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_ClusterManager_DescribeKeyPairs_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("DELETE", pattern_ClusterManager_DeleteKeyPairs_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_ClusterManager_DeleteKeyPairs_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_ClusterManager_DeleteKeyPairs_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_ClusterManager_AttachKeyPairs_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_ClusterManager_AttachKeyPairs_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_ClusterManager_AttachKeyPairs_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_ClusterManager_DetachKeyPairs_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_ClusterManager_DetachKeyPairs_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_ClusterManager_DetachKeyPairs_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_ClusterManager_DescribeSubnets_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_ClusterManager_DescribeSubnets_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_ClusterManager_DescribeSubnets_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_ClusterManager_CreateCluster_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_ClusterManager_CreateCluster_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_ClusterManager_CreateCluster_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_ClusterManager_CreateDebugCluster_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_ClusterManager_CreateDebugCluster_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_ClusterManager_CreateDebugCluster_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_ClusterManager_ModifyClusterAttributes_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_ClusterManager_ModifyClusterAttributes_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_ClusterManager_ModifyClusterAttributes_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_ClusterManager_ModifyClusterNodeAttributes_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_ClusterManager_ModifyClusterNodeAttributes_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_ClusterManager_ModifyClusterNodeAttributes_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_ClusterManager_DeleteClusters_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_ClusterManager_DeleteClusters_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_ClusterManager_DeleteClusters_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_ClusterManager_UpgradeCluster_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_ClusterManager_UpgradeCluster_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_ClusterManager_UpgradeCluster_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_ClusterManager_RollbackCluster_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_ClusterManager_RollbackCluster_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_ClusterManager_RollbackCluster_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_ClusterManager_ResizeCluster_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_ClusterManager_ResizeCluster_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_ClusterManager_ResizeCluster_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_ClusterManager_AddClusterNodes_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_ClusterManager_AddClusterNodes_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_ClusterManager_AddClusterNodes_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_ClusterManager_DeleteClusterNodes_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_ClusterManager_DeleteClusterNodes_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_ClusterManager_DeleteClusterNodes_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("PATCH", pattern_ClusterManager_UpdateClusterEnv_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_ClusterManager_UpdateClusterEnv_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_ClusterManager_UpdateClusterEnv_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_ClusterManager_DescribeClusters_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_ClusterManager_DescribeClusters_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_ClusterManager_DescribeClusters_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_ClusterManager_DescribeDebugClusters_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_ClusterManager_DescribeDebugClusters_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_ClusterManager_DescribeDebugClusters_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_ClusterManager_DescribeAppClusters_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_ClusterManager_DescribeAppClusters_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_ClusterManager_DescribeAppClusters_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_ClusterManager_DescribeDebugAppClusters_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_ClusterManager_DescribeDebugAppClusters_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_ClusterManager_DescribeDebugAppClusters_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_ClusterManager_DescribeClusterNodes_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_ClusterManager_DescribeClusterNodes_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_ClusterManager_DescribeClusterNodes_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_ClusterManager_StopClusters_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_ClusterManager_StopClusters_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_ClusterManager_StopClusters_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_ClusterManager_StartClusters_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_ClusterManager_StartClusters_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_ClusterManager_StartClusters_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_ClusterManager_RecoverClusters_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_ClusterManager_RecoverClusters_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_ClusterManager_RecoverClusters_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_ClusterManager_CeaseClusters_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_ClusterManager_CeaseClusters_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_ClusterManager_CeaseClusters_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_ClusterManager_GetClusterStatistics_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_ClusterManager_GetClusterStatistics_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_ClusterManager_GetClusterStatistics_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -var ( - pattern_ClusterManager_CreateKeyPair_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "clusters", "key_pairs"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_ClusterManager_DescribeKeyPairs_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "clusters", "key_pairs"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_ClusterManager_DeleteKeyPairs_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "clusters", "key_pairs"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_ClusterManager_AttachKeyPairs_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v1", "clusters", "key_pair", "attach"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_ClusterManager_DetachKeyPairs_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v1", "clusters", "key_pair", "detach"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_ClusterManager_DescribeSubnets_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "clusters", "subnets"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_ClusterManager_CreateCluster_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "clusters", "create"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_ClusterManager_CreateDebugCluster_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "debug_clusters", "create"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_ClusterManager_ModifyClusterAttributes_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "clusters", "modify"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_ClusterManager_ModifyClusterNodeAttributes_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "clusters", "modify_nodes"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_ClusterManager_DeleteClusters_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "clusters", "delete"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_ClusterManager_UpgradeCluster_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "clusters", "upgrade"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_ClusterManager_RollbackCluster_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "clusters", "rollback"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_ClusterManager_ResizeCluster_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "clusters", "resize"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_ClusterManager_AddClusterNodes_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "clusters", "add_nodes"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_ClusterManager_DeleteClusterNodes_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "clusters", "delete_nodes"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_ClusterManager_UpdateClusterEnv_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "clusters", "update_env"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_ClusterManager_DescribeClusters_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "clusters"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_ClusterManager_DescribeDebugClusters_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "debug_clusters"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_ClusterManager_DescribeAppClusters_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "clusters", "apps"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_ClusterManager_DescribeDebugAppClusters_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "debug_clusters", "apps"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_ClusterManager_DescribeClusterNodes_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "clusters", "nodes"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_ClusterManager_StopClusters_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "clusters", "stop"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_ClusterManager_StartClusters_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "clusters", "start"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_ClusterManager_RecoverClusters_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "clusters", "recover"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_ClusterManager_CeaseClusters_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "clusters", "cease"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_ClusterManager_GetClusterStatistics_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "clusters", "statistics"}, "", runtime.AssumeColonVerbOpt(true))) -) - -var ( - forward_ClusterManager_CreateKeyPair_0 = runtime.ForwardResponseMessage - - forward_ClusterManager_DescribeKeyPairs_0 = runtime.ForwardResponseMessage - - forward_ClusterManager_DeleteKeyPairs_0 = runtime.ForwardResponseMessage - - forward_ClusterManager_AttachKeyPairs_0 = runtime.ForwardResponseMessage - - forward_ClusterManager_DetachKeyPairs_0 = runtime.ForwardResponseMessage - - forward_ClusterManager_DescribeSubnets_0 = runtime.ForwardResponseMessage - - forward_ClusterManager_CreateCluster_0 = runtime.ForwardResponseMessage - - forward_ClusterManager_CreateDebugCluster_0 = runtime.ForwardResponseMessage - - forward_ClusterManager_ModifyClusterAttributes_0 = runtime.ForwardResponseMessage - - forward_ClusterManager_ModifyClusterNodeAttributes_0 = runtime.ForwardResponseMessage - - forward_ClusterManager_DeleteClusters_0 = runtime.ForwardResponseMessage - - forward_ClusterManager_UpgradeCluster_0 = runtime.ForwardResponseMessage - - forward_ClusterManager_RollbackCluster_0 = runtime.ForwardResponseMessage - - forward_ClusterManager_ResizeCluster_0 = runtime.ForwardResponseMessage - - forward_ClusterManager_AddClusterNodes_0 = runtime.ForwardResponseMessage - - forward_ClusterManager_DeleteClusterNodes_0 = runtime.ForwardResponseMessage - - forward_ClusterManager_UpdateClusterEnv_0 = runtime.ForwardResponseMessage - - forward_ClusterManager_DescribeClusters_0 = runtime.ForwardResponseMessage - - forward_ClusterManager_DescribeDebugClusters_0 = runtime.ForwardResponseMessage - - forward_ClusterManager_DescribeAppClusters_0 = runtime.ForwardResponseMessage - - forward_ClusterManager_DescribeDebugAppClusters_0 = runtime.ForwardResponseMessage - - forward_ClusterManager_DescribeClusterNodes_0 = runtime.ForwardResponseMessage - - forward_ClusterManager_StopClusters_0 = runtime.ForwardResponseMessage - - forward_ClusterManager_StartClusters_0 = runtime.ForwardResponseMessage - - forward_ClusterManager_RecoverClusters_0 = runtime.ForwardResponseMessage - - forward_ClusterManager_CeaseClusters_0 = runtime.ForwardResponseMessage - - forward_ClusterManager_GetClusterStatistics_0 = runtime.ForwardResponseMessage -) diff --git a/vendor/openpitrix.io/openpitrix/pkg/pb/helm.pb.go b/vendor/openpitrix.io/openpitrix/pkg/pb/helm.pb.go deleted file mode 100644 index a81ee7a2dd..0000000000 --- a/vendor/openpitrix.io/openpitrix/pkg/pb/helm.pb.go +++ /dev/null @@ -1,926 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// source: helm.proto - -package pb - -import ( - context "context" - fmt "fmt" - math "math" - - proto "github.com/golang/protobuf/proto" - _ "github.com/golang/protobuf/ptypes/empty" - timestamp "github.com/golang/protobuf/ptypes/timestamp" - wrappers "github.com/golang/protobuf/ptypes/wrappers" - _ "github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger/options" - _ "google.golang.org/genproto/googleapis/api/annotations" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" -) - -// 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 - -type Release struct { - ReleaseName *wrappers.StringValue `protobuf:"bytes,1,opt,name=release_name,json=releaseName,proto3" json:"release_name,omitempty"` - Version *wrappers.Int32Value `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` - Namespace *wrappers.StringValue `protobuf:"bytes,3,opt,name=namespace,proto3" json:"namespace,omitempty"` - Status *wrappers.StringValue `protobuf:"bytes,4,opt,name=status,proto3" json:"status,omitempty"` - Description *wrappers.StringValue `protobuf:"bytes,5,opt,name=description,proto3" json:"description,omitempty"` - FirstDeployedTime *timestamp.Timestamp `protobuf:"bytes,6,opt,name=first_deployed_time,json=firstDeployedTime,proto3" json:"first_deployed_time,omitempty"` - LastDeployedTime *timestamp.Timestamp `protobuf:"bytes,7,opt,name=last_deployed_time,json=lastDeployedTime,proto3" json:"last_deployed_time,omitempty"` - DeletedTime *timestamp.Timestamp `protobuf:"bytes,8,opt,name=deleted_time,json=deletedTime,proto3" json:"deleted_time,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Release) Reset() { *m = Release{} } -func (m *Release) String() string { return proto.CompactTextString(m) } -func (*Release) ProtoMessage() {} -func (*Release) Descriptor() ([]byte, []int) { - return fileDescriptor_141ba45979af1a8e, []int{0} -} - -func (m *Release) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Release.Unmarshal(m, b) -} -func (m *Release) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Release.Marshal(b, m, deterministic) -} -func (m *Release) XXX_Merge(src proto.Message) { - xxx_messageInfo_Release.Merge(m, src) -} -func (m *Release) XXX_Size() int { - return xxx_messageInfo_Release.Size(m) -} -func (m *Release) XXX_DiscardUnknown() { - xxx_messageInfo_Release.DiscardUnknown(m) -} - -var xxx_messageInfo_Release proto.InternalMessageInfo - -func (m *Release) GetReleaseName() *wrappers.StringValue { - if m != nil { - return m.ReleaseName - } - return nil -} - -func (m *Release) GetVersion() *wrappers.Int32Value { - if m != nil { - return m.Version - } - return nil -} - -func (m *Release) GetNamespace() *wrappers.StringValue { - if m != nil { - return m.Namespace - } - return nil -} - -func (m *Release) GetStatus() *wrappers.StringValue { - if m != nil { - return m.Status - } - return nil -} - -func (m *Release) GetDescription() *wrappers.StringValue { - if m != nil { - return m.Description - } - return nil -} - -func (m *Release) GetFirstDeployedTime() *timestamp.Timestamp { - if m != nil { - return m.FirstDeployedTime - } - return nil -} - -func (m *Release) GetLastDeployedTime() *timestamp.Timestamp { - if m != nil { - return m.LastDeployedTime - } - return nil -} - -func (m *Release) GetDeletedTime() *timestamp.Timestamp { - if m != nil { - return m.DeletedTime - } - return nil -} - -type ListReleasesRequest struct { - RuntimeId *wrappers.StringValue `protobuf:"bytes,1,opt,name=runtime_id,json=runtimeId,proto3" json:"runtime_id,omitempty"` - ReleaseName *wrappers.StringValue `protobuf:"bytes,2,opt,name=release_name,json=releaseName,proto3" json:"release_name,omitempty"` - Namespace *wrappers.StringValue `protobuf:"bytes,3,opt,name=namespace,proto3" json:"namespace,omitempty"` - Status *wrappers.StringValue `protobuf:"bytes,4,opt,name=status,proto3" json:"status,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ListReleasesRequest) Reset() { *m = ListReleasesRequest{} } -func (m *ListReleasesRequest) String() string { return proto.CompactTextString(m) } -func (*ListReleasesRequest) ProtoMessage() {} -func (*ListReleasesRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_141ba45979af1a8e, []int{1} -} - -func (m *ListReleasesRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ListReleasesRequest.Unmarshal(m, b) -} -func (m *ListReleasesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ListReleasesRequest.Marshal(b, m, deterministic) -} -func (m *ListReleasesRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_ListReleasesRequest.Merge(m, src) -} -func (m *ListReleasesRequest) XXX_Size() int { - return xxx_messageInfo_ListReleasesRequest.Size(m) -} -func (m *ListReleasesRequest) XXX_DiscardUnknown() { - xxx_messageInfo_ListReleasesRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_ListReleasesRequest proto.InternalMessageInfo - -func (m *ListReleasesRequest) GetRuntimeId() *wrappers.StringValue { - if m != nil { - return m.RuntimeId - } - return nil -} - -func (m *ListReleasesRequest) GetReleaseName() *wrappers.StringValue { - if m != nil { - return m.ReleaseName - } - return nil -} - -func (m *ListReleasesRequest) GetNamespace() *wrappers.StringValue { - if m != nil { - return m.Namespace - } - return nil -} - -func (m *ListReleasesRequest) GetStatus() *wrappers.StringValue { - if m != nil { - return m.Status - } - return nil -} - -type ListReleaseResponse struct { - ReleaseSet []*Release `protobuf:"bytes,1,rep,name=release_set,json=releaseSet,proto3" json:"release_set,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ListReleaseResponse) Reset() { *m = ListReleaseResponse{} } -func (m *ListReleaseResponse) String() string { return proto.CompactTextString(m) } -func (*ListReleaseResponse) ProtoMessage() {} -func (*ListReleaseResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_141ba45979af1a8e, []int{2} -} - -func (m *ListReleaseResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ListReleaseResponse.Unmarshal(m, b) -} -func (m *ListReleaseResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ListReleaseResponse.Marshal(b, m, deterministic) -} -func (m *ListReleaseResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_ListReleaseResponse.Merge(m, src) -} -func (m *ListReleaseResponse) XXX_Size() int { - return xxx_messageInfo_ListReleaseResponse.Size(m) -} -func (m *ListReleaseResponse) XXX_DiscardUnknown() { - xxx_messageInfo_ListReleaseResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_ListReleaseResponse proto.InternalMessageInfo - -func (m *ListReleaseResponse) GetReleaseSet() []*Release { - if m != nil { - return m.ReleaseSet - } - return nil -} - -type CreateReleaseRequest struct { - // required, id of app to run in cluster - AppId *wrappers.StringValue `protobuf:"bytes,1,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty"` - // required, id of app version - VersionId *wrappers.StringValue `protobuf:"bytes,2,opt,name=version_id,json=versionId,proto3" json:"version_id,omitempty"` - // required, id of runtime - RuntimeId *wrappers.StringValue `protobuf:"bytes,3,opt,name=runtime_id,json=runtimeId,proto3" json:"runtime_id,omitempty"` - // release name - ReleaseName *wrappers.StringValue `protobuf:"bytes,4,opt,name=release_name,json=releaseName,proto3" json:"release_name,omitempty"` - // namespace - Namespace *wrappers.StringValue `protobuf:"bytes,5,opt,name=namespace,proto3" json:"namespace,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *CreateReleaseRequest) Reset() { *m = CreateReleaseRequest{} } -func (m *CreateReleaseRequest) String() string { return proto.CompactTextString(m) } -func (*CreateReleaseRequest) ProtoMessage() {} -func (*CreateReleaseRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_141ba45979af1a8e, []int{3} -} - -func (m *CreateReleaseRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_CreateReleaseRequest.Unmarshal(m, b) -} -func (m *CreateReleaseRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_CreateReleaseRequest.Marshal(b, m, deterministic) -} -func (m *CreateReleaseRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_CreateReleaseRequest.Merge(m, src) -} -func (m *CreateReleaseRequest) XXX_Size() int { - return xxx_messageInfo_CreateReleaseRequest.Size(m) -} -func (m *CreateReleaseRequest) XXX_DiscardUnknown() { - xxx_messageInfo_CreateReleaseRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_CreateReleaseRequest proto.InternalMessageInfo - -func (m *CreateReleaseRequest) GetAppId() *wrappers.StringValue { - if m != nil { - return m.AppId - } - return nil -} - -func (m *CreateReleaseRequest) GetVersionId() *wrappers.StringValue { - if m != nil { - return m.VersionId - } - return nil -} - -func (m *CreateReleaseRequest) GetRuntimeId() *wrappers.StringValue { - if m != nil { - return m.RuntimeId - } - return nil -} - -func (m *CreateReleaseRequest) GetReleaseName() *wrappers.StringValue { - if m != nil { - return m.ReleaseName - } - return nil -} - -func (m *CreateReleaseRequest) GetNamespace() *wrappers.StringValue { - if m != nil { - return m.Namespace - } - return nil -} - -type CreateReleaseResponse struct { - ReleaseName *wrappers.StringValue `protobuf:"bytes,1,opt,name=release_name,json=releaseName,proto3" json:"release_name,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *CreateReleaseResponse) Reset() { *m = CreateReleaseResponse{} } -func (m *CreateReleaseResponse) String() string { return proto.CompactTextString(m) } -func (*CreateReleaseResponse) ProtoMessage() {} -func (*CreateReleaseResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_141ba45979af1a8e, []int{4} -} - -func (m *CreateReleaseResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_CreateReleaseResponse.Unmarshal(m, b) -} -func (m *CreateReleaseResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_CreateReleaseResponse.Marshal(b, m, deterministic) -} -func (m *CreateReleaseResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_CreateReleaseResponse.Merge(m, src) -} -func (m *CreateReleaseResponse) XXX_Size() int { - return xxx_messageInfo_CreateReleaseResponse.Size(m) -} -func (m *CreateReleaseResponse) XXX_DiscardUnknown() { - xxx_messageInfo_CreateReleaseResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_CreateReleaseResponse proto.InternalMessageInfo - -func (m *CreateReleaseResponse) GetReleaseName() *wrappers.StringValue { - if m != nil { - return m.ReleaseName - } - return nil -} - -type UpgradeReleaseRequest struct { - RuntimeId *wrappers.StringValue `protobuf:"bytes,1,opt,name=runtime_id,json=runtimeId,proto3" json:"runtime_id,omitempty"` - ReleaseName *wrappers.StringValue `protobuf:"bytes,2,opt,name=release_name,json=releaseName,proto3" json:"release_name,omitempty"` - VersionId *wrappers.StringValue `protobuf:"bytes,3,opt,name=version_id,json=versionId,proto3" json:"version_id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *UpgradeReleaseRequest) Reset() { *m = UpgradeReleaseRequest{} } -func (m *UpgradeReleaseRequest) String() string { return proto.CompactTextString(m) } -func (*UpgradeReleaseRequest) ProtoMessage() {} -func (*UpgradeReleaseRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_141ba45979af1a8e, []int{5} -} - -func (m *UpgradeReleaseRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_UpgradeReleaseRequest.Unmarshal(m, b) -} -func (m *UpgradeReleaseRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_UpgradeReleaseRequest.Marshal(b, m, deterministic) -} -func (m *UpgradeReleaseRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_UpgradeReleaseRequest.Merge(m, src) -} -func (m *UpgradeReleaseRequest) XXX_Size() int { - return xxx_messageInfo_UpgradeReleaseRequest.Size(m) -} -func (m *UpgradeReleaseRequest) XXX_DiscardUnknown() { - xxx_messageInfo_UpgradeReleaseRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_UpgradeReleaseRequest proto.InternalMessageInfo - -func (m *UpgradeReleaseRequest) GetRuntimeId() *wrappers.StringValue { - if m != nil { - return m.RuntimeId - } - return nil -} - -func (m *UpgradeReleaseRequest) GetReleaseName() *wrappers.StringValue { - if m != nil { - return m.ReleaseName - } - return nil -} - -func (m *UpgradeReleaseRequest) GetVersionId() *wrappers.StringValue { - if m != nil { - return m.VersionId - } - return nil -} - -type UpgradeReleaseResponse struct { - ReleaseName *wrappers.StringValue `protobuf:"bytes,1,opt,name=release_name,json=releaseName,proto3" json:"release_name,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *UpgradeReleaseResponse) Reset() { *m = UpgradeReleaseResponse{} } -func (m *UpgradeReleaseResponse) String() string { return proto.CompactTextString(m) } -func (*UpgradeReleaseResponse) ProtoMessage() {} -func (*UpgradeReleaseResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_141ba45979af1a8e, []int{6} -} - -func (m *UpgradeReleaseResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_UpgradeReleaseResponse.Unmarshal(m, b) -} -func (m *UpgradeReleaseResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_UpgradeReleaseResponse.Marshal(b, m, deterministic) -} -func (m *UpgradeReleaseResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_UpgradeReleaseResponse.Merge(m, src) -} -func (m *UpgradeReleaseResponse) XXX_Size() int { - return xxx_messageInfo_UpgradeReleaseResponse.Size(m) -} -func (m *UpgradeReleaseResponse) XXX_DiscardUnknown() { - xxx_messageInfo_UpgradeReleaseResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_UpgradeReleaseResponse proto.InternalMessageInfo - -func (m *UpgradeReleaseResponse) GetReleaseName() *wrappers.StringValue { - if m != nil { - return m.ReleaseName - } - return nil -} - -type RollbackReleaseRequest struct { - RuntimeId *wrappers.StringValue `protobuf:"bytes,1,opt,name=runtime_id,json=runtimeId,proto3" json:"runtime_id,omitempty"` - ReleaseName *wrappers.StringValue `protobuf:"bytes,2,opt,name=release_name,json=releaseName,proto3" json:"release_name,omitempty"` - Version *wrappers.Int32Value `protobuf:"bytes,3,opt,name=version,proto3" json:"version,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *RollbackReleaseRequest) Reset() { *m = RollbackReleaseRequest{} } -func (m *RollbackReleaseRequest) String() string { return proto.CompactTextString(m) } -func (*RollbackReleaseRequest) ProtoMessage() {} -func (*RollbackReleaseRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_141ba45979af1a8e, []int{7} -} - -func (m *RollbackReleaseRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_RollbackReleaseRequest.Unmarshal(m, b) -} -func (m *RollbackReleaseRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_RollbackReleaseRequest.Marshal(b, m, deterministic) -} -func (m *RollbackReleaseRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_RollbackReleaseRequest.Merge(m, src) -} -func (m *RollbackReleaseRequest) XXX_Size() int { - return xxx_messageInfo_RollbackReleaseRequest.Size(m) -} -func (m *RollbackReleaseRequest) XXX_DiscardUnknown() { - xxx_messageInfo_RollbackReleaseRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_RollbackReleaseRequest proto.InternalMessageInfo - -func (m *RollbackReleaseRequest) GetRuntimeId() *wrappers.StringValue { - if m != nil { - return m.RuntimeId - } - return nil -} - -func (m *RollbackReleaseRequest) GetReleaseName() *wrappers.StringValue { - if m != nil { - return m.ReleaseName - } - return nil -} - -func (m *RollbackReleaseRequest) GetVersion() *wrappers.Int32Value { - if m != nil { - return m.Version - } - return nil -} - -type RollbackReleaseResponse struct { - ReleaseName *wrappers.StringValue `protobuf:"bytes,1,opt,name=release_name,json=releaseName,proto3" json:"release_name,omitempty"` - Version *wrappers.Int32Value `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *RollbackReleaseResponse) Reset() { *m = RollbackReleaseResponse{} } -func (m *RollbackReleaseResponse) String() string { return proto.CompactTextString(m) } -func (*RollbackReleaseResponse) ProtoMessage() {} -func (*RollbackReleaseResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_141ba45979af1a8e, []int{8} -} - -func (m *RollbackReleaseResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_RollbackReleaseResponse.Unmarshal(m, b) -} -func (m *RollbackReleaseResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_RollbackReleaseResponse.Marshal(b, m, deterministic) -} -func (m *RollbackReleaseResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_RollbackReleaseResponse.Merge(m, src) -} -func (m *RollbackReleaseResponse) XXX_Size() int { - return xxx_messageInfo_RollbackReleaseResponse.Size(m) -} -func (m *RollbackReleaseResponse) XXX_DiscardUnknown() { - xxx_messageInfo_RollbackReleaseResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_RollbackReleaseResponse proto.InternalMessageInfo - -func (m *RollbackReleaseResponse) GetReleaseName() *wrappers.StringValue { - if m != nil { - return m.ReleaseName - } - return nil -} - -func (m *RollbackReleaseResponse) GetVersion() *wrappers.Int32Value { - if m != nil { - return m.Version - } - return nil -} - -type DeleteReleaseRequest struct { - RuntimeId *wrappers.StringValue `protobuf:"bytes,1,opt,name=runtime_id,json=runtimeId,proto3" json:"runtime_id,omitempty"` - ReleaseName *wrappers.StringValue `protobuf:"bytes,2,opt,name=release_name,json=releaseName,proto3" json:"release_name,omitempty"` - Purge *wrappers.BoolValue `protobuf:"bytes,3,opt,name=purge,proto3" json:"purge,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *DeleteReleaseRequest) Reset() { *m = DeleteReleaseRequest{} } -func (m *DeleteReleaseRequest) String() string { return proto.CompactTextString(m) } -func (*DeleteReleaseRequest) ProtoMessage() {} -func (*DeleteReleaseRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_141ba45979af1a8e, []int{9} -} - -func (m *DeleteReleaseRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_DeleteReleaseRequest.Unmarshal(m, b) -} -func (m *DeleteReleaseRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_DeleteReleaseRequest.Marshal(b, m, deterministic) -} -func (m *DeleteReleaseRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_DeleteReleaseRequest.Merge(m, src) -} -func (m *DeleteReleaseRequest) XXX_Size() int { - return xxx_messageInfo_DeleteReleaseRequest.Size(m) -} -func (m *DeleteReleaseRequest) XXX_DiscardUnknown() { - xxx_messageInfo_DeleteReleaseRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_DeleteReleaseRequest proto.InternalMessageInfo - -func (m *DeleteReleaseRequest) GetRuntimeId() *wrappers.StringValue { - if m != nil { - return m.RuntimeId - } - return nil -} - -func (m *DeleteReleaseRequest) GetReleaseName() *wrappers.StringValue { - if m != nil { - return m.ReleaseName - } - return nil -} - -func (m *DeleteReleaseRequest) GetPurge() *wrappers.BoolValue { - if m != nil { - return m.Purge - } - return nil -} - -type DeleteReleaseResponse struct { - ReleaseName *wrappers.StringValue `protobuf:"bytes,1,opt,name=release_name,json=releaseName,proto3" json:"release_name,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *DeleteReleaseResponse) Reset() { *m = DeleteReleaseResponse{} } -func (m *DeleteReleaseResponse) String() string { return proto.CompactTextString(m) } -func (*DeleteReleaseResponse) ProtoMessage() {} -func (*DeleteReleaseResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_141ba45979af1a8e, []int{10} -} - -func (m *DeleteReleaseResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_DeleteReleaseResponse.Unmarshal(m, b) -} -func (m *DeleteReleaseResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_DeleteReleaseResponse.Marshal(b, m, deterministic) -} -func (m *DeleteReleaseResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_DeleteReleaseResponse.Merge(m, src) -} -func (m *DeleteReleaseResponse) XXX_Size() int { - return xxx_messageInfo_DeleteReleaseResponse.Size(m) -} -func (m *DeleteReleaseResponse) XXX_DiscardUnknown() { - xxx_messageInfo_DeleteReleaseResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_DeleteReleaseResponse proto.InternalMessageInfo - -func (m *DeleteReleaseResponse) GetReleaseName() *wrappers.StringValue { - if m != nil { - return m.ReleaseName - } - return nil -} - -func init() { - proto.RegisterType((*Release)(nil), "openpitrix.Release") - proto.RegisterType((*ListReleasesRequest)(nil), "openpitrix.ListReleasesRequest") - proto.RegisterType((*ListReleaseResponse)(nil), "openpitrix.ListReleaseResponse") - proto.RegisterType((*CreateReleaseRequest)(nil), "openpitrix.CreateReleaseRequest") - proto.RegisterType((*CreateReleaseResponse)(nil), "openpitrix.CreateReleaseResponse") - proto.RegisterType((*UpgradeReleaseRequest)(nil), "openpitrix.UpgradeReleaseRequest") - proto.RegisterType((*UpgradeReleaseResponse)(nil), "openpitrix.UpgradeReleaseResponse") - proto.RegisterType((*RollbackReleaseRequest)(nil), "openpitrix.RollbackReleaseRequest") - proto.RegisterType((*RollbackReleaseResponse)(nil), "openpitrix.RollbackReleaseResponse") - proto.RegisterType((*DeleteReleaseRequest)(nil), "openpitrix.DeleteReleaseRequest") - proto.RegisterType((*DeleteReleaseResponse)(nil), "openpitrix.DeleteReleaseResponse") -} - -func init() { proto.RegisterFile("helm.proto", fileDescriptor_141ba45979af1a8e) } - -var fileDescriptor_141ba45979af1a8e = []byte{ - // 773 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x55, 0xcd, 0x6e, 0xd3, 0x40, - 0x10, 0x96, 0xf3, 0x57, 0x3a, 0x09, 0x69, 0xbb, 0xfd, 0x21, 0x72, 0x2b, 0x1a, 0x8c, 0x90, 0xaa, - 0xd2, 0x26, 0x90, 0xc2, 0xa5, 0x08, 0x50, 0x4a, 0x0f, 0x94, 0xbf, 0x43, 0x0a, 0x08, 0xb8, 0x44, - 0x9b, 0x78, 0x6b, 0x2c, 0x1c, 0x7b, 0xd9, 0xdd, 0xb4, 0xf4, 0x86, 0x10, 0x48, 0xbd, 0x12, 0x9e, - 0x80, 0x57, 0xe1, 0xc0, 0x8d, 0x0b, 0xbc, 0x02, 0x0f, 0x82, 0x6c, 0xaf, 0x69, 0xd6, 0x0e, 0x6d, - 0x4a, 0x2b, 0xe8, 0x29, 0x91, 0xe7, 0xfb, 0xbe, 0x99, 0x9d, 0x6f, 0x76, 0x16, 0xe0, 0x25, 0x71, - 0x3a, 0x15, 0xca, 0x3c, 0xe1, 0x21, 0xf0, 0x28, 0x71, 0xa9, 0x2d, 0x98, 0xfd, 0x46, 0x9f, 0xb5, - 0x3c, 0xcf, 0x72, 0x48, 0x35, 0x88, 0xb4, 0xba, 0x5b, 0x55, 0xd2, 0xa1, 0x62, 0x37, 0x04, 0xea, - 0xe7, 0xe3, 0xc1, 0x1d, 0x86, 0x29, 0x25, 0x8c, 0xcb, 0xf8, 0x7c, 0x3c, 0x2e, 0xec, 0x0e, 0xe1, - 0x02, 0x77, 0xa8, 0x04, 0xcc, 0x49, 0x00, 0xa6, 0x76, 0x15, 0xbb, 0xae, 0x27, 0xb0, 0xb0, 0x3d, - 0x37, 0xa2, 0x2f, 0x05, 0x3f, 0xed, 0x65, 0x8b, 0xb8, 0xcb, 0x7c, 0x07, 0x5b, 0x16, 0x61, 0x55, - 0x8f, 0x06, 0x88, 0x24, 0xda, 0xd8, 0xcb, 0xc0, 0x48, 0x83, 0x38, 0x04, 0x73, 0x82, 0x6e, 0x43, - 0x81, 0x85, 0x7f, 0x9b, 0x2e, 0xee, 0x90, 0x92, 0x56, 0xd6, 0x16, 0xf2, 0xb5, 0xb9, 0x4a, 0x98, - 0xae, 0x12, 0xd5, 0x53, 0xd9, 0x14, 0xcc, 0x76, 0xad, 0xa7, 0xd8, 0xe9, 0x92, 0x46, 0x5e, 0x32, - 0x1e, 0xe1, 0x0e, 0x41, 0xd7, 0x61, 0x64, 0x9b, 0x30, 0x6e, 0x7b, 0x6e, 0x29, 0x15, 0x70, 0x67, - 0x13, 0xdc, 0x0d, 0x57, 0xac, 0xd4, 0x42, 0x6a, 0x84, 0x45, 0xab, 0x30, 0xea, 0xe7, 0xe3, 0x14, - 0xb7, 0x49, 0x29, 0x3d, 0x44, 0xd2, 0x7d, 0x38, 0xba, 0x06, 0x39, 0x2e, 0xb0, 0xe8, 0xf2, 0x52, - 0x66, 0x08, 0xa2, 0xc4, 0xa2, 0x5b, 0x90, 0x37, 0x09, 0x6f, 0x33, 0x3b, 0xe8, 0x4b, 0x29, 0x3b, - 0xcc, 0x41, 0xfb, 0x08, 0xe8, 0x1e, 0x4c, 0x6e, 0xd9, 0x8c, 0x8b, 0xa6, 0x49, 0xa8, 0xe3, 0xed, - 0x12, 0xb3, 0xe9, 0x7b, 0x54, 0xca, 0x05, 0x3a, 0x7a, 0x42, 0xe7, 0x71, 0x64, 0x60, 0x63, 0x22, - 0xa0, 0xad, 0x4b, 0x96, 0xff, 0x1d, 0xdd, 0x05, 0xe4, 0xe0, 0x84, 0xd4, 0xc8, 0xa1, 0x52, 0xe3, - 0x3e, 0x4b, 0x51, 0xba, 0x09, 0x05, 0x93, 0x38, 0x44, 0x44, 0x1a, 0x67, 0x0e, 0xd5, 0xc8, 0x4b, - 0xbc, 0xff, 0xc5, 0xf8, 0x90, 0x82, 0xc9, 0x07, 0x36, 0x17, 0x72, 0x1c, 0x78, 0x83, 0xbc, 0xee, - 0x12, 0x2e, 0xd0, 0x0d, 0x00, 0xd6, 0x75, 0x7d, 0xc5, 0xa6, 0x6d, 0x0e, 0x35, 0x14, 0xa3, 0x12, - 0xbf, 0x61, 0x26, 0x66, 0x2a, 0x75, 0xd4, 0x99, 0xfa, 0xe7, 0xc3, 0x61, 0xdc, 0x57, 0xda, 0xd0, - 0x20, 0x9c, 0x7a, 0x2e, 0xf7, 0xc5, 0xa2, 0xba, 0x9a, 0x9c, 0x88, 0x92, 0x56, 0x4e, 0x2f, 0xe4, - 0x6b, 0x93, 0x95, 0xfd, 0x5b, 0x5f, 0x89, 0x18, 0x20, 0x71, 0x9b, 0x44, 0x18, 0x5f, 0x52, 0x30, - 0x75, 0x87, 0x11, 0x2c, 0xc8, 0x6f, 0xbd, 0xb0, 0xab, 0x2b, 0x90, 0xc3, 0x94, 0x0e, 0xdb, 0xd1, - 0x2c, 0xa6, 0x74, 0xc3, 0xf4, 0xad, 0x90, 0x97, 0xc6, 0x27, 0x0e, 0xd3, 0xcb, 0x51, 0x89, 0x0f, - 0xc9, 0x7d, 0x3e, 0xa6, 0x8f, 0xe7, 0x63, 0xe6, 0x58, 0x3e, 0x66, 0x8f, 0xe4, 0xa3, 0xf1, 0x0c, - 0xa6, 0x63, 0x3d, 0x94, 0x9e, 0x1c, 0x77, 0x63, 0x19, 0xdf, 0x35, 0x98, 0x7e, 0x42, 0x2d, 0x86, - 0xcd, 0xb8, 0x3f, 0xff, 0x77, 0xea, 0x55, 0xa3, 0xd3, 0x47, 0x32, 0xda, 0x78, 0x0e, 0x33, 0xf1, - 0x33, 0x9d, 0x54, 0xbf, 0xbe, 0x69, 0x30, 0xd3, 0xf0, 0x1c, 0xa7, 0x85, 0xdb, 0xaf, 0x4e, 0x55, - 0xc3, 0xfa, 0x9e, 0x9e, 0xf4, 0xf0, 0x4f, 0x8f, 0xf1, 0x51, 0x83, 0x73, 0x89, 0xf3, 0x9c, 0x50, - 0xb3, 0xfe, 0xf2, 0x39, 0x34, 0xbe, 0x6a, 0x30, 0xb5, 0x1e, 0xec, 0xe5, 0x53, 0xd5, 0xe1, 0x2b, - 0x90, 0xa5, 0x5d, 0x66, 0x45, 0x4b, 0x38, 0xf9, 0xac, 0xac, 0x79, 0x9e, 0x23, 0xb7, 0x55, 0x00, - 0xf4, 0xaf, 0x6d, 0xec, 0x1c, 0x27, 0xd4, 0xd9, 0xda, 0xe7, 0x2c, 0x14, 0xa5, 0xe8, 0x43, 0xec, - 0x62, 0x8b, 0x30, 0xb4, 0x03, 0x85, 0xfe, 0xc7, 0x0b, 0xcd, 0xf7, 0x6f, 0xe6, 0x01, 0xcf, 0x9a, - 0xfe, 0x27, 0x40, 0x54, 0xa5, 0x71, 0xa9, 0x57, 0x2f, 0xa2, 0x40, 0xb4, 0x2c, 0x43, 0xef, 0x7e, - 0xfc, 0xfc, 0x94, 0x2a, 0xa2, 0x42, 0x75, 0xfb, 0x6a, 0x95, 0x45, 0x89, 0xde, 0x6a, 0x70, 0x56, - 0xd9, 0x4e, 0xa8, 0xdc, 0xaf, 0x3c, 0x68, 0xf9, 0xeb, 0x17, 0x0e, 0x40, 0xc8, 0xec, 0x8b, 0xbd, - 0xfa, 0x38, 0x2a, 0x86, 0x31, 0x25, 0xff, 0x84, 0xae, 0xe4, 0x5f, 0xd5, 0x16, 0xd1, 0x7b, 0x0d, - 0x8a, 0xea, 0x8d, 0x47, 0x4a, 0x86, 0x81, 0x1b, 0x4e, 0x37, 0x0e, 0x82, 0xc8, 0x2a, 0x2e, 0xf7, - 0xea, 0x13, 0x68, 0x4c, 0x06, 0xd5, 0x32, 0x6a, 0x89, 0x32, 0xf6, 0x34, 0x18, 0x8b, 0x5d, 0x26, - 0xa4, 0x24, 0x19, 0xbc, 0x39, 0xf4, 0x8b, 0x07, 0x62, 0x64, 0x25, 0x4b, 0xbd, 0x3a, 0x42, 0xe3, - 0x51, 0x54, 0x2d, 0xc5, 0x48, 0x94, 0xe2, 0x9b, 0xa2, 0xcc, 0x9e, 0x6a, 0xca, 0xa0, 0xeb, 0xa5, - 0x9a, 0x32, 0x70, 0x70, 0xa5, 0x29, 0x61, 0x4c, 0x2d, 0x61, 0x31, 0x5e, 0xc2, 0x5a, 0xe6, 0x45, - 0x8a, 0xb6, 0x5a, 0xb9, 0x60, 0x98, 0x57, 0x7e, 0x05, 0x00, 0x00, 0xff, 0xff, 0x0a, 0xf9, 0x10, - 0xa6, 0x2a, 0x0c, 0x00, 0x00, -} - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConn - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion4 - -// ReleaseManagerClient is the client API for ReleaseManager service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type ReleaseManagerClient interface { - ListReleases(ctx context.Context, in *ListReleasesRequest, opts ...grpc.CallOption) (*ListReleaseResponse, error) - CreateRelease(ctx context.Context, in *CreateReleaseRequest, opts ...grpc.CallOption) (*CreateReleaseResponse, error) - UpgradeRelease(ctx context.Context, in *UpgradeReleaseRequest, opts ...grpc.CallOption) (*UpgradeReleaseResponse, error) - RollbackRelease(ctx context.Context, in *RollbackReleaseRequest, opts ...grpc.CallOption) (*RollbackReleaseResponse, error) - DeleteRelease(ctx context.Context, in *DeleteReleaseRequest, opts ...grpc.CallOption) (*DeleteReleaseResponse, error) -} - -type releaseManagerClient struct { - cc *grpc.ClientConn -} - -func NewReleaseManagerClient(cc *grpc.ClientConn) ReleaseManagerClient { - return &releaseManagerClient{cc} -} - -func (c *releaseManagerClient) ListReleases(ctx context.Context, in *ListReleasesRequest, opts ...grpc.CallOption) (*ListReleaseResponse, error) { - out := new(ListReleaseResponse) - err := c.cc.Invoke(ctx, "/openpitrix.ReleaseManager/ListReleases", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *releaseManagerClient) CreateRelease(ctx context.Context, in *CreateReleaseRequest, opts ...grpc.CallOption) (*CreateReleaseResponse, error) { - out := new(CreateReleaseResponse) - err := c.cc.Invoke(ctx, "/openpitrix.ReleaseManager/CreateRelease", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *releaseManagerClient) UpgradeRelease(ctx context.Context, in *UpgradeReleaseRequest, opts ...grpc.CallOption) (*UpgradeReleaseResponse, error) { - out := new(UpgradeReleaseResponse) - err := c.cc.Invoke(ctx, "/openpitrix.ReleaseManager/UpgradeRelease", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *releaseManagerClient) RollbackRelease(ctx context.Context, in *RollbackReleaseRequest, opts ...grpc.CallOption) (*RollbackReleaseResponse, error) { - out := new(RollbackReleaseResponse) - err := c.cc.Invoke(ctx, "/openpitrix.ReleaseManager/RollbackRelease", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *releaseManagerClient) DeleteRelease(ctx context.Context, in *DeleteReleaseRequest, opts ...grpc.CallOption) (*DeleteReleaseResponse, error) { - out := new(DeleteReleaseResponse) - err := c.cc.Invoke(ctx, "/openpitrix.ReleaseManager/DeleteRelease", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// ReleaseManagerServer is the server API for ReleaseManager service. -type ReleaseManagerServer interface { - ListReleases(context.Context, *ListReleasesRequest) (*ListReleaseResponse, error) - CreateRelease(context.Context, *CreateReleaseRequest) (*CreateReleaseResponse, error) - UpgradeRelease(context.Context, *UpgradeReleaseRequest) (*UpgradeReleaseResponse, error) - RollbackRelease(context.Context, *RollbackReleaseRequest) (*RollbackReleaseResponse, error) - DeleteRelease(context.Context, *DeleteReleaseRequest) (*DeleteReleaseResponse, error) -} - -// UnimplementedReleaseManagerServer can be embedded to have forward compatible implementations. -type UnimplementedReleaseManagerServer struct { -} - -func (*UnimplementedReleaseManagerServer) ListReleases(ctx context.Context, req *ListReleasesRequest) (*ListReleaseResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ListReleases not implemented") -} -func (*UnimplementedReleaseManagerServer) CreateRelease(ctx context.Context, req *CreateReleaseRequest) (*CreateReleaseResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method CreateRelease not implemented") -} -func (*UnimplementedReleaseManagerServer) UpgradeRelease(ctx context.Context, req *UpgradeReleaseRequest) (*UpgradeReleaseResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method UpgradeRelease not implemented") -} -func (*UnimplementedReleaseManagerServer) RollbackRelease(ctx context.Context, req *RollbackReleaseRequest) (*RollbackReleaseResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method RollbackRelease not implemented") -} -func (*UnimplementedReleaseManagerServer) DeleteRelease(ctx context.Context, req *DeleteReleaseRequest) (*DeleteReleaseResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method DeleteRelease not implemented") -} - -func RegisterReleaseManagerServer(s *grpc.Server, srv ReleaseManagerServer) { - s.RegisterService(&_ReleaseManager_serviceDesc, srv) -} - -func _ReleaseManager_ListReleases_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ListReleasesRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ReleaseManagerServer).ListReleases(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/openpitrix.ReleaseManager/ListReleases", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ReleaseManagerServer).ListReleases(ctx, req.(*ListReleasesRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _ReleaseManager_CreateRelease_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CreateReleaseRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ReleaseManagerServer).CreateRelease(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/openpitrix.ReleaseManager/CreateRelease", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ReleaseManagerServer).CreateRelease(ctx, req.(*CreateReleaseRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _ReleaseManager_UpgradeRelease_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(UpgradeReleaseRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ReleaseManagerServer).UpgradeRelease(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/openpitrix.ReleaseManager/UpgradeRelease", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ReleaseManagerServer).UpgradeRelease(ctx, req.(*UpgradeReleaseRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _ReleaseManager_RollbackRelease_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(RollbackReleaseRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ReleaseManagerServer).RollbackRelease(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/openpitrix.ReleaseManager/RollbackRelease", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ReleaseManagerServer).RollbackRelease(ctx, req.(*RollbackReleaseRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _ReleaseManager_DeleteRelease_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DeleteReleaseRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ReleaseManagerServer).DeleteRelease(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/openpitrix.ReleaseManager/DeleteRelease", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ReleaseManagerServer).DeleteRelease(ctx, req.(*DeleteReleaseRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _ReleaseManager_serviceDesc = grpc.ServiceDesc{ - ServiceName: "openpitrix.ReleaseManager", - HandlerType: (*ReleaseManagerServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "ListReleases", - Handler: _ReleaseManager_ListReleases_Handler, - }, - { - MethodName: "CreateRelease", - Handler: _ReleaseManager_CreateRelease_Handler, - }, - { - MethodName: "UpgradeRelease", - Handler: _ReleaseManager_UpgradeRelease_Handler, - }, - { - MethodName: "RollbackRelease", - Handler: _ReleaseManager_RollbackRelease_Handler, - }, - { - MethodName: "DeleteRelease", - Handler: _ReleaseManager_DeleteRelease_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "helm.proto", -} diff --git a/vendor/openpitrix.io/openpitrix/pkg/pb/helm.pb.gw.go b/vendor/openpitrix.io/openpitrix/pkg/pb/helm.pb.gw.go deleted file mode 100644 index 0b1360a9bb..0000000000 --- a/vendor/openpitrix.io/openpitrix/pkg/pb/helm.pb.gw.go +++ /dev/null @@ -1,474 +0,0 @@ -// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: helm.proto - -/* -Package pb is a reverse proxy. - -It translates gRPC into RESTful JSON APIs. -*/ -package pb - -import ( - "context" - "io" - "net/http" - - "github.com/golang/protobuf/descriptor" - "github.com/golang/protobuf/proto" - "github.com/grpc-ecosystem/grpc-gateway/runtime" - "github.com/grpc-ecosystem/grpc-gateway/utilities" - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/grpclog" - "google.golang.org/grpc/status" -) - -// Suppress "imported and not used" errors -var _ codes.Code -var _ io.Reader -var _ status.Status -var _ = runtime.String -var _ = utilities.NewDoubleArray -var _ = descriptor.ForMessage - -var ( - filter_ReleaseManager_ListReleases_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_ReleaseManager_ListReleases_0(ctx context.Context, marshaler runtime.Marshaler, client ReleaseManagerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ListReleasesRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_ReleaseManager_ListReleases_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.ListReleases(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_ReleaseManager_ListReleases_0(ctx context.Context, marshaler runtime.Marshaler, server ReleaseManagerServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ListReleasesRequest - var metadata runtime.ServerMetadata - - if err := runtime.PopulateQueryParameters(&protoReq, req.URL.Query(), filter_ReleaseManager_ListReleases_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.ListReleases(ctx, &protoReq) - return msg, metadata, err - -} - -func request_ReleaseManager_CreateRelease_0(ctx context.Context, marshaler runtime.Marshaler, client ReleaseManagerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq CreateReleaseRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.CreateRelease(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_ReleaseManager_CreateRelease_0(ctx context.Context, marshaler runtime.Marshaler, server ReleaseManagerServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq CreateReleaseRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.CreateRelease(ctx, &protoReq) - return msg, metadata, err - -} - -func request_ReleaseManager_UpgradeRelease_0(ctx context.Context, marshaler runtime.Marshaler, client ReleaseManagerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq UpgradeReleaseRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.UpgradeRelease(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_ReleaseManager_UpgradeRelease_0(ctx context.Context, marshaler runtime.Marshaler, server ReleaseManagerServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq UpgradeReleaseRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.UpgradeRelease(ctx, &protoReq) - return msg, metadata, err - -} - -func request_ReleaseManager_RollbackRelease_0(ctx context.Context, marshaler runtime.Marshaler, client ReleaseManagerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq RollbackReleaseRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.RollbackRelease(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_ReleaseManager_RollbackRelease_0(ctx context.Context, marshaler runtime.Marshaler, server ReleaseManagerServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq RollbackReleaseRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.RollbackRelease(ctx, &protoReq) - return msg, metadata, err - -} - -func request_ReleaseManager_DeleteRelease_0(ctx context.Context, marshaler runtime.Marshaler, client ReleaseManagerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq DeleteReleaseRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.DeleteRelease(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_ReleaseManager_DeleteRelease_0(ctx context.Context, marshaler runtime.Marshaler, server ReleaseManagerServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq DeleteReleaseRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.DeleteRelease(ctx, &protoReq) - return msg, metadata, err - -} - -// RegisterReleaseManagerHandlerServer registers the http handlers for service ReleaseManager to "mux". -// UnaryRPC :call ReleaseManagerServer directly. -// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. -func RegisterReleaseManagerHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ReleaseManagerServer) error { - - mux.Handle("GET", pattern_ReleaseManager_ListReleases_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_ReleaseManager_ListReleases_0(rctx, inboundMarshaler, server, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_ReleaseManager_ListReleases_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("PUT", pattern_ReleaseManager_CreateRelease_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_ReleaseManager_CreateRelease_0(rctx, inboundMarshaler, server, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_ReleaseManager_CreateRelease_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("PATCH", pattern_ReleaseManager_UpgradeRelease_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_ReleaseManager_UpgradeRelease_0(rctx, inboundMarshaler, server, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_ReleaseManager_UpgradeRelease_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_ReleaseManager_RollbackRelease_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_ReleaseManager_RollbackRelease_0(rctx, inboundMarshaler, server, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_ReleaseManager_RollbackRelease_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("DELETE", pattern_ReleaseManager_DeleteRelease_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_ReleaseManager_DeleteRelease_0(rctx, inboundMarshaler, server, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_ReleaseManager_DeleteRelease_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -// RegisterReleaseManagerHandlerFromEndpoint is same as RegisterReleaseManagerHandler but -// automatically dials to "endpoint" and closes the connection when "ctx" gets done. -func RegisterReleaseManagerHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { - conn, err := grpc.Dial(endpoint, opts...) - if err != nil { - return err - } - defer func() { - if err != nil { - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - return - } - go func() { - <-ctx.Done() - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - }() - }() - - return RegisterReleaseManagerHandler(ctx, mux, conn) -} - -// RegisterReleaseManagerHandler registers the http handlers for service ReleaseManager to "mux". -// The handlers forward requests to the grpc endpoint over "conn". -func RegisterReleaseManagerHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { - return RegisterReleaseManagerHandlerClient(ctx, mux, NewReleaseManagerClient(conn)) -} - -// RegisterReleaseManagerHandlerClient registers the http handlers for service ReleaseManager -// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "ReleaseManagerClient". -// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "ReleaseManagerClient" -// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in -// "ReleaseManagerClient" to call the correct interceptors. -func RegisterReleaseManagerHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ReleaseManagerClient) error { - - mux.Handle("GET", pattern_ReleaseManager_ListReleases_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_ReleaseManager_ListReleases_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_ReleaseManager_ListReleases_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("PUT", pattern_ReleaseManager_CreateRelease_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_ReleaseManager_CreateRelease_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_ReleaseManager_CreateRelease_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("PATCH", pattern_ReleaseManager_UpgradeRelease_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_ReleaseManager_UpgradeRelease_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_ReleaseManager_UpgradeRelease_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_ReleaseManager_RollbackRelease_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_ReleaseManager_RollbackRelease_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_ReleaseManager_RollbackRelease_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("DELETE", pattern_ReleaseManager_DeleteRelease_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_ReleaseManager_DeleteRelease_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_ReleaseManager_DeleteRelease_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -var ( - pattern_ReleaseManager_ListReleases_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "releases"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_ReleaseManager_CreateRelease_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "releases"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_ReleaseManager_UpgradeRelease_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "releases"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_ReleaseManager_RollbackRelease_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "releases"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_ReleaseManager_DeleteRelease_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "releases"}, "", runtime.AssumeColonVerbOpt(true))) -) - -var ( - forward_ReleaseManager_ListReleases_0 = runtime.ForwardResponseMessage - - forward_ReleaseManager_CreateRelease_0 = runtime.ForwardResponseMessage - - forward_ReleaseManager_UpgradeRelease_0 = runtime.ForwardResponseMessage - - forward_ReleaseManager_RollbackRelease_0 = runtime.ForwardResponseMessage - - forward_ReleaseManager_DeleteRelease_0 = runtime.ForwardResponseMessage -) diff --git a/vendor/openpitrix.io/openpitrix/pkg/pb/isv.pb.go b/vendor/openpitrix.io/openpitrix/pkg/pb/isv.pb.go deleted file mode 100644 index 4d123e62bc..0000000000 --- a/vendor/openpitrix.io/openpitrix/pkg/pb/isv.pb.go +++ /dev/null @@ -1,1283 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// source: isv.proto - -package pb - -import ( - context "context" - fmt "fmt" - math "math" - - proto "github.com/golang/protobuf/proto" - timestamp "github.com/golang/protobuf/ptypes/timestamp" - wrappers "github.com/golang/protobuf/ptypes/wrappers" - _ "github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger/options" - _ "google.golang.org/genproto/googleapis/api/annotations" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" -) - -// 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 - -type DescribeVendorVerifyInfosRequest struct { - // query key, support these fields(user_id, status) - SearchWord *wrappers.StringValue `protobuf:"bytes,1,opt,name=search_word,json=searchWord,proto3" json:"search_word,omitempty"` - // sort key, order by sort_key, default create_time - SortKey *wrappers.StringValue `protobuf:"bytes,2,opt,name=sort_key,json=sortKey,proto3" json:"sort_key,omitempty"` - // value = 0 sort ASC, value = 1 sort DESC - Reverse *wrappers.BoolValue `protobuf:"bytes,3,opt,name=reverse,proto3" json:"reverse,omitempty"` - // data limit per page, default value 20, max value 200 - Limit uint32 `protobuf:"varint,4,opt,name=limit,proto3" json:"limit,omitempty"` - // data offset, default 0 - Offset uint32 `protobuf:"varint,5,opt,name=offset,proto3" json:"offset,omitempty"` - // user ids - UserId []string `protobuf:"bytes,11,rep,name=user_id,json=userId,proto3" json:"user_id,omitempty"` - // status eg.[draft|submitted|passed|rejected|suspended|in-review|new] - Status []string `protobuf:"bytes,12,rep,name=status,proto3" json:"status,omitempty"` - // select column to display - DisplayColumns []string `protobuf:"bytes,13,rep,name=display_columns,json=displayColumns,proto3" json:"display_columns,omitempty"` - // owner - Owner []string `protobuf:"bytes,14,rep,name=owner,proto3" json:"owner,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *DescribeVendorVerifyInfosRequest) Reset() { *m = DescribeVendorVerifyInfosRequest{} } -func (m *DescribeVendorVerifyInfosRequest) String() string { return proto.CompactTextString(m) } -func (*DescribeVendorVerifyInfosRequest) ProtoMessage() {} -func (*DescribeVendorVerifyInfosRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_9f98fd0318e50e7b, []int{0} -} - -func (m *DescribeVendorVerifyInfosRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_DescribeVendorVerifyInfosRequest.Unmarshal(m, b) -} -func (m *DescribeVendorVerifyInfosRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_DescribeVendorVerifyInfosRequest.Marshal(b, m, deterministic) -} -func (m *DescribeVendorVerifyInfosRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_DescribeVendorVerifyInfosRequest.Merge(m, src) -} -func (m *DescribeVendorVerifyInfosRequest) XXX_Size() int { - return xxx_messageInfo_DescribeVendorVerifyInfosRequest.Size(m) -} -func (m *DescribeVendorVerifyInfosRequest) XXX_DiscardUnknown() { - xxx_messageInfo_DescribeVendorVerifyInfosRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_DescribeVendorVerifyInfosRequest proto.InternalMessageInfo - -func (m *DescribeVendorVerifyInfosRequest) GetSearchWord() *wrappers.StringValue { - if m != nil { - return m.SearchWord - } - return nil -} - -func (m *DescribeVendorVerifyInfosRequest) GetSortKey() *wrappers.StringValue { - if m != nil { - return m.SortKey - } - return nil -} - -func (m *DescribeVendorVerifyInfosRequest) GetReverse() *wrappers.BoolValue { - if m != nil { - return m.Reverse - } - return nil -} - -func (m *DescribeVendorVerifyInfosRequest) GetLimit() uint32 { - if m != nil { - return m.Limit - } - return 0 -} - -func (m *DescribeVendorVerifyInfosRequest) GetOffset() uint32 { - if m != nil { - return m.Offset - } - return 0 -} - -func (m *DescribeVendorVerifyInfosRequest) GetUserId() []string { - if m != nil { - return m.UserId - } - return nil -} - -func (m *DescribeVendorVerifyInfosRequest) GetStatus() []string { - if m != nil { - return m.Status - } - return nil -} - -func (m *DescribeVendorVerifyInfosRequest) GetDisplayColumns() []string { - if m != nil { - return m.DisplayColumns - } - return nil -} - -func (m *DescribeVendorVerifyInfosRequest) GetOwner() []string { - if m != nil { - return m.Owner - } - return nil -} - -type DescribeVendorVerifyInfosResponse struct { - // total count of vendor - TotalCount uint32 `protobuf:"varint,1,opt,name=total_count,json=totalCount,proto3" json:"total_count,omitempty"` - // list of vendor verify info - VendorVerifyInfoSet []*VendorVerifyInfo `protobuf:"bytes,2,rep,name=vendor_verify_info_set,json=vendorVerifyInfoSet,proto3" json:"vendor_verify_info_set,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *DescribeVendorVerifyInfosResponse) Reset() { *m = DescribeVendorVerifyInfosResponse{} } -func (m *DescribeVendorVerifyInfosResponse) String() string { return proto.CompactTextString(m) } -func (*DescribeVendorVerifyInfosResponse) ProtoMessage() {} -func (*DescribeVendorVerifyInfosResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_9f98fd0318e50e7b, []int{1} -} - -func (m *DescribeVendorVerifyInfosResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_DescribeVendorVerifyInfosResponse.Unmarshal(m, b) -} -func (m *DescribeVendorVerifyInfosResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_DescribeVendorVerifyInfosResponse.Marshal(b, m, deterministic) -} -func (m *DescribeVendorVerifyInfosResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_DescribeVendorVerifyInfosResponse.Merge(m, src) -} -func (m *DescribeVendorVerifyInfosResponse) XXX_Size() int { - return xxx_messageInfo_DescribeVendorVerifyInfosResponse.Size(m) -} -func (m *DescribeVendorVerifyInfosResponse) XXX_DiscardUnknown() { - xxx_messageInfo_DescribeVendorVerifyInfosResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_DescribeVendorVerifyInfosResponse proto.InternalMessageInfo - -func (m *DescribeVendorVerifyInfosResponse) GetTotalCount() uint32 { - if m != nil { - return m.TotalCount - } - return 0 -} - -func (m *DescribeVendorVerifyInfosResponse) GetVendorVerifyInfoSet() []*VendorVerifyInfo { - if m != nil { - return m.VendorVerifyInfoSet - } - return nil -} - -type VendorVerifyInfo struct { - // user id - UserId *wrappers.StringValue `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` - // company name - CompanyName *wrappers.StringValue `protobuf:"bytes,2,opt,name=company_name,json=companyName,proto3" json:"company_name,omitempty"` - // company website - CompanyWebsite *wrappers.StringValue `protobuf:"bytes,3,opt,name=company_website,json=companyWebsite,proto3" json:"company_website,omitempty"` - // company profile - CompanyProfile *wrappers.StringValue `protobuf:"bytes,4,opt,name=company_profile,json=companyProfile,proto3" json:"company_profile,omitempty"` - // authorizer name - AuthorizerName *wrappers.StringValue `protobuf:"bytes,5,opt,name=authorizer_name,json=authorizerName,proto3" json:"authorizer_name,omitempty"` - // authorizer email eg.***@yunify.com - AuthorizerEmail *wrappers.StringValue `protobuf:"bytes,6,opt,name=authorizer_email,json=authorizerEmail,proto3" json:"authorizer_email,omitempty"` - // authorizer phone, string of 11 digit - AuthorizerPhone *wrappers.StringValue `protobuf:"bytes,7,opt,name=authorizer_phone,json=authorizerPhone,proto3" json:"authorizer_phone,omitempty"` - // bank name - BankName *wrappers.StringValue `protobuf:"bytes,8,opt,name=bank_name,json=bankName,proto3" json:"bank_name,omitempty"` - // name of bank account - BankAccountName *wrappers.StringValue `protobuf:"bytes,9,opt,name=bank_account_name,json=bankAccountName,proto3" json:"bank_account_name,omitempty"` - // number of bank account - BankAccountNumber *wrappers.StringValue `protobuf:"bytes,10,opt,name=bank_account_number,json=bankAccountNumber,proto3" json:"bank_account_number,omitempty"` - // status eg.[draft|submitted|passed|rejected|suspended|in-review|new] - Status *wrappers.StringValue `protobuf:"bytes,11,opt,name=status,proto3" json:"status,omitempty"` - // reject message - RejectMessage *wrappers.StringValue `protobuf:"bytes,12,opt,name=reject_message,json=rejectMessage,proto3" json:"reject_message,omitempty"` - // approver who approve the vendor verify - Approver *wrappers.StringValue `protobuf:"bytes,13,opt,name=approver,proto3" json:"approver,omitempty"` - // owner who own the vendor verify - Owner *wrappers.StringValue `protobuf:"bytes,14,opt,name=owner,proto3" json:"owner,omitempty"` - // owner path, concat string group_path:user_id - OwnerPath *wrappers.StringValue `protobuf:"bytes,15,opt,name=owner_path,json=ownerPath,proto3" json:"owner_path,omitempty"` - // submit time of vendor verify - SubmitTime *timestamp.Timestamp `protobuf:"bytes,16,opt,name=submit_time,json=submitTime,proto3" json:"submit_time,omitempty"` - // record status changed time - StatusTime *timestamp.Timestamp `protobuf:"bytes,17,opt,name=status_time,json=statusTime,proto3" json:"status_time,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *VendorVerifyInfo) Reset() { *m = VendorVerifyInfo{} } -func (m *VendorVerifyInfo) String() string { return proto.CompactTextString(m) } -func (*VendorVerifyInfo) ProtoMessage() {} -func (*VendorVerifyInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_9f98fd0318e50e7b, []int{2} -} - -func (m *VendorVerifyInfo) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_VendorVerifyInfo.Unmarshal(m, b) -} -func (m *VendorVerifyInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_VendorVerifyInfo.Marshal(b, m, deterministic) -} -func (m *VendorVerifyInfo) XXX_Merge(src proto.Message) { - xxx_messageInfo_VendorVerifyInfo.Merge(m, src) -} -func (m *VendorVerifyInfo) XXX_Size() int { - return xxx_messageInfo_VendorVerifyInfo.Size(m) -} -func (m *VendorVerifyInfo) XXX_DiscardUnknown() { - xxx_messageInfo_VendorVerifyInfo.DiscardUnknown(m) -} - -var xxx_messageInfo_VendorVerifyInfo proto.InternalMessageInfo - -func (m *VendorVerifyInfo) GetUserId() *wrappers.StringValue { - if m != nil { - return m.UserId - } - return nil -} - -func (m *VendorVerifyInfo) GetCompanyName() *wrappers.StringValue { - if m != nil { - return m.CompanyName - } - return nil -} - -func (m *VendorVerifyInfo) GetCompanyWebsite() *wrappers.StringValue { - if m != nil { - return m.CompanyWebsite - } - return nil -} - -func (m *VendorVerifyInfo) GetCompanyProfile() *wrappers.StringValue { - if m != nil { - return m.CompanyProfile - } - return nil -} - -func (m *VendorVerifyInfo) GetAuthorizerName() *wrappers.StringValue { - if m != nil { - return m.AuthorizerName - } - return nil -} - -func (m *VendorVerifyInfo) GetAuthorizerEmail() *wrappers.StringValue { - if m != nil { - return m.AuthorizerEmail - } - return nil -} - -func (m *VendorVerifyInfo) GetAuthorizerPhone() *wrappers.StringValue { - if m != nil { - return m.AuthorizerPhone - } - return nil -} - -func (m *VendorVerifyInfo) GetBankName() *wrappers.StringValue { - if m != nil { - return m.BankName - } - return nil -} - -func (m *VendorVerifyInfo) GetBankAccountName() *wrappers.StringValue { - if m != nil { - return m.BankAccountName - } - return nil -} - -func (m *VendorVerifyInfo) GetBankAccountNumber() *wrappers.StringValue { - if m != nil { - return m.BankAccountNumber - } - return nil -} - -func (m *VendorVerifyInfo) GetStatus() *wrappers.StringValue { - if m != nil { - return m.Status - } - return nil -} - -func (m *VendorVerifyInfo) GetRejectMessage() *wrappers.StringValue { - if m != nil { - return m.RejectMessage - } - return nil -} - -func (m *VendorVerifyInfo) GetApprover() *wrappers.StringValue { - if m != nil { - return m.Approver - } - return nil -} - -func (m *VendorVerifyInfo) GetOwner() *wrappers.StringValue { - if m != nil { - return m.Owner - } - return nil -} - -func (m *VendorVerifyInfo) GetOwnerPath() *wrappers.StringValue { - if m != nil { - return m.OwnerPath - } - return nil -} - -func (m *VendorVerifyInfo) GetSubmitTime() *timestamp.Timestamp { - if m != nil { - return m.SubmitTime - } - return nil -} - -func (m *VendorVerifyInfo) GetStatusTime() *timestamp.Timestamp { - if m != nil { - return m.StatusTime - } - return nil -} - -type SubmitVendorVerifyInfoRequest struct { - // required, id of user to submit - UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` - // required, company name - CompanyName *wrappers.StringValue `protobuf:"bytes,2,opt,name=company_name,json=companyName,proto3" json:"company_name,omitempty"` - // company website - CompanyWebsite *wrappers.StringValue `protobuf:"bytes,3,opt,name=company_website,json=companyWebsite,proto3" json:"company_website,omitempty"` - // company profile - CompanyProfile *wrappers.StringValue `protobuf:"bytes,4,opt,name=company_profile,json=companyProfile,proto3" json:"company_profile,omitempty"` - // required, authorizer name - AuthorizerName *wrappers.StringValue `protobuf:"bytes,5,opt,name=authorizer_name,json=authorizerName,proto3" json:"authorizer_name,omitempty"` - // required, authorizer email eg. xxx@yunify.com - AuthorizerEmail *wrappers.StringValue `protobuf:"bytes,6,opt,name=authorizer_email,json=authorizerEmail,proto3" json:"authorizer_email,omitempty"` - // authorizer phone, string of 11 digit - AuthorizerPhone *wrappers.StringValue `protobuf:"bytes,7,opt,name=authorizer_phone,json=authorizerPhone,proto3" json:"authorizer_phone,omitempty"` - // bank name - BankName *wrappers.StringValue `protobuf:"bytes,8,opt,name=bank_name,json=bankName,proto3" json:"bank_name,omitempty"` - // bank account name - BankAccountName *wrappers.StringValue `protobuf:"bytes,9,opt,name=bank_account_name,json=bankAccountName,proto3" json:"bank_account_name,omitempty"` - // bank account number - BankAccountNumber *wrappers.StringValue `protobuf:"bytes,10,opt,name=bank_account_number,json=bankAccountNumber,proto3" json:"bank_account_number,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *SubmitVendorVerifyInfoRequest) Reset() { *m = SubmitVendorVerifyInfoRequest{} } -func (m *SubmitVendorVerifyInfoRequest) String() string { return proto.CompactTextString(m) } -func (*SubmitVendorVerifyInfoRequest) ProtoMessage() {} -func (*SubmitVendorVerifyInfoRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_9f98fd0318e50e7b, []int{3} -} - -func (m *SubmitVendorVerifyInfoRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_SubmitVendorVerifyInfoRequest.Unmarshal(m, b) -} -func (m *SubmitVendorVerifyInfoRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_SubmitVendorVerifyInfoRequest.Marshal(b, m, deterministic) -} -func (m *SubmitVendorVerifyInfoRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_SubmitVendorVerifyInfoRequest.Merge(m, src) -} -func (m *SubmitVendorVerifyInfoRequest) XXX_Size() int { - return xxx_messageInfo_SubmitVendorVerifyInfoRequest.Size(m) -} -func (m *SubmitVendorVerifyInfoRequest) XXX_DiscardUnknown() { - xxx_messageInfo_SubmitVendorVerifyInfoRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_SubmitVendorVerifyInfoRequest proto.InternalMessageInfo - -func (m *SubmitVendorVerifyInfoRequest) GetUserId() string { - if m != nil { - return m.UserId - } - return "" -} - -func (m *SubmitVendorVerifyInfoRequest) GetCompanyName() *wrappers.StringValue { - if m != nil { - return m.CompanyName - } - return nil -} - -func (m *SubmitVendorVerifyInfoRequest) GetCompanyWebsite() *wrappers.StringValue { - if m != nil { - return m.CompanyWebsite - } - return nil -} - -func (m *SubmitVendorVerifyInfoRequest) GetCompanyProfile() *wrappers.StringValue { - if m != nil { - return m.CompanyProfile - } - return nil -} - -func (m *SubmitVendorVerifyInfoRequest) GetAuthorizerName() *wrappers.StringValue { - if m != nil { - return m.AuthorizerName - } - return nil -} - -func (m *SubmitVendorVerifyInfoRequest) GetAuthorizerEmail() *wrappers.StringValue { - if m != nil { - return m.AuthorizerEmail - } - return nil -} - -func (m *SubmitVendorVerifyInfoRequest) GetAuthorizerPhone() *wrappers.StringValue { - if m != nil { - return m.AuthorizerPhone - } - return nil -} - -func (m *SubmitVendorVerifyInfoRequest) GetBankName() *wrappers.StringValue { - if m != nil { - return m.BankName - } - return nil -} - -func (m *SubmitVendorVerifyInfoRequest) GetBankAccountName() *wrappers.StringValue { - if m != nil { - return m.BankAccountName - } - return nil -} - -func (m *SubmitVendorVerifyInfoRequest) GetBankAccountNumber() *wrappers.StringValue { - if m != nil { - return m.BankAccountNumber - } - return nil -} - -type SubmitVendorVerifyInfoResponse struct { - // id of user submitted - UserId *wrappers.StringValue `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *SubmitVendorVerifyInfoResponse) Reset() { *m = SubmitVendorVerifyInfoResponse{} } -func (m *SubmitVendorVerifyInfoResponse) String() string { return proto.CompactTextString(m) } -func (*SubmitVendorVerifyInfoResponse) ProtoMessage() {} -func (*SubmitVendorVerifyInfoResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_9f98fd0318e50e7b, []int{4} -} - -func (m *SubmitVendorVerifyInfoResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_SubmitVendorVerifyInfoResponse.Unmarshal(m, b) -} -func (m *SubmitVendorVerifyInfoResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_SubmitVendorVerifyInfoResponse.Marshal(b, m, deterministic) -} -func (m *SubmitVendorVerifyInfoResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_SubmitVendorVerifyInfoResponse.Merge(m, src) -} -func (m *SubmitVendorVerifyInfoResponse) XXX_Size() int { - return xxx_messageInfo_SubmitVendorVerifyInfoResponse.Size(m) -} -func (m *SubmitVendorVerifyInfoResponse) XXX_DiscardUnknown() { - xxx_messageInfo_SubmitVendorVerifyInfoResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_SubmitVendorVerifyInfoResponse proto.InternalMessageInfo - -func (m *SubmitVendorVerifyInfoResponse) GetUserId() *wrappers.StringValue { - if m != nil { - return m.UserId - } - return nil -} - -type PassVendorVerifyInfoRequest struct { - // required, id of user to pass - UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *PassVendorVerifyInfoRequest) Reset() { *m = PassVendorVerifyInfoRequest{} } -func (m *PassVendorVerifyInfoRequest) String() string { return proto.CompactTextString(m) } -func (*PassVendorVerifyInfoRequest) ProtoMessage() {} -func (*PassVendorVerifyInfoRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_9f98fd0318e50e7b, []int{5} -} - -func (m *PassVendorVerifyInfoRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_PassVendorVerifyInfoRequest.Unmarshal(m, b) -} -func (m *PassVendorVerifyInfoRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_PassVendorVerifyInfoRequest.Marshal(b, m, deterministic) -} -func (m *PassVendorVerifyInfoRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_PassVendorVerifyInfoRequest.Merge(m, src) -} -func (m *PassVendorVerifyInfoRequest) XXX_Size() int { - return xxx_messageInfo_PassVendorVerifyInfoRequest.Size(m) -} -func (m *PassVendorVerifyInfoRequest) XXX_DiscardUnknown() { - xxx_messageInfo_PassVendorVerifyInfoRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_PassVendorVerifyInfoRequest proto.InternalMessageInfo - -func (m *PassVendorVerifyInfoRequest) GetUserId() string { - if m != nil { - return m.UserId - } - return "" -} - -type PassVendorVerifyInfoResponse struct { - // id of user passed - UserId *wrappers.StringValue `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *PassVendorVerifyInfoResponse) Reset() { *m = PassVendorVerifyInfoResponse{} } -func (m *PassVendorVerifyInfoResponse) String() string { return proto.CompactTextString(m) } -func (*PassVendorVerifyInfoResponse) ProtoMessage() {} -func (*PassVendorVerifyInfoResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_9f98fd0318e50e7b, []int{6} -} - -func (m *PassVendorVerifyInfoResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_PassVendorVerifyInfoResponse.Unmarshal(m, b) -} -func (m *PassVendorVerifyInfoResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_PassVendorVerifyInfoResponse.Marshal(b, m, deterministic) -} -func (m *PassVendorVerifyInfoResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_PassVendorVerifyInfoResponse.Merge(m, src) -} -func (m *PassVendorVerifyInfoResponse) XXX_Size() int { - return xxx_messageInfo_PassVendorVerifyInfoResponse.Size(m) -} -func (m *PassVendorVerifyInfoResponse) XXX_DiscardUnknown() { - xxx_messageInfo_PassVendorVerifyInfoResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_PassVendorVerifyInfoResponse proto.InternalMessageInfo - -func (m *PassVendorVerifyInfoResponse) GetUserId() *wrappers.StringValue { - if m != nil { - return m.UserId - } - return nil -} - -type RejectVendorVerifyInfoRequest struct { - // required, id of user to reject - UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` - // reject message - RejectMessage *wrappers.StringValue `protobuf:"bytes,2,opt,name=reject_message,json=rejectMessage,proto3" json:"reject_message,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *RejectVendorVerifyInfoRequest) Reset() { *m = RejectVendorVerifyInfoRequest{} } -func (m *RejectVendorVerifyInfoRequest) String() string { return proto.CompactTextString(m) } -func (*RejectVendorVerifyInfoRequest) ProtoMessage() {} -func (*RejectVendorVerifyInfoRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_9f98fd0318e50e7b, []int{7} -} - -func (m *RejectVendorVerifyInfoRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_RejectVendorVerifyInfoRequest.Unmarshal(m, b) -} -func (m *RejectVendorVerifyInfoRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_RejectVendorVerifyInfoRequest.Marshal(b, m, deterministic) -} -func (m *RejectVendorVerifyInfoRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_RejectVendorVerifyInfoRequest.Merge(m, src) -} -func (m *RejectVendorVerifyInfoRequest) XXX_Size() int { - return xxx_messageInfo_RejectVendorVerifyInfoRequest.Size(m) -} -func (m *RejectVendorVerifyInfoRequest) XXX_DiscardUnknown() { - xxx_messageInfo_RejectVendorVerifyInfoRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_RejectVendorVerifyInfoRequest proto.InternalMessageInfo - -func (m *RejectVendorVerifyInfoRequest) GetUserId() string { - if m != nil { - return m.UserId - } - return "" -} - -func (m *RejectVendorVerifyInfoRequest) GetRejectMessage() *wrappers.StringValue { - if m != nil { - return m.RejectMessage - } - return nil -} - -type RejectVendorVerifyInfoResponse struct { - // id of user rejected - UserId *wrappers.StringValue `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *RejectVendorVerifyInfoResponse) Reset() { *m = RejectVendorVerifyInfoResponse{} } -func (m *RejectVendorVerifyInfoResponse) String() string { return proto.CompactTextString(m) } -func (*RejectVendorVerifyInfoResponse) ProtoMessage() {} -func (*RejectVendorVerifyInfoResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_9f98fd0318e50e7b, []int{8} -} - -func (m *RejectVendorVerifyInfoResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_RejectVendorVerifyInfoResponse.Unmarshal(m, b) -} -func (m *RejectVendorVerifyInfoResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_RejectVendorVerifyInfoResponse.Marshal(b, m, deterministic) -} -func (m *RejectVendorVerifyInfoResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_RejectVendorVerifyInfoResponse.Merge(m, src) -} -func (m *RejectVendorVerifyInfoResponse) XXX_Size() int { - return xxx_messageInfo_RejectVendorVerifyInfoResponse.Size(m) -} -func (m *RejectVendorVerifyInfoResponse) XXX_DiscardUnknown() { - xxx_messageInfo_RejectVendorVerifyInfoResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_RejectVendorVerifyInfoResponse proto.InternalMessageInfo - -func (m *RejectVendorVerifyInfoResponse) GetUserId() *wrappers.StringValue { - if m != nil { - return m.UserId - } - return nil -} - -type VendorStatistics struct { - // use user id to statistic - UserId *wrappers.StringValue `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` - // company name - CompanyName *wrappers.StringValue `protobuf:"bytes,2,opt,name=company_name,json=companyName,proto3" json:"company_name,omitempty"` - // number of user's active app - ActiveAppCount uint32 `protobuf:"varint,3,opt,name=active_app_count,json=activeAppCount,proto3" json:"active_app_count,omitempty"` - // total count of cluster last month - ClusterCountMonth uint32 `protobuf:"varint,4,opt,name=cluster_count_month,json=clusterCountMonth,proto3" json:"cluster_count_month,omitempty"` - // total count of cluster - ClusterCountTotal uint32 `protobuf:"varint,5,opt,name=cluster_count_total,json=clusterCountTotal,proto3" json:"cluster_count_total,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *VendorStatistics) Reset() { *m = VendorStatistics{} } -func (m *VendorStatistics) String() string { return proto.CompactTextString(m) } -func (*VendorStatistics) ProtoMessage() {} -func (*VendorStatistics) Descriptor() ([]byte, []int) { - return fileDescriptor_9f98fd0318e50e7b, []int{9} -} - -func (m *VendorStatistics) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_VendorStatistics.Unmarshal(m, b) -} -func (m *VendorStatistics) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_VendorStatistics.Marshal(b, m, deterministic) -} -func (m *VendorStatistics) XXX_Merge(src proto.Message) { - xxx_messageInfo_VendorStatistics.Merge(m, src) -} -func (m *VendorStatistics) XXX_Size() int { - return xxx_messageInfo_VendorStatistics.Size(m) -} -func (m *VendorStatistics) XXX_DiscardUnknown() { - xxx_messageInfo_VendorStatistics.DiscardUnknown(m) -} - -var xxx_messageInfo_VendorStatistics proto.InternalMessageInfo - -func (m *VendorStatistics) GetUserId() *wrappers.StringValue { - if m != nil { - return m.UserId - } - return nil -} - -func (m *VendorStatistics) GetCompanyName() *wrappers.StringValue { - if m != nil { - return m.CompanyName - } - return nil -} - -func (m *VendorStatistics) GetActiveAppCount() uint32 { - if m != nil { - return m.ActiveAppCount - } - return 0 -} - -func (m *VendorStatistics) GetClusterCountMonth() uint32 { - if m != nil { - return m.ClusterCountMonth - } - return 0 -} - -func (m *VendorStatistics) GetClusterCountTotal() uint32 { - if m != nil { - return m.ClusterCountTotal - } - return 0 -} - -type DescribeVendorStatisticsResponse struct { - // total count of vendor statistic - TotalCount uint32 `protobuf:"varint,1,opt,name=total_count,json=totalCount,proto3" json:"total_count,omitempty"` - // list of vendor statistic - VendorVerifyStatisticsSet []*VendorStatistics `protobuf:"bytes,2,rep,name=vendor_verify_statistics_set,json=vendorVerifyStatisticsSet,proto3" json:"vendor_verify_statistics_set,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *DescribeVendorStatisticsResponse) Reset() { *m = DescribeVendorStatisticsResponse{} } -func (m *DescribeVendorStatisticsResponse) String() string { return proto.CompactTextString(m) } -func (*DescribeVendorStatisticsResponse) ProtoMessage() {} -func (*DescribeVendorStatisticsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_9f98fd0318e50e7b, []int{10} -} - -func (m *DescribeVendorStatisticsResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_DescribeVendorStatisticsResponse.Unmarshal(m, b) -} -func (m *DescribeVendorStatisticsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_DescribeVendorStatisticsResponse.Marshal(b, m, deterministic) -} -func (m *DescribeVendorStatisticsResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_DescribeVendorStatisticsResponse.Merge(m, src) -} -func (m *DescribeVendorStatisticsResponse) XXX_Size() int { - return xxx_messageInfo_DescribeVendorStatisticsResponse.Size(m) -} -func (m *DescribeVendorStatisticsResponse) XXX_DiscardUnknown() { - xxx_messageInfo_DescribeVendorStatisticsResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_DescribeVendorStatisticsResponse proto.InternalMessageInfo - -func (m *DescribeVendorStatisticsResponse) GetTotalCount() uint32 { - if m != nil { - return m.TotalCount - } - return 0 -} - -func (m *DescribeVendorStatisticsResponse) GetVendorVerifyStatisticsSet() []*VendorStatistics { - if m != nil { - return m.VendorVerifyStatisticsSet - } - return nil -} - -type GetVendorVerifyInfoRequest struct { - // required, use user id to get vendor verify info - UserId *wrappers.StringValue `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *GetVendorVerifyInfoRequest) Reset() { *m = GetVendorVerifyInfoRequest{} } -func (m *GetVendorVerifyInfoRequest) String() string { return proto.CompactTextString(m) } -func (*GetVendorVerifyInfoRequest) ProtoMessage() {} -func (*GetVendorVerifyInfoRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_9f98fd0318e50e7b, []int{11} -} - -func (m *GetVendorVerifyInfoRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_GetVendorVerifyInfoRequest.Unmarshal(m, b) -} -func (m *GetVendorVerifyInfoRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_GetVendorVerifyInfoRequest.Marshal(b, m, deterministic) -} -func (m *GetVendorVerifyInfoRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetVendorVerifyInfoRequest.Merge(m, src) -} -func (m *GetVendorVerifyInfoRequest) XXX_Size() int { - return xxx_messageInfo_GetVendorVerifyInfoRequest.Size(m) -} -func (m *GetVendorVerifyInfoRequest) XXX_DiscardUnknown() { - xxx_messageInfo_GetVendorVerifyInfoRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_GetVendorVerifyInfoRequest proto.InternalMessageInfo - -func (m *GetVendorVerifyInfoRequest) GetUserId() *wrappers.StringValue { - if m != nil { - return m.UserId - } - return nil -} - -type GetVendorVerifyInfoResponse struct { - // vendor verify info - VendorVerifyInfo *VendorVerifyInfo `protobuf:"bytes,1,opt,name=vendor_verify_info,json=vendorVerifyInfo,proto3" json:"vendor_verify_info,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *GetVendorVerifyInfoResponse) Reset() { *m = GetVendorVerifyInfoResponse{} } -func (m *GetVendorVerifyInfoResponse) String() string { return proto.CompactTextString(m) } -func (*GetVendorVerifyInfoResponse) ProtoMessage() {} -func (*GetVendorVerifyInfoResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_9f98fd0318e50e7b, []int{12} -} - -func (m *GetVendorVerifyInfoResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_GetVendorVerifyInfoResponse.Unmarshal(m, b) -} -func (m *GetVendorVerifyInfoResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_GetVendorVerifyInfoResponse.Marshal(b, m, deterministic) -} -func (m *GetVendorVerifyInfoResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetVendorVerifyInfoResponse.Merge(m, src) -} -func (m *GetVendorVerifyInfoResponse) XXX_Size() int { - return xxx_messageInfo_GetVendorVerifyInfoResponse.Size(m) -} -func (m *GetVendorVerifyInfoResponse) XXX_DiscardUnknown() { - xxx_messageInfo_GetVendorVerifyInfoResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_GetVendorVerifyInfoResponse proto.InternalMessageInfo - -func (m *GetVendorVerifyInfoResponse) GetVendorVerifyInfo() *VendorVerifyInfo { - if m != nil { - return m.VendorVerifyInfo - } - return nil -} - -func init() { - proto.RegisterType((*DescribeVendorVerifyInfosRequest)(nil), "openpitrix.DescribeVendorVerifyInfosRequest") - proto.RegisterType((*DescribeVendorVerifyInfosResponse)(nil), "openpitrix.DescribeVendorVerifyInfosResponse") - proto.RegisterType((*VendorVerifyInfo)(nil), "openpitrix.VendorVerifyInfo") - proto.RegisterType((*SubmitVendorVerifyInfoRequest)(nil), "openpitrix.SubmitVendorVerifyInfoRequest") - proto.RegisterType((*SubmitVendorVerifyInfoResponse)(nil), "openpitrix.SubmitVendorVerifyInfoResponse") - proto.RegisterType((*PassVendorVerifyInfoRequest)(nil), "openpitrix.PassVendorVerifyInfoRequest") - proto.RegisterType((*PassVendorVerifyInfoResponse)(nil), "openpitrix.PassVendorVerifyInfoResponse") - proto.RegisterType((*RejectVendorVerifyInfoRequest)(nil), "openpitrix.RejectVendorVerifyInfoRequest") - proto.RegisterType((*RejectVendorVerifyInfoResponse)(nil), "openpitrix.RejectVendorVerifyInfoResponse") - proto.RegisterType((*VendorStatistics)(nil), "openpitrix.VendorStatistics") - proto.RegisterType((*DescribeVendorStatisticsResponse)(nil), "openpitrix.DescribeVendorStatisticsResponse") - proto.RegisterType((*GetVendorVerifyInfoRequest)(nil), "openpitrix.GetVendorVerifyInfoRequest") - proto.RegisterType((*GetVendorVerifyInfoResponse)(nil), "openpitrix.GetVendorVerifyInfoResponse") -} - -func init() { proto.RegisterFile("isv.proto", fileDescriptor_9f98fd0318e50e7b) } - -var fileDescriptor_9f98fd0318e50e7b = []byte{ - // 1259 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x57, 0x4d, 0x6f, 0x1b, 0x45, - 0x18, 0x96, 0x9d, 0xe6, 0xc3, 0xe3, 0xe6, 0x6b, 0x12, 0xb9, 0x1b, 0x27, 0x6d, 0x97, 0x95, 0x20, - 0x69, 0x95, 0x26, 0xa2, 0x94, 0x52, 0x5a, 0x55, 0xc8, 0x2d, 0x55, 0x69, 0xa1, 0x28, 0x38, 0xa5, - 0x95, 0x90, 0xd0, 0x6a, 0x6c, 0xbf, 0xb6, 0x87, 0xae, 0x77, 0x86, 0x99, 0x59, 0x87, 0x20, 0x21, - 0x21, 0xb8, 0x70, 0x0e, 0x48, 0x9c, 0x41, 0xe2, 0x80, 0x38, 0xf2, 0x1b, 0xf8, 0x05, 0xfc, 0x85, - 0x9e, 0xf9, 0x0d, 0x68, 0x66, 0xd6, 0xf1, 0x7a, 0xfd, 0x91, 0x4d, 0x7b, 0xe8, 0xa5, 0x27, 0x7b, - 0xdf, 0x7d, 0x9e, 0x77, 0x9e, 0x79, 0xfd, 0x7e, 0x19, 0x15, 0xa8, 0xec, 0xee, 0x70, 0xc1, 0x14, - 0xc3, 0x88, 0x71, 0x08, 0x39, 0x55, 0x82, 0x7e, 0x53, 0xbe, 0xd0, 0x62, 0xac, 0x15, 0xc0, 0xae, - 0x79, 0x53, 0x8b, 0x9a, 0xbb, 0x07, 0x82, 0x70, 0x0e, 0x42, 0x5a, 0x6c, 0xf9, 0x62, 0xfa, 0xbd, - 0xa2, 0x1d, 0x90, 0x8a, 0x74, 0x78, 0x0c, 0xd8, 0x88, 0x01, 0x84, 0xd3, 0x5d, 0x12, 0x86, 0x4c, - 0x11, 0x45, 0x59, 0xd8, 0xa3, 0x6f, 0x9b, 0x8f, 0xfa, 0x95, 0x16, 0x84, 0x57, 0xe4, 0x01, 0x69, - 0xb5, 0x40, 0xec, 0x32, 0x6e, 0x10, 0xc3, 0x68, 0xef, 0xbf, 0x3c, 0x72, 0x3f, 0x04, 0x59, 0x17, - 0xb4, 0x06, 0x4f, 0x20, 0x6c, 0x30, 0xf1, 0x04, 0x04, 0x6d, 0x1e, 0x3e, 0x08, 0x9b, 0x4c, 0x56, - 0xe1, 0xeb, 0x08, 0xa4, 0xc2, 0xb7, 0x51, 0x51, 0x02, 0x11, 0xf5, 0xb6, 0x7f, 0xc0, 0x44, 0xc3, - 0xc9, 0xb9, 0xb9, 0xad, 0xe2, 0xd5, 0x8d, 0x1d, 0x2b, 0x63, 0xa7, 0xa7, 0x73, 0x67, 0x5f, 0x09, - 0x1a, 0xb6, 0x9e, 0x90, 0x20, 0x82, 0x2a, 0xb2, 0x84, 0xa7, 0x4c, 0x34, 0xf0, 0x7b, 0x68, 0x4e, - 0x32, 0xa1, 0xfc, 0x67, 0x70, 0xe8, 0xe4, 0x33, 0x70, 0x67, 0x35, 0xfa, 0x63, 0x38, 0xc4, 0xd7, - 0xd0, 0xac, 0x80, 0x2e, 0x08, 0x09, 0xce, 0x94, 0xe1, 0x95, 0x87, 0x78, 0x77, 0x18, 0x0b, 0x62, - 0x56, 0x0c, 0xc5, 0xab, 0x68, 0x3a, 0xa0, 0x1d, 0xaa, 0x9c, 0x33, 0x6e, 0x6e, 0x6b, 0xbe, 0x6a, - 0x1f, 0x70, 0x09, 0xcd, 0xb0, 0x66, 0x53, 0x82, 0x72, 0xa6, 0x8d, 0x39, 0x7e, 0xc2, 0xe7, 0xd0, - 0x6c, 0x24, 0x41, 0xf8, 0xb4, 0xe1, 0x14, 0xdd, 0xa9, 0xad, 0x42, 0x75, 0x46, 0x3f, 0x3e, 0x68, - 0x68, 0x82, 0x54, 0x44, 0x45, 0xd2, 0x39, 0x6b, 0xed, 0xf6, 0x09, 0x6f, 0xa2, 0xc5, 0x06, 0x95, - 0x3c, 0x20, 0x87, 0x7e, 0x9d, 0x05, 0x51, 0x27, 0x94, 0xce, 0xbc, 0x01, 0x2c, 0xc4, 0xe6, 0xbb, - 0xd6, 0xaa, 0x75, 0xb0, 0x83, 0x10, 0x84, 0xb3, 0x60, 0x5e, 0xdb, 0x07, 0xef, 0xd7, 0x1c, 0x7a, - 0x63, 0x42, 0xc0, 0x25, 0x67, 0xa1, 0x04, 0x7c, 0x11, 0x15, 0x15, 0x53, 0x24, 0xf0, 0xeb, 0x2c, - 0x0a, 0x95, 0x89, 0xf8, 0x7c, 0x15, 0x19, 0xd3, 0x5d, 0x6d, 0xc1, 0x9f, 0xa1, 0x52, 0xd7, 0xb0, - 0xfd, 0xae, 0xa1, 0xfb, 0x34, 0x6c, 0x32, 0x5f, 0x5f, 0x2f, 0xef, 0x4e, 0x99, 0x08, 0xf7, 0x33, - 0x6e, 0x27, 0x7d, 0x4e, 0x75, 0xa5, 0x9b, 0xb2, 0xec, 0x83, 0xf2, 0x9e, 0xcf, 0xa1, 0xa5, 0x34, - 0x12, 0xbf, 0xdb, 0x0f, 0x4f, 0x96, 0x9f, 0xbd, 0x17, 0xbc, 0x0f, 0xd0, 0xd9, 0x3a, 0xeb, 0x70, - 0x12, 0x1e, 0xfa, 0x21, 0xe9, 0x40, 0xa6, 0x9f, 0xbd, 0x18, 0x33, 0x3e, 0x25, 0x1d, 0xc0, 0xf7, - 0xd0, 0x62, 0xcf, 0xc1, 0x01, 0xd4, 0x24, 0x55, 0xbd, 0x14, 0x98, 0xec, 0x63, 0x21, 0x26, 0x3d, - 0xb5, 0x9c, 0xa4, 0x1b, 0x2e, 0x58, 0x93, 0x06, 0x60, 0xb2, 0x22, 0xab, 0x9b, 0x3d, 0xcb, 0xd1, - 0x6e, 0x48, 0xa4, 0xda, 0x4c, 0xd0, 0x6f, 0x41, 0xd8, 0x1b, 0x4d, 0x67, 0x71, 0xd3, 0x27, 0x99, - 0x4b, 0xdd, 0x47, 0x4b, 0x09, 0x37, 0xd0, 0x21, 0x34, 0x70, 0x66, 0x32, 0xf8, 0x49, 0x1c, 0x7e, - 0x4f, 0x93, 0x52, 0x8e, 0x78, 0x9b, 0x85, 0xe0, 0xcc, 0x9e, 0xce, 0xd1, 0x9e, 0x26, 0xe1, 0xf7, - 0x51, 0xa1, 0x46, 0xc2, 0x67, 0xf6, 0x4a, 0x73, 0x19, 0x3c, 0xcc, 0x69, 0xb8, 0xb9, 0xcc, 0x47, - 0x68, 0xd9, 0x50, 0x49, 0xdd, 0xe4, 0xa8, 0x75, 0x51, 0xc8, 0x22, 0x42, 0xd3, 0x2a, 0x96, 0x65, - 0x3c, 0x7d, 0x82, 0x56, 0x06, 0x3d, 0x45, 0x9d, 0x1a, 0x08, 0x07, 0x65, 0xf0, 0xb5, 0x9c, 0xf4, - 0x65, 0x68, 0xf8, 0xda, 0x71, 0xdd, 0x16, 0xb3, 0x24, 0x6c, 0x5c, 0xd5, 0x77, 0xd1, 0x82, 0x80, - 0xaf, 0xa0, 0xae, 0xfc, 0x0e, 0x48, 0x49, 0x5a, 0xe0, 0x9c, 0xcd, 0xc0, 0x9e, 0xb7, 0x9c, 0x47, - 0x96, 0x82, 0x6f, 0xa0, 0x39, 0xc2, 0xb9, 0x60, 0x5d, 0x10, 0xce, 0x7c, 0x96, 0x60, 0xf6, 0xd0, - 0xf8, 0x6a, 0xbf, 0x57, 0x9c, 0x4c, 0xb3, 0x50, 0x7c, 0x0b, 0x21, 0xf3, 0xc5, 0xe7, 0x44, 0xb5, - 0x9d, 0xc5, 0x0c, 0xc4, 0x82, 0xc1, 0xef, 0x11, 0xd5, 0xc6, 0xb7, 0x50, 0x51, 0x46, 0xb5, 0x0e, - 0x55, 0xbe, 0x9e, 0x2e, 0xce, 0xd2, 0x98, 0xf6, 0xfa, 0xb8, 0x37, 0x7a, 0xaa, 0xc8, 0xc2, 0xb5, - 0xc1, 0x90, 0x4d, 0xd8, 0x2c, 0x79, 0x39, 0x03, 0xd9, 0xc0, 0xb5, 0xc1, 0xfb, 0x7b, 0x1a, 0x9d, - 0xdf, 0x37, 0xbe, 0x86, 0xda, 0x52, 0x3c, 0x6e, 0xce, 0x0d, 0xf6, 0x9c, 0xc2, 0xeb, 0xae, 0xf2, - 0xba, 0xab, 0xbc, 0xe2, 0xae, 0xe2, 0x3d, 0x45, 0x17, 0xc6, 0x25, 0x6d, 0x3c, 0xb2, 0x5f, 0x6c, - 0x52, 0x7a, 0xd7, 0xd1, 0xfa, 0x1e, 0x91, 0xf2, 0xb4, 0xb5, 0xe0, 0x7d, 0x8e, 0x36, 0x46, 0xf3, - 0x5e, 0x4e, 0xce, 0x77, 0xe8, 0x7c, 0xd5, 0xf4, 0xb4, 0x53, 0x17, 0xe7, 0x70, 0x07, 0xcd, 0x9f, - 0xba, 0x83, 0xea, 0x30, 0x8f, 0x3b, 0xfe, 0xe5, 0xee, 0xf5, 0x4b, 0xbe, 0xb7, 0xdc, 0xec, 0xeb, - 0x05, 0x58, 0x2a, 0x5a, 0x97, 0xaf, 0x6c, 0xb9, 0xd9, 0x42, 0x4b, 0xa4, 0xae, 0x68, 0x17, 0x7c, - 0xc2, 0x79, 0xbc, 0xe2, 0x4d, 0x99, 0x15, 0x6f, 0xc1, 0xda, 0x2b, 0x9c, 0xdb, 0x35, 0x6f, 0x07, - 0xad, 0xd4, 0x83, 0x48, 0x2a, 0x10, 0x16, 0xe6, 0x77, 0x58, 0xa8, 0xda, 0xf1, 0x66, 0xbb, 0x1c, - 0xbf, 0x32, 0xd0, 0x47, 0xfa, 0xc5, 0x30, 0xde, 0xac, 0x8c, 0xf1, 0xca, 0x3b, 0x80, 0x7f, 0xac, - 0x5f, 0x78, 0xbf, 0xe7, 0xd2, 0xeb, 0x7f, 0x3f, 0x3c, 0xd9, 0x97, 0xd1, 0x2f, 0xd1, 0xc6, 0xe0, - 0x32, 0x2a, 0x8f, 0x9d, 0x4c, 0x5e, 0x49, 0x13, 0x87, 0xad, 0x25, 0x57, 0xd2, 0xbe, 0x5d, 0x2f, - 0xa6, 0xfb, 0xa8, 0x7c, 0x1f, 0xc6, 0x26, 0xe4, 0x0b, 0x26, 0x04, 0x45, 0xeb, 0x23, 0x9d, 0xc6, - 0x77, 0x7e, 0x88, 0xf0, 0xf0, 0x7e, 0x7d, 0x7c, 0xc0, 0xa4, 0xdd, 0x7a, 0x29, 0xbd, 0x5b, 0x5f, - 0xfd, 0xbe, 0x80, 0xd0, 0x03, 0xd9, 0x7d, 0x44, 0x42, 0xd2, 0x02, 0x81, 0xff, 0xcc, 0xa1, 0xd2, - 0xe8, 0x5e, 0x82, 0x2f, 0x25, 0x3d, 0x4f, 0x1c, 0x92, 0xe5, 0xcb, 0x59, 0xa0, 0xf6, 0x32, 0xde, - 0x8d, 0xa3, 0xca, 0x3a, 0x5e, 0xb3, 0x20, 0xd7, 0xca, 0x73, 0xed, 0xb5, 0x5c, 0x7d, 0xad, 0x1f, - 0xfe, 0x7d, 0xfe, 0x73, 0x7e, 0xd5, 0x5b, 0xdc, 0xed, 0xbe, 0xbd, 0xab, 0x13, 0xd2, 0x22, 0xe4, - 0xcd, 0xdc, 0x65, 0xfc, 0x63, 0x1e, 0xad, 0x8d, 0xfd, 0xb7, 0x82, 0xb7, 0x93, 0x1a, 0x4e, 0xfa, - 0x17, 0x59, 0xbe, 0x92, 0x11, 0x1d, 0x8b, 0xfe, 0x29, 0x77, 0x54, 0x09, 0x71, 0x70, 0x1f, 0x06, - 0x25, 0x53, 0x90, 0x46, 0xf4, 0xb6, 0x5b, 0x27, 0xa1, 0xab, 0xe7, 0xa8, 0x70, 0x0f, 0xa8, 0x6a, - 0xbb, 0xaa, 0x0d, 0x12, 0xdc, 0x26, 0x85, 0xa0, 0x21, 0xb7, 0xe2, 0x8c, 0xd8, 0x76, 0xed, 0xe2, - 0x71, 0x69, 0xdb, 0x6d, 0x40, 0x93, 0x44, 0x81, 0x72, 0x05, 0xa8, 0x48, 0x84, 0x2e, 0x09, 0x02, - 0x77, 0xe8, 0x6c, 0x13, 0x88, 0x65, 0x9c, 0x0e, 0x04, 0xfe, 0x27, 0x87, 0xd6, 0x7b, 0x82, 0x2b, - 0x9c, 0x0f, 0xf5, 0x91, 0xd3, 0xc5, 0x61, 0x02, 0x7a, 0xb8, 0xf8, 0xbc, 0x87, 0x47, 0x95, 0x32, - 0x76, 0x74, 0x14, 0xfa, 0x45, 0xe5, 0xb2, 0x66, 0x1c, 0x13, 0xa3, 0x78, 0x13, 0xbf, 0x99, 0x52, - 0x9c, 0xf8, 0x9e, 0xa8, 0x45, 0xfc, 0x5b, 0x0e, 0xad, 0x8e, 0x1a, 0x1a, 0x78, 0x33, 0x29, 0x69, - 0xc2, 0x38, 0x2a, 0x6f, 0x9d, 0x0c, 0x8c, 0x75, 0x5f, 0x3f, 0xaa, 0xac, 0x62, 0xac, 0x21, 0x83, - 0x19, 0x67, 0x14, 0xaf, 0x79, 0xab, 0x69, 0xc5, 0x9c, 0x48, 0x93, 0x71, 0x7f, 0xe5, 0x50, 0x69, - 0xf4, 0x08, 0x18, 0xac, 0x8e, 0x89, 0x53, 0x6a, 0xb0, 0x3a, 0x26, 0x4f, 0x14, 0xef, 0xe6, 0x51, - 0xa5, 0x84, 0x57, 0x2d, 0x68, 0x84, 0xd6, 0x75, 0xaf, 0x94, 0xd6, 0x6a, 0x67, 0x96, 0x56, 0xfb, - 0x47, 0x0e, 0xad, 0x8c, 0x68, 0x23, 0xf8, 0xad, 0xe4, 0xf9, 0xe3, 0x9b, 0x57, 0x79, 0xf3, 0x44, - 0x5c, 0x2c, 0xf2, 0xf6, 0x51, 0xc5, 0xc1, 0xa5, 0x74, 0x31, 0x24, 0xea, 0x77, 0x03, 0x97, 0xc7, - 0x27, 0xc1, 0x9d, 0x33, 0x5f, 0xe4, 0x79, 0xad, 0x36, 0x63, 0x3a, 0xe2, 0x3b, 0xff, 0x07, 0x00, - 0x00, 0xff, 0xff, 0x71, 0x41, 0x15, 0x45, 0x99, 0x12, 0x00, 0x00, -} - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConn - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion4 - -// IsvManagerClient is the client API for IsvManager service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type IsvManagerClient interface { - // Submit vendor verify info - SubmitVendorVerifyInfo(ctx context.Context, in *SubmitVendorVerifyInfoRequest, opts ...grpc.CallOption) (*SubmitVendorVerifyInfoResponse, error) - // Get vendor verifies info, can filer with these fields(user_id, status), default return all VendorVerifyInfos - DescribeVendorVerifyInfos(ctx context.Context, in *DescribeVendorVerifyInfosRequest, opts ...grpc.CallOption) (*DescribeVendorVerifyInfosResponse, error) - // Get statistics of vendor - DescribeAppVendorStatistics(ctx context.Context, in *DescribeVendorVerifyInfosRequest, opts ...grpc.CallOption) (*DescribeVendorStatisticsResponse, error) - // Pass vendor verify - PassVendorVerifyInfo(ctx context.Context, in *PassVendorVerifyInfoRequest, opts ...grpc.CallOption) (*PassVendorVerifyInfoResponse, error) - // Reject vendor verify - RejectVendorVerifyInfo(ctx context.Context, in *RejectVendorVerifyInfoRequest, opts ...grpc.CallOption) (*RejectVendorVerifyInfoResponse, error) - // Get vendor verify info - GetVendorVerifyInfo(ctx context.Context, in *GetVendorVerifyInfoRequest, opts ...grpc.CallOption) (*GetVendorVerifyInfoResponse, error) -} - -type isvManagerClient struct { - cc *grpc.ClientConn -} - -func NewIsvManagerClient(cc *grpc.ClientConn) IsvManagerClient { - return &isvManagerClient{cc} -} - -func (c *isvManagerClient) SubmitVendorVerifyInfo(ctx context.Context, in *SubmitVendorVerifyInfoRequest, opts ...grpc.CallOption) (*SubmitVendorVerifyInfoResponse, error) { - out := new(SubmitVendorVerifyInfoResponse) - err := c.cc.Invoke(ctx, "/openpitrix.IsvManager/SubmitVendorVerifyInfo", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *isvManagerClient) DescribeVendorVerifyInfos(ctx context.Context, in *DescribeVendorVerifyInfosRequest, opts ...grpc.CallOption) (*DescribeVendorVerifyInfosResponse, error) { - out := new(DescribeVendorVerifyInfosResponse) - err := c.cc.Invoke(ctx, "/openpitrix.IsvManager/DescribeVendorVerifyInfos", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *isvManagerClient) DescribeAppVendorStatistics(ctx context.Context, in *DescribeVendorVerifyInfosRequest, opts ...grpc.CallOption) (*DescribeVendorStatisticsResponse, error) { - out := new(DescribeVendorStatisticsResponse) - err := c.cc.Invoke(ctx, "/openpitrix.IsvManager/DescribeAppVendorStatistics", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *isvManagerClient) PassVendorVerifyInfo(ctx context.Context, in *PassVendorVerifyInfoRequest, opts ...grpc.CallOption) (*PassVendorVerifyInfoResponse, error) { - out := new(PassVendorVerifyInfoResponse) - err := c.cc.Invoke(ctx, "/openpitrix.IsvManager/PassVendorVerifyInfo", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *isvManagerClient) RejectVendorVerifyInfo(ctx context.Context, in *RejectVendorVerifyInfoRequest, opts ...grpc.CallOption) (*RejectVendorVerifyInfoResponse, error) { - out := new(RejectVendorVerifyInfoResponse) - err := c.cc.Invoke(ctx, "/openpitrix.IsvManager/RejectVendorVerifyInfo", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *isvManagerClient) GetVendorVerifyInfo(ctx context.Context, in *GetVendorVerifyInfoRequest, opts ...grpc.CallOption) (*GetVendorVerifyInfoResponse, error) { - out := new(GetVendorVerifyInfoResponse) - err := c.cc.Invoke(ctx, "/openpitrix.IsvManager/GetVendorVerifyInfo", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// IsvManagerServer is the server API for IsvManager service. -type IsvManagerServer interface { - // Submit vendor verify info - SubmitVendorVerifyInfo(context.Context, *SubmitVendorVerifyInfoRequest) (*SubmitVendorVerifyInfoResponse, error) - // Get vendor verifies info, can filer with these fields(user_id, status), default return all VendorVerifyInfos - DescribeVendorVerifyInfos(context.Context, *DescribeVendorVerifyInfosRequest) (*DescribeVendorVerifyInfosResponse, error) - // Get statistics of vendor - DescribeAppVendorStatistics(context.Context, *DescribeVendorVerifyInfosRequest) (*DescribeVendorStatisticsResponse, error) - // Pass vendor verify - PassVendorVerifyInfo(context.Context, *PassVendorVerifyInfoRequest) (*PassVendorVerifyInfoResponse, error) - // Reject vendor verify - RejectVendorVerifyInfo(context.Context, *RejectVendorVerifyInfoRequest) (*RejectVendorVerifyInfoResponse, error) - // Get vendor verify info - GetVendorVerifyInfo(context.Context, *GetVendorVerifyInfoRequest) (*GetVendorVerifyInfoResponse, error) -} - -// UnimplementedIsvManagerServer can be embedded to have forward compatible implementations. -type UnimplementedIsvManagerServer struct { -} - -func (*UnimplementedIsvManagerServer) SubmitVendorVerifyInfo(ctx context.Context, req *SubmitVendorVerifyInfoRequest) (*SubmitVendorVerifyInfoResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method SubmitVendorVerifyInfo not implemented") -} -func (*UnimplementedIsvManagerServer) DescribeVendorVerifyInfos(ctx context.Context, req *DescribeVendorVerifyInfosRequest) (*DescribeVendorVerifyInfosResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method DescribeVendorVerifyInfos not implemented") -} -func (*UnimplementedIsvManagerServer) DescribeAppVendorStatistics(ctx context.Context, req *DescribeVendorVerifyInfosRequest) (*DescribeVendorStatisticsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method DescribeAppVendorStatistics not implemented") -} -func (*UnimplementedIsvManagerServer) PassVendorVerifyInfo(ctx context.Context, req *PassVendorVerifyInfoRequest) (*PassVendorVerifyInfoResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method PassVendorVerifyInfo not implemented") -} -func (*UnimplementedIsvManagerServer) RejectVendorVerifyInfo(ctx context.Context, req *RejectVendorVerifyInfoRequest) (*RejectVendorVerifyInfoResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method RejectVendorVerifyInfo not implemented") -} -func (*UnimplementedIsvManagerServer) GetVendorVerifyInfo(ctx context.Context, req *GetVendorVerifyInfoRequest) (*GetVendorVerifyInfoResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetVendorVerifyInfo not implemented") -} - -func RegisterIsvManagerServer(s *grpc.Server, srv IsvManagerServer) { - s.RegisterService(&_IsvManager_serviceDesc, srv) -} - -func _IsvManager_SubmitVendorVerifyInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(SubmitVendorVerifyInfoRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(IsvManagerServer).SubmitVendorVerifyInfo(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/openpitrix.IsvManager/SubmitVendorVerifyInfo", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(IsvManagerServer).SubmitVendorVerifyInfo(ctx, req.(*SubmitVendorVerifyInfoRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _IsvManager_DescribeVendorVerifyInfos_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DescribeVendorVerifyInfosRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(IsvManagerServer).DescribeVendorVerifyInfos(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/openpitrix.IsvManager/DescribeVendorVerifyInfos", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(IsvManagerServer).DescribeVendorVerifyInfos(ctx, req.(*DescribeVendorVerifyInfosRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _IsvManager_DescribeAppVendorStatistics_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DescribeVendorVerifyInfosRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(IsvManagerServer).DescribeAppVendorStatistics(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/openpitrix.IsvManager/DescribeAppVendorStatistics", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(IsvManagerServer).DescribeAppVendorStatistics(ctx, req.(*DescribeVendorVerifyInfosRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _IsvManager_PassVendorVerifyInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(PassVendorVerifyInfoRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(IsvManagerServer).PassVendorVerifyInfo(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/openpitrix.IsvManager/PassVendorVerifyInfo", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(IsvManagerServer).PassVendorVerifyInfo(ctx, req.(*PassVendorVerifyInfoRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _IsvManager_RejectVendorVerifyInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(RejectVendorVerifyInfoRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(IsvManagerServer).RejectVendorVerifyInfo(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/openpitrix.IsvManager/RejectVendorVerifyInfo", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(IsvManagerServer).RejectVendorVerifyInfo(ctx, req.(*RejectVendorVerifyInfoRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _IsvManager_GetVendorVerifyInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetVendorVerifyInfoRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(IsvManagerServer).GetVendorVerifyInfo(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/openpitrix.IsvManager/GetVendorVerifyInfo", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(IsvManagerServer).GetVendorVerifyInfo(ctx, req.(*GetVendorVerifyInfoRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _IsvManager_serviceDesc = grpc.ServiceDesc{ - ServiceName: "openpitrix.IsvManager", - HandlerType: (*IsvManagerServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "SubmitVendorVerifyInfo", - Handler: _IsvManager_SubmitVendorVerifyInfo_Handler, - }, - { - MethodName: "DescribeVendorVerifyInfos", - Handler: _IsvManager_DescribeVendorVerifyInfos_Handler, - }, - { - MethodName: "DescribeAppVendorStatistics", - Handler: _IsvManager_DescribeAppVendorStatistics_Handler, - }, - { - MethodName: "PassVendorVerifyInfo", - Handler: _IsvManager_PassVendorVerifyInfo_Handler, - }, - { - MethodName: "RejectVendorVerifyInfo", - Handler: _IsvManager_RejectVendorVerifyInfo_Handler, - }, - { - MethodName: "GetVendorVerifyInfo", - Handler: _IsvManager_GetVendorVerifyInfo_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "isv.proto", -} diff --git a/vendor/openpitrix.io/openpitrix/pkg/pb/isv.pb.gw.go b/vendor/openpitrix.io/openpitrix/pkg/pb/isv.pb.gw.go deleted file mode 100644 index f8e211a07d..0000000000 --- a/vendor/openpitrix.io/openpitrix/pkg/pb/isv.pb.gw.go +++ /dev/null @@ -1,550 +0,0 @@ -// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: isv.proto - -/* -Package pb is a reverse proxy. - -It translates gRPC into RESTful JSON APIs. -*/ -package pb - -import ( - "context" - "io" - "net/http" - - "github.com/golang/protobuf/descriptor" - "github.com/golang/protobuf/proto" - "github.com/grpc-ecosystem/grpc-gateway/runtime" - "github.com/grpc-ecosystem/grpc-gateway/utilities" - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/grpclog" - "google.golang.org/grpc/status" -) - -// Suppress "imported and not used" errors -var _ codes.Code -var _ io.Reader -var _ status.Status -var _ = runtime.String -var _ = utilities.NewDoubleArray -var _ = descriptor.ForMessage - -func request_IsvManager_SubmitVendorVerifyInfo_0(ctx context.Context, marshaler runtime.Marshaler, client IsvManagerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq SubmitVendorVerifyInfoRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.SubmitVendorVerifyInfo(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_IsvManager_SubmitVendorVerifyInfo_0(ctx context.Context, marshaler runtime.Marshaler, server IsvManagerServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq SubmitVendorVerifyInfoRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.SubmitVendorVerifyInfo(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_IsvManager_DescribeVendorVerifyInfos_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_IsvManager_DescribeVendorVerifyInfos_0(ctx context.Context, marshaler runtime.Marshaler, client IsvManagerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq DescribeVendorVerifyInfosRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_IsvManager_DescribeVendorVerifyInfos_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.DescribeVendorVerifyInfos(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_IsvManager_DescribeVendorVerifyInfos_0(ctx context.Context, marshaler runtime.Marshaler, server IsvManagerServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq DescribeVendorVerifyInfosRequest - var metadata runtime.ServerMetadata - - if err := runtime.PopulateQueryParameters(&protoReq, req.URL.Query(), filter_IsvManager_DescribeVendorVerifyInfos_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.DescribeVendorVerifyInfos(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_IsvManager_DescribeAppVendorStatistics_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_IsvManager_DescribeAppVendorStatistics_0(ctx context.Context, marshaler runtime.Marshaler, client IsvManagerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq DescribeVendorVerifyInfosRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_IsvManager_DescribeAppVendorStatistics_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.DescribeAppVendorStatistics(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_IsvManager_DescribeAppVendorStatistics_0(ctx context.Context, marshaler runtime.Marshaler, server IsvManagerServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq DescribeVendorVerifyInfosRequest - var metadata runtime.ServerMetadata - - if err := runtime.PopulateQueryParameters(&protoReq, req.URL.Query(), filter_IsvManager_DescribeAppVendorStatistics_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.DescribeAppVendorStatistics(ctx, &protoReq) - return msg, metadata, err - -} - -func request_IsvManager_PassVendorVerifyInfo_0(ctx context.Context, marshaler runtime.Marshaler, client IsvManagerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq PassVendorVerifyInfoRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.PassVendorVerifyInfo(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_IsvManager_PassVendorVerifyInfo_0(ctx context.Context, marshaler runtime.Marshaler, server IsvManagerServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq PassVendorVerifyInfoRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.PassVendorVerifyInfo(ctx, &protoReq) - return msg, metadata, err - -} - -func request_IsvManager_RejectVendorVerifyInfo_0(ctx context.Context, marshaler runtime.Marshaler, client IsvManagerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq RejectVendorVerifyInfoRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.RejectVendorVerifyInfo(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_IsvManager_RejectVendorVerifyInfo_0(ctx context.Context, marshaler runtime.Marshaler, server IsvManagerServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq RejectVendorVerifyInfoRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.RejectVendorVerifyInfo(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_IsvManager_GetVendorVerifyInfo_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_IsvManager_GetVendorVerifyInfo_0(ctx context.Context, marshaler runtime.Marshaler, client IsvManagerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq GetVendorVerifyInfoRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_IsvManager_GetVendorVerifyInfo_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.GetVendorVerifyInfo(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_IsvManager_GetVendorVerifyInfo_0(ctx context.Context, marshaler runtime.Marshaler, server IsvManagerServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq GetVendorVerifyInfoRequest - var metadata runtime.ServerMetadata - - if err := runtime.PopulateQueryParameters(&protoReq, req.URL.Query(), filter_IsvManager_GetVendorVerifyInfo_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.GetVendorVerifyInfo(ctx, &protoReq) - return msg, metadata, err - -} - -// RegisterIsvManagerHandlerServer registers the http handlers for service IsvManager to "mux". -// UnaryRPC :call IsvManagerServer directly. -// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. -func RegisterIsvManagerHandlerServer(ctx context.Context, mux *runtime.ServeMux, server IsvManagerServer) error { - - mux.Handle("POST", pattern_IsvManager_SubmitVendorVerifyInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_IsvManager_SubmitVendorVerifyInfo_0(rctx, inboundMarshaler, server, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_IsvManager_SubmitVendorVerifyInfo_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_IsvManager_DescribeVendorVerifyInfos_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_IsvManager_DescribeVendorVerifyInfos_0(rctx, inboundMarshaler, server, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_IsvManager_DescribeVendorVerifyInfos_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_IsvManager_DescribeAppVendorStatistics_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_IsvManager_DescribeAppVendorStatistics_0(rctx, inboundMarshaler, server, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_IsvManager_DescribeAppVendorStatistics_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_IsvManager_PassVendorVerifyInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_IsvManager_PassVendorVerifyInfo_0(rctx, inboundMarshaler, server, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_IsvManager_PassVendorVerifyInfo_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_IsvManager_RejectVendorVerifyInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_IsvManager_RejectVendorVerifyInfo_0(rctx, inboundMarshaler, server, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_IsvManager_RejectVendorVerifyInfo_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_IsvManager_GetVendorVerifyInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_IsvManager_GetVendorVerifyInfo_0(rctx, inboundMarshaler, server, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_IsvManager_GetVendorVerifyInfo_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -// RegisterIsvManagerHandlerFromEndpoint is same as RegisterIsvManagerHandler but -// automatically dials to "endpoint" and closes the connection when "ctx" gets done. -func RegisterIsvManagerHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { - conn, err := grpc.Dial(endpoint, opts...) - if err != nil { - return err - } - defer func() { - if err != nil { - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - return - } - go func() { - <-ctx.Done() - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - }() - }() - - return RegisterIsvManagerHandler(ctx, mux, conn) -} - -// RegisterIsvManagerHandler registers the http handlers for service IsvManager to "mux". -// The handlers forward requests to the grpc endpoint over "conn". -func RegisterIsvManagerHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { - return RegisterIsvManagerHandlerClient(ctx, mux, NewIsvManagerClient(conn)) -} - -// RegisterIsvManagerHandlerClient registers the http handlers for service IsvManager -// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "IsvManagerClient". -// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "IsvManagerClient" -// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in -// "IsvManagerClient" to call the correct interceptors. -func RegisterIsvManagerHandlerClient(ctx context.Context, mux *runtime.ServeMux, client IsvManagerClient) error { - - mux.Handle("POST", pattern_IsvManager_SubmitVendorVerifyInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_IsvManager_SubmitVendorVerifyInfo_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_IsvManager_SubmitVendorVerifyInfo_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_IsvManager_DescribeVendorVerifyInfos_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_IsvManager_DescribeVendorVerifyInfos_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_IsvManager_DescribeVendorVerifyInfos_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_IsvManager_DescribeAppVendorStatistics_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_IsvManager_DescribeAppVendorStatistics_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_IsvManager_DescribeAppVendorStatistics_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_IsvManager_PassVendorVerifyInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_IsvManager_PassVendorVerifyInfo_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_IsvManager_PassVendorVerifyInfo_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_IsvManager_RejectVendorVerifyInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_IsvManager_RejectVendorVerifyInfo_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_IsvManager_RejectVendorVerifyInfo_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_IsvManager_GetVendorVerifyInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_IsvManager_GetVendorVerifyInfo_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_IsvManager_GetVendorVerifyInfo_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -var ( - pattern_IsvManager_SubmitVendorVerifyInfo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "app_vendors"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_IsvManager_DescribeVendorVerifyInfos_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "app_vendors"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_IsvManager_DescribeAppVendorStatistics_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "app_vendors", "app_vendor_statistics"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_IsvManager_PassVendorVerifyInfo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "app_vendors", "pass"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_IsvManager_RejectVendorVerifyInfo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "app_vendors", "reject"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_IsvManager_GetVendorVerifyInfo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "app_vendors", "app_vendor"}, "", runtime.AssumeColonVerbOpt(true))) -) - -var ( - forward_IsvManager_SubmitVendorVerifyInfo_0 = runtime.ForwardResponseMessage - - forward_IsvManager_DescribeVendorVerifyInfos_0 = runtime.ForwardResponseMessage - - forward_IsvManager_DescribeAppVendorStatistics_0 = runtime.ForwardResponseMessage - - forward_IsvManager_PassVendorVerifyInfo_0 = runtime.ForwardResponseMessage - - forward_IsvManager_RejectVendorVerifyInfo_0 = runtime.ForwardResponseMessage - - forward_IsvManager_GetVendorVerifyInfo_0 = runtime.ForwardResponseMessage -) diff --git a/vendor/openpitrix.io/openpitrix/pkg/pb/job.pb.go b/vendor/openpitrix.io/openpitrix/pkg/pb/job.pb.go deleted file mode 100644 index 22ae081084..0000000000 --- a/vendor/openpitrix.io/openpitrix/pkg/pb/job.pb.go +++ /dev/null @@ -1,779 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// source: job.proto - -package pb - -import ( - context "context" - fmt "fmt" - math "math" - - proto "github.com/golang/protobuf/proto" - timestamp "github.com/golang/protobuf/ptypes/timestamp" - wrappers "github.com/golang/protobuf/ptypes/wrappers" - _ "github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger/options" - _ "google.golang.org/genproto/googleapis/api/annotations" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" -) - -// 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 - -type CreateJobRequest struct { - // required, cluster id - ClusterId *wrappers.StringValue `protobuf:"bytes,1,opt,name=cluster_id,json=clusterId,proto3" json:"cluster_id,omitempty"` - // required, id of app run in cluster - AppId *wrappers.StringValue `protobuf:"bytes,2,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty"` - // id of specific app version - VersionId *wrappers.StringValue `protobuf:"bytes,3,opt,name=version_id,json=versionId,proto3" json:"version_id,omitempty"` - // required, describe job's action.eg:[CreateCluster|StartClusters|...] - JobAction *wrappers.StringValue `protobuf:"bytes,4,opt,name=job_action,json=jobAction,proto3" json:"job_action,omitempty"` - // required, runtime provide.eg:[qingcloud|aliyun|aws|kubernetes] - Provider *wrappers.StringValue `protobuf:"bytes,5,opt,name=provider,proto3" json:"provider,omitempty"` - // required, directive, a json string, describe the info of running the job action - Directive *wrappers.StringValue `protobuf:"bytes,6,opt,name=directive,proto3" json:"directive,omitempty"` - // required, runtime id - RuntimeId *wrappers.StringValue `protobuf:"bytes,7,opt,name=runtime_id,json=runtimeId,proto3" json:"runtime_id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *CreateJobRequest) Reset() { *m = CreateJobRequest{} } -func (m *CreateJobRequest) String() string { return proto.CompactTextString(m) } -func (*CreateJobRequest) ProtoMessage() {} -func (*CreateJobRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_f32c477d91a04ead, []int{0} -} - -func (m *CreateJobRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_CreateJobRequest.Unmarshal(m, b) -} -func (m *CreateJobRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_CreateJobRequest.Marshal(b, m, deterministic) -} -func (m *CreateJobRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_CreateJobRequest.Merge(m, src) -} -func (m *CreateJobRequest) XXX_Size() int { - return xxx_messageInfo_CreateJobRequest.Size(m) -} -func (m *CreateJobRequest) XXX_DiscardUnknown() { - xxx_messageInfo_CreateJobRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_CreateJobRequest proto.InternalMessageInfo - -func (m *CreateJobRequest) GetClusterId() *wrappers.StringValue { - if m != nil { - return m.ClusterId - } - return nil -} - -func (m *CreateJobRequest) GetAppId() *wrappers.StringValue { - if m != nil { - return m.AppId - } - return nil -} - -func (m *CreateJobRequest) GetVersionId() *wrappers.StringValue { - if m != nil { - return m.VersionId - } - return nil -} - -func (m *CreateJobRequest) GetJobAction() *wrappers.StringValue { - if m != nil { - return m.JobAction - } - return nil -} - -func (m *CreateJobRequest) GetProvider() *wrappers.StringValue { - if m != nil { - return m.Provider - } - return nil -} - -func (m *CreateJobRequest) GetDirective() *wrappers.StringValue { - if m != nil { - return m.Directive - } - return nil -} - -func (m *CreateJobRequest) GetRuntimeId() *wrappers.StringValue { - if m != nil { - return m.RuntimeId - } - return nil -} - -type CreateJobResponse struct { - // id of job created - JobId *wrappers.StringValue `protobuf:"bytes,1,opt,name=job_id,json=jobId,proto3" json:"job_id,omitempty"` - // id of cluster run job - ClusterId *wrappers.StringValue `protobuf:"bytes,2,opt,name=cluster_id,json=clusterId,proto3" json:"cluster_id,omitempty"` - // id of app deploy in cluster - AppId *wrappers.StringValue `protobuf:"bytes,3,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty"` - // id of specific app version - VersionId *wrappers.StringValue `protobuf:"bytes,4,opt,name=version_id,json=versionId,proto3" json:"version_id,omitempty"` - // id of runtime of cluster - RuntimeId *wrappers.StringValue `protobuf:"bytes,5,opt,name=runtime_id,json=runtimeId,proto3" json:"runtime_id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *CreateJobResponse) Reset() { *m = CreateJobResponse{} } -func (m *CreateJobResponse) String() string { return proto.CompactTextString(m) } -func (*CreateJobResponse) ProtoMessage() {} -func (*CreateJobResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_f32c477d91a04ead, []int{1} -} - -func (m *CreateJobResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_CreateJobResponse.Unmarshal(m, b) -} -func (m *CreateJobResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_CreateJobResponse.Marshal(b, m, deterministic) -} -func (m *CreateJobResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_CreateJobResponse.Merge(m, src) -} -func (m *CreateJobResponse) XXX_Size() int { - return xxx_messageInfo_CreateJobResponse.Size(m) -} -func (m *CreateJobResponse) XXX_DiscardUnknown() { - xxx_messageInfo_CreateJobResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_CreateJobResponse proto.InternalMessageInfo - -func (m *CreateJobResponse) GetJobId() *wrappers.StringValue { - if m != nil { - return m.JobId - } - return nil -} - -func (m *CreateJobResponse) GetClusterId() *wrappers.StringValue { - if m != nil { - return m.ClusterId - } - return nil -} - -func (m *CreateJobResponse) GetAppId() *wrappers.StringValue { - if m != nil { - return m.AppId - } - return nil -} - -func (m *CreateJobResponse) GetVersionId() *wrappers.StringValue { - if m != nil { - return m.VersionId - } - return nil -} - -func (m *CreateJobResponse) GetRuntimeId() *wrappers.StringValue { - if m != nil { - return m.RuntimeId - } - return nil -} - -type Job struct { - // job id - JobId *wrappers.StringValue `protobuf:"bytes,1,opt,name=job_id,json=jobId,proto3" json:"job_id,omitempty"` - // id of cluster run job - ClusterId *wrappers.StringValue `protobuf:"bytes,2,opt,name=cluster_id,json=clusterId,proto3" json:"cluster_id,omitempty"` - // id of app deployed in cluster - AppId *wrappers.StringValue `protobuf:"bytes,3,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty"` - // id of specific app version - VersionId *wrappers.StringValue `protobuf:"bytes,4,opt,name=version_id,json=versionId,proto3" json:"version_id,omitempty"` - // describe job's action eg:[CreateCluster|StartClusters|...] - JobAction *wrappers.StringValue `protobuf:"bytes,5,opt,name=job_action,json=jobAction,proto3" json:"job_action,omitempty"` - // status eg.[successful|failed|running|pending] - Status *wrappers.StringValue `protobuf:"bytes,6,opt,name=status,proto3" json:"status,omitempty"` - // error code, if job run failed will return a error code - ErrorCode *wrappers.UInt32Value `protobuf:"bytes,7,opt,name=error_code,json=errorCode,proto3" json:"error_code,omitempty"` - // directive, a json string, describe the info of running the job action - Directive *wrappers.StringValue `protobuf:"bytes,8,opt,name=directive,proto3" json:"directive,omitempty"` - // host name of server - Executor *wrappers.StringValue `protobuf:"bytes,9,opt,name=executor,proto3" json:"executor,omitempty"` - // total count of task in job, a job contain one more task - TaskCount *wrappers.UInt32Value `protobuf:"bytes,10,opt,name=task_count,json=taskCount,proto3" json:"task_count,omitempty"` - // own path, concat string group_path:user_id - OwnerPath *wrappers.StringValue `protobuf:"bytes,11,opt,name=owner_path,json=ownerPath,proto3" json:"owner_path,omitempty"` - // runtime provider eg:[qingcloud|aliyun|aws|kubernetes] - Provider *wrappers.StringValue `protobuf:"bytes,12,opt,name=provider,proto3" json:"provider,omitempty"` - // id of runtime of cluster - RuntimeId *wrappers.StringValue `protobuf:"bytes,13,opt,name=runtime_id,json=runtimeId,proto3" json:"runtime_id,omitempty"` - // the time job create - CreateTime *timestamp.Timestamp `protobuf:"bytes,14,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty"` - // record the status changed time - StatusTime *timestamp.Timestamp `protobuf:"bytes,15,opt,name=status_time,json=statusTime,proto3" json:"status_time,omitempty"` - // owner - Owner *wrappers.StringValue `protobuf:"bytes,16,opt,name=owner,proto3" json:"owner,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Job) Reset() { *m = Job{} } -func (m *Job) String() string { return proto.CompactTextString(m) } -func (*Job) ProtoMessage() {} -func (*Job) Descriptor() ([]byte, []int) { - return fileDescriptor_f32c477d91a04ead, []int{2} -} - -func (m *Job) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Job.Unmarshal(m, b) -} -func (m *Job) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Job.Marshal(b, m, deterministic) -} -func (m *Job) XXX_Merge(src proto.Message) { - xxx_messageInfo_Job.Merge(m, src) -} -func (m *Job) XXX_Size() int { - return xxx_messageInfo_Job.Size(m) -} -func (m *Job) XXX_DiscardUnknown() { - xxx_messageInfo_Job.DiscardUnknown(m) -} - -var xxx_messageInfo_Job proto.InternalMessageInfo - -func (m *Job) GetJobId() *wrappers.StringValue { - if m != nil { - return m.JobId - } - return nil -} - -func (m *Job) GetClusterId() *wrappers.StringValue { - if m != nil { - return m.ClusterId - } - return nil -} - -func (m *Job) GetAppId() *wrappers.StringValue { - if m != nil { - return m.AppId - } - return nil -} - -func (m *Job) GetVersionId() *wrappers.StringValue { - if m != nil { - return m.VersionId - } - return nil -} - -func (m *Job) GetJobAction() *wrappers.StringValue { - if m != nil { - return m.JobAction - } - return nil -} - -func (m *Job) GetStatus() *wrappers.StringValue { - if m != nil { - return m.Status - } - return nil -} - -func (m *Job) GetErrorCode() *wrappers.UInt32Value { - if m != nil { - return m.ErrorCode - } - return nil -} - -func (m *Job) GetDirective() *wrappers.StringValue { - if m != nil { - return m.Directive - } - return nil -} - -func (m *Job) GetExecutor() *wrappers.StringValue { - if m != nil { - return m.Executor - } - return nil -} - -func (m *Job) GetTaskCount() *wrappers.UInt32Value { - if m != nil { - return m.TaskCount - } - return nil -} - -func (m *Job) GetOwnerPath() *wrappers.StringValue { - if m != nil { - return m.OwnerPath - } - return nil -} - -func (m *Job) GetProvider() *wrappers.StringValue { - if m != nil { - return m.Provider - } - return nil -} - -func (m *Job) GetRuntimeId() *wrappers.StringValue { - if m != nil { - return m.RuntimeId - } - return nil -} - -func (m *Job) GetCreateTime() *timestamp.Timestamp { - if m != nil { - return m.CreateTime - } - return nil -} - -func (m *Job) GetStatusTime() *timestamp.Timestamp { - if m != nil { - return m.StatusTime - } - return nil -} - -func (m *Job) GetOwner() *wrappers.StringValue { - if m != nil { - return m.Owner - } - return nil -} - -type DescribeJobsRequest struct { - // query key, support these fields(job_id, cluster_id, app_id, version_id, executor, provider, status, owner) - SearchWord *wrappers.StringValue `protobuf:"bytes,1,opt,name=search_word,json=searchWord,proto3" json:"search_word,omitempty"` - // sort key, order by sort_key, default create_time - SortKey *wrappers.StringValue `protobuf:"bytes,2,opt,name=sort_key,json=sortKey,proto3" json:"sort_key,omitempty"` - // value = 0 sort ASC, value = 1 sort DESC - Reverse *wrappers.BoolValue `protobuf:"bytes,3,opt,name=reverse,proto3" json:"reverse,omitempty"` - // data limit per page, default value 20, max value 200 - Limit uint32 `protobuf:"varint,4,opt,name=limit,proto3" json:"limit,omitempty"` - // data offset, default 0 - Offset uint32 `protobuf:"varint,5,opt,name=offset,proto3" json:"offset,omitempty"` - // select column to display - DisplayColumns []string `protobuf:"bytes,6,rep,name=display_columns,json=displayColumns,proto3" json:"display_columns,omitempty"` - // job ids - JobId []string `protobuf:"bytes,11,rep,name=job_id,json=jobId,proto3" json:"job_id,omitempty"` - // cluster id - ClusterId *wrappers.StringValue `protobuf:"bytes,12,opt,name=cluster_id,json=clusterId,proto3" json:"cluster_id,omitempty"` - // app id - AppId *wrappers.StringValue `protobuf:"bytes,13,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty"` - // specific app version id to filter result - VersionId *wrappers.StringValue `protobuf:"bytes,14,opt,name=version_id,json=versionId,proto3" json:"version_id,omitempty"` - // host name of server - Executor *wrappers.StringValue `protobuf:"bytes,15,opt,name=executor,proto3" json:"executor,omitempty"` - // runtime provider eg.[qingcloud|aliyun|aws|kubernetes] - Provider *wrappers.StringValue `protobuf:"bytes,16,opt,name=provider,proto3" json:"provider,omitempty"` - // runtime id - RuntimeId *wrappers.StringValue `protobuf:"bytes,17,opt,name=runtime_id,json=runtimeId,proto3" json:"runtime_id,omitempty"` - // status eg.[successful|failed|running|pending] - Status []string `protobuf:"bytes,18,rep,name=status,proto3" json:"status,omitempty"` - // owner - Owner []string `protobuf:"bytes,19,rep,name=owner,proto3" json:"owner,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *DescribeJobsRequest) Reset() { *m = DescribeJobsRequest{} } -func (m *DescribeJobsRequest) String() string { return proto.CompactTextString(m) } -func (*DescribeJobsRequest) ProtoMessage() {} -func (*DescribeJobsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_f32c477d91a04ead, []int{3} -} - -func (m *DescribeJobsRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_DescribeJobsRequest.Unmarshal(m, b) -} -func (m *DescribeJobsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_DescribeJobsRequest.Marshal(b, m, deterministic) -} -func (m *DescribeJobsRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_DescribeJobsRequest.Merge(m, src) -} -func (m *DescribeJobsRequest) XXX_Size() int { - return xxx_messageInfo_DescribeJobsRequest.Size(m) -} -func (m *DescribeJobsRequest) XXX_DiscardUnknown() { - xxx_messageInfo_DescribeJobsRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_DescribeJobsRequest proto.InternalMessageInfo - -func (m *DescribeJobsRequest) GetSearchWord() *wrappers.StringValue { - if m != nil { - return m.SearchWord - } - return nil -} - -func (m *DescribeJobsRequest) GetSortKey() *wrappers.StringValue { - if m != nil { - return m.SortKey - } - return nil -} - -func (m *DescribeJobsRequest) GetReverse() *wrappers.BoolValue { - if m != nil { - return m.Reverse - } - return nil -} - -func (m *DescribeJobsRequest) GetLimit() uint32 { - if m != nil { - return m.Limit - } - return 0 -} - -func (m *DescribeJobsRequest) GetOffset() uint32 { - if m != nil { - return m.Offset - } - return 0 -} - -func (m *DescribeJobsRequest) GetDisplayColumns() []string { - if m != nil { - return m.DisplayColumns - } - return nil -} - -func (m *DescribeJobsRequest) GetJobId() []string { - if m != nil { - return m.JobId - } - return nil -} - -func (m *DescribeJobsRequest) GetClusterId() *wrappers.StringValue { - if m != nil { - return m.ClusterId - } - return nil -} - -func (m *DescribeJobsRequest) GetAppId() *wrappers.StringValue { - if m != nil { - return m.AppId - } - return nil -} - -func (m *DescribeJobsRequest) GetVersionId() *wrappers.StringValue { - if m != nil { - return m.VersionId - } - return nil -} - -func (m *DescribeJobsRequest) GetExecutor() *wrappers.StringValue { - if m != nil { - return m.Executor - } - return nil -} - -func (m *DescribeJobsRequest) GetProvider() *wrappers.StringValue { - if m != nil { - return m.Provider - } - return nil -} - -func (m *DescribeJobsRequest) GetRuntimeId() *wrappers.StringValue { - if m != nil { - return m.RuntimeId - } - return nil -} - -func (m *DescribeJobsRequest) GetStatus() []string { - if m != nil { - return m.Status - } - return nil -} - -func (m *DescribeJobsRequest) GetOwner() []string { - if m != nil { - return m.Owner - } - return nil -} - -type DescribeJobsResponse struct { - // total count of job - TotalCount uint32 `protobuf:"varint,1,opt,name=total_count,json=totalCount,proto3" json:"total_count,omitempty"` - // list of job - JobSet []*Job `protobuf:"bytes,2,rep,name=job_set,json=jobSet,proto3" json:"job_set,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *DescribeJobsResponse) Reset() { *m = DescribeJobsResponse{} } -func (m *DescribeJobsResponse) String() string { return proto.CompactTextString(m) } -func (*DescribeJobsResponse) ProtoMessage() {} -func (*DescribeJobsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_f32c477d91a04ead, []int{4} -} - -func (m *DescribeJobsResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_DescribeJobsResponse.Unmarshal(m, b) -} -func (m *DescribeJobsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_DescribeJobsResponse.Marshal(b, m, deterministic) -} -func (m *DescribeJobsResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_DescribeJobsResponse.Merge(m, src) -} -func (m *DescribeJobsResponse) XXX_Size() int { - return xxx_messageInfo_DescribeJobsResponse.Size(m) -} -func (m *DescribeJobsResponse) XXX_DiscardUnknown() { - xxx_messageInfo_DescribeJobsResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_DescribeJobsResponse proto.InternalMessageInfo - -func (m *DescribeJobsResponse) GetTotalCount() uint32 { - if m != nil { - return m.TotalCount - } - return 0 -} - -func (m *DescribeJobsResponse) GetJobSet() []*Job { - if m != nil { - return m.JobSet - } - return nil -} - -func init() { - proto.RegisterType((*CreateJobRequest)(nil), "openpitrix.CreateJobRequest") - proto.RegisterType((*CreateJobResponse)(nil), "openpitrix.CreateJobResponse") - proto.RegisterType((*Job)(nil), "openpitrix.Job") - proto.RegisterType((*DescribeJobsRequest)(nil), "openpitrix.DescribeJobsRequest") - proto.RegisterType((*DescribeJobsResponse)(nil), "openpitrix.DescribeJobsResponse") -} - -func init() { proto.RegisterFile("job.proto", fileDescriptor_f32c477d91a04ead) } - -var fileDescriptor_f32c477d91a04ead = []byte{ - // 901 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe4, 0x56, 0x4f, 0x6f, 0x23, 0x35, - 0x14, 0x57, 0x92, 0xa6, 0x49, 0x9c, 0xfe, 0x5b, 0x6f, 0x59, 0x8d, 0xa2, 0x42, 0xad, 0x5e, 0x08, - 0xd2, 0x6c, 0x22, 0xd2, 0x95, 0x58, 0xb1, 0xe2, 0xb0, 0x5b, 0x24, 0x68, 0x11, 0x12, 0xca, 0xf2, - 0x47, 0xe2, 0x32, 0xf2, 0xcc, 0xbc, 0x24, 0xce, 0x4e, 0xc7, 0xc6, 0xf6, 0x34, 0xdb, 0x2b, 0x12, - 0x12, 0x67, 0xb8, 0xf2, 0x19, 0x90, 0x90, 0xb8, 0x73, 0xe6, 0xcc, 0x57, 0xe0, 0x03, 0xf0, 0x11, - 0x90, 0xed, 0x99, 0x74, 0xba, 0xdd, 0x8a, 0x99, 0x72, 0xdc, 0x53, 0x34, 0xf6, 0xef, 0x97, 0xf7, - 0xfc, 0x7e, 0xef, 0xf7, 0x6c, 0xd4, 0x5b, 0xf2, 0x70, 0x24, 0x24, 0xd7, 0x1c, 0x23, 0x2e, 0x20, - 0x15, 0x4c, 0x4b, 0xf6, 0x72, 0xf0, 0xce, 0x9c, 0xf3, 0x79, 0x02, 0x63, 0xbb, 0x13, 0x66, 0xb3, - 0xf1, 0x4a, 0x52, 0x21, 0x40, 0x2a, 0x87, 0x1d, 0x1c, 0xbe, 0xba, 0xaf, 0xd9, 0x39, 0x28, 0x4d, - 0xcf, 0x45, 0x0e, 0x38, 0xc8, 0x01, 0x54, 0xb0, 0x31, 0x4d, 0x53, 0xae, 0xa9, 0x66, 0x3c, 0x2d, - 0xe8, 0xbe, 0xfd, 0x89, 0x1e, 0xce, 0x21, 0x7d, 0xa8, 0x56, 0x74, 0x3e, 0x07, 0x39, 0xe6, 0xc2, - 0x22, 0x6e, 0xa2, 0x8f, 0x7e, 0x6b, 0xa1, 0xbd, 0x13, 0x09, 0x54, 0xc3, 0x19, 0x0f, 0xa7, 0xf0, - 0x5d, 0x06, 0x4a, 0xe3, 0x27, 0x08, 0x45, 0x49, 0xa6, 0x34, 0xc8, 0x80, 0xc5, 0x5e, 0x83, 0x34, - 0x86, 0xfd, 0xc9, 0xc1, 0xc8, 0x45, 0x1d, 0x15, 0x69, 0x8d, 0x9e, 0x6b, 0xc9, 0xd2, 0xf9, 0xd7, - 0x34, 0xc9, 0x60, 0xda, 0xcb, 0xf1, 0xa7, 0x31, 0x3e, 0x46, 0x9b, 0x54, 0x08, 0x43, 0x6c, 0x56, - 0x20, 0xb6, 0xa9, 0x10, 0xa7, 0xb1, 0x89, 0x78, 0x01, 0x52, 0x31, 0x9e, 0x1a, 0x62, 0xab, 0x4a, - 0xc4, 0x1c, 0xef, 0xc8, 0x4b, 0x1e, 0x06, 0x34, 0x32, 0x07, 0xf3, 0x36, 0xaa, 0x90, 0x97, 0x3c, - 0x7c, 0x6a, 0xe1, 0xf8, 0x31, 0xea, 0x0a, 0xc9, 0x2f, 0x58, 0x0c, 0xd2, 0x6b, 0x57, 0xa0, 0xae, - 0xd1, 0xf8, 0x43, 0xd4, 0x8b, 0x99, 0x84, 0x48, 0xb3, 0x0b, 0xf0, 0x36, 0xab, 0x44, 0x5d, 0xc3, - 0x4d, 0xca, 0x32, 0x4b, 0x8d, 0xb0, 0xe6, 0xbc, 0x9d, 0x2a, 0xe4, 0x1c, 0x7f, 0x1a, 0x1f, 0xfd, - 0xde, 0x44, 0xf7, 0x4a, 0x9a, 0x29, 0xc1, 0x53, 0x05, 0xa6, 0xee, 0xa6, 0x0a, 0x15, 0x05, 0x6b, - 0x2f, 0x79, 0xe8, 0x4a, 0x57, 0x52, 0xba, 0x79, 0x57, 0xa5, 0x5b, 0x77, 0x55, 0x7a, 0xa3, 0xb6, - 0xd2, 0xa5, 0xb2, 0xb5, 0xeb, 0x95, 0xed, 0xd7, 0x0e, 0x6a, 0x9d, 0xf1, 0xf0, 0x4d, 0x29, 0x54, - 0xc9, 0x12, 0xed, 0x7a, 0x96, 0x78, 0x84, 0x36, 0x95, 0xa6, 0x3a, 0x53, 0x95, 0xba, 0x3a, 0xc7, - 0x9a, 0x90, 0x20, 0x25, 0x97, 0x41, 0xc4, 0x63, 0xb8, 0xb5, 0xa5, 0xbf, 0x3a, 0x4d, 0xf5, 0xf1, - 0x24, 0x0f, 0x69, 0xf1, 0x27, 0x3c, 0x86, 0xeb, 0x5e, 0xea, 0xd6, 0xf3, 0xd2, 0x63, 0xd4, 0x85, - 0x97, 0x10, 0x65, 0x9a, 0x4b, 0xaf, 0x57, 0xc5, 0xc1, 0x05, 0xda, 0xa4, 0xac, 0xa9, 0x7a, 0x11, - 0x44, 0x3c, 0x4b, 0xb5, 0x87, 0xaa, 0xa4, 0x6c, 0xf0, 0x27, 0x06, 0x6e, 0xc8, 0x7c, 0x95, 0x82, - 0x0c, 0x04, 0xd5, 0x0b, 0xaf, 0x5f, 0x25, 0x67, 0x8b, 0xff, 0x82, 0xea, 0xc5, 0xb5, 0xa9, 0xb3, - 0x55, 0x6b, 0xea, 0x5c, 0xb7, 0xc0, 0x76, 0x2d, 0x0b, 0xe0, 0x27, 0xa8, 0x1f, 0xd9, 0xc1, 0x11, - 0x98, 0x05, 0x6f, 0xc7, 0xb2, 0x07, 0x37, 0xd8, 0x5f, 0x16, 0x17, 0xce, 0x14, 0x39, 0xb8, 0x59, - 0x30, 0x64, 0x27, 0xb5, 0x23, 0xef, 0xfe, 0x37, 0xd9, 0xc1, 0x2d, 0x79, 0x82, 0xda, 0xf6, 0xf4, - 0xde, 0x5e, 0x15, 0x07, 0x58, 0xe8, 0xd1, 0x1f, 0x6d, 0x74, 0xff, 0x63, 0x50, 0x91, 0x64, 0xa1, - 0x99, 0x74, 0xaa, 0xb8, 0x9e, 0x3e, 0x42, 0x7d, 0x05, 0x54, 0x46, 0x8b, 0x60, 0xc5, 0x65, 0x35, - 0x17, 0x23, 0x47, 0xf8, 0x86, 0xcb, 0x18, 0x7f, 0x80, 0xba, 0x8a, 0x4b, 0x1d, 0xbc, 0x80, 0xcb, - 0x4a, 0x46, 0xee, 0x18, 0xf4, 0x67, 0x70, 0x89, 0x1f, 0xa1, 0x8e, 0x04, 0xe3, 0x31, 0xc8, 0x7d, - 0x7c, 0xf3, 0xf0, 0xcf, 0x38, 0x4f, 0x72, 0x56, 0x0e, 0xc5, 0xfb, 0xa8, 0x9d, 0xb0, 0x73, 0xa6, - 0xad, 0x85, 0xb7, 0xa7, 0xee, 0x03, 0x3f, 0x40, 0x9b, 0x7c, 0x36, 0x53, 0xa0, 0xad, 0x39, 0xb7, - 0xa7, 0xf9, 0x17, 0x7e, 0x17, 0xed, 0xc6, 0x4c, 0x89, 0x84, 0x5e, 0x06, 0x11, 0x4f, 0xb2, 0xf3, - 0xd4, 0x98, 0xb0, 0x35, 0xec, 0x4d, 0x77, 0xf2, 0xe5, 0x13, 0xb7, 0x8a, 0xdf, 0x5a, 0x4f, 0xb1, - 0xbe, 0xdd, 0x7f, 0xed, 0x9c, 0xda, 0xba, 0xeb, 0x9c, 0xda, 0xbe, 0xeb, 0x9c, 0xda, 0xa9, 0x37, - 0xa7, 0xca, 0xde, 0xdd, 0xad, 0xe5, 0xdd, 0xb2, 0x83, 0xf6, 0xfe, 0x87, 0x83, 0xee, 0xd5, 0x73, - 0xd0, 0x83, 0xf5, 0x6c, 0xc4, 0xb6, 0xec, 0xc5, 0xf4, 0xdb, 0x2f, 0xfa, 0xfb, 0xbe, 0x53, 0xc3, - 0x75, 0x30, 0x45, 0xfb, 0xd7, 0x1b, 0x38, 0xbf, 0xab, 0x0f, 0x51, 0x5f, 0x73, 0x4d, 0x93, 0x7c, - 0xf2, 0x34, 0x6c, 0x0b, 0x20, 0xbb, 0xe4, 0x86, 0xcb, 0x10, 0x75, 0x8c, 0xba, 0xa6, 0x3f, 0x9a, - 0xa4, 0x35, 0xec, 0x4f, 0x76, 0x47, 0x57, 0x2f, 0xc8, 0x91, 0xb9, 0xf6, 0x8d, 0xfa, 0xcf, 0x41, - 0x4f, 0xfe, 0x6c, 0x22, 0x74, 0xc6, 0xc3, 0xcf, 0x69, 0x4a, 0xe7, 0x20, 0xf1, 0xa7, 0xa8, 0xb7, - 0x7e, 0x1a, 0xe0, 0x83, 0x32, 0xe9, 0xd5, 0x57, 0xde, 0xe0, 0xed, 0x5b, 0x76, 0xf3, 0x1c, 0xff, - 0x69, 0xa0, 0xad, 0x72, 0xf2, 0xf8, 0xb0, 0x8c, 0x7f, 0x8d, 0x2f, 0x07, 0xe4, 0x76, 0x80, 0xfb, - 0xcf, 0xa3, 0x5f, 0x1a, 0x3f, 0x3d, 0xfd, 0xb1, 0x81, 0x7f, 0x68, 0x7c, 0x02, 0x9a, 0x2c, 0x79, - 0xe8, 0x93, 0x19, 0x4b, 0x34, 0x48, 0xb2, 0x62, 0x7a, 0x41, 0xf4, 0x02, 0x14, 0x90, 0x19, 0x83, - 0x24, 0x56, 0x43, 0xd7, 0xdc, 0x3e, 0xb9, 0xea, 0x66, 0x9f, 0xb8, 0xe6, 0xf4, 0xc9, 0x55, 0xbf, - 0xf9, 0xa4, 0x68, 0x08, 0x9f, 0x14, 0x02, 0xfb, 0xc4, 0x69, 0xe2, 0x13, 0x2b, 0xc2, 0x7b, 0x3e, - 0x89, 0x61, 0x46, 0xb3, 0x44, 0x13, 0x09, 0x3a, 0x93, 0x29, 0xa1, 0x49, 0x62, 0x82, 0xab, 0xef, - 0xff, 0xfa, 0xfb, 0xe7, 0x26, 0xc2, 0xdd, 0xf1, 0xc5, 0xfb, 0x63, 0xf3, 0xfd, 0x6c, 0xe3, 0xdb, - 0xa6, 0x08, 0xc3, 0x4d, 0xdb, 0x03, 0xc7, 0xff, 0x06, 0x00, 0x00, 0xff, 0xff, 0x03, 0x9a, 0x48, - 0x87, 0xbf, 0x0b, 0x00, 0x00, -} - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConn - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion4 - -// JobManagerClient is the client API for JobManager service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type JobManagerClient interface { - CreateJob(ctx context.Context, in *CreateJobRequest, opts ...grpc.CallOption) (*CreateJobResponse, error) - // Get job, filter with these fields(job_id, cluster_id, app_id, version_id, executor, provider, status, owner), default return all jobs - DescribeJobs(ctx context.Context, in *DescribeJobsRequest, opts ...grpc.CallOption) (*DescribeJobsResponse, error) -} - -type jobManagerClient struct { - cc *grpc.ClientConn -} - -func NewJobManagerClient(cc *grpc.ClientConn) JobManagerClient { - return &jobManagerClient{cc} -} - -func (c *jobManagerClient) CreateJob(ctx context.Context, in *CreateJobRequest, opts ...grpc.CallOption) (*CreateJobResponse, error) { - out := new(CreateJobResponse) - err := c.cc.Invoke(ctx, "/openpitrix.JobManager/CreateJob", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *jobManagerClient) DescribeJobs(ctx context.Context, in *DescribeJobsRequest, opts ...grpc.CallOption) (*DescribeJobsResponse, error) { - out := new(DescribeJobsResponse) - err := c.cc.Invoke(ctx, "/openpitrix.JobManager/DescribeJobs", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// JobManagerServer is the server API for JobManager service. -type JobManagerServer interface { - CreateJob(context.Context, *CreateJobRequest) (*CreateJobResponse, error) - // Get job, filter with these fields(job_id, cluster_id, app_id, version_id, executor, provider, status, owner), default return all jobs - DescribeJobs(context.Context, *DescribeJobsRequest) (*DescribeJobsResponse, error) -} - -// UnimplementedJobManagerServer can be embedded to have forward compatible implementations. -type UnimplementedJobManagerServer struct { -} - -func (*UnimplementedJobManagerServer) CreateJob(ctx context.Context, req *CreateJobRequest) (*CreateJobResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method CreateJob not implemented") -} -func (*UnimplementedJobManagerServer) DescribeJobs(ctx context.Context, req *DescribeJobsRequest) (*DescribeJobsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method DescribeJobs not implemented") -} - -func RegisterJobManagerServer(s *grpc.Server, srv JobManagerServer) { - s.RegisterService(&_JobManager_serviceDesc, srv) -} - -func _JobManager_CreateJob_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CreateJobRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(JobManagerServer).CreateJob(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/openpitrix.JobManager/CreateJob", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(JobManagerServer).CreateJob(ctx, req.(*CreateJobRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _JobManager_DescribeJobs_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DescribeJobsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(JobManagerServer).DescribeJobs(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/openpitrix.JobManager/DescribeJobs", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(JobManagerServer).DescribeJobs(ctx, req.(*DescribeJobsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _JobManager_serviceDesc = grpc.ServiceDesc{ - ServiceName: "openpitrix.JobManager", - HandlerType: (*JobManagerServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "CreateJob", - Handler: _JobManager_CreateJob_Handler, - }, - { - MethodName: "DescribeJobs", - Handler: _JobManager_DescribeJobs_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "job.proto", -} diff --git a/vendor/openpitrix.io/openpitrix/pkg/pb/job.pb.gw.go b/vendor/openpitrix.io/openpitrix/pkg/pb/job.pb.gw.go deleted file mode 100644 index a737761ef3..0000000000 --- a/vendor/openpitrix.io/openpitrix/pkg/pb/job.pb.gw.go +++ /dev/null @@ -1,162 +0,0 @@ -// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: job.proto - -/* -Package pb is a reverse proxy. - -It translates gRPC into RESTful JSON APIs. -*/ -package pb - -import ( - "context" - "io" - "net/http" - - "github.com/golang/protobuf/descriptor" - "github.com/golang/protobuf/proto" - "github.com/grpc-ecosystem/grpc-gateway/runtime" - "github.com/grpc-ecosystem/grpc-gateway/utilities" - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/grpclog" - "google.golang.org/grpc/status" -) - -// Suppress "imported and not used" errors -var _ codes.Code -var _ io.Reader -var _ status.Status -var _ = runtime.String -var _ = utilities.NewDoubleArray -var _ = descriptor.ForMessage - -var ( - filter_JobManager_DescribeJobs_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_JobManager_DescribeJobs_0(ctx context.Context, marshaler runtime.Marshaler, client JobManagerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq DescribeJobsRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_JobManager_DescribeJobs_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.DescribeJobs(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_JobManager_DescribeJobs_0(ctx context.Context, marshaler runtime.Marshaler, server JobManagerServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq DescribeJobsRequest - var metadata runtime.ServerMetadata - - if err := runtime.PopulateQueryParameters(&protoReq, req.URL.Query(), filter_JobManager_DescribeJobs_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.DescribeJobs(ctx, &protoReq) - return msg, metadata, err - -} - -// RegisterJobManagerHandlerServer registers the http handlers for service JobManager to "mux". -// UnaryRPC :call JobManagerServer directly. -// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. -func RegisterJobManagerHandlerServer(ctx context.Context, mux *runtime.ServeMux, server JobManagerServer) error { - - mux.Handle("GET", pattern_JobManager_DescribeJobs_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_JobManager_DescribeJobs_0(rctx, inboundMarshaler, server, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_JobManager_DescribeJobs_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -// RegisterJobManagerHandlerFromEndpoint is same as RegisterJobManagerHandler but -// automatically dials to "endpoint" and closes the connection when "ctx" gets done. -func RegisterJobManagerHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { - conn, err := grpc.Dial(endpoint, opts...) - if err != nil { - return err - } - defer func() { - if err != nil { - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - return - } - go func() { - <-ctx.Done() - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - }() - }() - - return RegisterJobManagerHandler(ctx, mux, conn) -} - -// RegisterJobManagerHandler registers the http handlers for service JobManager to "mux". -// The handlers forward requests to the grpc endpoint over "conn". -func RegisterJobManagerHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { - return RegisterJobManagerHandlerClient(ctx, mux, NewJobManagerClient(conn)) -} - -// RegisterJobManagerHandlerClient registers the http handlers for service JobManager -// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "JobManagerClient". -// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "JobManagerClient" -// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in -// "JobManagerClient" to call the correct interceptors. -func RegisterJobManagerHandlerClient(ctx context.Context, mux *runtime.ServeMux, client JobManagerClient) error { - - mux.Handle("GET", pattern_JobManager_DescribeJobs_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_JobManager_DescribeJobs_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_JobManager_DescribeJobs_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -var ( - pattern_JobManager_DescribeJobs_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "jobs"}, "", runtime.AssumeColonVerbOpt(true))) -) - -var ( - forward_JobManager_DescribeJobs_0 = runtime.ForwardResponseMessage -) diff --git a/vendor/openpitrix.io/openpitrix/pkg/pb/market.pb.go b/vendor/openpitrix.io/openpitrix/pkg/pb/market.pb.go deleted file mode 100644 index 090707e7b3..0000000000 --- a/vendor/openpitrix.io/openpitrix/pkg/pb/market.pb.go +++ /dev/null @@ -1,1377 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// source: market.proto - -package pb - -import ( - context "context" - fmt "fmt" - math "math" - - proto "github.com/golang/protobuf/proto" - timestamp "github.com/golang/protobuf/ptypes/timestamp" - wrappers "github.com/golang/protobuf/ptypes/wrappers" - _ "github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger/options" - _ "google.golang.org/genproto/googleapis/api/annotations" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" -) - -// 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 - -type Market struct { - MarketId *wrappers.StringValue `protobuf:"bytes,1,opt,name=market_id,json=marketId,proto3" json:"market_id,omitempty"` - Name *wrappers.StringValue `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - Visibility *wrappers.StringValue `protobuf:"bytes,3,opt,name=visibility,proto3" json:"visibility,omitempty"` - Status *wrappers.StringValue `protobuf:"bytes,4,opt,name=status,proto3" json:"status,omitempty"` - OwnerPath *wrappers.StringValue `protobuf:"bytes,5,opt,name=owner_path,json=ownerPath,proto3" json:"owner_path,omitempty"` - Description *wrappers.StringValue `protobuf:"bytes,6,opt,name=description,proto3" json:"description,omitempty"` - CreateTime *timestamp.Timestamp `protobuf:"bytes,7,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty"` - StatusTime *timestamp.Timestamp `protobuf:"bytes,8,opt,name=status_time,json=statusTime,proto3" json:"status_time,omitempty"` - Owner *wrappers.StringValue `protobuf:"bytes,9,opt,name=owner,proto3" json:"owner,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Market) Reset() { *m = Market{} } -func (m *Market) String() string { return proto.CompactTextString(m) } -func (*Market) ProtoMessage() {} -func (*Market) Descriptor() ([]byte, []int) { - return fileDescriptor_3f90997f23a2c3f8, []int{0} -} - -func (m *Market) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Market.Unmarshal(m, b) -} -func (m *Market) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Market.Marshal(b, m, deterministic) -} -func (m *Market) XXX_Merge(src proto.Message) { - xxx_messageInfo_Market.Merge(m, src) -} -func (m *Market) XXX_Size() int { - return xxx_messageInfo_Market.Size(m) -} -func (m *Market) XXX_DiscardUnknown() { - xxx_messageInfo_Market.DiscardUnknown(m) -} - -var xxx_messageInfo_Market proto.InternalMessageInfo - -func (m *Market) GetMarketId() *wrappers.StringValue { - if m != nil { - return m.MarketId - } - return nil -} - -func (m *Market) GetName() *wrappers.StringValue { - if m != nil { - return m.Name - } - return nil -} - -func (m *Market) GetVisibility() *wrappers.StringValue { - if m != nil { - return m.Visibility - } - return nil -} - -func (m *Market) GetStatus() *wrappers.StringValue { - if m != nil { - return m.Status - } - return nil -} - -func (m *Market) GetOwnerPath() *wrappers.StringValue { - if m != nil { - return m.OwnerPath - } - return nil -} - -func (m *Market) GetDescription() *wrappers.StringValue { - if m != nil { - return m.Description - } - return nil -} - -func (m *Market) GetCreateTime() *timestamp.Timestamp { - if m != nil { - return m.CreateTime - } - return nil -} - -func (m *Market) GetStatusTime() *timestamp.Timestamp { - if m != nil { - return m.StatusTime - } - return nil -} - -func (m *Market) GetOwner() *wrappers.StringValue { - if m != nil { - return m.Owner - } - return nil -} - -type CreateMarketRequest struct { - Name *wrappers.StringValue `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - Visibility *wrappers.StringValue `protobuf:"bytes,2,opt,name=visibility,proto3" json:"visibility,omitempty"` - Description *wrappers.StringValue `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *CreateMarketRequest) Reset() { *m = CreateMarketRequest{} } -func (m *CreateMarketRequest) String() string { return proto.CompactTextString(m) } -func (*CreateMarketRequest) ProtoMessage() {} -func (*CreateMarketRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_3f90997f23a2c3f8, []int{1} -} - -func (m *CreateMarketRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_CreateMarketRequest.Unmarshal(m, b) -} -func (m *CreateMarketRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_CreateMarketRequest.Marshal(b, m, deterministic) -} -func (m *CreateMarketRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_CreateMarketRequest.Merge(m, src) -} -func (m *CreateMarketRequest) XXX_Size() int { - return xxx_messageInfo_CreateMarketRequest.Size(m) -} -func (m *CreateMarketRequest) XXX_DiscardUnknown() { - xxx_messageInfo_CreateMarketRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_CreateMarketRequest proto.InternalMessageInfo - -func (m *CreateMarketRequest) GetName() *wrappers.StringValue { - if m != nil { - return m.Name - } - return nil -} - -func (m *CreateMarketRequest) GetVisibility() *wrappers.StringValue { - if m != nil { - return m.Visibility - } - return nil -} - -func (m *CreateMarketRequest) GetDescription() *wrappers.StringValue { - if m != nil { - return m.Description - } - return nil -} - -type CreateMarketResponse struct { - MarketId *wrappers.StringValue `protobuf:"bytes,1,opt,name=market_id,json=marketId,proto3" json:"market_id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *CreateMarketResponse) Reset() { *m = CreateMarketResponse{} } -func (m *CreateMarketResponse) String() string { return proto.CompactTextString(m) } -func (*CreateMarketResponse) ProtoMessage() {} -func (*CreateMarketResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_3f90997f23a2c3f8, []int{2} -} - -func (m *CreateMarketResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_CreateMarketResponse.Unmarshal(m, b) -} -func (m *CreateMarketResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_CreateMarketResponse.Marshal(b, m, deterministic) -} -func (m *CreateMarketResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_CreateMarketResponse.Merge(m, src) -} -func (m *CreateMarketResponse) XXX_Size() int { - return xxx_messageInfo_CreateMarketResponse.Size(m) -} -func (m *CreateMarketResponse) XXX_DiscardUnknown() { - xxx_messageInfo_CreateMarketResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_CreateMarketResponse proto.InternalMessageInfo - -func (m *CreateMarketResponse) GetMarketId() *wrappers.StringValue { - if m != nil { - return m.MarketId - } - return nil -} - -type DescribeMarketsRequest struct { - SearchWord *wrappers.StringValue `protobuf:"bytes,1,opt,name=search_word,json=searchWord,proto3" json:"search_word,omitempty"` - // sort key, order by sort_key, default create_time - SortKey *wrappers.StringValue `protobuf:"bytes,2,opt,name=sort_key,json=sortKey,proto3" json:"sort_key,omitempty"` - // value = 0 sort ASC, value = 1 sort DESC - Reverse *wrappers.BoolValue `protobuf:"bytes,3,opt,name=reverse,proto3" json:"reverse,omitempty"` - // default is 20, max value is 200 - Limit uint32 `protobuf:"varint,4,opt,name=limit,proto3" json:"limit,omitempty"` - // default is 0 - Offset uint32 `protobuf:"varint,5,opt,name=offset,proto3" json:"offset,omitempty"` - MarketId []string `protobuf:"bytes,11,rep,name=market_id,json=marketId,proto3" json:"market_id,omitempty"` - Name []string `protobuf:"bytes,12,rep,name=name,proto3" json:"name,omitempty"` - Visibility []string `protobuf:"bytes,13,rep,name=visibility,proto3" json:"visibility,omitempty"` - Status []string `protobuf:"bytes,14,rep,name=status,proto3" json:"status,omitempty"` - Owner []string `protobuf:"bytes,15,rep,name=owner,proto3" json:"owner,omitempty"` - UserId []string `protobuf:"bytes,16,rep,name=user_id,json=userId,proto3" json:"user_id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *DescribeMarketsRequest) Reset() { *m = DescribeMarketsRequest{} } -func (m *DescribeMarketsRequest) String() string { return proto.CompactTextString(m) } -func (*DescribeMarketsRequest) ProtoMessage() {} -func (*DescribeMarketsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_3f90997f23a2c3f8, []int{3} -} - -func (m *DescribeMarketsRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_DescribeMarketsRequest.Unmarshal(m, b) -} -func (m *DescribeMarketsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_DescribeMarketsRequest.Marshal(b, m, deterministic) -} -func (m *DescribeMarketsRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_DescribeMarketsRequest.Merge(m, src) -} -func (m *DescribeMarketsRequest) XXX_Size() int { - return xxx_messageInfo_DescribeMarketsRequest.Size(m) -} -func (m *DescribeMarketsRequest) XXX_DiscardUnknown() { - xxx_messageInfo_DescribeMarketsRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_DescribeMarketsRequest proto.InternalMessageInfo - -func (m *DescribeMarketsRequest) GetSearchWord() *wrappers.StringValue { - if m != nil { - return m.SearchWord - } - return nil -} - -func (m *DescribeMarketsRequest) GetSortKey() *wrappers.StringValue { - if m != nil { - return m.SortKey - } - return nil -} - -func (m *DescribeMarketsRequest) GetReverse() *wrappers.BoolValue { - if m != nil { - return m.Reverse - } - return nil -} - -func (m *DescribeMarketsRequest) GetLimit() uint32 { - if m != nil { - return m.Limit - } - return 0 -} - -func (m *DescribeMarketsRequest) GetOffset() uint32 { - if m != nil { - return m.Offset - } - return 0 -} - -func (m *DescribeMarketsRequest) GetMarketId() []string { - if m != nil { - return m.MarketId - } - return nil -} - -func (m *DescribeMarketsRequest) GetName() []string { - if m != nil { - return m.Name - } - return nil -} - -func (m *DescribeMarketsRequest) GetVisibility() []string { - if m != nil { - return m.Visibility - } - return nil -} - -func (m *DescribeMarketsRequest) GetStatus() []string { - if m != nil { - return m.Status - } - return nil -} - -func (m *DescribeMarketsRequest) GetOwner() []string { - if m != nil { - return m.Owner - } - return nil -} - -func (m *DescribeMarketsRequest) GetUserId() []string { - if m != nil { - return m.UserId - } - return nil -} - -type DescribeMarketsResponse struct { - TotalCount uint32 `protobuf:"varint,1,opt,name=total_count,json=totalCount,proto3" json:"total_count,omitempty"` - MarketSet []*Market `protobuf:"bytes,2,rep,name=market_set,json=marketSet,proto3" json:"market_set,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *DescribeMarketsResponse) Reset() { *m = DescribeMarketsResponse{} } -func (m *DescribeMarketsResponse) String() string { return proto.CompactTextString(m) } -func (*DescribeMarketsResponse) ProtoMessage() {} -func (*DescribeMarketsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_3f90997f23a2c3f8, []int{4} -} - -func (m *DescribeMarketsResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_DescribeMarketsResponse.Unmarshal(m, b) -} -func (m *DescribeMarketsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_DescribeMarketsResponse.Marshal(b, m, deterministic) -} -func (m *DescribeMarketsResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_DescribeMarketsResponse.Merge(m, src) -} -func (m *DescribeMarketsResponse) XXX_Size() int { - return xxx_messageInfo_DescribeMarketsResponse.Size(m) -} -func (m *DescribeMarketsResponse) XXX_DiscardUnknown() { - xxx_messageInfo_DescribeMarketsResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_DescribeMarketsResponse proto.InternalMessageInfo - -func (m *DescribeMarketsResponse) GetTotalCount() uint32 { - if m != nil { - return m.TotalCount - } - return 0 -} - -func (m *DescribeMarketsResponse) GetMarketSet() []*Market { - if m != nil { - return m.MarketSet - } - return nil -} - -type ModifyMarketRequest struct { - MarketId *wrappers.StringValue `protobuf:"bytes,1,opt,name=market_id,json=marketId,proto3" json:"market_id,omitempty"` - Name *wrappers.StringValue `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - Visibility *wrappers.StringValue `protobuf:"bytes,3,opt,name=visibility,proto3" json:"visibility,omitempty"` - Status *wrappers.StringValue `protobuf:"bytes,4,opt,name=status,proto3" json:"status,omitempty"` - Description *wrappers.StringValue `protobuf:"bytes,5,opt,name=description,proto3" json:"description,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ModifyMarketRequest) Reset() { *m = ModifyMarketRequest{} } -func (m *ModifyMarketRequest) String() string { return proto.CompactTextString(m) } -func (*ModifyMarketRequest) ProtoMessage() {} -func (*ModifyMarketRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_3f90997f23a2c3f8, []int{5} -} - -func (m *ModifyMarketRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ModifyMarketRequest.Unmarshal(m, b) -} -func (m *ModifyMarketRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ModifyMarketRequest.Marshal(b, m, deterministic) -} -func (m *ModifyMarketRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_ModifyMarketRequest.Merge(m, src) -} -func (m *ModifyMarketRequest) XXX_Size() int { - return xxx_messageInfo_ModifyMarketRequest.Size(m) -} -func (m *ModifyMarketRequest) XXX_DiscardUnknown() { - xxx_messageInfo_ModifyMarketRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_ModifyMarketRequest proto.InternalMessageInfo - -func (m *ModifyMarketRequest) GetMarketId() *wrappers.StringValue { - if m != nil { - return m.MarketId - } - return nil -} - -func (m *ModifyMarketRequest) GetName() *wrappers.StringValue { - if m != nil { - return m.Name - } - return nil -} - -func (m *ModifyMarketRequest) GetVisibility() *wrappers.StringValue { - if m != nil { - return m.Visibility - } - return nil -} - -func (m *ModifyMarketRequest) GetStatus() *wrappers.StringValue { - if m != nil { - return m.Status - } - return nil -} - -func (m *ModifyMarketRequest) GetDescription() *wrappers.StringValue { - if m != nil { - return m.Description - } - return nil -} - -type ModifyMarketResponse struct { - MarketId *wrappers.StringValue `protobuf:"bytes,1,opt,name=market_id,json=marketId,proto3" json:"market_id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ModifyMarketResponse) Reset() { *m = ModifyMarketResponse{} } -func (m *ModifyMarketResponse) String() string { return proto.CompactTextString(m) } -func (*ModifyMarketResponse) ProtoMessage() {} -func (*ModifyMarketResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_3f90997f23a2c3f8, []int{6} -} - -func (m *ModifyMarketResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ModifyMarketResponse.Unmarshal(m, b) -} -func (m *ModifyMarketResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ModifyMarketResponse.Marshal(b, m, deterministic) -} -func (m *ModifyMarketResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_ModifyMarketResponse.Merge(m, src) -} -func (m *ModifyMarketResponse) XXX_Size() int { - return xxx_messageInfo_ModifyMarketResponse.Size(m) -} -func (m *ModifyMarketResponse) XXX_DiscardUnknown() { - xxx_messageInfo_ModifyMarketResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_ModifyMarketResponse proto.InternalMessageInfo - -func (m *ModifyMarketResponse) GetMarketId() *wrappers.StringValue { - if m != nil { - return m.MarketId - } - return nil -} - -type DeleteMarketsRequest struct { - MarketId []string `protobuf:"bytes,1,rep,name=market_id,json=marketId,proto3" json:"market_id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *DeleteMarketsRequest) Reset() { *m = DeleteMarketsRequest{} } -func (m *DeleteMarketsRequest) String() string { return proto.CompactTextString(m) } -func (*DeleteMarketsRequest) ProtoMessage() {} -func (*DeleteMarketsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_3f90997f23a2c3f8, []int{7} -} - -func (m *DeleteMarketsRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_DeleteMarketsRequest.Unmarshal(m, b) -} -func (m *DeleteMarketsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_DeleteMarketsRequest.Marshal(b, m, deterministic) -} -func (m *DeleteMarketsRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_DeleteMarketsRequest.Merge(m, src) -} -func (m *DeleteMarketsRequest) XXX_Size() int { - return xxx_messageInfo_DeleteMarketsRequest.Size(m) -} -func (m *DeleteMarketsRequest) XXX_DiscardUnknown() { - xxx_messageInfo_DeleteMarketsRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_DeleteMarketsRequest proto.InternalMessageInfo - -func (m *DeleteMarketsRequest) GetMarketId() []string { - if m != nil { - return m.MarketId - } - return nil -} - -type DeleteMarketsResponse struct { - MarketId []string `protobuf:"bytes,1,rep,name=market_id,json=marketId,proto3" json:"market_id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *DeleteMarketsResponse) Reset() { *m = DeleteMarketsResponse{} } -func (m *DeleteMarketsResponse) String() string { return proto.CompactTextString(m) } -func (*DeleteMarketsResponse) ProtoMessage() {} -func (*DeleteMarketsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_3f90997f23a2c3f8, []int{8} -} - -func (m *DeleteMarketsResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_DeleteMarketsResponse.Unmarshal(m, b) -} -func (m *DeleteMarketsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_DeleteMarketsResponse.Marshal(b, m, deterministic) -} -func (m *DeleteMarketsResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_DeleteMarketsResponse.Merge(m, src) -} -func (m *DeleteMarketsResponse) XXX_Size() int { - return xxx_messageInfo_DeleteMarketsResponse.Size(m) -} -func (m *DeleteMarketsResponse) XXX_DiscardUnknown() { - xxx_messageInfo_DeleteMarketsResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_DeleteMarketsResponse proto.InternalMessageInfo - -func (m *DeleteMarketsResponse) GetMarketId() []string { - if m != nil { - return m.MarketId - } - return nil -} - -type UserJoinMarketRequest struct { - MarketId []string `protobuf:"bytes,1,rep,name=market_id,json=marketId,proto3" json:"market_id,omitempty"` - UserId []string `protobuf:"bytes,2,rep,name=user_id,json=userId,proto3" json:"user_id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *UserJoinMarketRequest) Reset() { *m = UserJoinMarketRequest{} } -func (m *UserJoinMarketRequest) String() string { return proto.CompactTextString(m) } -func (*UserJoinMarketRequest) ProtoMessage() {} -func (*UserJoinMarketRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_3f90997f23a2c3f8, []int{9} -} - -func (m *UserJoinMarketRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_UserJoinMarketRequest.Unmarshal(m, b) -} -func (m *UserJoinMarketRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_UserJoinMarketRequest.Marshal(b, m, deterministic) -} -func (m *UserJoinMarketRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_UserJoinMarketRequest.Merge(m, src) -} -func (m *UserJoinMarketRequest) XXX_Size() int { - return xxx_messageInfo_UserJoinMarketRequest.Size(m) -} -func (m *UserJoinMarketRequest) XXX_DiscardUnknown() { - xxx_messageInfo_UserJoinMarketRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_UserJoinMarketRequest proto.InternalMessageInfo - -func (m *UserJoinMarketRequest) GetMarketId() []string { - if m != nil { - return m.MarketId - } - return nil -} - -func (m *UserJoinMarketRequest) GetUserId() []string { - if m != nil { - return m.UserId - } - return nil -} - -type UserJoinMarketResponse struct { - MarketId []string `protobuf:"bytes,1,rep,name=market_id,json=marketId,proto3" json:"market_id,omitempty"` - UserId []string `protobuf:"bytes,2,rep,name=user_id,json=userId,proto3" json:"user_id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *UserJoinMarketResponse) Reset() { *m = UserJoinMarketResponse{} } -func (m *UserJoinMarketResponse) String() string { return proto.CompactTextString(m) } -func (*UserJoinMarketResponse) ProtoMessage() {} -func (*UserJoinMarketResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_3f90997f23a2c3f8, []int{10} -} - -func (m *UserJoinMarketResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_UserJoinMarketResponse.Unmarshal(m, b) -} -func (m *UserJoinMarketResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_UserJoinMarketResponse.Marshal(b, m, deterministic) -} -func (m *UserJoinMarketResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_UserJoinMarketResponse.Merge(m, src) -} -func (m *UserJoinMarketResponse) XXX_Size() int { - return xxx_messageInfo_UserJoinMarketResponse.Size(m) -} -func (m *UserJoinMarketResponse) XXX_DiscardUnknown() { - xxx_messageInfo_UserJoinMarketResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_UserJoinMarketResponse proto.InternalMessageInfo - -func (m *UserJoinMarketResponse) GetMarketId() []string { - if m != nil { - return m.MarketId - } - return nil -} - -func (m *UserJoinMarketResponse) GetUserId() []string { - if m != nil { - return m.UserId - } - return nil -} - -type UserLeaveMarketRequest struct { - MarketId []string `protobuf:"bytes,1,rep,name=market_id,json=marketId,proto3" json:"market_id,omitempty"` - UserId []string `protobuf:"bytes,2,rep,name=user_id,json=userId,proto3" json:"user_id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *UserLeaveMarketRequest) Reset() { *m = UserLeaveMarketRequest{} } -func (m *UserLeaveMarketRequest) String() string { return proto.CompactTextString(m) } -func (*UserLeaveMarketRequest) ProtoMessage() {} -func (*UserLeaveMarketRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_3f90997f23a2c3f8, []int{11} -} - -func (m *UserLeaveMarketRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_UserLeaveMarketRequest.Unmarshal(m, b) -} -func (m *UserLeaveMarketRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_UserLeaveMarketRequest.Marshal(b, m, deterministic) -} -func (m *UserLeaveMarketRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_UserLeaveMarketRequest.Merge(m, src) -} -func (m *UserLeaveMarketRequest) XXX_Size() int { - return xxx_messageInfo_UserLeaveMarketRequest.Size(m) -} -func (m *UserLeaveMarketRequest) XXX_DiscardUnknown() { - xxx_messageInfo_UserLeaveMarketRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_UserLeaveMarketRequest proto.InternalMessageInfo - -func (m *UserLeaveMarketRequest) GetMarketId() []string { - if m != nil { - return m.MarketId - } - return nil -} - -func (m *UserLeaveMarketRequest) GetUserId() []string { - if m != nil { - return m.UserId - } - return nil -} - -type UserLeaveMarketResponse struct { - MarketId []string `protobuf:"bytes,1,rep,name=market_id,json=marketId,proto3" json:"market_id,omitempty"` - UserId []string `protobuf:"bytes,2,rep,name=user_id,json=userId,proto3" json:"user_id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *UserLeaveMarketResponse) Reset() { *m = UserLeaveMarketResponse{} } -func (m *UserLeaveMarketResponse) String() string { return proto.CompactTextString(m) } -func (*UserLeaveMarketResponse) ProtoMessage() {} -func (*UserLeaveMarketResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_3f90997f23a2c3f8, []int{12} -} - -func (m *UserLeaveMarketResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_UserLeaveMarketResponse.Unmarshal(m, b) -} -func (m *UserLeaveMarketResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_UserLeaveMarketResponse.Marshal(b, m, deterministic) -} -func (m *UserLeaveMarketResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_UserLeaveMarketResponse.Merge(m, src) -} -func (m *UserLeaveMarketResponse) XXX_Size() int { - return xxx_messageInfo_UserLeaveMarketResponse.Size(m) -} -func (m *UserLeaveMarketResponse) XXX_DiscardUnknown() { - xxx_messageInfo_UserLeaveMarketResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_UserLeaveMarketResponse proto.InternalMessageInfo - -func (m *UserLeaveMarketResponse) GetMarketId() []string { - if m != nil { - return m.MarketId - } - return nil -} - -func (m *UserLeaveMarketResponse) GetUserId() []string { - if m != nil { - return m.UserId - } - return nil -} - -type MarketUser struct { - MarketId *wrappers.StringValue `protobuf:"bytes,1,opt,name=market_id,json=marketId,proto3" json:"market_id,omitempty"` - UserId *wrappers.StringValue `protobuf:"bytes,2,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` - OwnerPath *wrappers.StringValue `protobuf:"bytes,3,opt,name=owner_path,json=ownerPath,proto3" json:"owner_path,omitempty"` - CreateTime *timestamp.Timestamp `protobuf:"bytes,4,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty"` - Owner *wrappers.StringValue `protobuf:"bytes,5,opt,name=owner,proto3" json:"owner,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *MarketUser) Reset() { *m = MarketUser{} } -func (m *MarketUser) String() string { return proto.CompactTextString(m) } -func (*MarketUser) ProtoMessage() {} -func (*MarketUser) Descriptor() ([]byte, []int) { - return fileDescriptor_3f90997f23a2c3f8, []int{13} -} - -func (m *MarketUser) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_MarketUser.Unmarshal(m, b) -} -func (m *MarketUser) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_MarketUser.Marshal(b, m, deterministic) -} -func (m *MarketUser) XXX_Merge(src proto.Message) { - xxx_messageInfo_MarketUser.Merge(m, src) -} -func (m *MarketUser) XXX_Size() int { - return xxx_messageInfo_MarketUser.Size(m) -} -func (m *MarketUser) XXX_DiscardUnknown() { - xxx_messageInfo_MarketUser.DiscardUnknown(m) -} - -var xxx_messageInfo_MarketUser proto.InternalMessageInfo - -func (m *MarketUser) GetMarketId() *wrappers.StringValue { - if m != nil { - return m.MarketId - } - return nil -} - -func (m *MarketUser) GetUserId() *wrappers.StringValue { - if m != nil { - return m.UserId - } - return nil -} - -func (m *MarketUser) GetOwnerPath() *wrappers.StringValue { - if m != nil { - return m.OwnerPath - } - return nil -} - -func (m *MarketUser) GetCreateTime() *timestamp.Timestamp { - if m != nil { - return m.CreateTime - } - return nil -} - -func (m *MarketUser) GetOwner() *wrappers.StringValue { - if m != nil { - return m.Owner - } - return nil -} - -type DescribeMarketUsersRequest struct { - SearchWord *wrappers.StringValue `protobuf:"bytes,1,opt,name=search_word,json=searchWord,proto3" json:"search_word,omitempty"` - // sort key, order by sort_key, default create_time - SortKey *wrappers.StringValue `protobuf:"bytes,2,opt,name=sort_key,json=sortKey,proto3" json:"sort_key,omitempty"` - // value = 0 sort ASC, value = 1 sort DESC - Reverse *wrappers.BoolValue `protobuf:"bytes,3,opt,name=reverse,proto3" json:"reverse,omitempty"` - // default is 20, max value is 200 - Limit uint32 `protobuf:"varint,4,opt,name=limit,proto3" json:"limit,omitempty"` - // default is 0 - Offset uint32 `protobuf:"varint,5,opt,name=offset,proto3" json:"offset,omitempty"` - MarketId []string `protobuf:"bytes,11,rep,name=market_id,json=marketId,proto3" json:"market_id,omitempty"` - UserId []string `protobuf:"bytes,12,rep,name=user_id,json=userId,proto3" json:"user_id,omitempty"` - Owner []string `protobuf:"bytes,13,rep,name=owner,proto3" json:"owner,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *DescribeMarketUsersRequest) Reset() { *m = DescribeMarketUsersRequest{} } -func (m *DescribeMarketUsersRequest) String() string { return proto.CompactTextString(m) } -func (*DescribeMarketUsersRequest) ProtoMessage() {} -func (*DescribeMarketUsersRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_3f90997f23a2c3f8, []int{14} -} - -func (m *DescribeMarketUsersRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_DescribeMarketUsersRequest.Unmarshal(m, b) -} -func (m *DescribeMarketUsersRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_DescribeMarketUsersRequest.Marshal(b, m, deterministic) -} -func (m *DescribeMarketUsersRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_DescribeMarketUsersRequest.Merge(m, src) -} -func (m *DescribeMarketUsersRequest) XXX_Size() int { - return xxx_messageInfo_DescribeMarketUsersRequest.Size(m) -} -func (m *DescribeMarketUsersRequest) XXX_DiscardUnknown() { - xxx_messageInfo_DescribeMarketUsersRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_DescribeMarketUsersRequest proto.InternalMessageInfo - -func (m *DescribeMarketUsersRequest) GetSearchWord() *wrappers.StringValue { - if m != nil { - return m.SearchWord - } - return nil -} - -func (m *DescribeMarketUsersRequest) GetSortKey() *wrappers.StringValue { - if m != nil { - return m.SortKey - } - return nil -} - -func (m *DescribeMarketUsersRequest) GetReverse() *wrappers.BoolValue { - if m != nil { - return m.Reverse - } - return nil -} - -func (m *DescribeMarketUsersRequest) GetLimit() uint32 { - if m != nil { - return m.Limit - } - return 0 -} - -func (m *DescribeMarketUsersRequest) GetOffset() uint32 { - if m != nil { - return m.Offset - } - return 0 -} - -func (m *DescribeMarketUsersRequest) GetMarketId() []string { - if m != nil { - return m.MarketId - } - return nil -} - -func (m *DescribeMarketUsersRequest) GetUserId() []string { - if m != nil { - return m.UserId - } - return nil -} - -func (m *DescribeMarketUsersRequest) GetOwner() []string { - if m != nil { - return m.Owner - } - return nil -} - -type DescribeMarketUsersResponse struct { - TotalCount uint32 `protobuf:"varint,1,opt,name=total_count,json=totalCount,proto3" json:"total_count,omitempty"` - MarketUserSet []*MarketUser `protobuf:"bytes,2,rep,name=market_user_set,json=marketUserSet,proto3" json:"market_user_set,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *DescribeMarketUsersResponse) Reset() { *m = DescribeMarketUsersResponse{} } -func (m *DescribeMarketUsersResponse) String() string { return proto.CompactTextString(m) } -func (*DescribeMarketUsersResponse) ProtoMessage() {} -func (*DescribeMarketUsersResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_3f90997f23a2c3f8, []int{15} -} - -func (m *DescribeMarketUsersResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_DescribeMarketUsersResponse.Unmarshal(m, b) -} -func (m *DescribeMarketUsersResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_DescribeMarketUsersResponse.Marshal(b, m, deterministic) -} -func (m *DescribeMarketUsersResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_DescribeMarketUsersResponse.Merge(m, src) -} -func (m *DescribeMarketUsersResponse) XXX_Size() int { - return xxx_messageInfo_DescribeMarketUsersResponse.Size(m) -} -func (m *DescribeMarketUsersResponse) XXX_DiscardUnknown() { - xxx_messageInfo_DescribeMarketUsersResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_DescribeMarketUsersResponse proto.InternalMessageInfo - -func (m *DescribeMarketUsersResponse) GetTotalCount() uint32 { - if m != nil { - return m.TotalCount - } - return 0 -} - -func (m *DescribeMarketUsersResponse) GetMarketUserSet() []*MarketUser { - if m != nil { - return m.MarketUserSet - } - return nil -} - -func init() { - proto.RegisterType((*Market)(nil), "openpitrix.Market") - proto.RegisterType((*CreateMarketRequest)(nil), "openpitrix.CreateMarketRequest") - proto.RegisterType((*CreateMarketResponse)(nil), "openpitrix.CreateMarketResponse") - proto.RegisterType((*DescribeMarketsRequest)(nil), "openpitrix.DescribeMarketsRequest") - proto.RegisterType((*DescribeMarketsResponse)(nil), "openpitrix.DescribeMarketsResponse") - proto.RegisterType((*ModifyMarketRequest)(nil), "openpitrix.ModifyMarketRequest") - proto.RegisterType((*ModifyMarketResponse)(nil), "openpitrix.ModifyMarketResponse") - proto.RegisterType((*DeleteMarketsRequest)(nil), "openpitrix.DeleteMarketsRequest") - proto.RegisterType((*DeleteMarketsResponse)(nil), "openpitrix.DeleteMarketsResponse") - proto.RegisterType((*UserJoinMarketRequest)(nil), "openpitrix.UserJoinMarketRequest") - proto.RegisterType((*UserJoinMarketResponse)(nil), "openpitrix.UserJoinMarketResponse") - proto.RegisterType((*UserLeaveMarketRequest)(nil), "openpitrix.UserLeaveMarketRequest") - proto.RegisterType((*UserLeaveMarketResponse)(nil), "openpitrix.UserLeaveMarketResponse") - proto.RegisterType((*MarketUser)(nil), "openpitrix.MarketUser") - proto.RegisterType((*DescribeMarketUsersRequest)(nil), "openpitrix.DescribeMarketUsersRequest") - proto.RegisterType((*DescribeMarketUsersResponse)(nil), "openpitrix.DescribeMarketUsersResponse") -} - -func init() { proto.RegisterFile("market.proto", fileDescriptor_3f90997f23a2c3f8) } - -var fileDescriptor_3f90997f23a2c3f8 = []byte{ - // 1053 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x56, 0xcb, 0x6e, 0x23, 0x45, - 0x17, 0x96, 0xef, 0xc9, 0xb1, 0x3b, 0xce, 0x5f, 0x49, 0x1c, 0xcb, 0x89, 0x12, 0xff, 0x8d, 0x04, - 0x61, 0x20, 0x36, 0xe3, 0x09, 0x42, 0x30, 0x30, 0x92, 0x67, 0x46, 0x42, 0x03, 0x84, 0x8b, 0xc3, - 0x45, 0x62, 0x63, 0xb5, 0xed, 0xb2, 0x53, 0x4c, 0xbb, 0xab, 0xa9, 0x2a, 0xc7, 0x8c, 0x90, 0x40, - 0x42, 0x6c, 0x90, 0x58, 0x20, 0xc3, 0x8a, 0x67, 0x60, 0xcd, 0x13, 0xc0, 0x92, 0x15, 0xaf, 0xc0, - 0x83, 0xa0, 0xae, 0x2a, 0x27, 0xd5, 0xdd, 0x8e, 0xd3, 0x99, 0xb0, 0x42, 0xac, 0x92, 0xae, 0xf3, - 0x9d, 0x73, 0xbe, 0x3a, 0x97, 0xfa, 0x0c, 0xa5, 0xb1, 0xc3, 0x1e, 0x63, 0xd1, 0xf0, 0x19, 0x15, - 0x14, 0x01, 0xf5, 0xb1, 0xe7, 0x13, 0xc1, 0xc8, 0x17, 0xb5, 0xbd, 0x11, 0xa5, 0x23, 0x17, 0x37, - 0xa5, 0xa5, 0x37, 0x19, 0x36, 0xa7, 0xcc, 0xf1, 0x7d, 0xcc, 0xb8, 0xc2, 0xd6, 0xf6, 0xa3, 0x76, - 0x41, 0xc6, 0x98, 0x0b, 0x67, 0xec, 0x6b, 0xc0, 0xae, 0x06, 0x38, 0x3e, 0x69, 0x3a, 0x9e, 0x47, - 0x85, 0x23, 0x08, 0xf5, 0xe6, 0xee, 0x2f, 0xca, 0x3f, 0xfd, 0xc3, 0x11, 0xf6, 0x0e, 0xf9, 0xd4, - 0x19, 0x8d, 0x30, 0x6b, 0x52, 0x5f, 0x22, 0xe2, 0x68, 0xfb, 0xa7, 0x2c, 0xe4, 0x8f, 0x25, 0x53, - 0xf4, 0x2a, 0xac, 0x2a, 0xce, 0x5d, 0x32, 0xa8, 0xa6, 0xea, 0xa9, 0x83, 0x62, 0x6b, 0xb7, 0xa1, - 0x52, 0x35, 0xe6, 0x5c, 0x1a, 0x27, 0x82, 0x11, 0x6f, 0xf4, 0xb1, 0xe3, 0x4e, 0x70, 0x67, 0x45, - 0xc1, 0x1f, 0x0d, 0xd0, 0x4b, 0x90, 0xf5, 0x9c, 0x31, 0xae, 0xa6, 0x13, 0x78, 0x49, 0x24, 0x7a, - 0x1d, 0xe0, 0x8c, 0x70, 0xd2, 0x23, 0x2e, 0x11, 0x4f, 0xaa, 0x99, 0x04, 0x7e, 0x06, 0x1e, 0x1d, - 0x41, 0x9e, 0x0b, 0x47, 0x4c, 0x78, 0x35, 0x9b, 0xc0, 0x53, 0x63, 0xd1, 0x5d, 0x00, 0x3a, 0xf5, - 0x30, 0xeb, 0xfa, 0x8e, 0x38, 0xad, 0xe6, 0x12, 0x78, 0xae, 0x4a, 0xfc, 0xfb, 0x8e, 0x38, 0x45, - 0xf7, 0xa0, 0x38, 0xc0, 0xbc, 0xcf, 0x88, 0x2c, 0x65, 0x35, 0x9f, 0xc0, 0xdb, 0x74, 0x40, 0x77, - 0xa1, 0xd8, 0x67, 0xd8, 0x11, 0xb8, 0x1b, 0xb4, 0xb3, 0x5a, 0x90, 0xfe, 0xb5, 0x98, 0xff, 0x87, - 0xf3, 0x5e, 0x77, 0x40, 0xc1, 0x83, 0x83, 0xc0, 0x59, 0xdd, 0x41, 0x39, 0xaf, 0x5c, 0xed, 0xac, - 0xe0, 0xd2, 0xb9, 0x05, 0x39, 0x79, 0x8d, 0xea, 0x6a, 0x02, 0xce, 0x0a, 0x6a, 0xff, 0x9e, 0x82, - 0x8d, 0x07, 0x32, 0xbf, 0x1a, 0x8e, 0x0e, 0xfe, 0x7c, 0x82, 0xb9, 0x38, 0x6f, 0x74, 0xea, 0x29, - 0x1b, 0x9d, 0xbe, 0x66, 0xa3, 0x23, 0x55, 0xcf, 0x5c, 0xb3, 0xea, 0xf6, 0x07, 0xb0, 0x19, 0xbe, - 0x06, 0xf7, 0xa9, 0xc7, 0xf1, 0x0d, 0x66, 0xdd, 0xfe, 0x3e, 0x03, 0x95, 0x87, 0x32, 0x45, 0x4f, - 0x47, 0xe5, 0xf3, 0xea, 0xbc, 0x01, 0x45, 0x8e, 0x1d, 0xd6, 0x3f, 0xed, 0x4e, 0x29, 0x4b, 0x16, - 0x17, 0x94, 0xc3, 0x27, 0x94, 0x0d, 0xd0, 0x2b, 0xb0, 0xc2, 0x29, 0x13, 0xdd, 0xc7, 0x38, 0x59, - 0xa1, 0x0a, 0x01, 0xfa, 0x6d, 0x1c, 0xac, 0x43, 0x81, 0xe1, 0x33, 0xcc, 0x38, 0xd6, 0x15, 0x8a, - 0x8f, 0xc6, 0x7d, 0x4a, 0x5d, 0xed, 0xa5, 0xa1, 0x68, 0x13, 0x72, 0x2e, 0x19, 0x13, 0x21, 0x77, - 0xc8, 0xea, 0xa8, 0x0f, 0x54, 0x81, 0x3c, 0x1d, 0x0e, 0x39, 0x16, 0x72, 0x41, 0xac, 0x8e, 0xfe, - 0x42, 0x3b, 0x66, 0xc5, 0x8a, 0xf5, 0xcc, 0xc1, 0xaa, 0xb1, 0xff, 0x48, 0x8f, 0x45, 0x49, 0x9e, - 0xab, 0xc6, 0xef, 0x85, 0x1a, 0x6f, 0x49, 0x8b, 0xd9, 0xda, 0xca, 0xf9, 0x0e, 0xaf, 0x49, 0xdb, - 0x7c, 0x4b, 0x37, 0xe7, 0xe3, 0x5a, 0x96, 0xc7, 0xea, 0x03, 0x6d, 0x43, 0x61, 0xc2, 0x31, 0x0b, - 0x92, 0xaf, 0x2b, 0x78, 0xf0, 0xf9, 0x68, 0x60, 0x8f, 0x61, 0x3b, 0xd6, 0x0d, 0xdd, 0xe4, 0x7d, - 0x28, 0x0a, 0x2a, 0x1c, 0xb7, 0xdb, 0xa7, 0x13, 0x4f, 0xc8, 0x76, 0x58, 0x1d, 0x90, 0x47, 0x0f, - 0x82, 0x13, 0x74, 0x1b, 0x40, 0xdf, 0x29, 0xb8, 0x6f, 0xba, 0x9e, 0x39, 0x28, 0xb6, 0x50, 0xe3, - 0xe2, 0xa9, 0x6e, 0xe8, 0xa9, 0xd1, 0x37, 0x3f, 0xc1, 0xc2, 0xfe, 0x35, 0x0d, 0x1b, 0xc7, 0x74, - 0x40, 0x86, 0x4f, 0xc2, 0x8b, 0xf1, 0xaf, 0x7f, 0x3c, 0x23, 0x9b, 0x98, 0x7b, 0x8a, 0x4d, 0x0c, - 0xd7, 0xed, 0xe6, 0x9b, 0x78, 0x07, 0x36, 0x1f, 0x62, 0x17, 0x8b, 0xe8, 0x1a, 0xee, 0x84, 0x43, - 0x86, 0x46, 0xd5, 0x3e, 0x82, 0xad, 0x88, 0x93, 0x26, 0xb2, 0xd4, 0xeb, 0x18, 0xb6, 0x3e, 0xe2, - 0x98, 0xbd, 0x45, 0x89, 0x17, 0xee, 0xfb, 0x32, 0x2f, 0x73, 0x68, 0xd3, 0xa1, 0xa1, 0x7d, 0x17, - 0x2a, 0xd1, 0x70, 0x09, 0x58, 0x5c, 0x19, 0xef, 0x1d, 0xec, 0x9c, 0xe1, 0x7f, 0x82, 0xdf, 0x7b, - 0xb0, 0x1d, 0x8b, 0x77, 0x23, 0x82, 0xbf, 0xa4, 0x01, 0x54, 0xa0, 0x20, 0xee, 0x4d, 0xb6, 0xe5, - 0x65, 0x33, 0x45, 0x82, 0xf1, 0x55, 0x04, 0x22, 0xda, 0x9f, 0xb9, 0x9e, 0xf6, 0x47, 0xb4, 0x3b, - 0x7b, 0x2d, 0xed, 0x3e, 0x97, 0xdf, 0x5c, 0x72, 0xf9, 0xfd, 0x2d, 0x0d, 0xb5, 0xf0, 0xab, 0x16, - 0x94, 0xed, 0x3f, 0x9d, 0x31, 0xe6, 0xab, 0x64, 0xce, 0xd7, 0x85, 0x68, 0x58, 0x86, 0x68, 0xd8, - 0x5f, 0xc1, 0xce, 0xc2, 0x2a, 0x26, 0xd5, 0x87, 0x7b, 0x50, 0xd6, 0x5c, 0x64, 0xd6, 0x0b, 0x91, - 0xa8, 0xc4, 0x45, 0x22, 0x08, 0xdd, 0xb1, 0xc6, 0xe7, 0xff, 0x9f, 0x60, 0xd1, 0xfa, 0xa3, 0x00, - 0x96, 0xb2, 0x1e, 0x3b, 0x9e, 0x33, 0xc2, 0x0c, 0x7d, 0x09, 0x25, 0xf3, 0xf7, 0x08, 0xda, 0x37, - 0x03, 0x2d, 0xf8, 0xc1, 0x55, 0xab, 0x5f, 0x0e, 0x50, 0xb7, 0xb0, 0x0f, 0x66, 0xed, 0x32, 0xb2, - 0x94, 0xa9, 0xae, 0xf2, 0x7f, 0xf3, 0xe7, 0x5f, 0x3f, 0xa6, 0xd7, 0xed, 0x62, 0xf3, 0xec, 0x76, - 0x53, 0x9d, 0xf0, 0xd7, 0x52, 0xb7, 0xd0, 0x0f, 0x29, 0x28, 0x47, 0xb4, 0x12, 0xd9, 0x66, 0xfc, - 0xc5, 0x3f, 0x6b, 0x6a, 0xcf, 0x2c, 0xc5, 0x68, 0x1a, 0x47, 0xb3, 0xf6, 0x1e, 0xda, 0x9d, 0x5b, - 0x35, 0x11, 0x5e, 0x9f, 0x12, 0x71, 0x5a, 0x1f, 0x12, 0x57, 0x60, 0x26, 0x59, 0x59, 0xc8, 0x64, - 0x15, 0xd4, 0xc3, 0x54, 0x85, 0x70, 0x3d, 0x16, 0xe8, 0x6c, 0xb8, 0x1e, 0x8b, 0x04, 0x45, 0xd7, - 0x43, 0x99, 0x42, 0xf5, 0x68, 0x45, 0xeb, 0xf1, 0x35, 0x58, 0x21, 0x29, 0x40, 0xf5, 0xf0, 0x45, - 0xe3, 0xd2, 0x52, 0xfb, 0xff, 0x12, 0x84, 0xce, 0xff, 0xfc, 0xac, 0xbd, 0x8e, 0xd6, 0x94, 0x6d, - 0x5e, 0x06, 0x45, 0xe0, 0x56, 0x94, 0xc0, 0xb7, 0x29, 0x58, 0x0b, 0xeb, 0x00, 0x0a, 0x25, 0x58, - 0x28, 0x39, 0x35, 0x7b, 0x19, 0x44, 0x93, 0x78, 0x61, 0xd6, 0xb6, 0x50, 0x31, 0x30, 0x98, 0x25, - 0xd8, 0xb2, 0xd7, 0x4d, 0x06, 0x9f, 0x51, 0xe2, 0x05, 0x34, 0xbe, 0x4b, 0x41, 0x39, 0xf2, 0xdc, - 0xa3, 0x58, 0x92, 0xb8, 0xb6, 0x84, 0xe7, 0xe2, 0x12, 0xbd, 0xb0, 0x0f, 0x67, 0xed, 0x35, 0x54, - 0x92, 0x16, 0x93, 0x4a, 0xc5, 0xfe, 0x9f, 0x49, 0xc5, 0x0d, 0xec, 0x01, 0x97, 0x9f, 0x53, 0xb0, - 0xb1, 0x60, 0x67, 0xd1, 0xb3, 0x97, 0xcf, 0xa0, 0xf9, 0x34, 0xd6, 0x9e, 0xbb, 0x12, 0xa7, 0x79, - 0xb5, 0x66, 0xed, 0x6d, 0xb4, 0xf5, 0x26, 0x16, 0xf5, 0x60, 0xb7, 0xe3, 0x83, 0x8a, 0x90, 0x51, - 0x2b, 0xb9, 0xff, 0xfc, 0x7e, 0xf6, 0xd3, 0xb4, 0xdf, 0xeb, 0xe5, 0xe5, 0x63, 0x77, 0xe7, 0xef, - 0x00, 0x00, 0x00, 0xff, 0xff, 0x3f, 0xb6, 0xd8, 0x65, 0xe2, 0x0f, 0x00, 0x00, -} - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConn - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion4 - -// MarketManagerClient is the client API for MarketManager service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type MarketManagerClient interface { - CreateMarket(ctx context.Context, in *CreateMarketRequest, opts ...grpc.CallOption) (*CreateMarketResponse, error) - DescribeMarkets(ctx context.Context, in *DescribeMarketsRequest, opts ...grpc.CallOption) (*DescribeMarketsResponse, error) - ModifyMarket(ctx context.Context, in *ModifyMarketRequest, opts ...grpc.CallOption) (*ModifyMarketResponse, error) - DeleteMarkets(ctx context.Context, in *DeleteMarketsRequest, opts ...grpc.CallOption) (*DeleteMarketsResponse, error) - UserJoinMarket(ctx context.Context, in *UserJoinMarketRequest, opts ...grpc.CallOption) (*UserJoinMarketResponse, error) - UserLeaveMarket(ctx context.Context, in *UserLeaveMarketRequest, opts ...grpc.CallOption) (*UserLeaveMarketResponse, error) - DescribeMarketUsers(ctx context.Context, in *DescribeMarketUsersRequest, opts ...grpc.CallOption) (*DescribeMarketUsersResponse, error) -} - -type marketManagerClient struct { - cc *grpc.ClientConn -} - -func NewMarketManagerClient(cc *grpc.ClientConn) MarketManagerClient { - return &marketManagerClient{cc} -} - -func (c *marketManagerClient) CreateMarket(ctx context.Context, in *CreateMarketRequest, opts ...grpc.CallOption) (*CreateMarketResponse, error) { - out := new(CreateMarketResponse) - err := c.cc.Invoke(ctx, "/openpitrix.MarketManager/CreateMarket", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *marketManagerClient) DescribeMarkets(ctx context.Context, in *DescribeMarketsRequest, opts ...grpc.CallOption) (*DescribeMarketsResponse, error) { - out := new(DescribeMarketsResponse) - err := c.cc.Invoke(ctx, "/openpitrix.MarketManager/DescribeMarkets", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *marketManagerClient) ModifyMarket(ctx context.Context, in *ModifyMarketRequest, opts ...grpc.CallOption) (*ModifyMarketResponse, error) { - out := new(ModifyMarketResponse) - err := c.cc.Invoke(ctx, "/openpitrix.MarketManager/ModifyMarket", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *marketManagerClient) DeleteMarkets(ctx context.Context, in *DeleteMarketsRequest, opts ...grpc.CallOption) (*DeleteMarketsResponse, error) { - out := new(DeleteMarketsResponse) - err := c.cc.Invoke(ctx, "/openpitrix.MarketManager/DeleteMarkets", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *marketManagerClient) UserJoinMarket(ctx context.Context, in *UserJoinMarketRequest, opts ...grpc.CallOption) (*UserJoinMarketResponse, error) { - out := new(UserJoinMarketResponse) - err := c.cc.Invoke(ctx, "/openpitrix.MarketManager/UserJoinMarket", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *marketManagerClient) UserLeaveMarket(ctx context.Context, in *UserLeaveMarketRequest, opts ...grpc.CallOption) (*UserLeaveMarketResponse, error) { - out := new(UserLeaveMarketResponse) - err := c.cc.Invoke(ctx, "/openpitrix.MarketManager/UserLeaveMarket", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *marketManagerClient) DescribeMarketUsers(ctx context.Context, in *DescribeMarketUsersRequest, opts ...grpc.CallOption) (*DescribeMarketUsersResponse, error) { - out := new(DescribeMarketUsersResponse) - err := c.cc.Invoke(ctx, "/openpitrix.MarketManager/DescribeMarketUsers", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// MarketManagerServer is the server API for MarketManager service. -type MarketManagerServer interface { - CreateMarket(context.Context, *CreateMarketRequest) (*CreateMarketResponse, error) - DescribeMarkets(context.Context, *DescribeMarketsRequest) (*DescribeMarketsResponse, error) - ModifyMarket(context.Context, *ModifyMarketRequest) (*ModifyMarketResponse, error) - DeleteMarkets(context.Context, *DeleteMarketsRequest) (*DeleteMarketsResponse, error) - UserJoinMarket(context.Context, *UserJoinMarketRequest) (*UserJoinMarketResponse, error) - UserLeaveMarket(context.Context, *UserLeaveMarketRequest) (*UserLeaveMarketResponse, error) - DescribeMarketUsers(context.Context, *DescribeMarketUsersRequest) (*DescribeMarketUsersResponse, error) -} - -// UnimplementedMarketManagerServer can be embedded to have forward compatible implementations. -type UnimplementedMarketManagerServer struct { -} - -func (*UnimplementedMarketManagerServer) CreateMarket(ctx context.Context, req *CreateMarketRequest) (*CreateMarketResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method CreateMarket not implemented") -} -func (*UnimplementedMarketManagerServer) DescribeMarkets(ctx context.Context, req *DescribeMarketsRequest) (*DescribeMarketsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method DescribeMarkets not implemented") -} -func (*UnimplementedMarketManagerServer) ModifyMarket(ctx context.Context, req *ModifyMarketRequest) (*ModifyMarketResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ModifyMarket not implemented") -} -func (*UnimplementedMarketManagerServer) DeleteMarkets(ctx context.Context, req *DeleteMarketsRequest) (*DeleteMarketsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method DeleteMarkets not implemented") -} -func (*UnimplementedMarketManagerServer) UserJoinMarket(ctx context.Context, req *UserJoinMarketRequest) (*UserJoinMarketResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method UserJoinMarket not implemented") -} -func (*UnimplementedMarketManagerServer) UserLeaveMarket(ctx context.Context, req *UserLeaveMarketRequest) (*UserLeaveMarketResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method UserLeaveMarket not implemented") -} -func (*UnimplementedMarketManagerServer) DescribeMarketUsers(ctx context.Context, req *DescribeMarketUsersRequest) (*DescribeMarketUsersResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method DescribeMarketUsers not implemented") -} - -func RegisterMarketManagerServer(s *grpc.Server, srv MarketManagerServer) { - s.RegisterService(&_MarketManager_serviceDesc, srv) -} - -func _MarketManager_CreateMarket_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CreateMarketRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MarketManagerServer).CreateMarket(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/openpitrix.MarketManager/CreateMarket", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MarketManagerServer).CreateMarket(ctx, req.(*CreateMarketRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _MarketManager_DescribeMarkets_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DescribeMarketsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MarketManagerServer).DescribeMarkets(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/openpitrix.MarketManager/DescribeMarkets", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MarketManagerServer).DescribeMarkets(ctx, req.(*DescribeMarketsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _MarketManager_ModifyMarket_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ModifyMarketRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MarketManagerServer).ModifyMarket(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/openpitrix.MarketManager/ModifyMarket", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MarketManagerServer).ModifyMarket(ctx, req.(*ModifyMarketRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _MarketManager_DeleteMarkets_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DeleteMarketsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MarketManagerServer).DeleteMarkets(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/openpitrix.MarketManager/DeleteMarkets", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MarketManagerServer).DeleteMarkets(ctx, req.(*DeleteMarketsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _MarketManager_UserJoinMarket_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(UserJoinMarketRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MarketManagerServer).UserJoinMarket(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/openpitrix.MarketManager/UserJoinMarket", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MarketManagerServer).UserJoinMarket(ctx, req.(*UserJoinMarketRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _MarketManager_UserLeaveMarket_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(UserLeaveMarketRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MarketManagerServer).UserLeaveMarket(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/openpitrix.MarketManager/UserLeaveMarket", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MarketManagerServer).UserLeaveMarket(ctx, req.(*UserLeaveMarketRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _MarketManager_DescribeMarketUsers_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DescribeMarketUsersRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MarketManagerServer).DescribeMarketUsers(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/openpitrix.MarketManager/DescribeMarketUsers", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MarketManagerServer).DescribeMarketUsers(ctx, req.(*DescribeMarketUsersRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _MarketManager_serviceDesc = grpc.ServiceDesc{ - ServiceName: "openpitrix.MarketManager", - HandlerType: (*MarketManagerServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "CreateMarket", - Handler: _MarketManager_CreateMarket_Handler, - }, - { - MethodName: "DescribeMarkets", - Handler: _MarketManager_DescribeMarkets_Handler, - }, - { - MethodName: "ModifyMarket", - Handler: _MarketManager_ModifyMarket_Handler, - }, - { - MethodName: "DeleteMarkets", - Handler: _MarketManager_DeleteMarkets_Handler, - }, - { - MethodName: "UserJoinMarket", - Handler: _MarketManager_UserJoinMarket_Handler, - }, - { - MethodName: "UserLeaveMarket", - Handler: _MarketManager_UserLeaveMarket_Handler, - }, - { - MethodName: "DescribeMarketUsers", - Handler: _MarketManager_DescribeMarketUsers_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "market.proto", -} diff --git a/vendor/openpitrix.io/openpitrix/pkg/pb/market.pb.gw.go b/vendor/openpitrix.io/openpitrix/pkg/pb/market.pb.gw.go deleted file mode 100644 index 0cbea0f68d..0000000000 --- a/vendor/openpitrix.io/openpitrix/pkg/pb/market.pb.gw.go +++ /dev/null @@ -1,629 +0,0 @@ -// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: market.proto - -/* -Package pb is a reverse proxy. - -It translates gRPC into RESTful JSON APIs. -*/ -package pb - -import ( - "context" - "io" - "net/http" - - "github.com/golang/protobuf/descriptor" - "github.com/golang/protobuf/proto" - "github.com/grpc-ecosystem/grpc-gateway/runtime" - "github.com/grpc-ecosystem/grpc-gateway/utilities" - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/grpclog" - "google.golang.org/grpc/status" -) - -// Suppress "imported and not used" errors -var _ codes.Code -var _ io.Reader -var _ status.Status -var _ = runtime.String -var _ = utilities.NewDoubleArray -var _ = descriptor.ForMessage - -func request_MarketManager_CreateMarket_0(ctx context.Context, marshaler runtime.Marshaler, client MarketManagerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq CreateMarketRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.CreateMarket(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_MarketManager_CreateMarket_0(ctx context.Context, marshaler runtime.Marshaler, server MarketManagerServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq CreateMarketRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.CreateMarket(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_MarketManager_DescribeMarkets_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_MarketManager_DescribeMarkets_0(ctx context.Context, marshaler runtime.Marshaler, client MarketManagerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq DescribeMarketsRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_MarketManager_DescribeMarkets_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.DescribeMarkets(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_MarketManager_DescribeMarkets_0(ctx context.Context, marshaler runtime.Marshaler, server MarketManagerServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq DescribeMarketsRequest - var metadata runtime.ServerMetadata - - if err := runtime.PopulateQueryParameters(&protoReq, req.URL.Query(), filter_MarketManager_DescribeMarkets_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.DescribeMarkets(ctx, &protoReq) - return msg, metadata, err - -} - -func request_MarketManager_ModifyMarket_0(ctx context.Context, marshaler runtime.Marshaler, client MarketManagerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ModifyMarketRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.ModifyMarket(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_MarketManager_ModifyMarket_0(ctx context.Context, marshaler runtime.Marshaler, server MarketManagerServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ModifyMarketRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.ModifyMarket(ctx, &protoReq) - return msg, metadata, err - -} - -func request_MarketManager_DeleteMarkets_0(ctx context.Context, marshaler runtime.Marshaler, client MarketManagerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq DeleteMarketsRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.DeleteMarkets(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_MarketManager_DeleteMarkets_0(ctx context.Context, marshaler runtime.Marshaler, server MarketManagerServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq DeleteMarketsRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.DeleteMarkets(ctx, &protoReq) - return msg, metadata, err - -} - -func request_MarketManager_UserJoinMarket_0(ctx context.Context, marshaler runtime.Marshaler, client MarketManagerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq UserJoinMarketRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.UserJoinMarket(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_MarketManager_UserJoinMarket_0(ctx context.Context, marshaler runtime.Marshaler, server MarketManagerServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq UserJoinMarketRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.UserJoinMarket(ctx, &protoReq) - return msg, metadata, err - -} - -func request_MarketManager_UserLeaveMarket_0(ctx context.Context, marshaler runtime.Marshaler, client MarketManagerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq UserLeaveMarketRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.UserLeaveMarket(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_MarketManager_UserLeaveMarket_0(ctx context.Context, marshaler runtime.Marshaler, server MarketManagerServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq UserLeaveMarketRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.UserLeaveMarket(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_MarketManager_DescribeMarketUsers_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_MarketManager_DescribeMarketUsers_0(ctx context.Context, marshaler runtime.Marshaler, client MarketManagerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq DescribeMarketUsersRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_MarketManager_DescribeMarketUsers_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.DescribeMarketUsers(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_MarketManager_DescribeMarketUsers_0(ctx context.Context, marshaler runtime.Marshaler, server MarketManagerServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq DescribeMarketUsersRequest - var metadata runtime.ServerMetadata - - if err := runtime.PopulateQueryParameters(&protoReq, req.URL.Query(), filter_MarketManager_DescribeMarketUsers_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.DescribeMarketUsers(ctx, &protoReq) - return msg, metadata, err - -} - -// RegisterMarketManagerHandlerServer registers the http handlers for service MarketManager to "mux". -// UnaryRPC :call MarketManagerServer directly. -// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. -func RegisterMarketManagerHandlerServer(ctx context.Context, mux *runtime.ServeMux, server MarketManagerServer) error { - - mux.Handle("POST", pattern_MarketManager_CreateMarket_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_MarketManager_CreateMarket_0(rctx, inboundMarshaler, server, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_MarketManager_CreateMarket_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_MarketManager_DescribeMarkets_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_MarketManager_DescribeMarkets_0(rctx, inboundMarshaler, server, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_MarketManager_DescribeMarkets_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("PATCH", pattern_MarketManager_ModifyMarket_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_MarketManager_ModifyMarket_0(rctx, inboundMarshaler, server, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_MarketManager_ModifyMarket_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("DELETE", pattern_MarketManager_DeleteMarkets_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_MarketManager_DeleteMarkets_0(rctx, inboundMarshaler, server, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_MarketManager_DeleteMarkets_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_MarketManager_UserJoinMarket_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_MarketManager_UserJoinMarket_0(rctx, inboundMarshaler, server, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_MarketManager_UserJoinMarket_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_MarketManager_UserLeaveMarket_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_MarketManager_UserLeaveMarket_0(rctx, inboundMarshaler, server, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_MarketManager_UserLeaveMarket_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_MarketManager_DescribeMarketUsers_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_MarketManager_DescribeMarketUsers_0(rctx, inboundMarshaler, server, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_MarketManager_DescribeMarketUsers_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -// RegisterMarketManagerHandlerFromEndpoint is same as RegisterMarketManagerHandler but -// automatically dials to "endpoint" and closes the connection when "ctx" gets done. -func RegisterMarketManagerHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { - conn, err := grpc.Dial(endpoint, opts...) - if err != nil { - return err - } - defer func() { - if err != nil { - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - return - } - go func() { - <-ctx.Done() - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - }() - }() - - return RegisterMarketManagerHandler(ctx, mux, conn) -} - -// RegisterMarketManagerHandler registers the http handlers for service MarketManager to "mux". -// The handlers forward requests to the grpc endpoint over "conn". -func RegisterMarketManagerHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { - return RegisterMarketManagerHandlerClient(ctx, mux, NewMarketManagerClient(conn)) -} - -// RegisterMarketManagerHandlerClient registers the http handlers for service MarketManager -// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "MarketManagerClient". -// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "MarketManagerClient" -// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in -// "MarketManagerClient" to call the correct interceptors. -func RegisterMarketManagerHandlerClient(ctx context.Context, mux *runtime.ServeMux, client MarketManagerClient) error { - - mux.Handle("POST", pattern_MarketManager_CreateMarket_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_MarketManager_CreateMarket_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_MarketManager_CreateMarket_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_MarketManager_DescribeMarkets_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_MarketManager_DescribeMarkets_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_MarketManager_DescribeMarkets_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("PATCH", pattern_MarketManager_ModifyMarket_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_MarketManager_ModifyMarket_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_MarketManager_ModifyMarket_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("DELETE", pattern_MarketManager_DeleteMarkets_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_MarketManager_DeleteMarkets_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_MarketManager_DeleteMarkets_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_MarketManager_UserJoinMarket_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_MarketManager_UserJoinMarket_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_MarketManager_UserJoinMarket_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_MarketManager_UserLeaveMarket_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_MarketManager_UserLeaveMarket_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_MarketManager_UserLeaveMarket_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_MarketManager_DescribeMarketUsers_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_MarketManager_DescribeMarketUsers_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_MarketManager_DescribeMarketUsers_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -var ( - pattern_MarketManager_CreateMarket_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "markets"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_MarketManager_DescribeMarkets_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "markets"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_MarketManager_ModifyMarket_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "markets"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_MarketManager_DeleteMarkets_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "markets"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_MarketManager_UserJoinMarket_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "markets"}, "join", runtime.AssumeColonVerbOpt(true))) - - pattern_MarketManager_UserLeaveMarket_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "markets"}, "leave", runtime.AssumeColonVerbOpt(true))) - - pattern_MarketManager_DescribeMarketUsers_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "market_users"}, "", runtime.AssumeColonVerbOpt(true))) -) - -var ( - forward_MarketManager_CreateMarket_0 = runtime.ForwardResponseMessage - - forward_MarketManager_DescribeMarkets_0 = runtime.ForwardResponseMessage - - forward_MarketManager_ModifyMarket_0 = runtime.ForwardResponseMessage - - forward_MarketManager_DeleteMarkets_0 = runtime.ForwardResponseMessage - - forward_MarketManager_UserJoinMarket_0 = runtime.ForwardResponseMessage - - forward_MarketManager_UserLeaveMarket_0 = runtime.ForwardResponseMessage - - forward_MarketManager_DescribeMarketUsers_0 = runtime.ForwardResponseMessage -) diff --git a/vendor/openpitrix.io/openpitrix/pkg/pb/repo.pb.go b/vendor/openpitrix.io/openpitrix/pkg/pb/repo.pb.go deleted file mode 100644 index a345790a24..0000000000 --- a/vendor/openpitrix.io/openpitrix/pkg/pb/repo.pb.go +++ /dev/null @@ -1,1460 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// source: repo.proto - -package pb - -import ( - context "context" - fmt "fmt" - math "math" - - proto "github.com/golang/protobuf/proto" - timestamp "github.com/golang/protobuf/ptypes/timestamp" - wrappers "github.com/golang/protobuf/ptypes/wrappers" - _ "github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger/options" - _ "google.golang.org/genproto/googleapis/api/annotations" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" -) - -// 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 - -type CreateRepoRequest struct { - // required, repository name - Name *wrappers.StringValue `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - // repository description - Description *wrappers.StringValue `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` - // repository type - Type *wrappers.StringValue `protobuf:"bytes,3,opt,name=type,proto3" json:"type,omitempty"` - // required, url of visiting the repository - Url *wrappers.StringValue `protobuf:"bytes,4,opt,name=url,proto3" json:"url,omitempty"` - // required, credential of visiting the repository - Credential *wrappers.StringValue `protobuf:"bytes,5,opt,name=credential,proto3" json:"credential,omitempty"` - // required, visibility eg:[public|private] - Visibility *wrappers.StringValue `protobuf:"bytes,6,opt,name=visibility,proto3" json:"visibility,omitempty"` - // required, runtime provider eg.[qingcloud|aliyun|aws|kubernetes] - Providers []string `protobuf:"bytes,7,rep,name=providers,proto3" json:"providers,omitempty"` - // a kv string, tags of server - Labels *wrappers.StringValue `protobuf:"bytes,8,opt,name=labels,proto3" json:"labels,omitempty"` - // selectors of label - Selectors *wrappers.StringValue `protobuf:"bytes,9,opt,name=selectors,proto3" json:"selectors,omitempty"` - // category id - CategoryId *wrappers.StringValue `protobuf:"bytes,10,opt,name=category_id,json=categoryId,proto3" json:"category_id,omitempty"` - // required app default status.eg:[draft|active] - AppDefaultStatus *wrappers.StringValue `protobuf:"bytes,11,opt,name=app_default_status,json=appDefaultStatus,proto3" json:"app_default_status,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *CreateRepoRequest) Reset() { *m = CreateRepoRequest{} } -func (m *CreateRepoRequest) String() string { return proto.CompactTextString(m) } -func (*CreateRepoRequest) ProtoMessage() {} -func (*CreateRepoRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_9a6377fc15c39a05, []int{0} -} - -func (m *CreateRepoRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_CreateRepoRequest.Unmarshal(m, b) -} -func (m *CreateRepoRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_CreateRepoRequest.Marshal(b, m, deterministic) -} -func (m *CreateRepoRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_CreateRepoRequest.Merge(m, src) -} -func (m *CreateRepoRequest) XXX_Size() int { - return xxx_messageInfo_CreateRepoRequest.Size(m) -} -func (m *CreateRepoRequest) XXX_DiscardUnknown() { - xxx_messageInfo_CreateRepoRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_CreateRepoRequest proto.InternalMessageInfo - -func (m *CreateRepoRequest) GetName() *wrappers.StringValue { - if m != nil { - return m.Name - } - return nil -} - -func (m *CreateRepoRequest) GetDescription() *wrappers.StringValue { - if m != nil { - return m.Description - } - return nil -} - -func (m *CreateRepoRequest) GetType() *wrappers.StringValue { - if m != nil { - return m.Type - } - return nil -} - -func (m *CreateRepoRequest) GetUrl() *wrappers.StringValue { - if m != nil { - return m.Url - } - return nil -} - -func (m *CreateRepoRequest) GetCredential() *wrappers.StringValue { - if m != nil { - return m.Credential - } - return nil -} - -func (m *CreateRepoRequest) GetVisibility() *wrappers.StringValue { - if m != nil { - return m.Visibility - } - return nil -} - -func (m *CreateRepoRequest) GetProviders() []string { - if m != nil { - return m.Providers - } - return nil -} - -func (m *CreateRepoRequest) GetLabels() *wrappers.StringValue { - if m != nil { - return m.Labels - } - return nil -} - -func (m *CreateRepoRequest) GetSelectors() *wrappers.StringValue { - if m != nil { - return m.Selectors - } - return nil -} - -func (m *CreateRepoRequest) GetCategoryId() *wrappers.StringValue { - if m != nil { - return m.CategoryId - } - return nil -} - -func (m *CreateRepoRequest) GetAppDefaultStatus() *wrappers.StringValue { - if m != nil { - return m.AppDefaultStatus - } - return nil -} - -type CreateRepoResponse struct { - // id of repository created - RepoId *wrappers.StringValue `protobuf:"bytes,1,opt,name=repo_id,json=repoId,proto3" json:"repo_id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *CreateRepoResponse) Reset() { *m = CreateRepoResponse{} } -func (m *CreateRepoResponse) String() string { return proto.CompactTextString(m) } -func (*CreateRepoResponse) ProtoMessage() {} -func (*CreateRepoResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_9a6377fc15c39a05, []int{1} -} - -func (m *CreateRepoResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_CreateRepoResponse.Unmarshal(m, b) -} -func (m *CreateRepoResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_CreateRepoResponse.Marshal(b, m, deterministic) -} -func (m *CreateRepoResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_CreateRepoResponse.Merge(m, src) -} -func (m *CreateRepoResponse) XXX_Size() int { - return xxx_messageInfo_CreateRepoResponse.Size(m) -} -func (m *CreateRepoResponse) XXX_DiscardUnknown() { - xxx_messageInfo_CreateRepoResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_CreateRepoResponse proto.InternalMessageInfo - -func (m *CreateRepoResponse) GetRepoId() *wrappers.StringValue { - if m != nil { - return m.RepoId - } - return nil -} - -type ModifyRepoRequest struct { - // required, id of repository to modify - RepoId *wrappers.StringValue `protobuf:"bytes,1,opt,name=repo_id,json=repoId,proto3" json:"repo_id,omitempty"` - // repository name - Name *wrappers.StringValue `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - // repository description - Description *wrappers.StringValue `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` - // repository type - Type *wrappers.StringValue `protobuf:"bytes,4,opt,name=type,proto3" json:"type,omitempty"` - // url of visiting the repository - Url *wrappers.StringValue `protobuf:"bytes,5,opt,name=url,proto3" json:"url,omitempty"` - // credential of visiting the repository - Credential *wrappers.StringValue `protobuf:"bytes,6,opt,name=credential,proto3" json:"credential,omitempty"` - // visibility eg:[public|private] - Visibility *wrappers.StringValue `protobuf:"bytes,7,opt,name=visibility,proto3" json:"visibility,omitempty"` - // runtime provider eg.[qingcloud|aliyun|aws|kubernetes] - Providers []string `protobuf:"bytes,8,rep,name=providers,proto3" json:"providers,omitempty"` - // a kv string, tags of server - Labels *wrappers.StringValue `protobuf:"bytes,9,opt,name=labels,proto3" json:"labels,omitempty"` - // selectors of label - Selectors *wrappers.StringValue `protobuf:"bytes,10,opt,name=selectors,proto3" json:"selectors,omitempty"` - // category id - CategoryId *wrappers.StringValue `protobuf:"bytes,11,opt,name=category_id,json=categoryId,proto3" json:"category_id,omitempty"` - // app default status eg:[draft|active] - AppDefaultStatus *wrappers.StringValue `protobuf:"bytes,12,opt,name=app_default_status,json=appDefaultStatus,proto3" json:"app_default_status,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ModifyRepoRequest) Reset() { *m = ModifyRepoRequest{} } -func (m *ModifyRepoRequest) String() string { return proto.CompactTextString(m) } -func (*ModifyRepoRequest) ProtoMessage() {} -func (*ModifyRepoRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_9a6377fc15c39a05, []int{2} -} - -func (m *ModifyRepoRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ModifyRepoRequest.Unmarshal(m, b) -} -func (m *ModifyRepoRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ModifyRepoRequest.Marshal(b, m, deterministic) -} -func (m *ModifyRepoRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_ModifyRepoRequest.Merge(m, src) -} -func (m *ModifyRepoRequest) XXX_Size() int { - return xxx_messageInfo_ModifyRepoRequest.Size(m) -} -func (m *ModifyRepoRequest) XXX_DiscardUnknown() { - xxx_messageInfo_ModifyRepoRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_ModifyRepoRequest proto.InternalMessageInfo - -func (m *ModifyRepoRequest) GetRepoId() *wrappers.StringValue { - if m != nil { - return m.RepoId - } - return nil -} - -func (m *ModifyRepoRequest) GetName() *wrappers.StringValue { - if m != nil { - return m.Name - } - return nil -} - -func (m *ModifyRepoRequest) GetDescription() *wrappers.StringValue { - if m != nil { - return m.Description - } - return nil -} - -func (m *ModifyRepoRequest) GetType() *wrappers.StringValue { - if m != nil { - return m.Type - } - return nil -} - -func (m *ModifyRepoRequest) GetUrl() *wrappers.StringValue { - if m != nil { - return m.Url - } - return nil -} - -func (m *ModifyRepoRequest) GetCredential() *wrappers.StringValue { - if m != nil { - return m.Credential - } - return nil -} - -func (m *ModifyRepoRequest) GetVisibility() *wrappers.StringValue { - if m != nil { - return m.Visibility - } - return nil -} - -func (m *ModifyRepoRequest) GetProviders() []string { - if m != nil { - return m.Providers - } - return nil -} - -func (m *ModifyRepoRequest) GetLabels() *wrappers.StringValue { - if m != nil { - return m.Labels - } - return nil -} - -func (m *ModifyRepoRequest) GetSelectors() *wrappers.StringValue { - if m != nil { - return m.Selectors - } - return nil -} - -func (m *ModifyRepoRequest) GetCategoryId() *wrappers.StringValue { - if m != nil { - return m.CategoryId - } - return nil -} - -func (m *ModifyRepoRequest) GetAppDefaultStatus() *wrappers.StringValue { - if m != nil { - return m.AppDefaultStatus - } - return nil -} - -type ModifyRepoResponse struct { - // id of repository modified - RepoId *wrappers.StringValue `protobuf:"bytes,1,opt,name=repo_id,json=repoId,proto3" json:"repo_id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ModifyRepoResponse) Reset() { *m = ModifyRepoResponse{} } -func (m *ModifyRepoResponse) String() string { return proto.CompactTextString(m) } -func (*ModifyRepoResponse) ProtoMessage() {} -func (*ModifyRepoResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_9a6377fc15c39a05, []int{3} -} - -func (m *ModifyRepoResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ModifyRepoResponse.Unmarshal(m, b) -} -func (m *ModifyRepoResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ModifyRepoResponse.Marshal(b, m, deterministic) -} -func (m *ModifyRepoResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_ModifyRepoResponse.Merge(m, src) -} -func (m *ModifyRepoResponse) XXX_Size() int { - return xxx_messageInfo_ModifyRepoResponse.Size(m) -} -func (m *ModifyRepoResponse) XXX_DiscardUnknown() { - xxx_messageInfo_ModifyRepoResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_ModifyRepoResponse proto.InternalMessageInfo - -func (m *ModifyRepoResponse) GetRepoId() *wrappers.StringValue { - if m != nil { - return m.RepoId - } - return nil -} - -type DeleteReposRequest struct { - // required, ids of repository to delete - RepoId []string `protobuf:"bytes,1,rep,name=repo_id,json=repoId,proto3" json:"repo_id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *DeleteReposRequest) Reset() { *m = DeleteReposRequest{} } -func (m *DeleteReposRequest) String() string { return proto.CompactTextString(m) } -func (*DeleteReposRequest) ProtoMessage() {} -func (*DeleteReposRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_9a6377fc15c39a05, []int{4} -} - -func (m *DeleteReposRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_DeleteReposRequest.Unmarshal(m, b) -} -func (m *DeleteReposRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_DeleteReposRequest.Marshal(b, m, deterministic) -} -func (m *DeleteReposRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_DeleteReposRequest.Merge(m, src) -} -func (m *DeleteReposRequest) XXX_Size() int { - return xxx_messageInfo_DeleteReposRequest.Size(m) -} -func (m *DeleteReposRequest) XXX_DiscardUnknown() { - xxx_messageInfo_DeleteReposRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_DeleteReposRequest proto.InternalMessageInfo - -func (m *DeleteReposRequest) GetRepoId() []string { - if m != nil { - return m.RepoId - } - return nil -} - -type DeleteReposResponse struct { - // ids of repository deleted - RepoId []string `protobuf:"bytes,1,rep,name=repo_id,json=repoId,proto3" json:"repo_id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *DeleteReposResponse) Reset() { *m = DeleteReposResponse{} } -func (m *DeleteReposResponse) String() string { return proto.CompactTextString(m) } -func (*DeleteReposResponse) ProtoMessage() {} -func (*DeleteReposResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_9a6377fc15c39a05, []int{5} -} - -func (m *DeleteReposResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_DeleteReposResponse.Unmarshal(m, b) -} -func (m *DeleteReposResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_DeleteReposResponse.Marshal(b, m, deterministic) -} -func (m *DeleteReposResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_DeleteReposResponse.Merge(m, src) -} -func (m *DeleteReposResponse) XXX_Size() int { - return xxx_messageInfo_DeleteReposResponse.Size(m) -} -func (m *DeleteReposResponse) XXX_DiscardUnknown() { - xxx_messageInfo_DeleteReposResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_DeleteReposResponse proto.InternalMessageInfo - -func (m *DeleteReposResponse) GetRepoId() []string { - if m != nil { - return m.RepoId - } - return nil -} - -type RepoLabel struct { - // label key - LabelKey *wrappers.StringValue `protobuf:"bytes,1,opt,name=label_key,json=labelKey,proto3" json:"label_key,omitempty"` - // label value - LabelValue *wrappers.StringValue `protobuf:"bytes,2,opt,name=label_value,json=labelValue,proto3" json:"label_value,omitempty"` - // the time when repository label create - CreateTime *timestamp.Timestamp `protobuf:"bytes,3,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *RepoLabel) Reset() { *m = RepoLabel{} } -func (m *RepoLabel) String() string { return proto.CompactTextString(m) } -func (*RepoLabel) ProtoMessage() {} -func (*RepoLabel) Descriptor() ([]byte, []int) { - return fileDescriptor_9a6377fc15c39a05, []int{6} -} - -func (m *RepoLabel) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_RepoLabel.Unmarshal(m, b) -} -func (m *RepoLabel) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_RepoLabel.Marshal(b, m, deterministic) -} -func (m *RepoLabel) XXX_Merge(src proto.Message) { - xxx_messageInfo_RepoLabel.Merge(m, src) -} -func (m *RepoLabel) XXX_Size() int { - return xxx_messageInfo_RepoLabel.Size(m) -} -func (m *RepoLabel) XXX_DiscardUnknown() { - xxx_messageInfo_RepoLabel.DiscardUnknown(m) -} - -var xxx_messageInfo_RepoLabel proto.InternalMessageInfo - -func (m *RepoLabel) GetLabelKey() *wrappers.StringValue { - if m != nil { - return m.LabelKey - } - return nil -} - -func (m *RepoLabel) GetLabelValue() *wrappers.StringValue { - if m != nil { - return m.LabelValue - } - return nil -} - -func (m *RepoLabel) GetCreateTime() *timestamp.Timestamp { - if m != nil { - return m.CreateTime - } - return nil -} - -type RepoSelector struct { - // selector key - SelectorKey *wrappers.StringValue `protobuf:"bytes,1,opt,name=selector_key,json=selectorKey,proto3" json:"selector_key,omitempty"` - // selector value - SelectorValue *wrappers.StringValue `protobuf:"bytes,2,opt,name=selector_value,json=selectorValue,proto3" json:"selector_value,omitempty"` - // the time when repository selector create - CreateTime *timestamp.Timestamp `protobuf:"bytes,3,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *RepoSelector) Reset() { *m = RepoSelector{} } -func (m *RepoSelector) String() string { return proto.CompactTextString(m) } -func (*RepoSelector) ProtoMessage() {} -func (*RepoSelector) Descriptor() ([]byte, []int) { - return fileDescriptor_9a6377fc15c39a05, []int{7} -} - -func (m *RepoSelector) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_RepoSelector.Unmarshal(m, b) -} -func (m *RepoSelector) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_RepoSelector.Marshal(b, m, deterministic) -} -func (m *RepoSelector) XXX_Merge(src proto.Message) { - xxx_messageInfo_RepoSelector.Merge(m, src) -} -func (m *RepoSelector) XXX_Size() int { - return xxx_messageInfo_RepoSelector.Size(m) -} -func (m *RepoSelector) XXX_DiscardUnknown() { - xxx_messageInfo_RepoSelector.DiscardUnknown(m) -} - -var xxx_messageInfo_RepoSelector proto.InternalMessageInfo - -func (m *RepoSelector) GetSelectorKey() *wrappers.StringValue { - if m != nil { - return m.SelectorKey - } - return nil -} - -func (m *RepoSelector) GetSelectorValue() *wrappers.StringValue { - if m != nil { - return m.SelectorValue - } - return nil -} - -func (m *RepoSelector) GetCreateTime() *timestamp.Timestamp { - if m != nil { - return m.CreateTime - } - return nil -} - -type Repo struct { - // repository id - RepoId *wrappers.StringValue `protobuf:"bytes,1,opt,name=repo_id,json=repoId,proto3" json:"repo_id,omitempty"` - // repository name - Name *wrappers.StringValue `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - // repository description - Description *wrappers.StringValue `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` - // type of repository eg.[http|https|s3] - Type *wrappers.StringValue `protobuf:"bytes,4,opt,name=type,proto3" json:"type,omitempty"` - // url of visiting the repository - Url *wrappers.StringValue `protobuf:"bytes,5,opt,name=url,proto3" json:"url,omitempty"` - // credential of visiting the repository - Credential *wrappers.StringValue `protobuf:"bytes,6,opt,name=credential,proto3" json:"credential,omitempty"` - // visibility.eg:[public|private] - Visibility *wrappers.StringValue `protobuf:"bytes,7,opt,name=visibility,proto3" json:"visibility,omitempty"` - // owner path, concat string group_path:user_id - OwnerPath *wrappers.StringValue `protobuf:"bytes,8,opt,name=owner_path,json=ownerPath,proto3" json:"owner_path,omitempty"` - // runtime provider eg.[qingcloud|aliyun|aws|kubernetes] - Providers []string `protobuf:"bytes,9,rep,name=providers,proto3" json:"providers,omitempty"` - // labels - Labels []*RepoLabel `protobuf:"bytes,10,rep,name=labels,proto3" json:"labels,omitempty"` - // selectors of label - Selectors []*RepoSelector `protobuf:"bytes,11,rep,name=selectors,proto3" json:"selectors,omitempty"` - // status eg.[active|deleted] - Status *wrappers.StringValue `protobuf:"bytes,12,opt,name=status,proto3" json:"status,omitempty"` - // the time when repository create - CreateTime *timestamp.Timestamp `protobuf:"bytes,13,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty"` - // record status changed time - StatusTime *timestamp.Timestamp `protobuf:"bytes,14,opt,name=status_time,json=statusTime,proto3" json:"status_time,omitempty"` - // list category - CategorySet []*ResourceCategory `protobuf:"bytes,15,rep,name=category_set,json=categorySet,proto3" json:"category_set,omitempty"` - // app default status eg[active|draft] - AppDefaultStatus *wrappers.StringValue `protobuf:"bytes,16,opt,name=app_default_status,json=appDefaultStatus,proto3" json:"app_default_status,omitempty"` - // controller, value 0 for self resource, value 1 for openpitrix resource - Controller *wrappers.Int32Value `protobuf:"bytes,17,opt,name=controller,proto3" json:"controller,omitempty"` - // owner - Owner *wrappers.StringValue `protobuf:"bytes,18,opt,name=owner,proto3" json:"owner,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Repo) Reset() { *m = Repo{} } -func (m *Repo) String() string { return proto.CompactTextString(m) } -func (*Repo) ProtoMessage() {} -func (*Repo) Descriptor() ([]byte, []int) { - return fileDescriptor_9a6377fc15c39a05, []int{8} -} - -func (m *Repo) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Repo.Unmarshal(m, b) -} -func (m *Repo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Repo.Marshal(b, m, deterministic) -} -func (m *Repo) XXX_Merge(src proto.Message) { - xxx_messageInfo_Repo.Merge(m, src) -} -func (m *Repo) XXX_Size() int { - return xxx_messageInfo_Repo.Size(m) -} -func (m *Repo) XXX_DiscardUnknown() { - xxx_messageInfo_Repo.DiscardUnknown(m) -} - -var xxx_messageInfo_Repo proto.InternalMessageInfo - -func (m *Repo) GetRepoId() *wrappers.StringValue { - if m != nil { - return m.RepoId - } - return nil -} - -func (m *Repo) GetName() *wrappers.StringValue { - if m != nil { - return m.Name - } - return nil -} - -func (m *Repo) GetDescription() *wrappers.StringValue { - if m != nil { - return m.Description - } - return nil -} - -func (m *Repo) GetType() *wrappers.StringValue { - if m != nil { - return m.Type - } - return nil -} - -func (m *Repo) GetUrl() *wrappers.StringValue { - if m != nil { - return m.Url - } - return nil -} - -func (m *Repo) GetCredential() *wrappers.StringValue { - if m != nil { - return m.Credential - } - return nil -} - -func (m *Repo) GetVisibility() *wrappers.StringValue { - if m != nil { - return m.Visibility - } - return nil -} - -func (m *Repo) GetOwnerPath() *wrappers.StringValue { - if m != nil { - return m.OwnerPath - } - return nil -} - -func (m *Repo) GetProviders() []string { - if m != nil { - return m.Providers - } - return nil -} - -func (m *Repo) GetLabels() []*RepoLabel { - if m != nil { - return m.Labels - } - return nil -} - -func (m *Repo) GetSelectors() []*RepoSelector { - if m != nil { - return m.Selectors - } - return nil -} - -func (m *Repo) GetStatus() *wrappers.StringValue { - if m != nil { - return m.Status - } - return nil -} - -func (m *Repo) GetCreateTime() *timestamp.Timestamp { - if m != nil { - return m.CreateTime - } - return nil -} - -func (m *Repo) GetStatusTime() *timestamp.Timestamp { - if m != nil { - return m.StatusTime - } - return nil -} - -func (m *Repo) GetCategorySet() []*ResourceCategory { - if m != nil { - return m.CategorySet - } - return nil -} - -func (m *Repo) GetAppDefaultStatus() *wrappers.StringValue { - if m != nil { - return m.AppDefaultStatus - } - return nil -} - -func (m *Repo) GetController() *wrappers.Int32Value { - if m != nil { - return m.Controller - } - return nil -} - -func (m *Repo) GetOwner() *wrappers.StringValue { - if m != nil { - return m.Owner - } - return nil -} - -type DescribeReposRequest struct { - // query key, support these fields(repo_id, name, type, visibility, status, app_default_status, owner, controller) - SearchWord *wrappers.StringValue `protobuf:"bytes,1,opt,name=search_word,json=searchWord,proto3" json:"search_word,omitempty"` - // sort key, order by sort_key, default create_time - SortKey *wrappers.StringValue `protobuf:"bytes,2,opt,name=sort_key,json=sortKey,proto3" json:"sort_key,omitempty"` - // value = 0 sort ASC, value = 1 sort DESC - Reverse *wrappers.BoolValue `protobuf:"bytes,3,opt,name=reverse,proto3" json:"reverse,omitempty"` - // data limit per page, default value 20, max value 200 - Limit uint32 `protobuf:"varint,4,opt,name=limit,proto3" json:"limit,omitempty"` - // data offset, default 0 - Offset uint32 `protobuf:"varint,5,opt,name=offset,proto3" json:"offset,omitempty"` - // repository ids - RepoId []string `protobuf:"bytes,11,rep,name=repo_id,json=repoId,proto3" json:"repo_id,omitempty"` - // repository name - Name []string `protobuf:"bytes,12,rep,name=name,proto3" json:"name,omitempty"` - // repository type - Type []string `protobuf:"bytes,13,rep,name=type,proto3" json:"type,omitempty"` - // visibility eg:[public|private] - Visibility []string `protobuf:"bytes,14,rep,name=visibility,proto3" json:"visibility,omitempty"` - // status eg.[active|deleted] - Status []string `protobuf:"bytes,15,rep,name=status,proto3" json:"status,omitempty"` - // runtime provider eg.[qingcloud|aliyun|aws|kubernetes] - Provider []string `protobuf:"bytes,16,rep,name=provider,proto3" json:"provider,omitempty"` - // a kv string, tags of server - Label *wrappers.StringValue `protobuf:"bytes,17,opt,name=label,proto3" json:"label,omitempty"` - // selector of label - Selector *wrappers.StringValue `protobuf:"bytes,18,opt,name=selector,proto3" json:"selector,omitempty"` - // category ids - CategoryId []string `protobuf:"bytes,19,rep,name=category_id,json=categoryId,proto3" json:"category_id,omitempty"` - // owner - Owner []string `protobuf:"bytes,20,rep,name=owner,proto3" json:"owner,omitempty"` - // app default status eg.[draft|active] - AppDefaultStatus []string `protobuf:"bytes,21,rep,name=app_default_status,json=appDefaultStatus,proto3" json:"app_default_status,omitempty"` - // user id - UserId string `protobuf:"bytes,22,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` - // controller, value 0 for self resource, value1 for openpitrix resource - Controller *wrappers.Int32Value `protobuf:"bytes,23,opt,name=controller,proto3" json:"controller,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *DescribeReposRequest) Reset() { *m = DescribeReposRequest{} } -func (m *DescribeReposRequest) String() string { return proto.CompactTextString(m) } -func (*DescribeReposRequest) ProtoMessage() {} -func (*DescribeReposRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_9a6377fc15c39a05, []int{9} -} - -func (m *DescribeReposRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_DescribeReposRequest.Unmarshal(m, b) -} -func (m *DescribeReposRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_DescribeReposRequest.Marshal(b, m, deterministic) -} -func (m *DescribeReposRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_DescribeReposRequest.Merge(m, src) -} -func (m *DescribeReposRequest) XXX_Size() int { - return xxx_messageInfo_DescribeReposRequest.Size(m) -} -func (m *DescribeReposRequest) XXX_DiscardUnknown() { - xxx_messageInfo_DescribeReposRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_DescribeReposRequest proto.InternalMessageInfo - -func (m *DescribeReposRequest) GetSearchWord() *wrappers.StringValue { - if m != nil { - return m.SearchWord - } - return nil -} - -func (m *DescribeReposRequest) GetSortKey() *wrappers.StringValue { - if m != nil { - return m.SortKey - } - return nil -} - -func (m *DescribeReposRequest) GetReverse() *wrappers.BoolValue { - if m != nil { - return m.Reverse - } - return nil -} - -func (m *DescribeReposRequest) GetLimit() uint32 { - if m != nil { - return m.Limit - } - return 0 -} - -func (m *DescribeReposRequest) GetOffset() uint32 { - if m != nil { - return m.Offset - } - return 0 -} - -func (m *DescribeReposRequest) GetRepoId() []string { - if m != nil { - return m.RepoId - } - return nil -} - -func (m *DescribeReposRequest) GetName() []string { - if m != nil { - return m.Name - } - return nil -} - -func (m *DescribeReposRequest) GetType() []string { - if m != nil { - return m.Type - } - return nil -} - -func (m *DescribeReposRequest) GetVisibility() []string { - if m != nil { - return m.Visibility - } - return nil -} - -func (m *DescribeReposRequest) GetStatus() []string { - if m != nil { - return m.Status - } - return nil -} - -func (m *DescribeReposRequest) GetProvider() []string { - if m != nil { - return m.Provider - } - return nil -} - -func (m *DescribeReposRequest) GetLabel() *wrappers.StringValue { - if m != nil { - return m.Label - } - return nil -} - -func (m *DescribeReposRequest) GetSelector() *wrappers.StringValue { - if m != nil { - return m.Selector - } - return nil -} - -func (m *DescribeReposRequest) GetCategoryId() []string { - if m != nil { - return m.CategoryId - } - return nil -} - -func (m *DescribeReposRequest) GetOwner() []string { - if m != nil { - return m.Owner - } - return nil -} - -func (m *DescribeReposRequest) GetAppDefaultStatus() []string { - if m != nil { - return m.AppDefaultStatus - } - return nil -} - -func (m *DescribeReposRequest) GetUserId() string { - if m != nil { - return m.UserId - } - return "" -} - -func (m *DescribeReposRequest) GetController() *wrappers.Int32Value { - if m != nil { - return m.Controller - } - return nil -} - -type DescribeReposResponse struct { - // total count of repository - TotalCount uint32 `protobuf:"varint,1,opt,name=total_count,json=totalCount,proto3" json:"total_count,omitempty"` - // list of repository - RepoSet []*Repo `protobuf:"bytes,2,rep,name=repo_set,json=repoSet,proto3" json:"repo_set,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *DescribeReposResponse) Reset() { *m = DescribeReposResponse{} } -func (m *DescribeReposResponse) String() string { return proto.CompactTextString(m) } -func (*DescribeReposResponse) ProtoMessage() {} -func (*DescribeReposResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_9a6377fc15c39a05, []int{10} -} - -func (m *DescribeReposResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_DescribeReposResponse.Unmarshal(m, b) -} -func (m *DescribeReposResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_DescribeReposResponse.Marshal(b, m, deterministic) -} -func (m *DescribeReposResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_DescribeReposResponse.Merge(m, src) -} -func (m *DescribeReposResponse) XXX_Size() int { - return xxx_messageInfo_DescribeReposResponse.Size(m) -} -func (m *DescribeReposResponse) XXX_DiscardUnknown() { - xxx_messageInfo_DescribeReposResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_DescribeReposResponse proto.InternalMessageInfo - -func (m *DescribeReposResponse) GetTotalCount() uint32 { - if m != nil { - return m.TotalCount - } - return 0 -} - -func (m *DescribeReposResponse) GetRepoSet() []*Repo { - if m != nil { - return m.RepoSet - } - return nil -} - -type ValidateRepoRequest struct { - // required, type of repository - Type *wrappers.StringValue `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` - // required, url of visiting the repository - Url *wrappers.StringValue `protobuf:"bytes,2,opt,name=url,proto3" json:"url,omitempty"` - // required, credential of visiting the repository - Credential *wrappers.StringValue `protobuf:"bytes,3,opt,name=credential,proto3" json:"credential,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ValidateRepoRequest) Reset() { *m = ValidateRepoRequest{} } -func (m *ValidateRepoRequest) String() string { return proto.CompactTextString(m) } -func (*ValidateRepoRequest) ProtoMessage() {} -func (*ValidateRepoRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_9a6377fc15c39a05, []int{11} -} - -func (m *ValidateRepoRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ValidateRepoRequest.Unmarshal(m, b) -} -func (m *ValidateRepoRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ValidateRepoRequest.Marshal(b, m, deterministic) -} -func (m *ValidateRepoRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_ValidateRepoRequest.Merge(m, src) -} -func (m *ValidateRepoRequest) XXX_Size() int { - return xxx_messageInfo_ValidateRepoRequest.Size(m) -} -func (m *ValidateRepoRequest) XXX_DiscardUnknown() { - xxx_messageInfo_ValidateRepoRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_ValidateRepoRequest proto.InternalMessageInfo - -func (m *ValidateRepoRequest) GetType() *wrappers.StringValue { - if m != nil { - return m.Type - } - return nil -} - -func (m *ValidateRepoRequest) GetUrl() *wrappers.StringValue { - if m != nil { - return m.Url - } - return nil -} - -func (m *ValidateRepoRequest) GetCredential() *wrappers.StringValue { - if m != nil { - return m.Credential - } - return nil -} - -type ValidateRepoResponse struct { - // validate repository ok or not - Ok *wrappers.BoolValue `protobuf:"bytes,1,opt,name=ok,proto3" json:"ok,omitempty"` - // if validate error,return error code - ErrorCode uint32 `protobuf:"varint,2,opt,name=errorCode,proto3" json:"errorCode,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ValidateRepoResponse) Reset() { *m = ValidateRepoResponse{} } -func (m *ValidateRepoResponse) String() string { return proto.CompactTextString(m) } -func (*ValidateRepoResponse) ProtoMessage() {} -func (*ValidateRepoResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_9a6377fc15c39a05, []int{12} -} - -func (m *ValidateRepoResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ValidateRepoResponse.Unmarshal(m, b) -} -func (m *ValidateRepoResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ValidateRepoResponse.Marshal(b, m, deterministic) -} -func (m *ValidateRepoResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_ValidateRepoResponse.Merge(m, src) -} -func (m *ValidateRepoResponse) XXX_Size() int { - return xxx_messageInfo_ValidateRepoResponse.Size(m) -} -func (m *ValidateRepoResponse) XXX_DiscardUnknown() { - xxx_messageInfo_ValidateRepoResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_ValidateRepoResponse proto.InternalMessageInfo - -func (m *ValidateRepoResponse) GetOk() *wrappers.BoolValue { - if m != nil { - return m.Ok - } - return nil -} - -func (m *ValidateRepoResponse) GetErrorCode() uint32 { - if m != nil { - return m.ErrorCode - } - return 0 -} - -func init() { - proto.RegisterType((*CreateRepoRequest)(nil), "openpitrix.CreateRepoRequest") - proto.RegisterType((*CreateRepoResponse)(nil), "openpitrix.CreateRepoResponse") - proto.RegisterType((*ModifyRepoRequest)(nil), "openpitrix.ModifyRepoRequest") - proto.RegisterType((*ModifyRepoResponse)(nil), "openpitrix.ModifyRepoResponse") - proto.RegisterType((*DeleteReposRequest)(nil), "openpitrix.DeleteReposRequest") - proto.RegisterType((*DeleteReposResponse)(nil), "openpitrix.DeleteReposResponse") - proto.RegisterType((*RepoLabel)(nil), "openpitrix.RepoLabel") - proto.RegisterType((*RepoSelector)(nil), "openpitrix.RepoSelector") - proto.RegisterType((*Repo)(nil), "openpitrix.Repo") - proto.RegisterType((*DescribeReposRequest)(nil), "openpitrix.DescribeReposRequest") - proto.RegisterType((*DescribeReposResponse)(nil), "openpitrix.DescribeReposResponse") - proto.RegisterType((*ValidateRepoRequest)(nil), "openpitrix.ValidateRepoRequest") - proto.RegisterType((*ValidateRepoResponse)(nil), "openpitrix.ValidateRepoResponse") -} - -func init() { proto.RegisterFile("repo.proto", fileDescriptor_9a6377fc15c39a05) } - -var fileDescriptor_9a6377fc15c39a05 = []byte{ - // 1377 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x58, 0xcd, 0x6e, 0x1b, 0x37, - 0x17, 0xc5, 0xc8, 0x96, 0x2c, 0xdd, 0xb1, 0x1c, 0x87, 0xb6, 0x93, 0xf9, 0x14, 0x7f, 0x36, 0xab, - 0x95, 0xeb, 0xca, 0x52, 0xab, 0xa4, 0x7f, 0xf9, 0x69, 0xe0, 0x38, 0x40, 0xe1, 0xa6, 0x01, 0x0a, - 0xb9, 0x48, 0x81, 0x6e, 0x54, 0x5a, 0x43, 0xc9, 0x03, 0x8f, 0x87, 0x53, 0x92, 0xb2, 0xab, 0x6d, - 0x80, 0x6e, 0xba, 0x74, 0x97, 0x05, 0x8a, 0x3e, 0x42, 0x81, 0x22, 0x2f, 0xd0, 0x3e, 0x41, 0xd1, - 0x57, 0xe8, 0x6b, 0xb4, 0x28, 0xc8, 0xa1, 0x46, 0x33, 0x92, 0x95, 0x8c, 0xe5, 0x2c, 0xba, 0xe8, - 0xca, 0x22, 0x79, 0x0e, 0x79, 0xc9, 0x7b, 0xcf, 0xe1, 0xd0, 0x00, 0x9c, 0x86, 0xac, 0x1e, 0x72, - 0x26, 0x19, 0x02, 0x16, 0xd2, 0x20, 0xf4, 0x24, 0xf7, 0xbe, 0xa9, 0x6c, 0xf4, 0x18, 0xeb, 0xf9, - 0xb4, 0xa1, 0x47, 0x0e, 0xfb, 0xdd, 0xc6, 0x19, 0x27, 0x61, 0x48, 0xb9, 0x88, 0xb0, 0x95, 0xcd, - 0xf1, 0x71, 0xe9, 0x9d, 0x50, 0x21, 0xc9, 0x49, 0x68, 0x00, 0xeb, 0x06, 0x40, 0x42, 0xaf, 0x41, - 0x82, 0x80, 0x49, 0x22, 0x3d, 0x16, 0x0c, 0xe9, 0x35, 0xfd, 0xa7, 0xb3, 0xd3, 0xa3, 0xc1, 0x8e, - 0x38, 0x23, 0xbd, 0x1e, 0xe5, 0x0d, 0x16, 0x6a, 0xc4, 0x05, 0x68, 0x5b, 0x0e, 0x42, 0x6a, 0x1a, - 0xd5, 0xbf, 0xe7, 0xe1, 0xfa, 0x1e, 0xa7, 0x44, 0xd2, 0x16, 0x0d, 0x59, 0x8b, 0x7e, 0xdd, 0xa7, - 0x42, 0xa2, 0xb7, 0x61, 0x3e, 0x20, 0x27, 0xd4, 0xb1, 0xb0, 0xb5, 0x65, 0x37, 0xd7, 0xeb, 0xd1, - 0xea, 0xf5, 0x61, 0x78, 0xf5, 0x03, 0xc9, 0xbd, 0xa0, 0xf7, 0x8c, 0xf8, 0x7d, 0xda, 0xd2, 0x48, - 0xf4, 0x11, 0xd8, 0x2e, 0x15, 0x1d, 0xee, 0xe9, 0x65, 0x9d, 0x5c, 0x06, 0x62, 0x92, 0xa0, 0x56, - 0x54, 0x61, 0x39, 0x73, 0x59, 0x56, 0x54, 0x48, 0x54, 0x87, 0xb9, 0x3e, 0xf7, 0x9d, 0xf9, 0x0c, - 0x04, 0x05, 0x44, 0xf7, 0x01, 0x3a, 0x9c, 0xba, 0x34, 0x90, 0x1e, 0xf1, 0x9d, 0x7c, 0x06, 0x5a, - 0x02, 0xaf, 0xd8, 0xa7, 0x9e, 0xf0, 0x0e, 0x3d, 0xdf, 0x93, 0x03, 0xa7, 0x90, 0x85, 0x3d, 0xc2, - 0xa3, 0x75, 0x28, 0x85, 0x9c, 0x9d, 0x7a, 0x2e, 0xe5, 0xc2, 0x59, 0xc0, 0x73, 0x5b, 0xa5, 0xd6, - 0xa8, 0x03, 0xdd, 0x81, 0x82, 0x4f, 0x0e, 0xa9, 0x2f, 0x9c, 0x62, 0x86, 0x79, 0x0d, 0x16, 0xdd, - 0x85, 0x92, 0xa0, 0x3e, 0xed, 0x48, 0xc6, 0x85, 0x53, 0xca, 0x40, 0x1c, 0xc1, 0xd1, 0x03, 0xb0, - 0x3b, 0x44, 0xd2, 0x1e, 0xe3, 0x83, 0xb6, 0xe7, 0x3a, 0x90, 0xe9, 0x30, 0x0c, 0x61, 0xdf, 0x45, - 0x9f, 0x00, 0x22, 0x61, 0xd8, 0x76, 0x69, 0x97, 0xf4, 0x7d, 0xd9, 0x16, 0x92, 0xc8, 0xbe, 0x70, - 0xec, 0x0c, 0xb3, 0x2c, 0x93, 0x30, 0x7c, 0x1c, 0xd1, 0x0e, 0x34, 0xab, 0xfa, 0x04, 0x50, 0xb2, - 0xfe, 0x44, 0xc8, 0x02, 0x41, 0xd1, 0xbb, 0xb0, 0xa0, 0xa4, 0xa4, 0x82, 0xcb, 0x52, 0x83, 0x05, - 0x05, 0xde, 0x77, 0xab, 0x2f, 0xf2, 0x70, 0xfd, 0x29, 0x73, 0xbd, 0xee, 0x20, 0x59, 0xcd, 0xb3, - 0x4d, 0x16, 0x8b, 0x20, 0x37, 0xab, 0x08, 0xe6, 0x66, 0x15, 0xc1, 0xfc, 0x65, 0x45, 0x90, 0x9f, - 0x4d, 0x04, 0x85, 0x2b, 0x89, 0x60, 0xe1, 0x2a, 0x22, 0x28, 0x4e, 0x17, 0x41, 0x69, 0x56, 0x11, - 0xc0, 0x95, 0x44, 0x60, 0xbf, 0x16, 0x11, 0x2c, 0xce, 0x2a, 0x82, 0x64, 0xd9, 0x5e, 0x4d, 0x04, - 0x3b, 0x80, 0x1e, 0x53, 0x9f, 0x46, 0x8a, 0x12, 0x43, 0x11, 0xdc, 0x4c, 0x4e, 0xa6, 0xce, 0x7e, - 0x08, 0xaf, 0xc3, 0x4a, 0x0a, 0x6e, 0x16, 0x9f, 0x8a, 0xff, 0xd5, 0x82, 0x92, 0x82, 0x7e, 0xaa, - 0x32, 0x80, 0x3e, 0x84, 0x92, 0x4e, 0x45, 0xfb, 0x98, 0x0e, 0x32, 0x45, 0x59, 0xd4, 0xf0, 0x27, - 0x74, 0xa0, 0xce, 0x3f, 0xa2, 0x9e, 0xaa, 0x81, 0x4c, 0x32, 0x03, 0x4d, 0xd0, 0xbf, 0xd1, 0x3d, - 0xb0, 0x3b, 0xda, 0x38, 0xda, 0xea, 0xb2, 0x34, 0x62, 0xab, 0x4c, 0xd0, 0x3f, 0x1f, 0xde, 0xa4, - 0xba, 0x92, 0x89, 0xa4, 0xaa, 0xa3, 0xfa, 0xbb, 0x05, 0x8b, 0x6a, 0x13, 0x07, 0xa6, 0x1a, 0xd0, - 0x43, 0x58, 0x1c, 0x56, 0x46, 0xe6, 0xad, 0xd8, 0x43, 0x86, 0xda, 0xcd, 0x1e, 0x2c, 0xc5, 0x13, - 0x64, 0xdf, 0x50, 0x79, 0xc8, 0x79, 0x0d, 0x7b, 0xfa, 0x6b, 0x01, 0xe6, 0xd5, 0x9e, 0xfe, 0xf3, - 0xbb, 0x7f, 0x87, 0xdf, 0xdd, 0x03, 0x60, 0x67, 0x01, 0xe5, 0xed, 0x90, 0xc8, 0xa3, 0x4c, 0x57, - 0x7b, 0x49, 0xe3, 0x3f, 0x23, 0xf2, 0x28, 0x6d, 0x96, 0xa5, 0x71, 0xb3, 0xdc, 0x89, 0xcd, 0x12, - 0xf0, 0xdc, 0x96, 0xdd, 0x5c, 0xab, 0x8f, 0x3e, 0x36, 0xeb, 0xb1, 0x38, 0x63, 0x97, 0x7c, 0x2f, - 0xe9, 0x92, 0xb6, 0x66, 0x38, 0xe3, 0x8c, 0xa1, 0x12, 0x92, 0x0e, 0x79, 0x07, 0x0a, 0x97, 0xb0, - 0x35, 0x83, 0x1d, 0x2f, 0xe2, 0xf2, 0x65, 0x8a, 0x58, 0x91, 0xa3, 0x69, 0x22, 0xf2, 0xd2, 0xab, - 0xc9, 0x11, 0x5c, 0x93, 0x1f, 0xc2, 0x62, 0xec, 0xe8, 0x82, 0x4a, 0xe7, 0x9a, 0xde, 0xea, 0x7a, - 0x7a, 0xab, 0x82, 0xf5, 0x79, 0x87, 0xee, 0x19, 0x5c, 0x2b, 0xbe, 0x03, 0x0e, 0xa8, 0x9c, 0xe2, - 0xe9, 0xcb, 0xb3, 0x78, 0xba, 0x4a, 0x7f, 0x87, 0x05, 0x92, 0x33, 0xdf, 0xa7, 0xdc, 0xb9, 0xae, - 0xe7, 0xb8, 0x35, 0x31, 0xc7, 0x7e, 0x20, 0x6f, 0x37, 0x87, 0x95, 0x17, 0xc3, 0x51, 0x13, 0xf2, - 0xba, 0x16, 0x1c, 0x94, 0x61, 0xed, 0x08, 0x5a, 0xfd, 0x39, 0x0f, 0xab, 0x8f, 0xb5, 0xba, 0x0e, - 0xd3, 0xd6, 0xff, 0x00, 0x6c, 0x41, 0x09, 0xef, 0x1c, 0xb5, 0xcf, 0x18, 0xcf, 0xe6, 0x09, 0x10, - 0x11, 0xbe, 0x60, 0xdc, 0x45, 0xef, 0x43, 0x51, 0x30, 0x2e, 0xb5, 0x2d, 0x66, 0xf1, 0x86, 0x05, - 0x85, 0x56, 0x96, 0x78, 0x47, 0xf9, 0xd0, 0x29, 0xe5, 0x62, 0xba, 0x93, 0x3d, 0x62, 0xcc, 0x37, - 0x2c, 0x03, 0x45, 0xab, 0x90, 0xf7, 0xbd, 0x13, 0x4f, 0x6a, 0x57, 0x28, 0xb7, 0xa2, 0x06, 0xba, - 0x01, 0x05, 0xd6, 0xed, 0xaa, 0xa4, 0xe6, 0x75, 0xb7, 0x69, 0x25, 0xaf, 0x29, 0x3b, 0x79, 0x4d, - 0x21, 0x64, 0xdc, 0x6c, 0x51, 0xf7, 0x46, 0x7e, 0x85, 0x8c, 0xdf, 0x94, 0xa3, 0x3e, 0xed, 0x28, - 0x1b, 0x29, 0x8d, 0x2f, 0xe9, 0x91, 0xa4, 0x8a, 0x6f, 0xc4, 0x1a, 0xb8, 0x16, 0xcd, 0x6f, 0xaa, - 0xbc, 0x02, 0xc5, 0xa1, 0x1e, 0x9d, 0x65, 0x3d, 0x12, 0xb7, 0x55, 0xf6, 0xb4, 0xf2, 0x4c, 0xd6, - 0x5f, 0x91, 0x3d, 0x0d, 0x45, 0x1f, 0x40, 0x71, 0x28, 0xbc, 0x4c, 0x49, 0x8f, 0xd1, 0x68, 0x33, - 0xfd, 0x1d, 0xb3, 0x12, 0x6d, 0x21, 0xf1, 0xa5, 0xb2, 0x3a, 0x2c, 0xa6, 0x55, 0x3d, 0x14, 0x35, - 0x50, 0xed, 0xc2, 0x5a, 0x5f, 0xd3, 0x90, 0xc9, 0x6a, 0xbe, 0x09, 0x0b, 0x7d, 0x41, 0xb9, 0x5a, - 0xe0, 0x06, 0xb6, 0xd4, 0x39, 0xa8, 0xe6, 0xbe, 0x3b, 0x56, 0xe6, 0x37, 0x2f, 0x55, 0xe6, 0x55, - 0x0a, 0x6b, 0x63, 0x15, 0x6b, 0xbe, 0x3e, 0x36, 0xc1, 0x96, 0x4c, 0x12, 0xbf, 0xdd, 0x61, 0xfd, - 0x40, 0xea, 0x92, 0x2d, 0xb7, 0x40, 0x77, 0xed, 0xa9, 0x1e, 0xf4, 0x16, 0x14, 0x75, 0xde, 0x55, - 0x45, 0xe4, 0xb4, 0xcc, 0x97, 0xc7, 0x1d, 0xad, 0xa5, 0x2b, 0xe3, 0x80, 0xca, 0xea, 0x0b, 0x0b, - 0x56, 0x9e, 0x11, 0xdf, 0x73, 0x27, 0x9f, 0xb9, 0xba, 0x1e, 0xac, 0xcb, 0xde, 0x3f, 0xb9, 0xd9, - 0xee, 0x9f, 0xb9, 0xcb, 0xdd, 0x3f, 0xd5, 0xaf, 0x60, 0x35, 0x1d, 0xb6, 0x39, 0x9d, 0x6d, 0xc8, - 0xb1, 0x63, 0x13, 0xf5, 0xcb, 0x34, 0x95, 0x63, 0xc7, 0xea, 0x22, 0xa1, 0x9c, 0x33, 0xbe, 0xc7, - 0xdc, 0xe8, 0x6a, 0x2f, 0xb7, 0x46, 0x1d, 0xcd, 0xdf, 0x0a, 0x60, 0xab, 0xa9, 0x9f, 0x92, 0x80, - 0xf4, 0x28, 0x47, 0x3f, 0x59, 0x00, 0xa3, 0xe7, 0x18, 0xfa, 0x7f, 0xf2, 0x4c, 0x27, 0xfe, 0x4d, - 0x50, 0xd9, 0x98, 0x36, 0x1c, 0xc5, 0x59, 0x3d, 0x38, 0xdf, 0xbd, 0x8f, 0xee, 0x46, 0x03, 0x58, - 0x25, 0x43, 0x78, 0x92, 0xf1, 0x41, 0x2d, 0xf1, 0x1b, 0xf7, 0x05, 0x75, 0xb1, 0x64, 0x58, 0x48, - 0xc6, 0x29, 0x0e, 0x49, 0xe7, 0x98, 0xf4, 0x28, 0x66, 0x5d, 0x4c, 0xc2, 0xf0, 0xf9, 0x1f, 0x7f, - 0x7e, 0x9f, 0x5b, 0xaa, 0x96, 0x1a, 0xa7, 0xef, 0x34, 0x34, 0xe5, 0xae, 0xb5, 0x8d, 0xbe, 0xcb, - 0x41, 0x39, 0x55, 0x34, 0x08, 0x27, 0xc3, 0xb8, 0xc8, 0x01, 0x2b, 0x6f, 0xbc, 0x04, 0x61, 0x62, - 0xfd, 0xc5, 0x3a, 0xdf, 0xfd, 0xd1, 0x42, 0x3f, 0x58, 0x1f, 0x53, 0x39, 0x8a, 0xcf, 0xa3, 0x02, - 0xd7, 0xba, 0x9e, 0x2f, 0x29, 0xc7, 0x67, 0x9e, 0x3c, 0xc2, 0xf2, 0x88, 0x0a, 0x8a, 0xbb, 0x1e, - 0xf5, 0x5d, 0xb1, 0x65, 0x9c, 0xa7, 0x86, 0x95, 0xbb, 0xd4, 0xb0, 0xaa, 0x90, 0x1a, 0x1e, 0x79, - 0x47, 0x0d, 0x47, 0xa2, 0xaa, 0xe1, 0x49, 0xa1, 0xd5, 0xb0, 0x56, 0x61, 0x0d, 0x8f, 0xd4, 0xf0, - 0x66, 0x0d, 0x1b, 0x0c, 0xe6, 0x54, 0xf6, 0x79, 0x80, 0x89, 0xef, 0xa7, 0x42, 0xd1, 0xe7, 0x61, - 0xa3, 0xd1, 0x79, 0xa0, 0x33, 0x80, 0xd1, 0xc3, 0x21, 0x9d, 0xae, 0x89, 0x77, 0x70, 0x3a, 0x5d, - 0x93, 0xef, 0x8d, 0xea, 0xf6, 0xf9, 0xee, 0x0a, 0x32, 0xef, 0xe7, 0x44, 0x8a, 0xa2, 0x2c, 0x34, - 0xd3, 0x59, 0x78, 0x6e, 0x81, 0x9d, 0x78, 0x36, 0xa0, 0x8d, 0xf4, 0x09, 0x8f, 0x3f, 0x3f, 0x2a, - 0x9b, 0x53, 0xc7, 0xcd, 0xe2, 0xcd, 0xf3, 0xdd, 0x5b, 0xe8, 0x7f, 0x8f, 0x88, 0xec, 0x1c, 0x61, - 0x57, 0x8f, 0x4f, 0x6e, 0x7d, 0x69, 0x3b, 0x1d, 0xc4, 0xb7, 0x16, 0x2c, 0x26, 0x05, 0x82, 0x52, - 0xab, 0x5c, 0xa0, 0xf8, 0x0a, 0x9e, 0x0e, 0x18, 0xc5, 0xb1, 0x86, 0x62, 0xb7, 0x18, 0x3f, 0x86, - 0x55, 0x84, 0xe2, 0x08, 0x1a, 0xa7, 0x06, 0xf4, 0x68, 0xfe, 0xcb, 0x5c, 0x78, 0x78, 0x58, 0xd0, - 0x0a, 0xbc, 0xfd, 0x4f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x58, 0x53, 0x0f, 0x6a, 0x05, 0x14, 0x00, - 0x00, -} - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConn - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion4 - -// RepoManagerClient is the client API for RepoManager service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type RepoManagerClient interface { - // Create repository, repository used to store package of app - CreateRepo(ctx context.Context, in *CreateRepoRequest, opts ...grpc.CallOption) (*CreateRepoResponse, error) - // Get repositories ,filter with these fields(repo_id, name, type, visibility, status, app_default_status, owner, controller), default return all repositories - DescribeRepos(ctx context.Context, in *DescribeReposRequest, opts ...grpc.CallOption) (*DescribeReposResponse, error) - // Modify repository - ModifyRepo(ctx context.Context, in *ModifyRepoRequest, opts ...grpc.CallOption) (*ModifyRepoResponse, error) - // Batch delete repositories - DeleteRepos(ctx context.Context, in *DeleteReposRequest, opts ...grpc.CallOption) (*DeleteReposResponse, error) - // Validate repository - ValidateRepo(ctx context.Context, in *ValidateRepoRequest, opts ...grpc.CallOption) (*ValidateRepoResponse, error) -} - -type repoManagerClient struct { - cc *grpc.ClientConn -} - -func NewRepoManagerClient(cc *grpc.ClientConn) RepoManagerClient { - return &repoManagerClient{cc} -} - -func (c *repoManagerClient) CreateRepo(ctx context.Context, in *CreateRepoRequest, opts ...grpc.CallOption) (*CreateRepoResponse, error) { - out := new(CreateRepoResponse) - err := c.cc.Invoke(ctx, "/openpitrix.RepoManager/CreateRepo", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *repoManagerClient) DescribeRepos(ctx context.Context, in *DescribeReposRequest, opts ...grpc.CallOption) (*DescribeReposResponse, error) { - out := new(DescribeReposResponse) - err := c.cc.Invoke(ctx, "/openpitrix.RepoManager/DescribeRepos", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *repoManagerClient) ModifyRepo(ctx context.Context, in *ModifyRepoRequest, opts ...grpc.CallOption) (*ModifyRepoResponse, error) { - out := new(ModifyRepoResponse) - err := c.cc.Invoke(ctx, "/openpitrix.RepoManager/ModifyRepo", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *repoManagerClient) DeleteRepos(ctx context.Context, in *DeleteReposRequest, opts ...grpc.CallOption) (*DeleteReposResponse, error) { - out := new(DeleteReposResponse) - err := c.cc.Invoke(ctx, "/openpitrix.RepoManager/DeleteRepos", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *repoManagerClient) ValidateRepo(ctx context.Context, in *ValidateRepoRequest, opts ...grpc.CallOption) (*ValidateRepoResponse, error) { - out := new(ValidateRepoResponse) - err := c.cc.Invoke(ctx, "/openpitrix.RepoManager/ValidateRepo", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// RepoManagerServer is the server API for RepoManager service. -type RepoManagerServer interface { - // Create repository, repository used to store package of app - CreateRepo(context.Context, *CreateRepoRequest) (*CreateRepoResponse, error) - // Get repositories ,filter with these fields(repo_id, name, type, visibility, status, app_default_status, owner, controller), default return all repositories - DescribeRepos(context.Context, *DescribeReposRequest) (*DescribeReposResponse, error) - // Modify repository - ModifyRepo(context.Context, *ModifyRepoRequest) (*ModifyRepoResponse, error) - // Batch delete repositories - DeleteRepos(context.Context, *DeleteReposRequest) (*DeleteReposResponse, error) - // Validate repository - ValidateRepo(context.Context, *ValidateRepoRequest) (*ValidateRepoResponse, error) -} - -// UnimplementedRepoManagerServer can be embedded to have forward compatible implementations. -type UnimplementedRepoManagerServer struct { -} - -func (*UnimplementedRepoManagerServer) CreateRepo(ctx context.Context, req *CreateRepoRequest) (*CreateRepoResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method CreateRepo not implemented") -} -func (*UnimplementedRepoManagerServer) DescribeRepos(ctx context.Context, req *DescribeReposRequest) (*DescribeReposResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method DescribeRepos not implemented") -} -func (*UnimplementedRepoManagerServer) ModifyRepo(ctx context.Context, req *ModifyRepoRequest) (*ModifyRepoResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ModifyRepo not implemented") -} -func (*UnimplementedRepoManagerServer) DeleteRepos(ctx context.Context, req *DeleteReposRequest) (*DeleteReposResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method DeleteRepos not implemented") -} -func (*UnimplementedRepoManagerServer) ValidateRepo(ctx context.Context, req *ValidateRepoRequest) (*ValidateRepoResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ValidateRepo not implemented") -} - -func RegisterRepoManagerServer(s *grpc.Server, srv RepoManagerServer) { - s.RegisterService(&_RepoManager_serviceDesc, srv) -} - -func _RepoManager_CreateRepo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CreateRepoRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(RepoManagerServer).CreateRepo(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/openpitrix.RepoManager/CreateRepo", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(RepoManagerServer).CreateRepo(ctx, req.(*CreateRepoRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _RepoManager_DescribeRepos_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DescribeReposRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(RepoManagerServer).DescribeRepos(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/openpitrix.RepoManager/DescribeRepos", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(RepoManagerServer).DescribeRepos(ctx, req.(*DescribeReposRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _RepoManager_ModifyRepo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ModifyRepoRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(RepoManagerServer).ModifyRepo(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/openpitrix.RepoManager/ModifyRepo", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(RepoManagerServer).ModifyRepo(ctx, req.(*ModifyRepoRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _RepoManager_DeleteRepos_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DeleteReposRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(RepoManagerServer).DeleteRepos(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/openpitrix.RepoManager/DeleteRepos", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(RepoManagerServer).DeleteRepos(ctx, req.(*DeleteReposRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _RepoManager_ValidateRepo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ValidateRepoRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(RepoManagerServer).ValidateRepo(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/openpitrix.RepoManager/ValidateRepo", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(RepoManagerServer).ValidateRepo(ctx, req.(*ValidateRepoRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _RepoManager_serviceDesc = grpc.ServiceDesc{ - ServiceName: "openpitrix.RepoManager", - HandlerType: (*RepoManagerServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "CreateRepo", - Handler: _RepoManager_CreateRepo_Handler, - }, - { - MethodName: "DescribeRepos", - Handler: _RepoManager_DescribeRepos_Handler, - }, - { - MethodName: "ModifyRepo", - Handler: _RepoManager_ModifyRepo_Handler, - }, - { - MethodName: "DeleteRepos", - Handler: _RepoManager_DeleteRepos_Handler, - }, - { - MethodName: "ValidateRepo", - Handler: _RepoManager_ValidateRepo_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "repo.proto", -} diff --git a/vendor/openpitrix.io/openpitrix/pkg/pb/repo.pb.gw.go b/vendor/openpitrix.io/openpitrix/pkg/pb/repo.pb.gw.go deleted file mode 100644 index 94c4af1de2..0000000000 --- a/vendor/openpitrix.io/openpitrix/pkg/pb/repo.pb.gw.go +++ /dev/null @@ -1,473 +0,0 @@ -// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: repo.proto - -/* -Package pb is a reverse proxy. - -It translates gRPC into RESTful JSON APIs. -*/ -package pb - -import ( - "context" - "io" - "net/http" - - "github.com/golang/protobuf/descriptor" - "github.com/golang/protobuf/proto" - "github.com/grpc-ecosystem/grpc-gateway/runtime" - "github.com/grpc-ecosystem/grpc-gateway/utilities" - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/grpclog" - "google.golang.org/grpc/status" -) - -// Suppress "imported and not used" errors -var _ codes.Code -var _ io.Reader -var _ status.Status -var _ = runtime.String -var _ = utilities.NewDoubleArray -var _ = descriptor.ForMessage - -func request_RepoManager_CreateRepo_0(ctx context.Context, marshaler runtime.Marshaler, client RepoManagerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq CreateRepoRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.CreateRepo(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_RepoManager_CreateRepo_0(ctx context.Context, marshaler runtime.Marshaler, server RepoManagerServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq CreateRepoRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.CreateRepo(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_RepoManager_DescribeRepos_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_RepoManager_DescribeRepos_0(ctx context.Context, marshaler runtime.Marshaler, client RepoManagerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq DescribeReposRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_RepoManager_DescribeRepos_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.DescribeRepos(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_RepoManager_DescribeRepos_0(ctx context.Context, marshaler runtime.Marshaler, server RepoManagerServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq DescribeReposRequest - var metadata runtime.ServerMetadata - - if err := runtime.PopulateQueryParameters(&protoReq, req.URL.Query(), filter_RepoManager_DescribeRepos_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.DescribeRepos(ctx, &protoReq) - return msg, metadata, err - -} - -func request_RepoManager_ModifyRepo_0(ctx context.Context, marshaler runtime.Marshaler, client RepoManagerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ModifyRepoRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.ModifyRepo(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_RepoManager_ModifyRepo_0(ctx context.Context, marshaler runtime.Marshaler, server RepoManagerServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ModifyRepoRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.ModifyRepo(ctx, &protoReq) - return msg, metadata, err - -} - -func request_RepoManager_DeleteRepos_0(ctx context.Context, marshaler runtime.Marshaler, client RepoManagerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq DeleteReposRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.DeleteRepos(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_RepoManager_DeleteRepos_0(ctx context.Context, marshaler runtime.Marshaler, server RepoManagerServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq DeleteReposRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.DeleteRepos(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_RepoManager_ValidateRepo_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_RepoManager_ValidateRepo_0(ctx context.Context, marshaler runtime.Marshaler, client RepoManagerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ValidateRepoRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_RepoManager_ValidateRepo_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.ValidateRepo(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_RepoManager_ValidateRepo_0(ctx context.Context, marshaler runtime.Marshaler, server RepoManagerServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ValidateRepoRequest - var metadata runtime.ServerMetadata - - if err := runtime.PopulateQueryParameters(&protoReq, req.URL.Query(), filter_RepoManager_ValidateRepo_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.ValidateRepo(ctx, &protoReq) - return msg, metadata, err - -} - -// RegisterRepoManagerHandlerServer registers the http handlers for service RepoManager to "mux". -// UnaryRPC :call RepoManagerServer directly. -// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. -func RegisterRepoManagerHandlerServer(ctx context.Context, mux *runtime.ServeMux, server RepoManagerServer) error { - - mux.Handle("POST", pattern_RepoManager_CreateRepo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_RepoManager_CreateRepo_0(rctx, inboundMarshaler, server, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_RepoManager_CreateRepo_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_RepoManager_DescribeRepos_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_RepoManager_DescribeRepos_0(rctx, inboundMarshaler, server, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_RepoManager_DescribeRepos_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("PATCH", pattern_RepoManager_ModifyRepo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_RepoManager_ModifyRepo_0(rctx, inboundMarshaler, server, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_RepoManager_ModifyRepo_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("DELETE", pattern_RepoManager_DeleteRepos_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_RepoManager_DeleteRepos_0(rctx, inboundMarshaler, server, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_RepoManager_DeleteRepos_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_RepoManager_ValidateRepo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_RepoManager_ValidateRepo_0(rctx, inboundMarshaler, server, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_RepoManager_ValidateRepo_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -// RegisterRepoManagerHandlerFromEndpoint is same as RegisterRepoManagerHandler but -// automatically dials to "endpoint" and closes the connection when "ctx" gets done. -func RegisterRepoManagerHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { - conn, err := grpc.Dial(endpoint, opts...) - if err != nil { - return err - } - defer func() { - if err != nil { - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - return - } - go func() { - <-ctx.Done() - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - }() - }() - - return RegisterRepoManagerHandler(ctx, mux, conn) -} - -// RegisterRepoManagerHandler registers the http handlers for service RepoManager to "mux". -// The handlers forward requests to the grpc endpoint over "conn". -func RegisterRepoManagerHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { - return RegisterRepoManagerHandlerClient(ctx, mux, NewRepoManagerClient(conn)) -} - -// RegisterRepoManagerHandlerClient registers the http handlers for service RepoManager -// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "RepoManagerClient". -// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "RepoManagerClient" -// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in -// "RepoManagerClient" to call the correct interceptors. -func RegisterRepoManagerHandlerClient(ctx context.Context, mux *runtime.ServeMux, client RepoManagerClient) error { - - mux.Handle("POST", pattern_RepoManager_CreateRepo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_RepoManager_CreateRepo_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_RepoManager_CreateRepo_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_RepoManager_DescribeRepos_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_RepoManager_DescribeRepos_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_RepoManager_DescribeRepos_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("PATCH", pattern_RepoManager_ModifyRepo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_RepoManager_ModifyRepo_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_RepoManager_ModifyRepo_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("DELETE", pattern_RepoManager_DeleteRepos_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_RepoManager_DeleteRepos_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_RepoManager_DeleteRepos_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_RepoManager_ValidateRepo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_RepoManager_ValidateRepo_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_RepoManager_ValidateRepo_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -var ( - pattern_RepoManager_CreateRepo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "repos"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_RepoManager_DescribeRepos_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "repos"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_RepoManager_ModifyRepo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "repos"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_RepoManager_DeleteRepos_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "repos"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_RepoManager_ValidateRepo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "repos", "validate"}, "", runtime.AssumeColonVerbOpt(true))) -) - -var ( - forward_RepoManager_CreateRepo_0 = runtime.ForwardResponseMessage - - forward_RepoManager_DescribeRepos_0 = runtime.ForwardResponseMessage - - forward_RepoManager_ModifyRepo_0 = runtime.ForwardResponseMessage - - forward_RepoManager_DeleteRepos_0 = runtime.ForwardResponseMessage - - forward_RepoManager_ValidateRepo_0 = runtime.ForwardResponseMessage -) diff --git a/vendor/openpitrix.io/openpitrix/pkg/pb/repo_indexer.pb.go b/vendor/openpitrix.io/openpitrix/pkg/pb/repo_indexer.pb.go deleted file mode 100644 index 63216f30fd..0000000000 --- a/vendor/openpitrix.io/openpitrix/pkg/pb/repo_indexer.pb.go +++ /dev/null @@ -1,528 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// source: repo_indexer.proto - -package pb - -import ( - context "context" - fmt "fmt" - math "math" - - proto "github.com/golang/protobuf/proto" - timestamp "github.com/golang/protobuf/ptypes/timestamp" - wrappers "github.com/golang/protobuf/ptypes/wrappers" - _ "github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger/options" - _ "google.golang.org/genproto/googleapis/api/annotations" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" -) - -// 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 - -type IndexRepoRequest struct { - // id of repository to index - RepoId *wrappers.StringValue `protobuf:"bytes,1,opt,name=repo_id,json=repoId,proto3" json:"repo_id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *IndexRepoRequest) Reset() { *m = IndexRepoRequest{} } -func (m *IndexRepoRequest) String() string { return proto.CompactTextString(m) } -func (*IndexRepoRequest) ProtoMessage() {} -func (*IndexRepoRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_e135b06a8245a758, []int{0} -} - -func (m *IndexRepoRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_IndexRepoRequest.Unmarshal(m, b) -} -func (m *IndexRepoRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_IndexRepoRequest.Marshal(b, m, deterministic) -} -func (m *IndexRepoRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_IndexRepoRequest.Merge(m, src) -} -func (m *IndexRepoRequest) XXX_Size() int { - return xxx_messageInfo_IndexRepoRequest.Size(m) -} -func (m *IndexRepoRequest) XXX_DiscardUnknown() { - xxx_messageInfo_IndexRepoRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_IndexRepoRequest proto.InternalMessageInfo - -func (m *IndexRepoRequest) GetRepoId() *wrappers.StringValue { - if m != nil { - return m.RepoId - } - return nil -} - -type IndexRepoResponse struct { - // repository event - RepoEvent *RepoEvent `protobuf:"bytes,1,opt,name=repo_event,json=repoEvent,proto3" json:"repo_event,omitempty"` - // id of repository indexed - RepoId *wrappers.StringValue `protobuf:"bytes,2,opt,name=repo_id,json=repoId,proto3" json:"repo_id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *IndexRepoResponse) Reset() { *m = IndexRepoResponse{} } -func (m *IndexRepoResponse) String() string { return proto.CompactTextString(m) } -func (*IndexRepoResponse) ProtoMessage() {} -func (*IndexRepoResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_e135b06a8245a758, []int{1} -} - -func (m *IndexRepoResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_IndexRepoResponse.Unmarshal(m, b) -} -func (m *IndexRepoResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_IndexRepoResponse.Marshal(b, m, deterministic) -} -func (m *IndexRepoResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_IndexRepoResponse.Merge(m, src) -} -func (m *IndexRepoResponse) XXX_Size() int { - return xxx_messageInfo_IndexRepoResponse.Size(m) -} -func (m *IndexRepoResponse) XXX_DiscardUnknown() { - xxx_messageInfo_IndexRepoResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_IndexRepoResponse proto.InternalMessageInfo - -func (m *IndexRepoResponse) GetRepoEvent() *RepoEvent { - if m != nil { - return m.RepoEvent - } - return nil -} - -func (m *IndexRepoResponse) GetRepoId() *wrappers.StringValue { - if m != nil { - return m.RepoId - } - return nil -} - -type RepoEvent struct { - // repository event id - RepoEventId *wrappers.StringValue `protobuf:"bytes,1,opt,name=repo_event_id,json=repoEventId,proto3" json:"repo_event_id,omitempty"` - // repository id - RepoId *wrappers.StringValue `protobuf:"bytes,2,opt,name=repo_id,json=repoId,proto3" json:"repo_id,omitempty"` - // owner path, concat string group_path:user_id - OwnerPath *wrappers.StringValue `protobuf:"bytes,3,opt,name=owner_path,json=ownerPath,proto3" json:"owner_path,omitempty"` - // repository event status eg.[failed|successful|working|pending] - Status *wrappers.StringValue `protobuf:"bytes,4,opt,name=status,proto3" json:"status,omitempty"` - // result - Result *wrappers.StringValue `protobuf:"bytes,5,opt,name=result,proto3" json:"result,omitempty"` - // repository event create time - CreateTime *timestamp.Timestamp `protobuf:"bytes,6,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty"` - // record status changed time - StatusTime *timestamp.Timestamp `protobuf:"bytes,7,opt,name=status_time,json=statusTime,proto3" json:"status_time,omitempty"` - // owner - Owner *wrappers.StringValue `protobuf:"bytes,8,opt,name=owner,proto3" json:"owner,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *RepoEvent) Reset() { *m = RepoEvent{} } -func (m *RepoEvent) String() string { return proto.CompactTextString(m) } -func (*RepoEvent) ProtoMessage() {} -func (*RepoEvent) Descriptor() ([]byte, []int) { - return fileDescriptor_e135b06a8245a758, []int{2} -} - -func (m *RepoEvent) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_RepoEvent.Unmarshal(m, b) -} -func (m *RepoEvent) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_RepoEvent.Marshal(b, m, deterministic) -} -func (m *RepoEvent) XXX_Merge(src proto.Message) { - xxx_messageInfo_RepoEvent.Merge(m, src) -} -func (m *RepoEvent) XXX_Size() int { - return xxx_messageInfo_RepoEvent.Size(m) -} -func (m *RepoEvent) XXX_DiscardUnknown() { - xxx_messageInfo_RepoEvent.DiscardUnknown(m) -} - -var xxx_messageInfo_RepoEvent proto.InternalMessageInfo - -func (m *RepoEvent) GetRepoEventId() *wrappers.StringValue { - if m != nil { - return m.RepoEventId - } - return nil -} - -func (m *RepoEvent) GetRepoId() *wrappers.StringValue { - if m != nil { - return m.RepoId - } - return nil -} - -func (m *RepoEvent) GetOwnerPath() *wrappers.StringValue { - if m != nil { - return m.OwnerPath - } - return nil -} - -func (m *RepoEvent) GetStatus() *wrappers.StringValue { - if m != nil { - return m.Status - } - return nil -} - -func (m *RepoEvent) GetResult() *wrappers.StringValue { - if m != nil { - return m.Result - } - return nil -} - -func (m *RepoEvent) GetCreateTime() *timestamp.Timestamp { - if m != nil { - return m.CreateTime - } - return nil -} - -func (m *RepoEvent) GetStatusTime() *timestamp.Timestamp { - if m != nil { - return m.StatusTime - } - return nil -} - -func (m *RepoEvent) GetOwner() *wrappers.StringValue { - if m != nil { - return m.Owner - } - return nil -} - -type DescribeRepoEventsRequest struct { - // data limit per page, default value 20, max value 200 - Limit uint32 `protobuf:"varint,4,opt,name=limit,proto3" json:"limit,omitempty"` - // data offset, default 0 - Offset uint32 `protobuf:"varint,5,opt,name=offset,proto3" json:"offset,omitempty"` - // repository event ids - RepoEventId []string `protobuf:"bytes,11,rep,name=repo_event_id,json=repoEventId,proto3" json:"repo_event_id,omitempty"` - // repository ids - RepoId []string `protobuf:"bytes,12,rep,name=repo_id,json=repoId,proto3" json:"repo_id,omitempty"` - // owner - Owner []string `protobuf:"bytes,13,rep,name=owner,proto3" json:"owner,omitempty"` - // repository event status eg.[failed|successful|working|pending] - Status []string `protobuf:"bytes,14,rep,name=status,proto3" json:"status,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *DescribeRepoEventsRequest) Reset() { *m = DescribeRepoEventsRequest{} } -func (m *DescribeRepoEventsRequest) String() string { return proto.CompactTextString(m) } -func (*DescribeRepoEventsRequest) ProtoMessage() {} -func (*DescribeRepoEventsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_e135b06a8245a758, []int{3} -} - -func (m *DescribeRepoEventsRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_DescribeRepoEventsRequest.Unmarshal(m, b) -} -func (m *DescribeRepoEventsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_DescribeRepoEventsRequest.Marshal(b, m, deterministic) -} -func (m *DescribeRepoEventsRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_DescribeRepoEventsRequest.Merge(m, src) -} -func (m *DescribeRepoEventsRequest) XXX_Size() int { - return xxx_messageInfo_DescribeRepoEventsRequest.Size(m) -} -func (m *DescribeRepoEventsRequest) XXX_DiscardUnknown() { - xxx_messageInfo_DescribeRepoEventsRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_DescribeRepoEventsRequest proto.InternalMessageInfo - -func (m *DescribeRepoEventsRequest) GetLimit() uint32 { - if m != nil { - return m.Limit - } - return 0 -} - -func (m *DescribeRepoEventsRequest) GetOffset() uint32 { - if m != nil { - return m.Offset - } - return 0 -} - -func (m *DescribeRepoEventsRequest) GetRepoEventId() []string { - if m != nil { - return m.RepoEventId - } - return nil -} - -func (m *DescribeRepoEventsRequest) GetRepoId() []string { - if m != nil { - return m.RepoId - } - return nil -} - -func (m *DescribeRepoEventsRequest) GetOwner() []string { - if m != nil { - return m.Owner - } - return nil -} - -func (m *DescribeRepoEventsRequest) GetStatus() []string { - if m != nil { - return m.Status - } - return nil -} - -type DescribeRepoEventsResponse struct { - // total count of repository event - TotalCount uint32 `protobuf:"varint,1,opt,name=total_count,json=totalCount,proto3" json:"total_count,omitempty"` - // list of repository event - RepoEventSet []*RepoEvent `protobuf:"bytes,2,rep,name=repo_event_set,json=repoEventSet,proto3" json:"repo_event_set,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *DescribeRepoEventsResponse) Reset() { *m = DescribeRepoEventsResponse{} } -func (m *DescribeRepoEventsResponse) String() string { return proto.CompactTextString(m) } -func (*DescribeRepoEventsResponse) ProtoMessage() {} -func (*DescribeRepoEventsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_e135b06a8245a758, []int{4} -} - -func (m *DescribeRepoEventsResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_DescribeRepoEventsResponse.Unmarshal(m, b) -} -func (m *DescribeRepoEventsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_DescribeRepoEventsResponse.Marshal(b, m, deterministic) -} -func (m *DescribeRepoEventsResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_DescribeRepoEventsResponse.Merge(m, src) -} -func (m *DescribeRepoEventsResponse) XXX_Size() int { - return xxx_messageInfo_DescribeRepoEventsResponse.Size(m) -} -func (m *DescribeRepoEventsResponse) XXX_DiscardUnknown() { - xxx_messageInfo_DescribeRepoEventsResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_DescribeRepoEventsResponse proto.InternalMessageInfo - -func (m *DescribeRepoEventsResponse) GetTotalCount() uint32 { - if m != nil { - return m.TotalCount - } - return 0 -} - -func (m *DescribeRepoEventsResponse) GetRepoEventSet() []*RepoEvent { - if m != nil { - return m.RepoEventSet - } - return nil -} - -func init() { - proto.RegisterType((*IndexRepoRequest)(nil), "openpitrix.IndexRepoRequest") - proto.RegisterType((*IndexRepoResponse)(nil), "openpitrix.IndexRepoResponse") - proto.RegisterType((*RepoEvent)(nil), "openpitrix.RepoEvent") - proto.RegisterType((*DescribeRepoEventsRequest)(nil), "openpitrix.DescribeRepoEventsRequest") - proto.RegisterType((*DescribeRepoEventsResponse)(nil), "openpitrix.DescribeRepoEventsResponse") -} - -func init() { proto.RegisterFile("repo_indexer.proto", fileDescriptor_e135b06a8245a758) } - -var fileDescriptor_e135b06a8245a758 = []byte{ - // 607 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x54, 0xcd, 0x6e, 0xd3, 0x4c, - 0x14, 0x95, 0x93, 0x36, 0xfd, 0x72, 0xd3, 0xf4, 0xa3, 0xa3, 0x96, 0x1a, 0x2b, 0xb4, 0x96, 0x25, - 0x50, 0x85, 0xa8, 0xad, 0x96, 0xb2, 0x21, 0x1b, 0xca, 0x8f, 0x50, 0x76, 0xc8, 0x45, 0x2c, 0xd8, - 0x44, 0x93, 0xe4, 0xd6, 0xb5, 0x94, 0x7a, 0x86, 0x99, 0x71, 0x5b, 0x58, 0x21, 0x24, 0x5e, 0xa0, - 0x48, 0x3c, 0x06, 0x2b, 0xde, 0x84, 0x25, 0x5b, 0x1e, 0x04, 0xcd, 0x8c, 0xed, 0x86, 0x86, 0xa8, - 0x81, 0x95, 0x3d, 0x73, 0xcf, 0xb9, 0xf7, 0xdc, 0xbf, 0x01, 0x22, 0x90, 0xb3, 0x7e, 0x9a, 0x8d, - 0xf0, 0x1c, 0x45, 0xc8, 0x05, 0x53, 0x8c, 0x00, 0xe3, 0x98, 0xf1, 0x54, 0x89, 0xf4, 0xdc, 0xdb, - 0x4c, 0x18, 0x4b, 0xc6, 0x18, 0x19, 0xcb, 0x20, 0x3f, 0x8a, 0xce, 0x04, 0xe5, 0x1c, 0x85, 0xb4, - 0x58, 0x6f, 0xeb, 0xaa, 0x5d, 0xa5, 0x27, 0x28, 0x15, 0x3d, 0xe1, 0x05, 0xa0, 0x53, 0x00, 0x28, - 0x4f, 0x23, 0x9a, 0x65, 0x4c, 0x51, 0x95, 0xb2, 0xac, 0xa4, 0xdf, 0x37, 0x9f, 0xe1, 0x4e, 0x82, - 0xd9, 0x8e, 0x3c, 0xa3, 0x49, 0x82, 0x22, 0x62, 0xdc, 0x20, 0xa6, 0xd1, 0x41, 0x0f, 0x6e, 0xf4, - 0xb4, 0xd2, 0x18, 0x39, 0x8b, 0xf1, 0x6d, 0x8e, 0x52, 0x91, 0x87, 0xb0, 0x64, 0x53, 0x18, 0xb9, - 0x8e, 0xef, 0x6c, 0xb7, 0xf6, 0x3a, 0xa1, 0x8d, 0x18, 0x96, 0x92, 0xc2, 0x43, 0x25, 0xd2, 0x2c, - 0x79, 0x4d, 0xc7, 0x39, 0xc6, 0x0d, 0x0d, 0xee, 0x8d, 0x82, 0x0f, 0x0e, 0xac, 0x4e, 0xf8, 0x92, - 0x9c, 0x65, 0x12, 0xc9, 0x3e, 0x80, 0x71, 0x86, 0xa7, 0x98, 0xa9, 0xc2, 0xdf, 0x7a, 0x78, 0x59, - 0x8e, 0x50, 0xa3, 0x9f, 0x6b, 0x63, 0xdc, 0x14, 0xe5, 0xef, 0xa4, 0x84, 0xda, 0x5f, 0x48, 0xf8, - 0x51, 0x87, 0x66, 0xe5, 0x8f, 0x3c, 0x86, 0xf6, 0x65, 0xe8, 0x79, 0xb3, 0x69, 0x55, 0x22, 0x7a, - 0xa3, 0x7f, 0x94, 0x41, 0xba, 0x00, 0xec, 0x2c, 0x43, 0xd1, 0xe7, 0x54, 0x1d, 0xbb, 0xf5, 0x39, - 0x98, 0x4d, 0x83, 0x7f, 0x49, 0xd5, 0x31, 0xd9, 0x87, 0x86, 0x54, 0x54, 0xe5, 0xd2, 0x5d, 0x98, - 0x27, 0xa4, 0xc5, 0x6a, 0x96, 0x40, 0x99, 0x8f, 0x95, 0xbb, 0x38, 0x9f, 0x50, 0x8d, 0x25, 0x5d, - 0x68, 0x0d, 0x05, 0x52, 0x85, 0x7d, 0x3d, 0x63, 0x6e, 0xc3, 0x50, 0xbd, 0x29, 0xea, 0xab, 0x72, - 0x00, 0x63, 0xb0, 0x70, 0x7d, 0xa1, 0xc9, 0x36, 0xb8, 0x25, 0x2f, 0x5d, 0x4f, 0xb6, 0x70, 0x43, - 0xde, 0x83, 0x45, 0x93, 0xb2, 0xfb, 0xdf, 0x1c, 0x72, 0x2d, 0x34, 0xf8, 0xe6, 0xc0, 0xad, 0x67, - 0x28, 0x87, 0x22, 0x1d, 0x60, 0xd5, 0x65, 0x59, 0x4e, 0xed, 0x1a, 0x2c, 0x8e, 0xd3, 0x93, 0x54, - 0x99, 0xb2, 0xb5, 0x63, 0x7b, 0x20, 0x37, 0xa1, 0xc1, 0x8e, 0x8e, 0x24, 0xda, 0xba, 0xb4, 0xe3, - 0xe2, 0x44, 0x82, 0xab, 0xb3, 0xd1, 0xf2, 0xeb, 0xdb, 0xcd, 0xdf, 0xbb, 0xbf, 0x71, 0xd9, 0xfd, - 0x65, 0x63, 0x2d, 0xfb, 0xbb, 0x56, 0x8a, 0x6f, 0x9b, 0x6b, 0x7b, 0xd0, 0xa1, 0x8a, 0xc6, 0xad, - 0x58, 0xb4, 0x3d, 0x05, 0xef, 0xc1, 0xfb, 0x93, 0xea, 0x62, 0x3f, 0xb6, 0xa0, 0xa5, 0x98, 0xa2, - 0xe3, 0xfe, 0x90, 0xe5, 0xc5, 0x82, 0xb4, 0x63, 0x30, 0x57, 0x4f, 0xf5, 0x0d, 0xe9, 0xc2, 0xca, - 0x84, 0x52, 0x9d, 0x49, 0xcd, 0xaf, 0xcf, 0x5e, 0xa2, 0xe5, 0x2a, 0x83, 0x43, 0x54, 0x7b, 0x5f, - 0x6b, 0xd0, 0xd2, 0xb6, 0x9e, 0x7d, 0x8d, 0xc8, 0x27, 0x07, 0x9a, 0xd5, 0x8e, 0x92, 0xce, 0xa4, - 0x8b, 0xab, 0xcf, 0x80, 0x77, 0x7b, 0x86, 0xd5, 0x0a, 0x0f, 0xba, 0x17, 0x07, 0x9b, 0xa4, 0x73, - 0xa8, 0xa8, 0x50, 0xbe, 0x79, 0xec, 0x7c, 0x1d, 0x59, 0xa6, 0x8a, 0x89, 0x77, 0xbe, 0x11, 0xfb, - 0xf1, 0xfb, 0xcf, 0xcf, 0xb5, 0xb5, 0xe0, 0xff, 0xe8, 0x74, 0x37, 0x32, 0xb6, 0xc8, 0xe0, 0x1e, - 0x39, 0xf7, 0xc8, 0x17, 0x07, 0xc8, 0x74, 0x51, 0xc8, 0x9d, 0xc9, 0x90, 0x33, 0x5b, 0xed, 0xdd, - 0xbd, 0x0e, 0x56, 0x48, 0xdc, 0xbd, 0x38, 0xd8, 0x20, 0xeb, 0x2f, 0x50, 0x4d, 0x49, 0x93, 0x46, - 0xdb, 0x2a, 0xa9, 0xb4, 0xd9, 0xf2, 0xca, 0x27, 0x0b, 0x6f, 0x6a, 0x7c, 0x30, 0x68, 0x98, 0x31, - 0x7c, 0xf0, 0x2b, 0x00, 0x00, 0xff, 0xff, 0x44, 0x04, 0xf0, 0xba, 0xcb, 0x05, 0x00, 0x00, -} - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConn - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion4 - -// RepoIndexerClient is the client API for RepoIndexer service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type RepoIndexerClient interface { - // Start index repository event - IndexRepo(ctx context.Context, in *IndexRepoRequest, opts ...grpc.CallOption) (*IndexRepoResponse, error) - // Get repository events - DescribeRepoEvents(ctx context.Context, in *DescribeRepoEventsRequest, opts ...grpc.CallOption) (*DescribeRepoEventsResponse, error) -} - -type repoIndexerClient struct { - cc *grpc.ClientConn -} - -func NewRepoIndexerClient(cc *grpc.ClientConn) RepoIndexerClient { - return &repoIndexerClient{cc} -} - -func (c *repoIndexerClient) IndexRepo(ctx context.Context, in *IndexRepoRequest, opts ...grpc.CallOption) (*IndexRepoResponse, error) { - out := new(IndexRepoResponse) - err := c.cc.Invoke(ctx, "/openpitrix.RepoIndexer/IndexRepo", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *repoIndexerClient) DescribeRepoEvents(ctx context.Context, in *DescribeRepoEventsRequest, opts ...grpc.CallOption) (*DescribeRepoEventsResponse, error) { - out := new(DescribeRepoEventsResponse) - err := c.cc.Invoke(ctx, "/openpitrix.RepoIndexer/DescribeRepoEvents", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// RepoIndexerServer is the server API for RepoIndexer service. -type RepoIndexerServer interface { - // Start index repository event - IndexRepo(context.Context, *IndexRepoRequest) (*IndexRepoResponse, error) - // Get repository events - DescribeRepoEvents(context.Context, *DescribeRepoEventsRequest) (*DescribeRepoEventsResponse, error) -} - -// UnimplementedRepoIndexerServer can be embedded to have forward compatible implementations. -type UnimplementedRepoIndexerServer struct { -} - -func (*UnimplementedRepoIndexerServer) IndexRepo(ctx context.Context, req *IndexRepoRequest) (*IndexRepoResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method IndexRepo not implemented") -} -func (*UnimplementedRepoIndexerServer) DescribeRepoEvents(ctx context.Context, req *DescribeRepoEventsRequest) (*DescribeRepoEventsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method DescribeRepoEvents not implemented") -} - -func RegisterRepoIndexerServer(s *grpc.Server, srv RepoIndexerServer) { - s.RegisterService(&_RepoIndexer_serviceDesc, srv) -} - -func _RepoIndexer_IndexRepo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(IndexRepoRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(RepoIndexerServer).IndexRepo(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/openpitrix.RepoIndexer/IndexRepo", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(RepoIndexerServer).IndexRepo(ctx, req.(*IndexRepoRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _RepoIndexer_DescribeRepoEvents_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DescribeRepoEventsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(RepoIndexerServer).DescribeRepoEvents(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/openpitrix.RepoIndexer/DescribeRepoEvents", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(RepoIndexerServer).DescribeRepoEvents(ctx, req.(*DescribeRepoEventsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _RepoIndexer_serviceDesc = grpc.ServiceDesc{ - ServiceName: "openpitrix.RepoIndexer", - HandlerType: (*RepoIndexerServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "IndexRepo", - Handler: _RepoIndexer_IndexRepo_Handler, - }, - { - MethodName: "DescribeRepoEvents", - Handler: _RepoIndexer_DescribeRepoEvents_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "repo_indexer.proto", -} diff --git a/vendor/openpitrix.io/openpitrix/pkg/pb/repo_indexer.pb.gw.go b/vendor/openpitrix.io/openpitrix/pkg/pb/repo_indexer.pb.gw.go deleted file mode 100644 index f151082c30..0000000000 --- a/vendor/openpitrix.io/openpitrix/pkg/pb/repo_indexer.pb.gw.go +++ /dev/null @@ -1,240 +0,0 @@ -// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: repo_indexer.proto - -/* -Package pb is a reverse proxy. - -It translates gRPC into RESTful JSON APIs. -*/ -package pb - -import ( - "context" - "io" - "net/http" - - "github.com/golang/protobuf/descriptor" - "github.com/golang/protobuf/proto" - "github.com/grpc-ecosystem/grpc-gateway/runtime" - "github.com/grpc-ecosystem/grpc-gateway/utilities" - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/grpclog" - "google.golang.org/grpc/status" -) - -// Suppress "imported and not used" errors -var _ codes.Code -var _ io.Reader -var _ status.Status -var _ = runtime.String -var _ = utilities.NewDoubleArray -var _ = descriptor.ForMessage - -func request_RepoIndexer_IndexRepo_0(ctx context.Context, marshaler runtime.Marshaler, client RepoIndexerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq IndexRepoRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.IndexRepo(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_RepoIndexer_IndexRepo_0(ctx context.Context, marshaler runtime.Marshaler, server RepoIndexerServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq IndexRepoRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.IndexRepo(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_RepoIndexer_DescribeRepoEvents_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_RepoIndexer_DescribeRepoEvents_0(ctx context.Context, marshaler runtime.Marshaler, client RepoIndexerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq DescribeRepoEventsRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_RepoIndexer_DescribeRepoEvents_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.DescribeRepoEvents(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_RepoIndexer_DescribeRepoEvents_0(ctx context.Context, marshaler runtime.Marshaler, server RepoIndexerServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq DescribeRepoEventsRequest - var metadata runtime.ServerMetadata - - if err := runtime.PopulateQueryParameters(&protoReq, req.URL.Query(), filter_RepoIndexer_DescribeRepoEvents_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.DescribeRepoEvents(ctx, &protoReq) - return msg, metadata, err - -} - -// RegisterRepoIndexerHandlerServer registers the http handlers for service RepoIndexer to "mux". -// UnaryRPC :call RepoIndexerServer directly. -// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. -func RegisterRepoIndexerHandlerServer(ctx context.Context, mux *runtime.ServeMux, server RepoIndexerServer) error { - - mux.Handle("POST", pattern_RepoIndexer_IndexRepo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_RepoIndexer_IndexRepo_0(rctx, inboundMarshaler, server, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_RepoIndexer_IndexRepo_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_RepoIndexer_DescribeRepoEvents_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_RepoIndexer_DescribeRepoEvents_0(rctx, inboundMarshaler, server, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_RepoIndexer_DescribeRepoEvents_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -// RegisterRepoIndexerHandlerFromEndpoint is same as RegisterRepoIndexerHandler but -// automatically dials to "endpoint" and closes the connection when "ctx" gets done. -func RegisterRepoIndexerHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { - conn, err := grpc.Dial(endpoint, opts...) - if err != nil { - return err - } - defer func() { - if err != nil { - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - return - } - go func() { - <-ctx.Done() - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - }() - }() - - return RegisterRepoIndexerHandler(ctx, mux, conn) -} - -// RegisterRepoIndexerHandler registers the http handlers for service RepoIndexer to "mux". -// The handlers forward requests to the grpc endpoint over "conn". -func RegisterRepoIndexerHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { - return RegisterRepoIndexerHandlerClient(ctx, mux, NewRepoIndexerClient(conn)) -} - -// RegisterRepoIndexerHandlerClient registers the http handlers for service RepoIndexer -// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "RepoIndexerClient". -// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "RepoIndexerClient" -// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in -// "RepoIndexerClient" to call the correct interceptors. -func RegisterRepoIndexerHandlerClient(ctx context.Context, mux *runtime.ServeMux, client RepoIndexerClient) error { - - mux.Handle("POST", pattern_RepoIndexer_IndexRepo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_RepoIndexer_IndexRepo_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_RepoIndexer_IndexRepo_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_RepoIndexer_DescribeRepoEvents_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_RepoIndexer_DescribeRepoEvents_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_RepoIndexer_DescribeRepoEvents_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -var ( - pattern_RepoIndexer_IndexRepo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "repos", "index"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_RepoIndexer_DescribeRepoEvents_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "repo_events"}, "", runtime.AssumeColonVerbOpt(true))) -) - -var ( - forward_RepoIndexer_IndexRepo_0 = runtime.ForwardResponseMessage - - forward_RepoIndexer_DescribeRepoEvents_0 = runtime.ForwardResponseMessage -) diff --git a/vendor/openpitrix.io/openpitrix/pkg/pb/runtime.pb.go b/vendor/openpitrix.io/openpitrix/pkg/pb/runtime.pb.go deleted file mode 100644 index 43fb3de067..0000000000 --- a/vendor/openpitrix.io/openpitrix/pkg/pb/runtime.pb.go +++ /dev/null @@ -1,2490 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// source: runtime.proto - -package pb - -import ( - context "context" - fmt "fmt" - math "math" - - proto "github.com/golang/protobuf/proto" - timestamp "github.com/golang/protobuf/ptypes/timestamp" - wrappers "github.com/golang/protobuf/ptypes/wrappers" - _ "github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger/options" - _ "google.golang.org/genproto/googleapis/api/annotations" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" -) - -// 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 - -type RuntimeCredential struct { - // runtime credential id - RuntimeCredentialId *wrappers.StringValue `protobuf:"bytes,1,opt,name=runtime_credential_id,json=runtimeCredentialId,proto3" json:"runtime_credential_id,omitempty"` - // runtime credential name - Name *wrappers.StringValue `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - // runtime credential description - Description *wrappers.StringValue `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` - // runtime url eg.[http://www.qingyun.com] - RuntimeUrl *wrappers.StringValue `protobuf:"bytes,4,opt,name=runtime_url,json=runtimeUrl,proto3" json:"runtime_url,omitempty"` - // runtime credential content - RuntimeCredentialContent *wrappers.StringValue `protobuf:"bytes,5,opt,name=runtime_credential_content,json=runtimeCredentialContent,proto3" json:"runtime_credential_content,omitempty"` - // own path, concat string group_path:user_id - OwnerPath *wrappers.StringValue `protobuf:"bytes,6,opt,name=owner_path,json=ownerPath,proto3" json:"owner_path,omitempty"` - // runtime provider eg.[qingcloud|aliyun|aws|kubernetes] - Provider *wrappers.StringValue `protobuf:"bytes,7,opt,name=provider,proto3" json:"provider,omitempty"` - // runtime credential status eg.[active|deleted] - Status *wrappers.StringValue `protobuf:"bytes,8,opt,name=status,proto3" json:"status,omitempty"` - // the time when runtime credential create - CreateTime *timestamp.Timestamp `protobuf:"bytes,9,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty"` - // record status changed time - StatusTime *timestamp.Timestamp `protobuf:"bytes,10,opt,name=status_time,json=statusTime,proto3" json:"status_time,omitempty"` - // debug or not - Debug *wrappers.BoolValue `protobuf:"bytes,11,opt,name=debug,proto3" json:"debug,omitempty"` - // owner - Owner *wrappers.StringValue `protobuf:"bytes,12,opt,name=owner,proto3" json:"owner,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *RuntimeCredential) Reset() { *m = RuntimeCredential{} } -func (m *RuntimeCredential) String() string { return proto.CompactTextString(m) } -func (*RuntimeCredential) ProtoMessage() {} -func (*RuntimeCredential) Descriptor() ([]byte, []int) { - return fileDescriptor_86e2dd377c869464, []int{0} -} - -func (m *RuntimeCredential) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_RuntimeCredential.Unmarshal(m, b) -} -func (m *RuntimeCredential) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_RuntimeCredential.Marshal(b, m, deterministic) -} -func (m *RuntimeCredential) XXX_Merge(src proto.Message) { - xxx_messageInfo_RuntimeCredential.Merge(m, src) -} -func (m *RuntimeCredential) XXX_Size() int { - return xxx_messageInfo_RuntimeCredential.Size(m) -} -func (m *RuntimeCredential) XXX_DiscardUnknown() { - xxx_messageInfo_RuntimeCredential.DiscardUnknown(m) -} - -var xxx_messageInfo_RuntimeCredential proto.InternalMessageInfo - -func (m *RuntimeCredential) GetRuntimeCredentialId() *wrappers.StringValue { - if m != nil { - return m.RuntimeCredentialId - } - return nil -} - -func (m *RuntimeCredential) GetName() *wrappers.StringValue { - if m != nil { - return m.Name - } - return nil -} - -func (m *RuntimeCredential) GetDescription() *wrappers.StringValue { - if m != nil { - return m.Description - } - return nil -} - -func (m *RuntimeCredential) GetRuntimeUrl() *wrappers.StringValue { - if m != nil { - return m.RuntimeUrl - } - return nil -} - -func (m *RuntimeCredential) GetRuntimeCredentialContent() *wrappers.StringValue { - if m != nil { - return m.RuntimeCredentialContent - } - return nil -} - -func (m *RuntimeCredential) GetOwnerPath() *wrappers.StringValue { - if m != nil { - return m.OwnerPath - } - return nil -} - -func (m *RuntimeCredential) GetProvider() *wrappers.StringValue { - if m != nil { - return m.Provider - } - return nil -} - -func (m *RuntimeCredential) GetStatus() *wrappers.StringValue { - if m != nil { - return m.Status - } - return nil -} - -func (m *RuntimeCredential) GetCreateTime() *timestamp.Timestamp { - if m != nil { - return m.CreateTime - } - return nil -} - -func (m *RuntimeCredential) GetStatusTime() *timestamp.Timestamp { - if m != nil { - return m.StatusTime - } - return nil -} - -func (m *RuntimeCredential) GetDebug() *wrappers.BoolValue { - if m != nil { - return m.Debug - } - return nil -} - -func (m *RuntimeCredential) GetOwner() *wrappers.StringValue { - if m != nil { - return m.Owner - } - return nil -} - -type Runtime struct { - // runtime id - RuntimeId *wrappers.StringValue `protobuf:"bytes,1,opt,name=runtime_id,json=runtimeId,proto3" json:"runtime_id,omitempty"` - // runtime name,create by owner. - Name *wrappers.StringValue `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - // runtime description - Description *wrappers.StringValue `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` - // runtime provider.eg.[qingcloud|aliyun|aws|kubernetes] - Provider *wrappers.StringValue `protobuf:"bytes,4,opt,name=provider,proto3" json:"provider,omitempty"` - // runtime credential id - RuntimeCredentialId *wrappers.StringValue `protobuf:"bytes,5,opt,name=runtime_credential_id,json=runtimeCredentialId,proto3" json:"runtime_credential_id,omitempty"` - // runtime zone eg.[pek3a|pek3b|...] - Zone *wrappers.StringValue `protobuf:"bytes,6,opt,name=zone,proto3" json:"zone,omitempty"` - // owner path, concat string group_path:user_id - OwnerPath *wrappers.StringValue `protobuf:"bytes,7,opt,name=owner_path,json=ownerPath,proto3" json:"owner_path,omitempty"` - // status eg.[active|deleted] - Status *wrappers.StringValue `protobuf:"bytes,8,opt,name=status,proto3" json:"status,omitempty"` - // the time when runtime create - CreateTime *timestamp.Timestamp `protobuf:"bytes,9,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty"` - // record status changed time - StatusTime *timestamp.Timestamp `protobuf:"bytes,10,opt,name=status_time,json=statusTime,proto3" json:"status_time,omitempty"` - // debug or not - Debug *wrappers.BoolValue `protobuf:"bytes,11,opt,name=debug,proto3" json:"debug,omitempty"` - // owner - Owner *wrappers.StringValue `protobuf:"bytes,12,opt,name=owner,proto3" json:"owner,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Runtime) Reset() { *m = Runtime{} } -func (m *Runtime) String() string { return proto.CompactTextString(m) } -func (*Runtime) ProtoMessage() {} -func (*Runtime) Descriptor() ([]byte, []int) { - return fileDescriptor_86e2dd377c869464, []int{1} -} - -func (m *Runtime) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Runtime.Unmarshal(m, b) -} -func (m *Runtime) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Runtime.Marshal(b, m, deterministic) -} -func (m *Runtime) XXX_Merge(src proto.Message) { - xxx_messageInfo_Runtime.Merge(m, src) -} -func (m *Runtime) XXX_Size() int { - return xxx_messageInfo_Runtime.Size(m) -} -func (m *Runtime) XXX_DiscardUnknown() { - xxx_messageInfo_Runtime.DiscardUnknown(m) -} - -var xxx_messageInfo_Runtime proto.InternalMessageInfo - -func (m *Runtime) GetRuntimeId() *wrappers.StringValue { - if m != nil { - return m.RuntimeId - } - return nil -} - -func (m *Runtime) GetName() *wrappers.StringValue { - if m != nil { - return m.Name - } - return nil -} - -func (m *Runtime) GetDescription() *wrappers.StringValue { - if m != nil { - return m.Description - } - return nil -} - -func (m *Runtime) GetProvider() *wrappers.StringValue { - if m != nil { - return m.Provider - } - return nil -} - -func (m *Runtime) GetRuntimeCredentialId() *wrappers.StringValue { - if m != nil { - return m.RuntimeCredentialId - } - return nil -} - -func (m *Runtime) GetZone() *wrappers.StringValue { - if m != nil { - return m.Zone - } - return nil -} - -func (m *Runtime) GetOwnerPath() *wrappers.StringValue { - if m != nil { - return m.OwnerPath - } - return nil -} - -func (m *Runtime) GetStatus() *wrappers.StringValue { - if m != nil { - return m.Status - } - return nil -} - -func (m *Runtime) GetCreateTime() *timestamp.Timestamp { - if m != nil { - return m.CreateTime - } - return nil -} - -func (m *Runtime) GetStatusTime() *timestamp.Timestamp { - if m != nil { - return m.StatusTime - } - return nil -} - -func (m *Runtime) GetDebug() *wrappers.BoolValue { - if m != nil { - return m.Debug - } - return nil -} - -func (m *Runtime) GetOwner() *wrappers.StringValue { - if m != nil { - return m.Owner - } - return nil -} - -type RuntimeDetail struct { - // runtime - Runtime *Runtime `protobuf:"bytes,1,opt,name=runtime,proto3" json:"runtime,omitempty"` - // runtime credential - RuntimeCredential *RuntimeCredential `protobuf:"bytes,2,opt,name=runtime_credential,json=runtimeCredential,proto3" json:"runtime_credential,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *RuntimeDetail) Reset() { *m = RuntimeDetail{} } -func (m *RuntimeDetail) String() string { return proto.CompactTextString(m) } -func (*RuntimeDetail) ProtoMessage() {} -func (*RuntimeDetail) Descriptor() ([]byte, []int) { - return fileDescriptor_86e2dd377c869464, []int{2} -} - -func (m *RuntimeDetail) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_RuntimeDetail.Unmarshal(m, b) -} -func (m *RuntimeDetail) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_RuntimeDetail.Marshal(b, m, deterministic) -} -func (m *RuntimeDetail) XXX_Merge(src proto.Message) { - xxx_messageInfo_RuntimeDetail.Merge(m, src) -} -func (m *RuntimeDetail) XXX_Size() int { - return xxx_messageInfo_RuntimeDetail.Size(m) -} -func (m *RuntimeDetail) XXX_DiscardUnknown() { - xxx_messageInfo_RuntimeDetail.DiscardUnknown(m) -} - -var xxx_messageInfo_RuntimeDetail proto.InternalMessageInfo - -func (m *RuntimeDetail) GetRuntime() *Runtime { - if m != nil { - return m.Runtime - } - return nil -} - -func (m *RuntimeDetail) GetRuntimeCredential() *RuntimeCredential { - if m != nil { - return m.RuntimeCredential - } - return nil -} - -type CreateRuntimeRequest struct { - // required, runtime name - Name *wrappers.StringValue `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - // runtime description - Description *wrappers.StringValue `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` - // required, runtime provider eg.[qingcloud|aliyun|aws|kubernetes] - Provider *wrappers.StringValue `protobuf:"bytes,3,opt,name=provider,proto3" json:"provider,omitempty"` - // required, runtime credential id - RuntimeCredentialId *wrappers.StringValue `protobuf:"bytes,4,opt,name=runtime_credential_id,json=runtimeCredentialId,proto3" json:"runtime_credential_id,omitempty"` - // required, runtime zone eg.[pek3a|pek3b|...] - Zone *wrappers.StringValue `protobuf:"bytes,5,opt,name=zone,proto3" json:"zone,omitempty"` - // for kubesphere only, if provider this value means upsert this record - RuntimeId *wrappers.StringValue `protobuf:"bytes,10,opt,name=runtime_id,json=runtimeId,proto3" json:"runtime_id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *CreateRuntimeRequest) Reset() { *m = CreateRuntimeRequest{} } -func (m *CreateRuntimeRequest) String() string { return proto.CompactTextString(m) } -func (*CreateRuntimeRequest) ProtoMessage() {} -func (*CreateRuntimeRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_86e2dd377c869464, []int{3} -} - -func (m *CreateRuntimeRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_CreateRuntimeRequest.Unmarshal(m, b) -} -func (m *CreateRuntimeRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_CreateRuntimeRequest.Marshal(b, m, deterministic) -} -func (m *CreateRuntimeRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_CreateRuntimeRequest.Merge(m, src) -} -func (m *CreateRuntimeRequest) XXX_Size() int { - return xxx_messageInfo_CreateRuntimeRequest.Size(m) -} -func (m *CreateRuntimeRequest) XXX_DiscardUnknown() { - xxx_messageInfo_CreateRuntimeRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_CreateRuntimeRequest proto.InternalMessageInfo - -func (m *CreateRuntimeRequest) GetName() *wrappers.StringValue { - if m != nil { - return m.Name - } - return nil -} - -func (m *CreateRuntimeRequest) GetDescription() *wrappers.StringValue { - if m != nil { - return m.Description - } - return nil -} - -func (m *CreateRuntimeRequest) GetProvider() *wrappers.StringValue { - if m != nil { - return m.Provider - } - return nil -} - -func (m *CreateRuntimeRequest) GetRuntimeCredentialId() *wrappers.StringValue { - if m != nil { - return m.RuntimeCredentialId - } - return nil -} - -func (m *CreateRuntimeRequest) GetZone() *wrappers.StringValue { - if m != nil { - return m.Zone - } - return nil -} - -func (m *CreateRuntimeRequest) GetRuntimeId() *wrappers.StringValue { - if m != nil { - return m.RuntimeId - } - return nil -} - -type CreateRuntimeResponse struct { - // id of runtime created - RuntimeId *wrappers.StringValue `protobuf:"bytes,1,opt,name=runtime_id,json=runtimeId,proto3" json:"runtime_id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *CreateRuntimeResponse) Reset() { *m = CreateRuntimeResponse{} } -func (m *CreateRuntimeResponse) String() string { return proto.CompactTextString(m) } -func (*CreateRuntimeResponse) ProtoMessage() {} -func (*CreateRuntimeResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_86e2dd377c869464, []int{4} -} - -func (m *CreateRuntimeResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_CreateRuntimeResponse.Unmarshal(m, b) -} -func (m *CreateRuntimeResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_CreateRuntimeResponse.Marshal(b, m, deterministic) -} -func (m *CreateRuntimeResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_CreateRuntimeResponse.Merge(m, src) -} -func (m *CreateRuntimeResponse) XXX_Size() int { - return xxx_messageInfo_CreateRuntimeResponse.Size(m) -} -func (m *CreateRuntimeResponse) XXX_DiscardUnknown() { - xxx_messageInfo_CreateRuntimeResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_CreateRuntimeResponse proto.InternalMessageInfo - -func (m *CreateRuntimeResponse) GetRuntimeId() *wrappers.StringValue { - if m != nil { - return m.RuntimeId - } - return nil -} - -type DescribeRuntimesRequest struct { - // query key, support these fields(runtime_id, provider, zone, status, owner) - SearchWord *wrappers.StringValue `protobuf:"bytes,1,opt,name=search_word,json=searchWord,proto3" json:"search_word,omitempty"` - // sort key, order by sort_key, default create_time - SortKey *wrappers.StringValue `protobuf:"bytes,2,opt,name=sort_key,json=sortKey,proto3" json:"sort_key,omitempty"` - // value = 0 sort ASC, value = 1 sort DESC - Reverse *wrappers.BoolValue `protobuf:"bytes,3,opt,name=reverse,proto3" json:"reverse,omitempty"` - // data limit per page, default value 20, max value 200 - Limit uint32 `protobuf:"varint,4,opt,name=limit,proto3" json:"limit,omitempty"` - // data offset, default 0 - Offset uint32 `protobuf:"varint,5,opt,name=offset,proto3" json:"offset,omitempty"` - // select columns to display - DisplayColumns []string `protobuf:"bytes,6,rep,name=display_columns,json=displayColumns,proto3" json:"display_columns,omitempty"` - // runtime ids - RuntimeId []string `protobuf:"bytes,11,rep,name=runtime_id,json=runtimeId,proto3" json:"runtime_id,omitempty"` - // status eg.[active|deleted] - Status []string `protobuf:"bytes,12,rep,name=status,proto3" json:"status,omitempty"` - // runtime provider eg.[qingcloud|aliyun|aws|kubernetes] - Provider []string `protobuf:"bytes,13,rep,name=provider,proto3" json:"provider,omitempty"` - // owner - Owner []string `protobuf:"bytes,14,rep,name=owner,proto3" json:"owner,omitempty"` - // runtime credential id - RuntimeCredentialId []string `protobuf:"bytes,15,rep,name=runtime_credential_id,json=runtimeCredentialId,proto3" json:"runtime_credential_id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *DescribeRuntimesRequest) Reset() { *m = DescribeRuntimesRequest{} } -func (m *DescribeRuntimesRequest) String() string { return proto.CompactTextString(m) } -func (*DescribeRuntimesRequest) ProtoMessage() {} -func (*DescribeRuntimesRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_86e2dd377c869464, []int{5} -} - -func (m *DescribeRuntimesRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_DescribeRuntimesRequest.Unmarshal(m, b) -} -func (m *DescribeRuntimesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_DescribeRuntimesRequest.Marshal(b, m, deterministic) -} -func (m *DescribeRuntimesRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_DescribeRuntimesRequest.Merge(m, src) -} -func (m *DescribeRuntimesRequest) XXX_Size() int { - return xxx_messageInfo_DescribeRuntimesRequest.Size(m) -} -func (m *DescribeRuntimesRequest) XXX_DiscardUnknown() { - xxx_messageInfo_DescribeRuntimesRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_DescribeRuntimesRequest proto.InternalMessageInfo - -func (m *DescribeRuntimesRequest) GetSearchWord() *wrappers.StringValue { - if m != nil { - return m.SearchWord - } - return nil -} - -func (m *DescribeRuntimesRequest) GetSortKey() *wrappers.StringValue { - if m != nil { - return m.SortKey - } - return nil -} - -func (m *DescribeRuntimesRequest) GetReverse() *wrappers.BoolValue { - if m != nil { - return m.Reverse - } - return nil -} - -func (m *DescribeRuntimesRequest) GetLimit() uint32 { - if m != nil { - return m.Limit - } - return 0 -} - -func (m *DescribeRuntimesRequest) GetOffset() uint32 { - if m != nil { - return m.Offset - } - return 0 -} - -func (m *DescribeRuntimesRequest) GetDisplayColumns() []string { - if m != nil { - return m.DisplayColumns - } - return nil -} - -func (m *DescribeRuntimesRequest) GetRuntimeId() []string { - if m != nil { - return m.RuntimeId - } - return nil -} - -func (m *DescribeRuntimesRequest) GetStatus() []string { - if m != nil { - return m.Status - } - return nil -} - -func (m *DescribeRuntimesRequest) GetProvider() []string { - if m != nil { - return m.Provider - } - return nil -} - -func (m *DescribeRuntimesRequest) GetOwner() []string { - if m != nil { - return m.Owner - } - return nil -} - -func (m *DescribeRuntimesRequest) GetRuntimeCredentialId() []string { - if m != nil { - return m.RuntimeCredentialId - } - return nil -} - -type DescribeRuntimesResponse struct { - // total count of runtime - TotalCount uint32 `protobuf:"varint,1,opt,name=total_count,json=totalCount,proto3" json:"total_count,omitempty"` - // list of runtime - RuntimeSet []*Runtime `protobuf:"bytes,2,rep,name=runtime_set,json=runtimeSet,proto3" json:"runtime_set,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *DescribeRuntimesResponse) Reset() { *m = DescribeRuntimesResponse{} } -func (m *DescribeRuntimesResponse) String() string { return proto.CompactTextString(m) } -func (*DescribeRuntimesResponse) ProtoMessage() {} -func (*DescribeRuntimesResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_86e2dd377c869464, []int{6} -} - -func (m *DescribeRuntimesResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_DescribeRuntimesResponse.Unmarshal(m, b) -} -func (m *DescribeRuntimesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_DescribeRuntimesResponse.Marshal(b, m, deterministic) -} -func (m *DescribeRuntimesResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_DescribeRuntimesResponse.Merge(m, src) -} -func (m *DescribeRuntimesResponse) XXX_Size() int { - return xxx_messageInfo_DescribeRuntimesResponse.Size(m) -} -func (m *DescribeRuntimesResponse) XXX_DiscardUnknown() { - xxx_messageInfo_DescribeRuntimesResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_DescribeRuntimesResponse proto.InternalMessageInfo - -func (m *DescribeRuntimesResponse) GetTotalCount() uint32 { - if m != nil { - return m.TotalCount - } - return 0 -} - -func (m *DescribeRuntimesResponse) GetRuntimeSet() []*Runtime { - if m != nil { - return m.RuntimeSet - } - return nil -} - -type DescribeRuntimeDetailsResponse struct { - // total count of runtime - TotalCount uint32 `protobuf:"varint,1,opt,name=total_count,json=totalCount,proto3" json:"total_count,omitempty"` - // list of runtime detail info - RuntimeDetailSet []*RuntimeDetail `protobuf:"bytes,2,rep,name=runtime_detail_set,json=runtimeDetailSet,proto3" json:"runtime_detail_set,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *DescribeRuntimeDetailsResponse) Reset() { *m = DescribeRuntimeDetailsResponse{} } -func (m *DescribeRuntimeDetailsResponse) String() string { return proto.CompactTextString(m) } -func (*DescribeRuntimeDetailsResponse) ProtoMessage() {} -func (*DescribeRuntimeDetailsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_86e2dd377c869464, []int{7} -} - -func (m *DescribeRuntimeDetailsResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_DescribeRuntimeDetailsResponse.Unmarshal(m, b) -} -func (m *DescribeRuntimeDetailsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_DescribeRuntimeDetailsResponse.Marshal(b, m, deterministic) -} -func (m *DescribeRuntimeDetailsResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_DescribeRuntimeDetailsResponse.Merge(m, src) -} -func (m *DescribeRuntimeDetailsResponse) XXX_Size() int { - return xxx_messageInfo_DescribeRuntimeDetailsResponse.Size(m) -} -func (m *DescribeRuntimeDetailsResponse) XXX_DiscardUnknown() { - xxx_messageInfo_DescribeRuntimeDetailsResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_DescribeRuntimeDetailsResponse proto.InternalMessageInfo - -func (m *DescribeRuntimeDetailsResponse) GetTotalCount() uint32 { - if m != nil { - return m.TotalCount - } - return 0 -} - -func (m *DescribeRuntimeDetailsResponse) GetRuntimeDetailSet() []*RuntimeDetail { - if m != nil { - return m.RuntimeDetailSet - } - return nil -} - -type ModifyRuntimeRequest struct { - // required, id of runtime to modify - RuntimeId *wrappers.StringValue `protobuf:"bytes,1,opt,name=runtime_id,json=runtimeId,proto3" json:"runtime_id,omitempty"` - // runtime name - Name *wrappers.StringValue `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - // runtime description - Description *wrappers.StringValue `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` - // runtime credential id - RuntimeCredentialId *wrappers.StringValue `protobuf:"bytes,4,opt,name=runtime_credential_id,json=runtimeCredentialId,proto3" json:"runtime_credential_id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ModifyRuntimeRequest) Reset() { *m = ModifyRuntimeRequest{} } -func (m *ModifyRuntimeRequest) String() string { return proto.CompactTextString(m) } -func (*ModifyRuntimeRequest) ProtoMessage() {} -func (*ModifyRuntimeRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_86e2dd377c869464, []int{8} -} - -func (m *ModifyRuntimeRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ModifyRuntimeRequest.Unmarshal(m, b) -} -func (m *ModifyRuntimeRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ModifyRuntimeRequest.Marshal(b, m, deterministic) -} -func (m *ModifyRuntimeRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_ModifyRuntimeRequest.Merge(m, src) -} -func (m *ModifyRuntimeRequest) XXX_Size() int { - return xxx_messageInfo_ModifyRuntimeRequest.Size(m) -} -func (m *ModifyRuntimeRequest) XXX_DiscardUnknown() { - xxx_messageInfo_ModifyRuntimeRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_ModifyRuntimeRequest proto.InternalMessageInfo - -func (m *ModifyRuntimeRequest) GetRuntimeId() *wrappers.StringValue { - if m != nil { - return m.RuntimeId - } - return nil -} - -func (m *ModifyRuntimeRequest) GetName() *wrappers.StringValue { - if m != nil { - return m.Name - } - return nil -} - -func (m *ModifyRuntimeRequest) GetDescription() *wrappers.StringValue { - if m != nil { - return m.Description - } - return nil -} - -func (m *ModifyRuntimeRequest) GetRuntimeCredentialId() *wrappers.StringValue { - if m != nil { - return m.RuntimeCredentialId - } - return nil -} - -type ModifyRuntimeResponse struct { - // id of runtime modified - RuntimeId *wrappers.StringValue `protobuf:"bytes,1,opt,name=runtime_id,json=runtimeId,proto3" json:"runtime_id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ModifyRuntimeResponse) Reset() { *m = ModifyRuntimeResponse{} } -func (m *ModifyRuntimeResponse) String() string { return proto.CompactTextString(m) } -func (*ModifyRuntimeResponse) ProtoMessage() {} -func (*ModifyRuntimeResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_86e2dd377c869464, []int{9} -} - -func (m *ModifyRuntimeResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ModifyRuntimeResponse.Unmarshal(m, b) -} -func (m *ModifyRuntimeResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ModifyRuntimeResponse.Marshal(b, m, deterministic) -} -func (m *ModifyRuntimeResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_ModifyRuntimeResponse.Merge(m, src) -} -func (m *ModifyRuntimeResponse) XXX_Size() int { - return xxx_messageInfo_ModifyRuntimeResponse.Size(m) -} -func (m *ModifyRuntimeResponse) XXX_DiscardUnknown() { - xxx_messageInfo_ModifyRuntimeResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_ModifyRuntimeResponse proto.InternalMessageInfo - -func (m *ModifyRuntimeResponse) GetRuntimeId() *wrappers.StringValue { - if m != nil { - return m.RuntimeId - } - return nil -} - -type DeleteRuntimesRequest struct { - // required, ids of runtime to delete - RuntimeId []string `protobuf:"bytes,1,rep,name=runtime_id,json=runtimeId,proto3" json:"runtime_id,omitempty"` - // whether force delete runtime or not - Force *wrappers.BoolValue `protobuf:"bytes,2,opt,name=force,proto3" json:"force,omitempty"` - // timeout(s), when delete runtime - GracePeriod uint32 `protobuf:"varint,3,opt,name=grace_period,json=gracePeriod,proto3" json:"grace_period,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *DeleteRuntimesRequest) Reset() { *m = DeleteRuntimesRequest{} } -func (m *DeleteRuntimesRequest) String() string { return proto.CompactTextString(m) } -func (*DeleteRuntimesRequest) ProtoMessage() {} -func (*DeleteRuntimesRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_86e2dd377c869464, []int{10} -} - -func (m *DeleteRuntimesRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_DeleteRuntimesRequest.Unmarshal(m, b) -} -func (m *DeleteRuntimesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_DeleteRuntimesRequest.Marshal(b, m, deterministic) -} -func (m *DeleteRuntimesRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_DeleteRuntimesRequest.Merge(m, src) -} -func (m *DeleteRuntimesRequest) XXX_Size() int { - return xxx_messageInfo_DeleteRuntimesRequest.Size(m) -} -func (m *DeleteRuntimesRequest) XXX_DiscardUnknown() { - xxx_messageInfo_DeleteRuntimesRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_DeleteRuntimesRequest proto.InternalMessageInfo - -func (m *DeleteRuntimesRequest) GetRuntimeId() []string { - if m != nil { - return m.RuntimeId - } - return nil -} - -func (m *DeleteRuntimesRequest) GetForce() *wrappers.BoolValue { - if m != nil { - return m.Force - } - return nil -} - -func (m *DeleteRuntimesRequest) GetGracePeriod() uint32 { - if m != nil { - return m.GracePeriod - } - return 0 -} - -type DeleteRuntimesResponse struct { - // ids of runtime deleted - RuntimeId []string `protobuf:"bytes,1,rep,name=runtime_id,json=runtimeId,proto3" json:"runtime_id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *DeleteRuntimesResponse) Reset() { *m = DeleteRuntimesResponse{} } -func (m *DeleteRuntimesResponse) String() string { return proto.CompactTextString(m) } -func (*DeleteRuntimesResponse) ProtoMessage() {} -func (*DeleteRuntimesResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_86e2dd377c869464, []int{11} -} - -func (m *DeleteRuntimesResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_DeleteRuntimesResponse.Unmarshal(m, b) -} -func (m *DeleteRuntimesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_DeleteRuntimesResponse.Marshal(b, m, deterministic) -} -func (m *DeleteRuntimesResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_DeleteRuntimesResponse.Merge(m, src) -} -func (m *DeleteRuntimesResponse) XXX_Size() int { - return xxx_messageInfo_DeleteRuntimesResponse.Size(m) -} -func (m *DeleteRuntimesResponse) XXX_DiscardUnknown() { - xxx_messageInfo_DeleteRuntimesResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_DeleteRuntimesResponse proto.InternalMessageInfo - -func (m *DeleteRuntimesResponse) GetRuntimeId() []string { - if m != nil { - return m.RuntimeId - } - return nil -} - -type CreateRuntimeCredentialRequest struct { - // required, runtime url - RuntimeUrl *wrappers.StringValue `protobuf:"bytes,1,opt,name=runtime_url,json=runtimeUrl,proto3" json:"runtime_url,omitempty"` - // required, runtime credential content, a json file - RuntimeCredentialContent *wrappers.StringValue `protobuf:"bytes,2,opt,name=runtime_credential_content,json=runtimeCredentialContent,proto3" json:"runtime_credential_content,omitempty"` - // required, runtime provider eg.[qingcloud|aliyun|aws|kubernetes] - Provider *wrappers.StringValue `protobuf:"bytes,3,opt,name=provider,proto3" json:"provider,omitempty"` - // runtime credential name - Name *wrappers.StringValue `protobuf:"bytes,4,opt,name=name,proto3" json:"name,omitempty"` - // runtime credential description - Description *wrappers.StringValue `protobuf:"bytes,5,opt,name=description,proto3" json:"description,omitempty"` - // for kubesphere only, if provider this value means upsert this record - RuntimeCredentialId *wrappers.StringValue `protobuf:"bytes,10,opt,name=runtime_credential_id,json=runtimeCredentialId,proto3" json:"runtime_credential_id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *CreateRuntimeCredentialRequest) Reset() { *m = CreateRuntimeCredentialRequest{} } -func (m *CreateRuntimeCredentialRequest) String() string { return proto.CompactTextString(m) } -func (*CreateRuntimeCredentialRequest) ProtoMessage() {} -func (*CreateRuntimeCredentialRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_86e2dd377c869464, []int{12} -} - -func (m *CreateRuntimeCredentialRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_CreateRuntimeCredentialRequest.Unmarshal(m, b) -} -func (m *CreateRuntimeCredentialRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_CreateRuntimeCredentialRequest.Marshal(b, m, deterministic) -} -func (m *CreateRuntimeCredentialRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_CreateRuntimeCredentialRequest.Merge(m, src) -} -func (m *CreateRuntimeCredentialRequest) XXX_Size() int { - return xxx_messageInfo_CreateRuntimeCredentialRequest.Size(m) -} -func (m *CreateRuntimeCredentialRequest) XXX_DiscardUnknown() { - xxx_messageInfo_CreateRuntimeCredentialRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_CreateRuntimeCredentialRequest proto.InternalMessageInfo - -func (m *CreateRuntimeCredentialRequest) GetRuntimeUrl() *wrappers.StringValue { - if m != nil { - return m.RuntimeUrl - } - return nil -} - -func (m *CreateRuntimeCredentialRequest) GetRuntimeCredentialContent() *wrappers.StringValue { - if m != nil { - return m.RuntimeCredentialContent - } - return nil -} - -func (m *CreateRuntimeCredentialRequest) GetProvider() *wrappers.StringValue { - if m != nil { - return m.Provider - } - return nil -} - -func (m *CreateRuntimeCredentialRequest) GetName() *wrappers.StringValue { - if m != nil { - return m.Name - } - return nil -} - -func (m *CreateRuntimeCredentialRequest) GetDescription() *wrappers.StringValue { - if m != nil { - return m.Description - } - return nil -} - -func (m *CreateRuntimeCredentialRequest) GetRuntimeCredentialId() *wrappers.StringValue { - if m != nil { - return m.RuntimeCredentialId - } - return nil -} - -type CreateRuntimeCredentialResponse struct { - // id of runtime credential created - RuntimeCredentialId *wrappers.StringValue `protobuf:"bytes,1,opt,name=runtime_credential_id,json=runtimeCredentialId,proto3" json:"runtime_credential_id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *CreateRuntimeCredentialResponse) Reset() { *m = CreateRuntimeCredentialResponse{} } -func (m *CreateRuntimeCredentialResponse) String() string { return proto.CompactTextString(m) } -func (*CreateRuntimeCredentialResponse) ProtoMessage() {} -func (*CreateRuntimeCredentialResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_86e2dd377c869464, []int{13} -} - -func (m *CreateRuntimeCredentialResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_CreateRuntimeCredentialResponse.Unmarshal(m, b) -} -func (m *CreateRuntimeCredentialResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_CreateRuntimeCredentialResponse.Marshal(b, m, deterministic) -} -func (m *CreateRuntimeCredentialResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_CreateRuntimeCredentialResponse.Merge(m, src) -} -func (m *CreateRuntimeCredentialResponse) XXX_Size() int { - return xxx_messageInfo_CreateRuntimeCredentialResponse.Size(m) -} -func (m *CreateRuntimeCredentialResponse) XXX_DiscardUnknown() { - xxx_messageInfo_CreateRuntimeCredentialResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_CreateRuntimeCredentialResponse proto.InternalMessageInfo - -func (m *CreateRuntimeCredentialResponse) GetRuntimeCredentialId() *wrappers.StringValue { - if m != nil { - return m.RuntimeCredentialId - } - return nil -} - -type ValidateRuntimeCredentialRequest struct { - // required, runtime url - RuntimeUrl *wrappers.StringValue `protobuf:"bytes,1,opt,name=runtime_url,json=runtimeUrl,proto3" json:"runtime_url,omitempty"` - // required, runtime url - RuntimeCredentialContent *wrappers.StringValue `protobuf:"bytes,2,opt,name=runtime_credential_content,json=runtimeCredentialContent,proto3" json:"runtime_credential_content,omitempty"` - // required, runtime provider eg.[qingcloud|aliyun|aws|kubernetes] - Provider *wrappers.StringValue `protobuf:"bytes,3,opt,name=provider,proto3" json:"provider,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ValidateRuntimeCredentialRequest) Reset() { *m = ValidateRuntimeCredentialRequest{} } -func (m *ValidateRuntimeCredentialRequest) String() string { return proto.CompactTextString(m) } -func (*ValidateRuntimeCredentialRequest) ProtoMessage() {} -func (*ValidateRuntimeCredentialRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_86e2dd377c869464, []int{14} -} - -func (m *ValidateRuntimeCredentialRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ValidateRuntimeCredentialRequest.Unmarshal(m, b) -} -func (m *ValidateRuntimeCredentialRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ValidateRuntimeCredentialRequest.Marshal(b, m, deterministic) -} -func (m *ValidateRuntimeCredentialRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_ValidateRuntimeCredentialRequest.Merge(m, src) -} -func (m *ValidateRuntimeCredentialRequest) XXX_Size() int { - return xxx_messageInfo_ValidateRuntimeCredentialRequest.Size(m) -} -func (m *ValidateRuntimeCredentialRequest) XXX_DiscardUnknown() { - xxx_messageInfo_ValidateRuntimeCredentialRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_ValidateRuntimeCredentialRequest proto.InternalMessageInfo - -func (m *ValidateRuntimeCredentialRequest) GetRuntimeUrl() *wrappers.StringValue { - if m != nil { - return m.RuntimeUrl - } - return nil -} - -func (m *ValidateRuntimeCredentialRequest) GetRuntimeCredentialContent() *wrappers.StringValue { - if m != nil { - return m.RuntimeCredentialContent - } - return nil -} - -func (m *ValidateRuntimeCredentialRequest) GetProvider() *wrappers.StringValue { - if m != nil { - return m.Provider - } - return nil -} - -type ValidateRuntimeCredentialResponse struct { - // validte ok or not - Ok *wrappers.BoolValue `protobuf:"bytes,1,opt,name=ok,proto3" json:"ok,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ValidateRuntimeCredentialResponse) Reset() { *m = ValidateRuntimeCredentialResponse{} } -func (m *ValidateRuntimeCredentialResponse) String() string { return proto.CompactTextString(m) } -func (*ValidateRuntimeCredentialResponse) ProtoMessage() {} -func (*ValidateRuntimeCredentialResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_86e2dd377c869464, []int{15} -} - -func (m *ValidateRuntimeCredentialResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ValidateRuntimeCredentialResponse.Unmarshal(m, b) -} -func (m *ValidateRuntimeCredentialResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ValidateRuntimeCredentialResponse.Marshal(b, m, deterministic) -} -func (m *ValidateRuntimeCredentialResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_ValidateRuntimeCredentialResponse.Merge(m, src) -} -func (m *ValidateRuntimeCredentialResponse) XXX_Size() int { - return xxx_messageInfo_ValidateRuntimeCredentialResponse.Size(m) -} -func (m *ValidateRuntimeCredentialResponse) XXX_DiscardUnknown() { - xxx_messageInfo_ValidateRuntimeCredentialResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_ValidateRuntimeCredentialResponse proto.InternalMessageInfo - -func (m *ValidateRuntimeCredentialResponse) GetOk() *wrappers.BoolValue { - if m != nil { - return m.Ok - } - return nil -} - -type DescribeRuntimeCredentialsRequest struct { - // query key - SearchWord *wrappers.StringValue `protobuf:"bytes,1,opt,name=search_word,json=searchWord,proto3" json:"search_word,omitempty"` - // sort key, order by sort_key, default create_time - SortKey *wrappers.StringValue `protobuf:"bytes,2,opt,name=sort_key,json=sortKey,proto3" json:"sort_key,omitempty"` - // value = 0 sort ASC, value = 1 sort DESC - Reverse *wrappers.BoolValue `protobuf:"bytes,3,opt,name=reverse,proto3" json:"reverse,omitempty"` - // data limit per page, default value 20, max value 200 - Limit uint32 `protobuf:"varint,4,opt,name=limit,proto3" json:"limit,omitempty"` - // data offset, default 0 - Offset uint32 `protobuf:"varint,5,opt,name=offset,proto3" json:"offset,omitempty"` - // select columns to display - DisplayColumns []string `protobuf:"bytes,6,rep,name=display_columns,json=displayColumns,proto3" json:"display_columns,omitempty"` - // runtime credential ids - RuntimeCredentialId []string `protobuf:"bytes,11,rep,name=runtime_credential_id,json=runtimeCredentialId,proto3" json:"runtime_credential_id,omitempty"` - // status eg.[active|deleted] - Status []string `protobuf:"bytes,12,rep,name=status,proto3" json:"status,omitempty"` - // runtime provider eg.[qingcloud|aliyun|aws|kubernetes] - Provider []string `protobuf:"bytes,13,rep,name=provider,proto3" json:"provider,omitempty"` - // owner - Owner []string `protobuf:"bytes,14,rep,name=owner,proto3" json:"owner,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *DescribeRuntimeCredentialsRequest) Reset() { *m = DescribeRuntimeCredentialsRequest{} } -func (m *DescribeRuntimeCredentialsRequest) String() string { return proto.CompactTextString(m) } -func (*DescribeRuntimeCredentialsRequest) ProtoMessage() {} -func (*DescribeRuntimeCredentialsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_86e2dd377c869464, []int{16} -} - -func (m *DescribeRuntimeCredentialsRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_DescribeRuntimeCredentialsRequest.Unmarshal(m, b) -} -func (m *DescribeRuntimeCredentialsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_DescribeRuntimeCredentialsRequest.Marshal(b, m, deterministic) -} -func (m *DescribeRuntimeCredentialsRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_DescribeRuntimeCredentialsRequest.Merge(m, src) -} -func (m *DescribeRuntimeCredentialsRequest) XXX_Size() int { - return xxx_messageInfo_DescribeRuntimeCredentialsRequest.Size(m) -} -func (m *DescribeRuntimeCredentialsRequest) XXX_DiscardUnknown() { - xxx_messageInfo_DescribeRuntimeCredentialsRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_DescribeRuntimeCredentialsRequest proto.InternalMessageInfo - -func (m *DescribeRuntimeCredentialsRequest) GetSearchWord() *wrappers.StringValue { - if m != nil { - return m.SearchWord - } - return nil -} - -func (m *DescribeRuntimeCredentialsRequest) GetSortKey() *wrappers.StringValue { - if m != nil { - return m.SortKey - } - return nil -} - -func (m *DescribeRuntimeCredentialsRequest) GetReverse() *wrappers.BoolValue { - if m != nil { - return m.Reverse - } - return nil -} - -func (m *DescribeRuntimeCredentialsRequest) GetLimit() uint32 { - if m != nil { - return m.Limit - } - return 0 -} - -func (m *DescribeRuntimeCredentialsRequest) GetOffset() uint32 { - if m != nil { - return m.Offset - } - return 0 -} - -func (m *DescribeRuntimeCredentialsRequest) GetDisplayColumns() []string { - if m != nil { - return m.DisplayColumns - } - return nil -} - -func (m *DescribeRuntimeCredentialsRequest) GetRuntimeCredentialId() []string { - if m != nil { - return m.RuntimeCredentialId - } - return nil -} - -func (m *DescribeRuntimeCredentialsRequest) GetStatus() []string { - if m != nil { - return m.Status - } - return nil -} - -func (m *DescribeRuntimeCredentialsRequest) GetProvider() []string { - if m != nil { - return m.Provider - } - return nil -} - -func (m *DescribeRuntimeCredentialsRequest) GetOwner() []string { - if m != nil { - return m.Owner - } - return nil -} - -type DescribeRuntimeCredentialsResponse struct { - // total count of runtime credential - TotalCount uint32 `protobuf:"varint,1,opt,name=total_count,json=totalCount,proto3" json:"total_count,omitempty"` - // list of runtime credential - RuntimeCredentialSet []*RuntimeCredential `protobuf:"bytes,2,rep,name=runtime_credential_set,json=runtimeCredentialSet,proto3" json:"runtime_credential_set,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *DescribeRuntimeCredentialsResponse) Reset() { *m = DescribeRuntimeCredentialsResponse{} } -func (m *DescribeRuntimeCredentialsResponse) String() string { return proto.CompactTextString(m) } -func (*DescribeRuntimeCredentialsResponse) ProtoMessage() {} -func (*DescribeRuntimeCredentialsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_86e2dd377c869464, []int{17} -} - -func (m *DescribeRuntimeCredentialsResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_DescribeRuntimeCredentialsResponse.Unmarshal(m, b) -} -func (m *DescribeRuntimeCredentialsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_DescribeRuntimeCredentialsResponse.Marshal(b, m, deterministic) -} -func (m *DescribeRuntimeCredentialsResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_DescribeRuntimeCredentialsResponse.Merge(m, src) -} -func (m *DescribeRuntimeCredentialsResponse) XXX_Size() int { - return xxx_messageInfo_DescribeRuntimeCredentialsResponse.Size(m) -} -func (m *DescribeRuntimeCredentialsResponse) XXX_DiscardUnknown() { - xxx_messageInfo_DescribeRuntimeCredentialsResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_DescribeRuntimeCredentialsResponse proto.InternalMessageInfo - -func (m *DescribeRuntimeCredentialsResponse) GetTotalCount() uint32 { - if m != nil { - return m.TotalCount - } - return 0 -} - -func (m *DescribeRuntimeCredentialsResponse) GetRuntimeCredentialSet() []*RuntimeCredential { - if m != nil { - return m.RuntimeCredentialSet - } - return nil -} - -type ModifyRuntimeCredentialRequest struct { - // required, id of runtime credential to modify - RuntimeCredentialId *wrappers.StringValue `protobuf:"bytes,1,opt,name=runtime_credential_id,json=runtimeCredentialId,proto3" json:"runtime_credential_id,omitempty"` - // runtime credential name - Name *wrappers.StringValue `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - // runtime credential description - Description *wrappers.StringValue `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` - // runtime credential content, a json file - RuntimeCredentialContent *wrappers.StringValue `protobuf:"bytes,4,opt,name=runtime_credential_content,json=runtimeCredentialContent,proto3" json:"runtime_credential_content,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ModifyRuntimeCredentialRequest) Reset() { *m = ModifyRuntimeCredentialRequest{} } -func (m *ModifyRuntimeCredentialRequest) String() string { return proto.CompactTextString(m) } -func (*ModifyRuntimeCredentialRequest) ProtoMessage() {} -func (*ModifyRuntimeCredentialRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_86e2dd377c869464, []int{18} -} - -func (m *ModifyRuntimeCredentialRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ModifyRuntimeCredentialRequest.Unmarshal(m, b) -} -func (m *ModifyRuntimeCredentialRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ModifyRuntimeCredentialRequest.Marshal(b, m, deterministic) -} -func (m *ModifyRuntimeCredentialRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_ModifyRuntimeCredentialRequest.Merge(m, src) -} -func (m *ModifyRuntimeCredentialRequest) XXX_Size() int { - return xxx_messageInfo_ModifyRuntimeCredentialRequest.Size(m) -} -func (m *ModifyRuntimeCredentialRequest) XXX_DiscardUnknown() { - xxx_messageInfo_ModifyRuntimeCredentialRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_ModifyRuntimeCredentialRequest proto.InternalMessageInfo - -func (m *ModifyRuntimeCredentialRequest) GetRuntimeCredentialId() *wrappers.StringValue { - if m != nil { - return m.RuntimeCredentialId - } - return nil -} - -func (m *ModifyRuntimeCredentialRequest) GetName() *wrappers.StringValue { - if m != nil { - return m.Name - } - return nil -} - -func (m *ModifyRuntimeCredentialRequest) GetDescription() *wrappers.StringValue { - if m != nil { - return m.Description - } - return nil -} - -func (m *ModifyRuntimeCredentialRequest) GetRuntimeCredentialContent() *wrappers.StringValue { - if m != nil { - return m.RuntimeCredentialContent - } - return nil -} - -type ModifyRuntimeCredentialResponse struct { - // id of runtime credential modified - RuntimeCredentialId *wrappers.StringValue `protobuf:"bytes,1,opt,name=runtime_credential_id,json=runtimeCredentialId,proto3" json:"runtime_credential_id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ModifyRuntimeCredentialResponse) Reset() { *m = ModifyRuntimeCredentialResponse{} } -func (m *ModifyRuntimeCredentialResponse) String() string { return proto.CompactTextString(m) } -func (*ModifyRuntimeCredentialResponse) ProtoMessage() {} -func (*ModifyRuntimeCredentialResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_86e2dd377c869464, []int{19} -} - -func (m *ModifyRuntimeCredentialResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ModifyRuntimeCredentialResponse.Unmarshal(m, b) -} -func (m *ModifyRuntimeCredentialResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ModifyRuntimeCredentialResponse.Marshal(b, m, deterministic) -} -func (m *ModifyRuntimeCredentialResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_ModifyRuntimeCredentialResponse.Merge(m, src) -} -func (m *ModifyRuntimeCredentialResponse) XXX_Size() int { - return xxx_messageInfo_ModifyRuntimeCredentialResponse.Size(m) -} -func (m *ModifyRuntimeCredentialResponse) XXX_DiscardUnknown() { - xxx_messageInfo_ModifyRuntimeCredentialResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_ModifyRuntimeCredentialResponse proto.InternalMessageInfo - -func (m *ModifyRuntimeCredentialResponse) GetRuntimeCredentialId() *wrappers.StringValue { - if m != nil { - return m.RuntimeCredentialId - } - return nil -} - -type DeleteRuntimeCredentialsRequest struct { - // required, ids of runtime credential to delete - RuntimeCredentialId []string `protobuf:"bytes,1,rep,name=runtime_credential_id,json=runtimeCredentialId,proto3" json:"runtime_credential_id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *DeleteRuntimeCredentialsRequest) Reset() { *m = DeleteRuntimeCredentialsRequest{} } -func (m *DeleteRuntimeCredentialsRequest) String() string { return proto.CompactTextString(m) } -func (*DeleteRuntimeCredentialsRequest) ProtoMessage() {} -func (*DeleteRuntimeCredentialsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_86e2dd377c869464, []int{20} -} - -func (m *DeleteRuntimeCredentialsRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_DeleteRuntimeCredentialsRequest.Unmarshal(m, b) -} -func (m *DeleteRuntimeCredentialsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_DeleteRuntimeCredentialsRequest.Marshal(b, m, deterministic) -} -func (m *DeleteRuntimeCredentialsRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_DeleteRuntimeCredentialsRequest.Merge(m, src) -} -func (m *DeleteRuntimeCredentialsRequest) XXX_Size() int { - return xxx_messageInfo_DeleteRuntimeCredentialsRequest.Size(m) -} -func (m *DeleteRuntimeCredentialsRequest) XXX_DiscardUnknown() { - xxx_messageInfo_DeleteRuntimeCredentialsRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_DeleteRuntimeCredentialsRequest proto.InternalMessageInfo - -func (m *DeleteRuntimeCredentialsRequest) GetRuntimeCredentialId() []string { - if m != nil { - return m.RuntimeCredentialId - } - return nil -} - -type DeleteRuntimeCredentialsResponse struct { - // ids of runtime credential deleted - RuntimeCredentialId []string `protobuf:"bytes,1,rep,name=runtime_credential_id,json=runtimeCredentialId,proto3" json:"runtime_credential_id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *DeleteRuntimeCredentialsResponse) Reset() { *m = DeleteRuntimeCredentialsResponse{} } -func (m *DeleteRuntimeCredentialsResponse) String() string { return proto.CompactTextString(m) } -func (*DeleteRuntimeCredentialsResponse) ProtoMessage() {} -func (*DeleteRuntimeCredentialsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_86e2dd377c869464, []int{21} -} - -func (m *DeleteRuntimeCredentialsResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_DeleteRuntimeCredentialsResponse.Unmarshal(m, b) -} -func (m *DeleteRuntimeCredentialsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_DeleteRuntimeCredentialsResponse.Marshal(b, m, deterministic) -} -func (m *DeleteRuntimeCredentialsResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_DeleteRuntimeCredentialsResponse.Merge(m, src) -} -func (m *DeleteRuntimeCredentialsResponse) XXX_Size() int { - return xxx_messageInfo_DeleteRuntimeCredentialsResponse.Size(m) -} -func (m *DeleteRuntimeCredentialsResponse) XXX_DiscardUnknown() { - xxx_messageInfo_DeleteRuntimeCredentialsResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_DeleteRuntimeCredentialsResponse proto.InternalMessageInfo - -func (m *DeleteRuntimeCredentialsResponse) GetRuntimeCredentialId() []string { - if m != nil { - return m.RuntimeCredentialId - } - return nil -} - -type DescribeRuntimeProviderZonesRequest struct { - // required, use runtime credential id to get run time provider zones - RuntimeCredentialId *wrappers.StringValue `protobuf:"bytes,1,opt,name=runtime_credential_id,json=runtimeCredentialId,proto3" json:"runtime_credential_id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *DescribeRuntimeProviderZonesRequest) Reset() { *m = DescribeRuntimeProviderZonesRequest{} } -func (m *DescribeRuntimeProviderZonesRequest) String() string { return proto.CompactTextString(m) } -func (*DescribeRuntimeProviderZonesRequest) ProtoMessage() {} -func (*DescribeRuntimeProviderZonesRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_86e2dd377c869464, []int{22} -} - -func (m *DescribeRuntimeProviderZonesRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_DescribeRuntimeProviderZonesRequest.Unmarshal(m, b) -} -func (m *DescribeRuntimeProviderZonesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_DescribeRuntimeProviderZonesRequest.Marshal(b, m, deterministic) -} -func (m *DescribeRuntimeProviderZonesRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_DescribeRuntimeProviderZonesRequest.Merge(m, src) -} -func (m *DescribeRuntimeProviderZonesRequest) XXX_Size() int { - return xxx_messageInfo_DescribeRuntimeProviderZonesRequest.Size(m) -} -func (m *DescribeRuntimeProviderZonesRequest) XXX_DiscardUnknown() { - xxx_messageInfo_DescribeRuntimeProviderZonesRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_DescribeRuntimeProviderZonesRequest proto.InternalMessageInfo - -func (m *DescribeRuntimeProviderZonesRequest) GetRuntimeCredentialId() *wrappers.StringValue { - if m != nil { - return m.RuntimeCredentialId - } - return nil -} - -type DescribeRuntimeProviderZonesResponse struct { - // runtime credential id - RuntimeCredentialId *wrappers.StringValue `protobuf:"bytes,1,opt,name=runtime_credential_id,json=runtimeCredentialId,proto3" json:"runtime_credential_id,omitempty"` - // list of zone - Zone []string `protobuf:"bytes,2,rep,name=zone,proto3" json:"zone,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *DescribeRuntimeProviderZonesResponse) Reset() { *m = DescribeRuntimeProviderZonesResponse{} } -func (m *DescribeRuntimeProviderZonesResponse) String() string { return proto.CompactTextString(m) } -func (*DescribeRuntimeProviderZonesResponse) ProtoMessage() {} -func (*DescribeRuntimeProviderZonesResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_86e2dd377c869464, []int{23} -} - -func (m *DescribeRuntimeProviderZonesResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_DescribeRuntimeProviderZonesResponse.Unmarshal(m, b) -} -func (m *DescribeRuntimeProviderZonesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_DescribeRuntimeProviderZonesResponse.Marshal(b, m, deterministic) -} -func (m *DescribeRuntimeProviderZonesResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_DescribeRuntimeProviderZonesResponse.Merge(m, src) -} -func (m *DescribeRuntimeProviderZonesResponse) XXX_Size() int { - return xxx_messageInfo_DescribeRuntimeProviderZonesResponse.Size(m) -} -func (m *DescribeRuntimeProviderZonesResponse) XXX_DiscardUnknown() { - xxx_messageInfo_DescribeRuntimeProviderZonesResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_DescribeRuntimeProviderZonesResponse proto.InternalMessageInfo - -func (m *DescribeRuntimeProviderZonesResponse) GetRuntimeCredentialId() *wrappers.StringValue { - if m != nil { - return m.RuntimeCredentialId - } - return nil -} - -func (m *DescribeRuntimeProviderZonesResponse) GetZone() []string { - if m != nil { - return m.Zone - } - return nil -} - -type GetRuntimeStatisticsRequest struct { - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *GetRuntimeStatisticsRequest) Reset() { *m = GetRuntimeStatisticsRequest{} } -func (m *GetRuntimeStatisticsRequest) String() string { return proto.CompactTextString(m) } -func (*GetRuntimeStatisticsRequest) ProtoMessage() {} -func (*GetRuntimeStatisticsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_86e2dd377c869464, []int{24} -} - -func (m *GetRuntimeStatisticsRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_GetRuntimeStatisticsRequest.Unmarshal(m, b) -} -func (m *GetRuntimeStatisticsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_GetRuntimeStatisticsRequest.Marshal(b, m, deterministic) -} -func (m *GetRuntimeStatisticsRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetRuntimeStatisticsRequest.Merge(m, src) -} -func (m *GetRuntimeStatisticsRequest) XXX_Size() int { - return xxx_messageInfo_GetRuntimeStatisticsRequest.Size(m) -} -func (m *GetRuntimeStatisticsRequest) XXX_DiscardUnknown() { - xxx_messageInfo_GetRuntimeStatisticsRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_GetRuntimeStatisticsRequest proto.InternalMessageInfo - -type GetRuntimeStatisticsResponse struct { - // runtime create time range map to runtime count, max length is 14 - LastTwoWeekCreated map[string]uint32 `protobuf:"bytes,1,rep,name=last_two_week_created,json=lastTwoWeekCreated,proto3" json:"last_two_week_created,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` - // provider id map to runtime count, max length is 10 - TopTenProviders map[string]uint32 `protobuf:"bytes,2,rep,name=top_ten_providers,json=topTenProviders,proto3" json:"top_ten_providers,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` - // total count of runtime - RuntimeCount uint32 `protobuf:"varint,3,opt,name=runtime_count,json=runtimeCount,proto3" json:"runtime_count,omitempty"` - // total count of provider - ProviderCount uint32 `protobuf:"varint,4,opt,name=provider_count,json=providerCount,proto3" json:"provider_count,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *GetRuntimeStatisticsResponse) Reset() { *m = GetRuntimeStatisticsResponse{} } -func (m *GetRuntimeStatisticsResponse) String() string { return proto.CompactTextString(m) } -func (*GetRuntimeStatisticsResponse) ProtoMessage() {} -func (*GetRuntimeStatisticsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_86e2dd377c869464, []int{25} -} - -func (m *GetRuntimeStatisticsResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_GetRuntimeStatisticsResponse.Unmarshal(m, b) -} -func (m *GetRuntimeStatisticsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_GetRuntimeStatisticsResponse.Marshal(b, m, deterministic) -} -func (m *GetRuntimeStatisticsResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetRuntimeStatisticsResponse.Merge(m, src) -} -func (m *GetRuntimeStatisticsResponse) XXX_Size() int { - return xxx_messageInfo_GetRuntimeStatisticsResponse.Size(m) -} -func (m *GetRuntimeStatisticsResponse) XXX_DiscardUnknown() { - xxx_messageInfo_GetRuntimeStatisticsResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_GetRuntimeStatisticsResponse proto.InternalMessageInfo - -func (m *GetRuntimeStatisticsResponse) GetLastTwoWeekCreated() map[string]uint32 { - if m != nil { - return m.LastTwoWeekCreated - } - return nil -} - -func (m *GetRuntimeStatisticsResponse) GetTopTenProviders() map[string]uint32 { - if m != nil { - return m.TopTenProviders - } - return nil -} - -func (m *GetRuntimeStatisticsResponse) GetRuntimeCount() uint32 { - if m != nil { - return m.RuntimeCount - } - return 0 -} - -func (m *GetRuntimeStatisticsResponse) GetProviderCount() uint32 { - if m != nil { - return m.ProviderCount - } - return 0 -} - -func init() { - proto.RegisterType((*RuntimeCredential)(nil), "openpitrix.RuntimeCredential") - proto.RegisterType((*Runtime)(nil), "openpitrix.Runtime") - proto.RegisterType((*RuntimeDetail)(nil), "openpitrix.RuntimeDetail") - proto.RegisterType((*CreateRuntimeRequest)(nil), "openpitrix.CreateRuntimeRequest") - proto.RegisterType((*CreateRuntimeResponse)(nil), "openpitrix.CreateRuntimeResponse") - proto.RegisterType((*DescribeRuntimesRequest)(nil), "openpitrix.DescribeRuntimesRequest") - proto.RegisterType((*DescribeRuntimesResponse)(nil), "openpitrix.DescribeRuntimesResponse") - proto.RegisterType((*DescribeRuntimeDetailsResponse)(nil), "openpitrix.DescribeRuntimeDetailsResponse") - proto.RegisterType((*ModifyRuntimeRequest)(nil), "openpitrix.ModifyRuntimeRequest") - proto.RegisterType((*ModifyRuntimeResponse)(nil), "openpitrix.ModifyRuntimeResponse") - proto.RegisterType((*DeleteRuntimesRequest)(nil), "openpitrix.DeleteRuntimesRequest") - proto.RegisterType((*DeleteRuntimesResponse)(nil), "openpitrix.DeleteRuntimesResponse") - proto.RegisterType((*CreateRuntimeCredentialRequest)(nil), "openpitrix.CreateRuntimeCredentialRequest") - proto.RegisterType((*CreateRuntimeCredentialResponse)(nil), "openpitrix.CreateRuntimeCredentialResponse") - proto.RegisterType((*ValidateRuntimeCredentialRequest)(nil), "openpitrix.ValidateRuntimeCredentialRequest") - proto.RegisterType((*ValidateRuntimeCredentialResponse)(nil), "openpitrix.ValidateRuntimeCredentialResponse") - proto.RegisterType((*DescribeRuntimeCredentialsRequest)(nil), "openpitrix.DescribeRuntimeCredentialsRequest") - proto.RegisterType((*DescribeRuntimeCredentialsResponse)(nil), "openpitrix.DescribeRuntimeCredentialsResponse") - proto.RegisterType((*ModifyRuntimeCredentialRequest)(nil), "openpitrix.ModifyRuntimeCredentialRequest") - proto.RegisterType((*ModifyRuntimeCredentialResponse)(nil), "openpitrix.ModifyRuntimeCredentialResponse") - proto.RegisterType((*DeleteRuntimeCredentialsRequest)(nil), "openpitrix.DeleteRuntimeCredentialsRequest") - proto.RegisterType((*DeleteRuntimeCredentialsResponse)(nil), "openpitrix.DeleteRuntimeCredentialsResponse") - proto.RegisterType((*DescribeRuntimeProviderZonesRequest)(nil), "openpitrix.DescribeRuntimeProviderZonesRequest") - proto.RegisterType((*DescribeRuntimeProviderZonesResponse)(nil), "openpitrix.DescribeRuntimeProviderZonesResponse") - proto.RegisterType((*GetRuntimeStatisticsRequest)(nil), "openpitrix.GetRuntimeStatisticsRequest") - proto.RegisterType((*GetRuntimeStatisticsResponse)(nil), "openpitrix.GetRuntimeStatisticsResponse") - proto.RegisterMapType((map[string]uint32)(nil), "openpitrix.GetRuntimeStatisticsResponse.LastTwoWeekCreatedEntry") - proto.RegisterMapType((map[string]uint32)(nil), "openpitrix.GetRuntimeStatisticsResponse.TopTenProvidersEntry") -} - -func init() { proto.RegisterFile("runtime.proto", fileDescriptor_86e2dd377c869464) } - -var fileDescriptor_86e2dd377c869464 = []byte{ - // 1934 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x59, 0xcd, 0x6f, 0x1c, 0x49, - 0x15, 0x57, 0xcf, 0x78, 0xec, 0xf8, 0x8d, 0xc7, 0x89, 0x6b, 0x1d, 0xbb, 0xd3, 0xf1, 0x47, 0xbb, - 0xb3, 0xb0, 0xc1, 0x19, 0xdb, 0x61, 0x88, 0xd8, 0x65, 0x57, 0x41, 0x4c, 0x9c, 0x55, 0x40, 0x24, - 0x22, 0x1a, 0x7b, 0xb3, 0x52, 0x2e, 0xa3, 0xf6, 0x4c, 0xcd, 0xb8, 0xe5, 0x76, 0xd7, 0x6c, 0x75, - 0x8d, 0x07, 0x73, 0x40, 0x2b, 0x96, 0x0b, 0x6c, 0x2e, 0x0c, 0x42, 0x20, 0x0e, 0x1c, 0x11, 0x27, - 0xc4, 0x05, 0x21, 0x04, 0x12, 0x08, 0x09, 0x24, 0xce, 0x88, 0xff, 0x80, 0x1b, 0x7f, 0x00, 0x47, - 0x50, 0x57, 0x55, 0x7b, 0xfa, 0x7b, 0xda, 0xf6, 0x24, 0x08, 0x76, 0x4f, 0xf1, 0x74, 0xbd, 0x57, - 0xf5, 0xbe, 0x7e, 0xbf, 0x7a, 0xaf, 0x02, 0x15, 0xda, 0x77, 0x98, 0x75, 0x8c, 0xb7, 0x7b, 0x94, - 0x30, 0x82, 0x80, 0xf4, 0xb0, 0xd3, 0xb3, 0x18, 0xb5, 0xbe, 0xa9, 0xad, 0x75, 0x09, 0xe9, 0xda, - 0x78, 0x87, 0xaf, 0x1c, 0xf4, 0x3b, 0x3b, 0x03, 0x6a, 0xf6, 0x7a, 0x98, 0xba, 0x42, 0x56, 0x5b, - 0x8f, 0xae, 0x7b, 0xfb, 0xb8, 0xcc, 0x3c, 0xee, 0x49, 0x81, 0x15, 0x29, 0x60, 0xf6, 0xac, 0x1d, - 0xd3, 0x71, 0x08, 0x33, 0x99, 0x45, 0x1c, 0x5f, 0xbd, 0xca, 0xff, 0x69, 0x6d, 0x75, 0xb1, 0xb3, - 0xe5, 0x0e, 0xcc, 0x6e, 0x17, 0xd3, 0x1d, 0xd2, 0xe3, 0x12, 0x71, 0x69, 0xe3, 0xdf, 0x25, 0x58, - 0x68, 0x08, 0x53, 0x77, 0x29, 0x6e, 0x63, 0x87, 0x59, 0xa6, 0x8d, 0x9e, 0xc2, 0x75, 0x69, 0x7f, - 0xb3, 0x75, 0xf6, 0xb5, 0x69, 0xb5, 0x55, 0x45, 0x57, 0x6e, 0x97, 0x6b, 0x2b, 0xdb, 0xc2, 0x82, - 0x6d, 0xdf, 0xc4, 0xed, 0x3d, 0x46, 0x2d, 0xa7, 0xfb, 0xcc, 0xb4, 0xfb, 0xb8, 0xf1, 0x1a, 0x8d, - 0xee, 0xf7, 0xb5, 0x36, 0xba, 0x0b, 0x53, 0x8e, 0x79, 0x8c, 0xd5, 0x42, 0x8e, 0x0d, 0xb8, 0x24, - 0xfa, 0x32, 0x94, 0xdb, 0xd8, 0x6d, 0x51, 0x8b, 0xdb, 0xae, 0x16, 0x73, 0x28, 0x06, 0x15, 0xd0, - 0x7d, 0x28, 0xfb, 0x3e, 0xf4, 0xa9, 0xad, 0x4e, 0xe5, 0xd0, 0x07, 0xa9, 0xf0, 0x1e, 0xb5, 0xd1, - 0x73, 0xd0, 0x12, 0x42, 0xd0, 0x22, 0x0e, 0xc3, 0x0e, 0x53, 0x4b, 0x39, 0x76, 0x53, 0x63, 0x71, - 0xd8, 0x15, 0xda, 0xe8, 0x1d, 0x00, 0x32, 0x70, 0x30, 0x6d, 0xf6, 0x4c, 0x76, 0xa8, 0x4e, 0xe7, - 0xd8, 0x6b, 0x96, 0xcb, 0x3f, 0x35, 0xd9, 0x21, 0x7a, 0x0b, 0xae, 0xf4, 0x28, 0x39, 0xb1, 0xda, - 0x98, 0xaa, 0x33, 0x39, 0x54, 0xcf, 0xa4, 0xd1, 0x3d, 0x98, 0x76, 0x99, 0xc9, 0xfa, 0xae, 0x7a, - 0x25, 0x87, 0x9e, 0x94, 0x45, 0xef, 0x40, 0xb9, 0x45, 0xb1, 0xc9, 0x70, 0xd3, 0x73, 0x46, 0x9d, - 0xe5, 0xaa, 0x5a, 0x4c, 0x75, 0xdf, 0x2f, 0xd2, 0x06, 0x08, 0x71, 0xef, 0x83, 0xa7, 0x2c, 0xb6, - 0x11, 0xca, 0x30, 0x5e, 0x59, 0x88, 0x73, 0xe5, 0xbb, 0x50, 0x6a, 0xe3, 0x83, 0x7e, 0x57, 0x2d, - 0xa7, 0xa8, 0x3d, 0x20, 0xc4, 0x16, 0xc6, 0x0a, 0x41, 0x54, 0x83, 0x12, 0x0f, 0x94, 0x3a, 0x97, - 0xc3, 0x41, 0x21, 0x6a, 0xfc, 0xb5, 0x04, 0x33, 0x12, 0x01, 0x5e, 0x62, 0xfc, 0xa4, 0xe7, 0x2c, - 0xf6, 0x59, 0x29, 0xff, 0x5f, 0x29, 0xf1, 0x60, 0x29, 0x4c, 0x9d, 0xab, 0x14, 0x52, 0x01, 0x5e, - 0xba, 0x04, 0xc0, 0xbf, 0x45, 0x1c, 0x9c, 0xab, 0x9a, 0xb9, 0x64, 0x04, 0x05, 0x33, 0xe7, 0x43, - 0xc1, 0xa7, 0xb5, 0x9c, 0x54, 0xcb, 0x2f, 0x14, 0xa8, 0xc8, 0x5a, 0x7e, 0x88, 0x99, 0x69, 0xd9, - 0x68, 0x0b, 0x66, 0x64, 0xb6, 0x64, 0x39, 0xbf, 0xb6, 0x3d, 0xba, 0x8a, 0xb6, 0xa5, 0x6c, 0xc3, - 0x97, 0x41, 0x8f, 0x01, 0xc5, 0xeb, 0x42, 0x56, 0xf4, 0x6a, 0x82, 0xe6, 0xa8, 0x04, 0x1a, 0x0b, - 0xb1, 0xaa, 0x30, 0x3e, 0x2a, 0xc2, 0xe2, 0x2e, 0x0f, 0xa0, 0x7f, 0x10, 0xfe, 0xa0, 0x8f, 0x5d, - 0x76, 0x06, 0x15, 0xe5, 0xa2, 0x50, 0x29, 0x5c, 0x06, 0x2a, 0xc5, 0xc9, 0x40, 0x65, 0xea, 0xb2, - 0x50, 0x29, 0x9d, 0x07, 0x2a, 0x01, 0x5e, 0x82, 0x73, 0xf1, 0x92, 0xb1, 0x0f, 0xd7, 0x23, 0x49, - 0x70, 0x7b, 0xc4, 0x71, 0x2f, 0xc7, 0x76, 0xc6, 0xef, 0x8a, 0xb0, 0xfc, 0x90, 0x07, 0xf8, 0xc0, - 0xdf, 0xd8, 0xf5, 0xd3, 0x7b, 0x1f, 0xca, 0x2e, 0x36, 0x69, 0xeb, 0xb0, 0x39, 0x20, 0x34, 0xdf, - 0xce, 0x20, 0x14, 0xde, 0x27, 0xb4, 0x8d, 0xde, 0x84, 0x2b, 0x2e, 0xa1, 0xac, 0x79, 0x84, 0x4f, - 0x73, 0x25, 0x7a, 0xc6, 0x93, 0xfe, 0x3a, 0x3e, 0x45, 0xf7, 0x60, 0x86, 0xe2, 0x13, 0x4c, 0x5d, - 0x2c, 0x73, 0x9c, 0x05, 0x33, 0x5f, 0x14, 0x2d, 0x42, 0xc9, 0xb6, 0x8e, 0x2d, 0xc6, 0x13, 0x5a, - 0x69, 0x88, 0x1f, 0x68, 0x09, 0xa6, 0x49, 0xa7, 0xe3, 0x62, 0x71, 0xd7, 0x57, 0x1a, 0xf2, 0x17, - 0x7a, 0x03, 0xae, 0xb6, 0x2d, 0xb7, 0x67, 0x9b, 0xa7, 0xcd, 0x16, 0xb1, 0xfb, 0xc7, 0x8e, 0xab, - 0x4e, 0xeb, 0xc5, 0xdb, 0xb3, 0x8d, 0x79, 0xf9, 0x79, 0x57, 0x7c, 0x45, 0xab, 0xa1, 0xe8, 0x96, - 0xb9, 0x4c, 0xe0, 0xb6, 0x58, 0x3a, 0x23, 0xb0, 0x39, 0xbe, 0xe4, 0x53, 0x94, 0x16, 0x28, 0xd4, - 0x0a, 0x5f, 0x19, 0x95, 0xe2, 0xa2, 0x4f, 0x09, 0xf3, 0x7c, 0x41, 0xfc, 0x40, 0xb5, 0xb4, 0x02, - 0xbd, 0xca, 0xa5, 0x92, 0x4a, 0xd0, 0xf8, 0x00, 0xd4, 0x78, 0xf2, 0x64, 0x59, 0xac, 0x43, 0x99, - 0x11, 0xc6, 0x9b, 0x9d, 0xbe, 0xc3, 0x78, 0xf6, 0x2a, 0x0d, 0xe0, 0x9f, 0x76, 0xbd, 0x2f, 0xe8, - 0xde, 0xa8, 0xb3, 0xf2, 0xe2, 0x53, 0xd0, 0x8b, 0x69, 0xbc, 0xe2, 0x47, 0x60, 0x0f, 0x33, 0xe3, - 0xfb, 0x0a, 0xac, 0x45, 0xce, 0x14, 0x1c, 0x75, 0x8e, 0x93, 0x1f, 0x8d, 0xe8, 0xa9, 0xcd, 0x75, - 0x03, 0x06, 0xdc, 0x48, 0x30, 0x40, 0x1c, 0xd0, 0xb8, 0x46, 0x83, 0x3f, 0x3d, 0x63, 0x7e, 0x5c, - 0x80, 0xc5, 0x27, 0xa4, 0x6d, 0x75, 0x4e, 0x23, 0xcc, 0xf4, 0x3f, 0xd6, 0x01, 0x4c, 0x9c, 0x9c, - 0x3c, 0xb6, 0x88, 0x04, 0x66, 0x12, 0x6c, 0xf1, 0xb1, 0x02, 0xd7, 0x1f, 0x62, 0x1b, 0xb3, 0x18, - 0x57, 0xac, 0x46, 0xb6, 0x8d, 0xc0, 0xe4, 0x2e, 0x94, 0x3a, 0x84, 0xb6, 0xfc, 0x98, 0x66, 0xde, - 0x9b, 0x5c, 0x10, 0x6d, 0xc0, 0x5c, 0x97, 0x9a, 0x2d, 0xdc, 0xec, 0x61, 0x6a, 0x91, 0x36, 0x8f, - 0x69, 0xa5, 0x51, 0xe6, 0xdf, 0x9e, 0xf2, 0x4f, 0xc6, 0x9b, 0xb0, 0x14, 0x35, 0x46, 0x3a, 0x99, - 0x6d, 0x8d, 0xf1, 0xdb, 0x22, 0xac, 0x85, 0xb8, 0x34, 0x70, 0xff, 0x8d, 0xb8, 0x2f, 0x38, 0x76, - 0x28, 0x13, 0x1d, 0x3b, 0x0a, 0x97, 0x1a, 0x3b, 0x2e, 0x7e, 0x07, 0xfa, 0x85, 0x3d, 0x75, 0xd1, - 0xc2, 0x2e, 0x4d, 0xac, 0xb0, 0xe1, 0xa2, 0x85, 0xed, 0xc2, 0x7a, 0x6a, 0xea, 0x64, 0xf6, 0x27, - 0x3e, 0xf6, 0x1a, 0xff, 0x52, 0x40, 0x7f, 0x66, 0xda, 0x56, 0xfb, 0x93, 0x56, 0x32, 0xc6, 0x37, - 0x60, 0x23, 0xc3, 0x71, 0x19, 0xf0, 0x4d, 0x28, 0x90, 0x23, 0xe9, 0x70, 0x16, 0xb4, 0x0b, 0xe4, - 0xc8, 0xf8, 0x79, 0x11, 0x36, 0x22, 0xf7, 0xc7, 0x68, 0xc7, 0x4f, 0x5b, 0x8f, 0x60, 0xeb, 0x91, - 0xda, 0x11, 0x94, 0x53, 0x3b, 0x82, 0xc9, 0xf5, 0x23, 0xc6, 0x4f, 0x15, 0x30, 0xb2, 0x12, 0x95, - 0xf7, 0xb2, 0xdf, 0x83, 0xa5, 0x04, 0x2f, 0x46, 0x17, 0xfe, 0x98, 0x79, 0x64, 0x31, 0xe6, 0xa5, - 0x77, 0xf1, 0xff, 0xb1, 0x00, 0x6b, 0xa1, 0xfb, 0x2d, 0x0e, 0xc7, 0xff, 0x87, 0xc7, 0xaf, 0x6c, - 0x4e, 0x98, 0xba, 0x0c, 0x27, 0x78, 0x44, 0x9a, 0x1a, 0xc1, 0x97, 0x46, 0xa4, 0xef, 0xc1, 0x7a, - 0xe8, 0xca, 0x4e, 0x80, 0x7e, 0x2d, 0xfd, 0xd0, 0xd4, 0x3e, 0xf8, 0x19, 0xe8, 0xe9, 0xdb, 0x4a, - 0x67, 0x2e, 0xb2, 0xef, 0x00, 0x6e, 0x45, 0x20, 0xf0, 0x54, 0x82, 0xe6, 0x39, 0x71, 0x46, 0xcd, - 0xcf, 0xe4, 0xe3, 0xf4, 0x42, 0x81, 0xd7, 0xb3, 0x4f, 0x7e, 0x59, 0x29, 0x42, 0x48, 0x8e, 0xb5, - 0x05, 0x1e, 0x16, 0xfe, 0xb7, 0xb1, 0x0a, 0x37, 0x1f, 0x61, 0x26, 0x0d, 0xd9, 0x63, 0x26, 0xb3, - 0x5c, 0x66, 0xb5, 0x7c, 0xff, 0x8d, 0xbf, 0x17, 0x61, 0x25, 0x79, 0x5d, 0x5a, 0xe9, 0xc2, 0x75, - 0xdb, 0x74, 0x59, 0x93, 0x0d, 0x48, 0x73, 0x80, 0xf1, 0x51, 0x53, 0xbc, 0xc7, 0x88, 0xd8, 0x97, - 0x6b, 0x5f, 0x09, 0x52, 0x40, 0xd6, 0x46, 0xdb, 0x8f, 0x4d, 0x97, 0xed, 0x0f, 0xc8, 0xfb, 0x18, - 0x1f, 0x89, 0x2e, 0xa0, 0xfd, 0xae, 0xc3, 0xe8, 0x69, 0x03, 0xd9, 0xb1, 0x05, 0x64, 0xc1, 0x02, - 0x23, 0xbd, 0x26, 0xc3, 0x4e, 0xd3, 0xa7, 0x3a, 0x57, 0x72, 0xce, 0xfd, 0xdc, 0x07, 0xee, 0x93, - 0xde, 0x3e, 0x76, 0xfc, 0xd8, 0xbb, 0xe2, 0xb4, 0xab, 0x2c, 0xfc, 0x15, 0xdd, 0x3a, 0xfb, 0x8f, - 0x02, 0x49, 0x83, 0xa2, 0x5b, 0x9d, 0xf3, 0xe3, 0xcb, 0x89, 0xf0, 0x33, 0x30, 0xef, 0xdb, 0x21, - 0xa5, 0xc4, 0x75, 0x51, 0xf1, 0xbf, 0x72, 0x31, 0xed, 0x5d, 0x58, 0x4e, 0xf1, 0x12, 0x5d, 0x83, - 0xa2, 0x77, 0xa3, 0x79, 0xa9, 0x9d, 0x6d, 0x78, 0x7f, 0x7a, 0xd4, 0x7d, 0xe2, 0xa5, 0x92, 0x73, - 0x52, 0xa5, 0x21, 0x7e, 0xbc, 0x5d, 0x78, 0x4b, 0xd1, 0x1e, 0xc0, 0x62, 0x92, 0xed, 0xe7, 0xd9, - 0xa3, 0xf6, 0x1b, 0x15, 0xe6, 0x65, 0x68, 0x9e, 0x98, 0x8e, 0xd9, 0xc5, 0x14, 0x7d, 0xa8, 0x40, - 0x25, 0xd4, 0x7f, 0x21, 0x3d, 0x18, 0xcb, 0xa4, 0x67, 0x22, 0x6d, 0x23, 0x43, 0x42, 0x84, 0xd9, - 0xd8, 0x1c, 0xd6, 0xaf, 0xa1, 0x79, 0xb1, 0xa6, 0xcb, 0xa8, 0x7d, 0xe7, 0x6f, 0xff, 0xf8, 0x61, - 0x61, 0xc1, 0x98, 0xdb, 0x39, 0xf9, 0xfc, 0x8e, 0xfc, 0xe4, 0xbe, 0xad, 0x6c, 0xa2, 0x1f, 0x28, - 0x80, 0x84, 0xe4, 0x43, 0x7c, 0xd0, 0xef, 0x4e, 0xd4, 0x8e, 0x2f, 0x0e, 0xeb, 0x4b, 0x48, 0x3e, - 0x76, 0xe9, 0xfc, 0x01, 0x2f, 0x64, 0xcd, 0xb2, 0x81, 0x3c, 0x6b, 0xf8, 0x42, 0x33, 0x68, 0x93, - 0xe5, 0x8d, 0x22, 0x49, 0x43, 0x31, 0xba, 0x15, 0x3c, 0x34, 0xe5, 0xa5, 0x45, 0xdb, 0xcc, 0x10, - 0x8a, 0x4e, 0xd7, 0xff, 0x54, 0xe0, 0x5a, 0x74, 0x9f, 0x7c, 0xa7, 0xbc, 0x9e, 0x2d, 0x24, 0x43, - 0xf0, 0xb1, 0x32, 0xac, 0x33, 0x44, 0x1f, 0x61, 0xe6, 0xbb, 0xee, 0x56, 0xf5, 0x96, 0xe9, 0xe8, - 0x1d, 0xcb, 0x66, 0x98, 0xea, 0x03, 0x8b, 0x1d, 0xea, 0xec, 0x10, 0xbb, 0x58, 0xef, 0x58, 0xd8, - 0x6e, 0xbb, 0xb7, 0x47, 0xa3, 0x56, 0x55, 0xf7, 0x6b, 0xb9, 0xaa, 0x7b, 0xc4, 0x51, 0xd5, 0x45, - 0xfb, 0x51, 0xd5, 0x79, 0x4f, 0xf1, 0xb9, 0xaa, 0xde, 0xc6, 0x1d, 0xb3, 0x6f, 0x33, 0x9d, 0x62, - 0xd6, 0xa7, 0x8e, 0x6e, 0xda, 0xf6, 0xd9, 0x29, 0x3c, 0xc2, 0xf3, 0x28, 0x94, 0x6f, 0xf4, 0x51, - 0xc1, 0x9b, 0x38, 0x85, 0xa9, 0xc1, 0x74, 0x4f, 0xd4, 0xe5, 0x9f, 0x29, 0xc3, 0xfa, 0x87, 0x0a, - 0xfa, 0xb6, 0xe7, 0x73, 0x28, 0xe9, 0x2f, 0xd9, 0xf3, 0xf0, 0x59, 0xdc, 0xff, 0x45, 0x94, 0x50, - 0x61, 0x1c, 0x75, 0xa1, 0xcb, 0x3a, 0x5c, 0xed, 0x49, 0x4f, 0x20, 0xe1, 0x6a, 0x4f, 0x7c, 0x0b, - 0x90, 0xa8, 0x13, 0x6b, 0x61, 0xd4, 0xd5, 0x62, 0xa8, 0xfb, 0xae, 0x02, 0xf3, 0xe1, 0x69, 0x1b, - 0x6d, 0x84, 0x83, 0x9b, 0xf0, 0x2c, 0xa0, 0x19, 0x59, 0x22, 0xd2, 0x8a, 0x3b, 0xc3, 0xfa, 0x02, - 0xba, 0x2a, 0x16, 0xc3, 0xc1, 0x58, 0xd8, 0x8c, 0x99, 0xf1, 0x6b, 0x05, 0x96, 0x53, 0xe6, 0x3f, - 0xb4, 0x99, 0x8a, 0xef, 0x58, 0x77, 0xa8, 0xdd, 0xc9, 0x25, 0x2b, 0x2d, 0xac, 0x0f, 0xeb, 0x37, - 0xd1, 0x8d, 0x56, 0x88, 0x9d, 0xf4, 0xd1, 0x75, 0xcb, 0x6d, 0x5d, 0x35, 0xd4, 0xa0, 0xad, 0x3b, - 0xa3, 0x65, 0x6e, 0xf7, 0x5f, 0x14, 0x58, 0x89, 0x93, 0xd6, 0xab, 0x30, 0xfe, 0xc9, 0xb0, 0xbe, - 0x81, 0xd6, 0x93, 0x28, 0x2d, 0xea, 0xc2, 0x2d, 0x63, 0x2d, 0x5e, 0x7b, 0x51, 0x47, 0x7e, 0x59, - 0x00, 0x2d, 0x7d, 0x2c, 0x40, 0x5b, 0x19, 0x80, 0x8b, 0x37, 0x7b, 0xda, 0x76, 0x5e, 0x71, 0xe9, - 0xcc, 0xaf, 0x94, 0x61, 0xfd, 0x85, 0x82, 0xbe, 0xa7, 0x04, 0xe8, 0x29, 0xe0, 0x86, 0x5b, 0x1d, - 0x8f, 0xd5, 0x50, 0x9b, 0x34, 0x82, 0xe9, 0x08, 0xbe, 0xe3, 0xa9, 0x2a, 0x78, 0x22, 0x8f, 0x9c, - 0x86, 0x52, 0x93, 0x8f, 0xfe, 0x5c, 0xf0, 0x7a, 0xde, 0x38, 0x83, 0xbd, 0xc2, 0xa8, 0xfd, 0x49, - 0x19, 0xd6, 0x7f, 0xa2, 0xa0, 0x1f, 0x29, 0x31, 0x82, 0x7b, 0x85, 0xb1, 0x4b, 0x3d, 0x97, 0x47, - 0x50, 0x47, 0x63, 0x6a, 0x8f, 0x23, 0x3f, 0x65, 0x60, 0x09, 0x83, 0x27, 0x7b, 0x2e, 0x0c, 0x83, - 0x67, 0xcc, 0x04, 0x24, 0x91, 0x1f, 0x66, 0xc8, 0x18, 0xf2, 0x6b, 0x99, 0xc8, 0xff, 0x83, 0x02, - 0x6a, 0xda, 0x70, 0x82, 0xee, 0xa4, 0xf2, 0x63, 0x42, 0xda, 0xab, 0xf9, 0x84, 0xa5, 0xe9, 0x5f, - 0x1d, 0xd6, 0x0d, 0xa4, 0x3f, 0x30, 0x59, 0xeb, 0x50, 0x6f, 0x87, 0xc8, 0x35, 0x16, 0xfc, 0xd5, - 0xcd, 0x71, 0xdc, 0x75, 0x23, 0xf5, 0x11, 0x08, 0x85, 0xac, 0x1a, 0xf7, 0x48, 0xa6, 0x6d, 0xe5, - 0x94, 0x96, 0x4e, 0x3c, 0x1e, 0xd6, 0x57, 0xd1, 0x4d, 0x5f, 0x2e, 0x2d, 0x03, 0x9f, 0x35, 0x36, - 0x52, 0xed, 0x3f, 0x91, 0xba, 0x9e, 0x23, 0xbf, 0x57, 0x60, 0x25, 0x6b, 0xaa, 0x42, 0x3b, 0x19, - 0xc0, 0x4a, 0x9a, 0xfc, 0xb4, 0xbb, 0xf9, 0x15, 0xa4, 0x47, 0x5f, 0x1a, 0xd6, 0x57, 0x90, 0x16, - 0xa4, 0x2f, 0x1f, 0x3d, 0xbc, 0x6f, 0x08, 0x75, 0x01, 0x67, 0x0e, 0xf1, 0x15, 0xf4, 0x0b, 0x05, - 0x16, 0x93, 0x86, 0x15, 0xf4, 0xc6, 0xf8, 0x71, 0x46, 0x98, 0x7b, 0x3b, 0xef, 0xdc, 0x63, 0xdc, - 0xe7, 0x85, 0xdf, 0xc5, 0x8c, 0x83, 0x5c, 0x2c, 0xea, 0xa4, 0x13, 0xea, 0x12, 0x6e, 0xa0, 0xe5, - 0x90, 0x95, 0x23, 0xc9, 0x07, 0x53, 0xcf, 0x0b, 0xbd, 0x83, 0x83, 0x69, 0x3e, 0x75, 0x7e, 0xe1, - 0x3f, 0x01, 0x00, 0x00, 0xff, 0xff, 0x13, 0x03, 0x48, 0xff, 0x46, 0x25, 0x00, 0x00, -} - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConn - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion4 - -// RuntimeManagerClient is the client API for RuntimeManager service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type RuntimeManagerClient interface { - // create runtime - CreateRuntime(ctx context.Context, in *CreateRuntimeRequest, opts ...grpc.CallOption) (*CreateRuntimeResponse, error) - // create debug runtime - CreateDebugRuntime(ctx context.Context, in *CreateRuntimeRequest, opts ...grpc.CallOption) (*CreateRuntimeResponse, error) - DescribeRuntimeDetails(ctx context.Context, in *DescribeRuntimesRequest, opts ...grpc.CallOption) (*DescribeRuntimeDetailsResponse, error) - // Get runtimes, can filter with these fields(runtime_id, provider, zone, status, owner), default return all runtimes - DescribeRuntimes(ctx context.Context, in *DescribeRuntimesRequest, opts ...grpc.CallOption) (*DescribeRuntimesResponse, error) - // Get debug runtimes, can filter with these fields(runtime_id, provider, zone, status, owner), default return all debug runtimes - DescribeDebugRuntimes(ctx context.Context, in *DescribeRuntimesRequest, opts ...grpc.CallOption) (*DescribeRuntimesResponse, error) - // Modify runtime - ModifyRuntime(ctx context.Context, in *ModifyRuntimeRequest, opts ...grpc.CallOption) (*ModifyRuntimeResponse, error) - // Batch delete runtimes - DeleteRuntimes(ctx context.Context, in *DeleteRuntimesRequest, opts ...grpc.CallOption) (*DeleteRuntimesResponse, error) - // Create runtime credential - CreateRuntimeCredential(ctx context.Context, in *CreateRuntimeCredentialRequest, opts ...grpc.CallOption) (*CreateRuntimeCredentialResponse, error) - // Create debug runtime credential - CreateDebugRuntimeCredential(ctx context.Context, in *CreateRuntimeCredentialRequest, opts ...grpc.CallOption) (*CreateRuntimeCredentialResponse, error) - // Get runtime credentials, filter with these fields(runtime_credential_id, status, provider, owner), default return all runtime credentials - DescribeRuntimeCredentials(ctx context.Context, in *DescribeRuntimeCredentialsRequest, opts ...grpc.CallOption) (*DescribeRuntimeCredentialsResponse, error) - // Get debug runtime credentials, filter with these fields(runtime_credential_id, status, provider, owner), default return all debug runtime credentials - DescribeDebugRuntimeCredentials(ctx context.Context, in *DescribeRuntimeCredentialsRequest, opts ...grpc.CallOption) (*DescribeRuntimeCredentialsResponse, error) - // Modify runtime credential - ModifyRuntimeCredential(ctx context.Context, in *ModifyRuntimeCredentialRequest, opts ...grpc.CallOption) (*ModifyRuntimeCredentialResponse, error) - // Batch delete runtime credentials - DeleteRuntimeCredentials(ctx context.Context, in *DeleteRuntimeCredentialsRequest, opts ...grpc.CallOption) (*DeleteRuntimeCredentialsResponse, error) - // Validate runtime credential - ValidateRuntimeCredential(ctx context.Context, in *ValidateRuntimeCredentialRequest, opts ...grpc.CallOption) (*ValidateRuntimeCredentialResponse, error) - // Get runtime provider zones - DescribeRuntimeProviderZones(ctx context.Context, in *DescribeRuntimeProviderZonesRequest, opts ...grpc.CallOption) (*DescribeRuntimeProviderZonesResponse, error) - // Get statistics of runtime - GetRuntimeStatistics(ctx context.Context, in *GetRuntimeStatisticsRequest, opts ...grpc.CallOption) (*GetRuntimeStatisticsResponse, error) -} - -type runtimeManagerClient struct { - cc *grpc.ClientConn -} - -func NewRuntimeManagerClient(cc *grpc.ClientConn) RuntimeManagerClient { - return &runtimeManagerClient{cc} -} - -func (c *runtimeManagerClient) CreateRuntime(ctx context.Context, in *CreateRuntimeRequest, opts ...grpc.CallOption) (*CreateRuntimeResponse, error) { - out := new(CreateRuntimeResponse) - err := c.cc.Invoke(ctx, "/openpitrix.RuntimeManager/CreateRuntime", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *runtimeManagerClient) CreateDebugRuntime(ctx context.Context, in *CreateRuntimeRequest, opts ...grpc.CallOption) (*CreateRuntimeResponse, error) { - out := new(CreateRuntimeResponse) - err := c.cc.Invoke(ctx, "/openpitrix.RuntimeManager/CreateDebugRuntime", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *runtimeManagerClient) DescribeRuntimeDetails(ctx context.Context, in *DescribeRuntimesRequest, opts ...grpc.CallOption) (*DescribeRuntimeDetailsResponse, error) { - out := new(DescribeRuntimeDetailsResponse) - err := c.cc.Invoke(ctx, "/openpitrix.RuntimeManager/DescribeRuntimeDetails", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *runtimeManagerClient) DescribeRuntimes(ctx context.Context, in *DescribeRuntimesRequest, opts ...grpc.CallOption) (*DescribeRuntimesResponse, error) { - out := new(DescribeRuntimesResponse) - err := c.cc.Invoke(ctx, "/openpitrix.RuntimeManager/DescribeRuntimes", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *runtimeManagerClient) DescribeDebugRuntimes(ctx context.Context, in *DescribeRuntimesRequest, opts ...grpc.CallOption) (*DescribeRuntimesResponse, error) { - out := new(DescribeRuntimesResponse) - err := c.cc.Invoke(ctx, "/openpitrix.RuntimeManager/DescribeDebugRuntimes", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *runtimeManagerClient) ModifyRuntime(ctx context.Context, in *ModifyRuntimeRequest, opts ...grpc.CallOption) (*ModifyRuntimeResponse, error) { - out := new(ModifyRuntimeResponse) - err := c.cc.Invoke(ctx, "/openpitrix.RuntimeManager/ModifyRuntime", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *runtimeManagerClient) DeleteRuntimes(ctx context.Context, in *DeleteRuntimesRequest, opts ...grpc.CallOption) (*DeleteRuntimesResponse, error) { - out := new(DeleteRuntimesResponse) - err := c.cc.Invoke(ctx, "/openpitrix.RuntimeManager/DeleteRuntimes", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *runtimeManagerClient) CreateRuntimeCredential(ctx context.Context, in *CreateRuntimeCredentialRequest, opts ...grpc.CallOption) (*CreateRuntimeCredentialResponse, error) { - out := new(CreateRuntimeCredentialResponse) - err := c.cc.Invoke(ctx, "/openpitrix.RuntimeManager/CreateRuntimeCredential", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *runtimeManagerClient) CreateDebugRuntimeCredential(ctx context.Context, in *CreateRuntimeCredentialRequest, opts ...grpc.CallOption) (*CreateRuntimeCredentialResponse, error) { - out := new(CreateRuntimeCredentialResponse) - err := c.cc.Invoke(ctx, "/openpitrix.RuntimeManager/CreateDebugRuntimeCredential", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *runtimeManagerClient) DescribeRuntimeCredentials(ctx context.Context, in *DescribeRuntimeCredentialsRequest, opts ...grpc.CallOption) (*DescribeRuntimeCredentialsResponse, error) { - out := new(DescribeRuntimeCredentialsResponse) - err := c.cc.Invoke(ctx, "/openpitrix.RuntimeManager/DescribeRuntimeCredentials", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *runtimeManagerClient) DescribeDebugRuntimeCredentials(ctx context.Context, in *DescribeRuntimeCredentialsRequest, opts ...grpc.CallOption) (*DescribeRuntimeCredentialsResponse, error) { - out := new(DescribeRuntimeCredentialsResponse) - err := c.cc.Invoke(ctx, "/openpitrix.RuntimeManager/DescribeDebugRuntimeCredentials", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *runtimeManagerClient) ModifyRuntimeCredential(ctx context.Context, in *ModifyRuntimeCredentialRequest, opts ...grpc.CallOption) (*ModifyRuntimeCredentialResponse, error) { - out := new(ModifyRuntimeCredentialResponse) - err := c.cc.Invoke(ctx, "/openpitrix.RuntimeManager/ModifyRuntimeCredential", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *runtimeManagerClient) DeleteRuntimeCredentials(ctx context.Context, in *DeleteRuntimeCredentialsRequest, opts ...grpc.CallOption) (*DeleteRuntimeCredentialsResponse, error) { - out := new(DeleteRuntimeCredentialsResponse) - err := c.cc.Invoke(ctx, "/openpitrix.RuntimeManager/DeleteRuntimeCredentials", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *runtimeManagerClient) ValidateRuntimeCredential(ctx context.Context, in *ValidateRuntimeCredentialRequest, opts ...grpc.CallOption) (*ValidateRuntimeCredentialResponse, error) { - out := new(ValidateRuntimeCredentialResponse) - err := c.cc.Invoke(ctx, "/openpitrix.RuntimeManager/ValidateRuntimeCredential", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *runtimeManagerClient) DescribeRuntimeProviderZones(ctx context.Context, in *DescribeRuntimeProviderZonesRequest, opts ...grpc.CallOption) (*DescribeRuntimeProviderZonesResponse, error) { - out := new(DescribeRuntimeProviderZonesResponse) - err := c.cc.Invoke(ctx, "/openpitrix.RuntimeManager/DescribeRuntimeProviderZones", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *runtimeManagerClient) GetRuntimeStatistics(ctx context.Context, in *GetRuntimeStatisticsRequest, opts ...grpc.CallOption) (*GetRuntimeStatisticsResponse, error) { - out := new(GetRuntimeStatisticsResponse) - err := c.cc.Invoke(ctx, "/openpitrix.RuntimeManager/GetRuntimeStatistics", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// RuntimeManagerServer is the server API for RuntimeManager service. -type RuntimeManagerServer interface { - // create runtime - CreateRuntime(context.Context, *CreateRuntimeRequest) (*CreateRuntimeResponse, error) - // create debug runtime - CreateDebugRuntime(context.Context, *CreateRuntimeRequest) (*CreateRuntimeResponse, error) - DescribeRuntimeDetails(context.Context, *DescribeRuntimesRequest) (*DescribeRuntimeDetailsResponse, error) - // Get runtimes, can filter with these fields(runtime_id, provider, zone, status, owner), default return all runtimes - DescribeRuntimes(context.Context, *DescribeRuntimesRequest) (*DescribeRuntimesResponse, error) - // Get debug runtimes, can filter with these fields(runtime_id, provider, zone, status, owner), default return all debug runtimes - DescribeDebugRuntimes(context.Context, *DescribeRuntimesRequest) (*DescribeRuntimesResponse, error) - // Modify runtime - ModifyRuntime(context.Context, *ModifyRuntimeRequest) (*ModifyRuntimeResponse, error) - // Batch delete runtimes - DeleteRuntimes(context.Context, *DeleteRuntimesRequest) (*DeleteRuntimesResponse, error) - // Create runtime credential - CreateRuntimeCredential(context.Context, *CreateRuntimeCredentialRequest) (*CreateRuntimeCredentialResponse, error) - // Create debug runtime credential - CreateDebugRuntimeCredential(context.Context, *CreateRuntimeCredentialRequest) (*CreateRuntimeCredentialResponse, error) - // Get runtime credentials, filter with these fields(runtime_credential_id, status, provider, owner), default return all runtime credentials - DescribeRuntimeCredentials(context.Context, *DescribeRuntimeCredentialsRequest) (*DescribeRuntimeCredentialsResponse, error) - // Get debug runtime credentials, filter with these fields(runtime_credential_id, status, provider, owner), default return all debug runtime credentials - DescribeDebugRuntimeCredentials(context.Context, *DescribeRuntimeCredentialsRequest) (*DescribeRuntimeCredentialsResponse, error) - // Modify runtime credential - ModifyRuntimeCredential(context.Context, *ModifyRuntimeCredentialRequest) (*ModifyRuntimeCredentialResponse, error) - // Batch delete runtime credentials - DeleteRuntimeCredentials(context.Context, *DeleteRuntimeCredentialsRequest) (*DeleteRuntimeCredentialsResponse, error) - // Validate runtime credential - ValidateRuntimeCredential(context.Context, *ValidateRuntimeCredentialRequest) (*ValidateRuntimeCredentialResponse, error) - // Get runtime provider zones - DescribeRuntimeProviderZones(context.Context, *DescribeRuntimeProviderZonesRequest) (*DescribeRuntimeProviderZonesResponse, error) - // Get statistics of runtime - GetRuntimeStatistics(context.Context, *GetRuntimeStatisticsRequest) (*GetRuntimeStatisticsResponse, error) -} - -// UnimplementedRuntimeManagerServer can be embedded to have forward compatible implementations. -type UnimplementedRuntimeManagerServer struct { -} - -func (*UnimplementedRuntimeManagerServer) CreateRuntime(ctx context.Context, req *CreateRuntimeRequest) (*CreateRuntimeResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method CreateRuntime not implemented") -} -func (*UnimplementedRuntimeManagerServer) CreateDebugRuntime(ctx context.Context, req *CreateRuntimeRequest) (*CreateRuntimeResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method CreateDebugRuntime not implemented") -} -func (*UnimplementedRuntimeManagerServer) DescribeRuntimeDetails(ctx context.Context, req *DescribeRuntimesRequest) (*DescribeRuntimeDetailsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method DescribeRuntimeDetails not implemented") -} -func (*UnimplementedRuntimeManagerServer) DescribeRuntimes(ctx context.Context, req *DescribeRuntimesRequest) (*DescribeRuntimesResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method DescribeRuntimes not implemented") -} -func (*UnimplementedRuntimeManagerServer) DescribeDebugRuntimes(ctx context.Context, req *DescribeRuntimesRequest) (*DescribeRuntimesResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method DescribeDebugRuntimes not implemented") -} -func (*UnimplementedRuntimeManagerServer) ModifyRuntime(ctx context.Context, req *ModifyRuntimeRequest) (*ModifyRuntimeResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ModifyRuntime not implemented") -} -func (*UnimplementedRuntimeManagerServer) DeleteRuntimes(ctx context.Context, req *DeleteRuntimesRequest) (*DeleteRuntimesResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method DeleteRuntimes not implemented") -} -func (*UnimplementedRuntimeManagerServer) CreateRuntimeCredential(ctx context.Context, req *CreateRuntimeCredentialRequest) (*CreateRuntimeCredentialResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method CreateRuntimeCredential not implemented") -} -func (*UnimplementedRuntimeManagerServer) CreateDebugRuntimeCredential(ctx context.Context, req *CreateRuntimeCredentialRequest) (*CreateRuntimeCredentialResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method CreateDebugRuntimeCredential not implemented") -} -func (*UnimplementedRuntimeManagerServer) DescribeRuntimeCredentials(ctx context.Context, req *DescribeRuntimeCredentialsRequest) (*DescribeRuntimeCredentialsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method DescribeRuntimeCredentials not implemented") -} -func (*UnimplementedRuntimeManagerServer) DescribeDebugRuntimeCredentials(ctx context.Context, req *DescribeRuntimeCredentialsRequest) (*DescribeRuntimeCredentialsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method DescribeDebugRuntimeCredentials not implemented") -} -func (*UnimplementedRuntimeManagerServer) ModifyRuntimeCredential(ctx context.Context, req *ModifyRuntimeCredentialRequest) (*ModifyRuntimeCredentialResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ModifyRuntimeCredential not implemented") -} -func (*UnimplementedRuntimeManagerServer) DeleteRuntimeCredentials(ctx context.Context, req *DeleteRuntimeCredentialsRequest) (*DeleteRuntimeCredentialsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method DeleteRuntimeCredentials not implemented") -} -func (*UnimplementedRuntimeManagerServer) ValidateRuntimeCredential(ctx context.Context, req *ValidateRuntimeCredentialRequest) (*ValidateRuntimeCredentialResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ValidateRuntimeCredential not implemented") -} -func (*UnimplementedRuntimeManagerServer) DescribeRuntimeProviderZones(ctx context.Context, req *DescribeRuntimeProviderZonesRequest) (*DescribeRuntimeProviderZonesResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method DescribeRuntimeProviderZones not implemented") -} -func (*UnimplementedRuntimeManagerServer) GetRuntimeStatistics(ctx context.Context, req *GetRuntimeStatisticsRequest) (*GetRuntimeStatisticsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetRuntimeStatistics not implemented") -} - -func RegisterRuntimeManagerServer(s *grpc.Server, srv RuntimeManagerServer) { - s.RegisterService(&_RuntimeManager_serviceDesc, srv) -} - -func _RuntimeManager_CreateRuntime_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CreateRuntimeRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(RuntimeManagerServer).CreateRuntime(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/openpitrix.RuntimeManager/CreateRuntime", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(RuntimeManagerServer).CreateRuntime(ctx, req.(*CreateRuntimeRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _RuntimeManager_CreateDebugRuntime_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CreateRuntimeRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(RuntimeManagerServer).CreateDebugRuntime(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/openpitrix.RuntimeManager/CreateDebugRuntime", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(RuntimeManagerServer).CreateDebugRuntime(ctx, req.(*CreateRuntimeRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _RuntimeManager_DescribeRuntimeDetails_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DescribeRuntimesRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(RuntimeManagerServer).DescribeRuntimeDetails(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/openpitrix.RuntimeManager/DescribeRuntimeDetails", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(RuntimeManagerServer).DescribeRuntimeDetails(ctx, req.(*DescribeRuntimesRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _RuntimeManager_DescribeRuntimes_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DescribeRuntimesRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(RuntimeManagerServer).DescribeRuntimes(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/openpitrix.RuntimeManager/DescribeRuntimes", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(RuntimeManagerServer).DescribeRuntimes(ctx, req.(*DescribeRuntimesRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _RuntimeManager_DescribeDebugRuntimes_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DescribeRuntimesRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(RuntimeManagerServer).DescribeDebugRuntimes(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/openpitrix.RuntimeManager/DescribeDebugRuntimes", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(RuntimeManagerServer).DescribeDebugRuntimes(ctx, req.(*DescribeRuntimesRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _RuntimeManager_ModifyRuntime_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ModifyRuntimeRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(RuntimeManagerServer).ModifyRuntime(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/openpitrix.RuntimeManager/ModifyRuntime", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(RuntimeManagerServer).ModifyRuntime(ctx, req.(*ModifyRuntimeRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _RuntimeManager_DeleteRuntimes_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DeleteRuntimesRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(RuntimeManagerServer).DeleteRuntimes(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/openpitrix.RuntimeManager/DeleteRuntimes", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(RuntimeManagerServer).DeleteRuntimes(ctx, req.(*DeleteRuntimesRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _RuntimeManager_CreateRuntimeCredential_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CreateRuntimeCredentialRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(RuntimeManagerServer).CreateRuntimeCredential(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/openpitrix.RuntimeManager/CreateRuntimeCredential", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(RuntimeManagerServer).CreateRuntimeCredential(ctx, req.(*CreateRuntimeCredentialRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _RuntimeManager_CreateDebugRuntimeCredential_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CreateRuntimeCredentialRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(RuntimeManagerServer).CreateDebugRuntimeCredential(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/openpitrix.RuntimeManager/CreateDebugRuntimeCredential", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(RuntimeManagerServer).CreateDebugRuntimeCredential(ctx, req.(*CreateRuntimeCredentialRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _RuntimeManager_DescribeRuntimeCredentials_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DescribeRuntimeCredentialsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(RuntimeManagerServer).DescribeRuntimeCredentials(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/openpitrix.RuntimeManager/DescribeRuntimeCredentials", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(RuntimeManagerServer).DescribeRuntimeCredentials(ctx, req.(*DescribeRuntimeCredentialsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _RuntimeManager_DescribeDebugRuntimeCredentials_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DescribeRuntimeCredentialsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(RuntimeManagerServer).DescribeDebugRuntimeCredentials(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/openpitrix.RuntimeManager/DescribeDebugRuntimeCredentials", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(RuntimeManagerServer).DescribeDebugRuntimeCredentials(ctx, req.(*DescribeRuntimeCredentialsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _RuntimeManager_ModifyRuntimeCredential_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ModifyRuntimeCredentialRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(RuntimeManagerServer).ModifyRuntimeCredential(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/openpitrix.RuntimeManager/ModifyRuntimeCredential", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(RuntimeManagerServer).ModifyRuntimeCredential(ctx, req.(*ModifyRuntimeCredentialRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _RuntimeManager_DeleteRuntimeCredentials_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DeleteRuntimeCredentialsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(RuntimeManagerServer).DeleteRuntimeCredentials(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/openpitrix.RuntimeManager/DeleteRuntimeCredentials", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(RuntimeManagerServer).DeleteRuntimeCredentials(ctx, req.(*DeleteRuntimeCredentialsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _RuntimeManager_ValidateRuntimeCredential_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ValidateRuntimeCredentialRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(RuntimeManagerServer).ValidateRuntimeCredential(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/openpitrix.RuntimeManager/ValidateRuntimeCredential", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(RuntimeManagerServer).ValidateRuntimeCredential(ctx, req.(*ValidateRuntimeCredentialRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _RuntimeManager_DescribeRuntimeProviderZones_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DescribeRuntimeProviderZonesRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(RuntimeManagerServer).DescribeRuntimeProviderZones(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/openpitrix.RuntimeManager/DescribeRuntimeProviderZones", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(RuntimeManagerServer).DescribeRuntimeProviderZones(ctx, req.(*DescribeRuntimeProviderZonesRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _RuntimeManager_GetRuntimeStatistics_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetRuntimeStatisticsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(RuntimeManagerServer).GetRuntimeStatistics(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/openpitrix.RuntimeManager/GetRuntimeStatistics", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(RuntimeManagerServer).GetRuntimeStatistics(ctx, req.(*GetRuntimeStatisticsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _RuntimeManager_serviceDesc = grpc.ServiceDesc{ - ServiceName: "openpitrix.RuntimeManager", - HandlerType: (*RuntimeManagerServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "CreateRuntime", - Handler: _RuntimeManager_CreateRuntime_Handler, - }, - { - MethodName: "CreateDebugRuntime", - Handler: _RuntimeManager_CreateDebugRuntime_Handler, - }, - { - MethodName: "DescribeRuntimeDetails", - Handler: _RuntimeManager_DescribeRuntimeDetails_Handler, - }, - { - MethodName: "DescribeRuntimes", - Handler: _RuntimeManager_DescribeRuntimes_Handler, - }, - { - MethodName: "DescribeDebugRuntimes", - Handler: _RuntimeManager_DescribeDebugRuntimes_Handler, - }, - { - MethodName: "ModifyRuntime", - Handler: _RuntimeManager_ModifyRuntime_Handler, - }, - { - MethodName: "DeleteRuntimes", - Handler: _RuntimeManager_DeleteRuntimes_Handler, - }, - { - MethodName: "CreateRuntimeCredential", - Handler: _RuntimeManager_CreateRuntimeCredential_Handler, - }, - { - MethodName: "CreateDebugRuntimeCredential", - Handler: _RuntimeManager_CreateDebugRuntimeCredential_Handler, - }, - { - MethodName: "DescribeRuntimeCredentials", - Handler: _RuntimeManager_DescribeRuntimeCredentials_Handler, - }, - { - MethodName: "DescribeDebugRuntimeCredentials", - Handler: _RuntimeManager_DescribeDebugRuntimeCredentials_Handler, - }, - { - MethodName: "ModifyRuntimeCredential", - Handler: _RuntimeManager_ModifyRuntimeCredential_Handler, - }, - { - MethodName: "DeleteRuntimeCredentials", - Handler: _RuntimeManager_DeleteRuntimeCredentials_Handler, - }, - { - MethodName: "ValidateRuntimeCredential", - Handler: _RuntimeManager_ValidateRuntimeCredential_Handler, - }, - { - MethodName: "DescribeRuntimeProviderZones", - Handler: _RuntimeManager_DescribeRuntimeProviderZones_Handler, - }, - { - MethodName: "GetRuntimeStatistics", - Handler: _RuntimeManager_GetRuntimeStatistics_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "runtime.proto", -} diff --git a/vendor/openpitrix.io/openpitrix/pkg/pb/runtime.pb.gw.go b/vendor/openpitrix.io/openpitrix/pkg/pb/runtime.pb.gw.go deleted file mode 100644 index 36267e4694..0000000000 --- a/vendor/openpitrix.io/openpitrix/pkg/pb/runtime.pb.gw.go +++ /dev/null @@ -1,1234 +0,0 @@ -// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: runtime.proto - -/* -Package pb is a reverse proxy. - -It translates gRPC into RESTful JSON APIs. -*/ -package pb - -import ( - "context" - "io" - "net/http" - - "github.com/golang/protobuf/descriptor" - "github.com/golang/protobuf/proto" - "github.com/grpc-ecosystem/grpc-gateway/runtime" - "github.com/grpc-ecosystem/grpc-gateway/utilities" - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/grpclog" - "google.golang.org/grpc/status" -) - -// Suppress "imported and not used" errors -var _ codes.Code -var _ io.Reader -var _ status.Status -var _ = runtime.String -var _ = utilities.NewDoubleArray -var _ = descriptor.ForMessage - -func request_RuntimeManager_CreateRuntime_0(ctx context.Context, marshaler runtime.Marshaler, client RuntimeManagerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq CreateRuntimeRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.CreateRuntime(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_RuntimeManager_CreateRuntime_0(ctx context.Context, marshaler runtime.Marshaler, server RuntimeManagerServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq CreateRuntimeRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.CreateRuntime(ctx, &protoReq) - return msg, metadata, err - -} - -func request_RuntimeManager_CreateDebugRuntime_0(ctx context.Context, marshaler runtime.Marshaler, client RuntimeManagerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq CreateRuntimeRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.CreateDebugRuntime(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_RuntimeManager_CreateDebugRuntime_0(ctx context.Context, marshaler runtime.Marshaler, server RuntimeManagerServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq CreateRuntimeRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.CreateDebugRuntime(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_RuntimeManager_DescribeRuntimes_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_RuntimeManager_DescribeRuntimes_0(ctx context.Context, marshaler runtime.Marshaler, client RuntimeManagerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq DescribeRuntimesRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_RuntimeManager_DescribeRuntimes_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.DescribeRuntimes(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_RuntimeManager_DescribeRuntimes_0(ctx context.Context, marshaler runtime.Marshaler, server RuntimeManagerServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq DescribeRuntimesRequest - var metadata runtime.ServerMetadata - - if err := runtime.PopulateQueryParameters(&protoReq, req.URL.Query(), filter_RuntimeManager_DescribeRuntimes_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.DescribeRuntimes(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_RuntimeManager_DescribeDebugRuntimes_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_RuntimeManager_DescribeDebugRuntimes_0(ctx context.Context, marshaler runtime.Marshaler, client RuntimeManagerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq DescribeRuntimesRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_RuntimeManager_DescribeDebugRuntimes_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.DescribeDebugRuntimes(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_RuntimeManager_DescribeDebugRuntimes_0(ctx context.Context, marshaler runtime.Marshaler, server RuntimeManagerServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq DescribeRuntimesRequest - var metadata runtime.ServerMetadata - - if err := runtime.PopulateQueryParameters(&protoReq, req.URL.Query(), filter_RuntimeManager_DescribeDebugRuntimes_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.DescribeDebugRuntimes(ctx, &protoReq) - return msg, metadata, err - -} - -func request_RuntimeManager_ModifyRuntime_0(ctx context.Context, marshaler runtime.Marshaler, client RuntimeManagerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ModifyRuntimeRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.ModifyRuntime(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_RuntimeManager_ModifyRuntime_0(ctx context.Context, marshaler runtime.Marshaler, server RuntimeManagerServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ModifyRuntimeRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.ModifyRuntime(ctx, &protoReq) - return msg, metadata, err - -} - -func request_RuntimeManager_DeleteRuntimes_0(ctx context.Context, marshaler runtime.Marshaler, client RuntimeManagerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq DeleteRuntimesRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.DeleteRuntimes(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_RuntimeManager_DeleteRuntimes_0(ctx context.Context, marshaler runtime.Marshaler, server RuntimeManagerServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq DeleteRuntimesRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.DeleteRuntimes(ctx, &protoReq) - return msg, metadata, err - -} - -func request_RuntimeManager_CreateRuntimeCredential_0(ctx context.Context, marshaler runtime.Marshaler, client RuntimeManagerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq CreateRuntimeCredentialRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.CreateRuntimeCredential(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_RuntimeManager_CreateRuntimeCredential_0(ctx context.Context, marshaler runtime.Marshaler, server RuntimeManagerServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq CreateRuntimeCredentialRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.CreateRuntimeCredential(ctx, &protoReq) - return msg, metadata, err - -} - -func request_RuntimeManager_CreateDebugRuntimeCredential_0(ctx context.Context, marshaler runtime.Marshaler, client RuntimeManagerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq CreateRuntimeCredentialRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.CreateDebugRuntimeCredential(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_RuntimeManager_CreateDebugRuntimeCredential_0(ctx context.Context, marshaler runtime.Marshaler, server RuntimeManagerServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq CreateRuntimeCredentialRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.CreateDebugRuntimeCredential(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_RuntimeManager_DescribeRuntimeCredentials_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_RuntimeManager_DescribeRuntimeCredentials_0(ctx context.Context, marshaler runtime.Marshaler, client RuntimeManagerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq DescribeRuntimeCredentialsRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_RuntimeManager_DescribeRuntimeCredentials_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.DescribeRuntimeCredentials(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_RuntimeManager_DescribeRuntimeCredentials_0(ctx context.Context, marshaler runtime.Marshaler, server RuntimeManagerServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq DescribeRuntimeCredentialsRequest - var metadata runtime.ServerMetadata - - if err := runtime.PopulateQueryParameters(&protoReq, req.URL.Query(), filter_RuntimeManager_DescribeRuntimeCredentials_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.DescribeRuntimeCredentials(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_RuntimeManager_DescribeDebugRuntimeCredentials_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_RuntimeManager_DescribeDebugRuntimeCredentials_0(ctx context.Context, marshaler runtime.Marshaler, client RuntimeManagerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq DescribeRuntimeCredentialsRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_RuntimeManager_DescribeDebugRuntimeCredentials_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.DescribeDebugRuntimeCredentials(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_RuntimeManager_DescribeDebugRuntimeCredentials_0(ctx context.Context, marshaler runtime.Marshaler, server RuntimeManagerServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq DescribeRuntimeCredentialsRequest - var metadata runtime.ServerMetadata - - if err := runtime.PopulateQueryParameters(&protoReq, req.URL.Query(), filter_RuntimeManager_DescribeDebugRuntimeCredentials_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.DescribeDebugRuntimeCredentials(ctx, &protoReq) - return msg, metadata, err - -} - -func request_RuntimeManager_ModifyRuntimeCredential_0(ctx context.Context, marshaler runtime.Marshaler, client RuntimeManagerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ModifyRuntimeCredentialRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.ModifyRuntimeCredential(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_RuntimeManager_ModifyRuntimeCredential_0(ctx context.Context, marshaler runtime.Marshaler, server RuntimeManagerServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ModifyRuntimeCredentialRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.ModifyRuntimeCredential(ctx, &protoReq) - return msg, metadata, err - -} - -func request_RuntimeManager_DeleteRuntimeCredentials_0(ctx context.Context, marshaler runtime.Marshaler, client RuntimeManagerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq DeleteRuntimeCredentialsRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.DeleteRuntimeCredentials(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_RuntimeManager_DeleteRuntimeCredentials_0(ctx context.Context, marshaler runtime.Marshaler, server RuntimeManagerServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq DeleteRuntimeCredentialsRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.DeleteRuntimeCredentials(ctx, &protoReq) - return msg, metadata, err - -} - -func request_RuntimeManager_ValidateRuntimeCredential_0(ctx context.Context, marshaler runtime.Marshaler, client RuntimeManagerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ValidateRuntimeCredentialRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.ValidateRuntimeCredential(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_RuntimeManager_ValidateRuntimeCredential_0(ctx context.Context, marshaler runtime.Marshaler, server RuntimeManagerServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ValidateRuntimeCredentialRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.ValidateRuntimeCredential(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_RuntimeManager_DescribeRuntimeProviderZones_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_RuntimeManager_DescribeRuntimeProviderZones_0(ctx context.Context, marshaler runtime.Marshaler, client RuntimeManagerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq DescribeRuntimeProviderZonesRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_RuntimeManager_DescribeRuntimeProviderZones_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.DescribeRuntimeProviderZones(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_RuntimeManager_DescribeRuntimeProviderZones_0(ctx context.Context, marshaler runtime.Marshaler, server RuntimeManagerServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq DescribeRuntimeProviderZonesRequest - var metadata runtime.ServerMetadata - - if err := runtime.PopulateQueryParameters(&protoReq, req.URL.Query(), filter_RuntimeManager_DescribeRuntimeProviderZones_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.DescribeRuntimeProviderZones(ctx, &protoReq) - return msg, metadata, err - -} - -func request_RuntimeManager_GetRuntimeStatistics_0(ctx context.Context, marshaler runtime.Marshaler, client RuntimeManagerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq GetRuntimeStatisticsRequest - var metadata runtime.ServerMetadata - - msg, err := client.GetRuntimeStatistics(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_RuntimeManager_GetRuntimeStatistics_0(ctx context.Context, marshaler runtime.Marshaler, server RuntimeManagerServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq GetRuntimeStatisticsRequest - var metadata runtime.ServerMetadata - - msg, err := server.GetRuntimeStatistics(ctx, &protoReq) - return msg, metadata, err - -} - -// RegisterRuntimeManagerHandlerServer registers the http handlers for service RuntimeManager to "mux". -// UnaryRPC :call RuntimeManagerServer directly. -// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. -func RegisterRuntimeManagerHandlerServer(ctx context.Context, mux *runtime.ServeMux, server RuntimeManagerServer) error { - - mux.Handle("POST", pattern_RuntimeManager_CreateRuntime_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_RuntimeManager_CreateRuntime_0(rctx, inboundMarshaler, server, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_RuntimeManager_CreateRuntime_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_RuntimeManager_CreateDebugRuntime_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_RuntimeManager_CreateDebugRuntime_0(rctx, inboundMarshaler, server, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_RuntimeManager_CreateDebugRuntime_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_RuntimeManager_DescribeRuntimes_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_RuntimeManager_DescribeRuntimes_0(rctx, inboundMarshaler, server, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_RuntimeManager_DescribeRuntimes_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_RuntimeManager_DescribeDebugRuntimes_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_RuntimeManager_DescribeDebugRuntimes_0(rctx, inboundMarshaler, server, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_RuntimeManager_DescribeDebugRuntimes_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("PATCH", pattern_RuntimeManager_ModifyRuntime_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_RuntimeManager_ModifyRuntime_0(rctx, inboundMarshaler, server, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_RuntimeManager_ModifyRuntime_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("DELETE", pattern_RuntimeManager_DeleteRuntimes_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_RuntimeManager_DeleteRuntimes_0(rctx, inboundMarshaler, server, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_RuntimeManager_DeleteRuntimes_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_RuntimeManager_CreateRuntimeCredential_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_RuntimeManager_CreateRuntimeCredential_0(rctx, inboundMarshaler, server, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_RuntimeManager_CreateRuntimeCredential_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_RuntimeManager_CreateDebugRuntimeCredential_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_RuntimeManager_CreateDebugRuntimeCredential_0(rctx, inboundMarshaler, server, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_RuntimeManager_CreateDebugRuntimeCredential_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_RuntimeManager_DescribeRuntimeCredentials_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_RuntimeManager_DescribeRuntimeCredentials_0(rctx, inboundMarshaler, server, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_RuntimeManager_DescribeRuntimeCredentials_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_RuntimeManager_DescribeDebugRuntimeCredentials_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_RuntimeManager_DescribeDebugRuntimeCredentials_0(rctx, inboundMarshaler, server, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_RuntimeManager_DescribeDebugRuntimeCredentials_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("PATCH", pattern_RuntimeManager_ModifyRuntimeCredential_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_RuntimeManager_ModifyRuntimeCredential_0(rctx, inboundMarshaler, server, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_RuntimeManager_ModifyRuntimeCredential_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("DELETE", pattern_RuntimeManager_DeleteRuntimeCredentials_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_RuntimeManager_DeleteRuntimeCredentials_0(rctx, inboundMarshaler, server, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_RuntimeManager_DeleteRuntimeCredentials_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_RuntimeManager_ValidateRuntimeCredential_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_RuntimeManager_ValidateRuntimeCredential_0(rctx, inboundMarshaler, server, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_RuntimeManager_ValidateRuntimeCredential_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_RuntimeManager_DescribeRuntimeProviderZones_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_RuntimeManager_DescribeRuntimeProviderZones_0(rctx, inboundMarshaler, server, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_RuntimeManager_DescribeRuntimeProviderZones_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_RuntimeManager_GetRuntimeStatistics_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_RuntimeManager_GetRuntimeStatistics_0(rctx, inboundMarshaler, server, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_RuntimeManager_GetRuntimeStatistics_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -// RegisterRuntimeManagerHandlerFromEndpoint is same as RegisterRuntimeManagerHandler but -// automatically dials to "endpoint" and closes the connection when "ctx" gets done. -func RegisterRuntimeManagerHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { - conn, err := grpc.Dial(endpoint, opts...) - if err != nil { - return err - } - defer func() { - if err != nil { - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - return - } - go func() { - <-ctx.Done() - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - }() - }() - - return RegisterRuntimeManagerHandler(ctx, mux, conn) -} - -// RegisterRuntimeManagerHandler registers the http handlers for service RuntimeManager to "mux". -// The handlers forward requests to the grpc endpoint over "conn". -func RegisterRuntimeManagerHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { - return RegisterRuntimeManagerHandlerClient(ctx, mux, NewRuntimeManagerClient(conn)) -} - -// RegisterRuntimeManagerHandlerClient registers the http handlers for service RuntimeManager -// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "RuntimeManagerClient". -// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "RuntimeManagerClient" -// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in -// "RuntimeManagerClient" to call the correct interceptors. -func RegisterRuntimeManagerHandlerClient(ctx context.Context, mux *runtime.ServeMux, client RuntimeManagerClient) error { - - mux.Handle("POST", pattern_RuntimeManager_CreateRuntime_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_RuntimeManager_CreateRuntime_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_RuntimeManager_CreateRuntime_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_RuntimeManager_CreateDebugRuntime_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_RuntimeManager_CreateDebugRuntime_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_RuntimeManager_CreateDebugRuntime_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_RuntimeManager_DescribeRuntimes_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_RuntimeManager_DescribeRuntimes_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_RuntimeManager_DescribeRuntimes_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_RuntimeManager_DescribeDebugRuntimes_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_RuntimeManager_DescribeDebugRuntimes_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_RuntimeManager_DescribeDebugRuntimes_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("PATCH", pattern_RuntimeManager_ModifyRuntime_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_RuntimeManager_ModifyRuntime_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_RuntimeManager_ModifyRuntime_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("DELETE", pattern_RuntimeManager_DeleteRuntimes_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_RuntimeManager_DeleteRuntimes_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_RuntimeManager_DeleteRuntimes_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_RuntimeManager_CreateRuntimeCredential_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_RuntimeManager_CreateRuntimeCredential_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_RuntimeManager_CreateRuntimeCredential_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_RuntimeManager_CreateDebugRuntimeCredential_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_RuntimeManager_CreateDebugRuntimeCredential_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_RuntimeManager_CreateDebugRuntimeCredential_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_RuntimeManager_DescribeRuntimeCredentials_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_RuntimeManager_DescribeRuntimeCredentials_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_RuntimeManager_DescribeRuntimeCredentials_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_RuntimeManager_DescribeDebugRuntimeCredentials_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_RuntimeManager_DescribeDebugRuntimeCredentials_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_RuntimeManager_DescribeDebugRuntimeCredentials_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("PATCH", pattern_RuntimeManager_ModifyRuntimeCredential_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_RuntimeManager_ModifyRuntimeCredential_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_RuntimeManager_ModifyRuntimeCredential_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("DELETE", pattern_RuntimeManager_DeleteRuntimeCredentials_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_RuntimeManager_DeleteRuntimeCredentials_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_RuntimeManager_DeleteRuntimeCredentials_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_RuntimeManager_ValidateRuntimeCredential_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_RuntimeManager_ValidateRuntimeCredential_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_RuntimeManager_ValidateRuntimeCredential_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_RuntimeManager_DescribeRuntimeProviderZones_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_RuntimeManager_DescribeRuntimeProviderZones_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_RuntimeManager_DescribeRuntimeProviderZones_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_RuntimeManager_GetRuntimeStatistics_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_RuntimeManager_GetRuntimeStatistics_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_RuntimeManager_GetRuntimeStatistics_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -var ( - pattern_RuntimeManager_CreateRuntime_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "runtimes"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_RuntimeManager_CreateDebugRuntime_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "debug_runtimes"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_RuntimeManager_DescribeRuntimes_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "runtimes"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_RuntimeManager_DescribeDebugRuntimes_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "debug_runtimes"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_RuntimeManager_ModifyRuntime_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "runtimes"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_RuntimeManager_DeleteRuntimes_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "runtimes"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_RuntimeManager_CreateRuntimeCredential_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "runtimes", "credentials"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_RuntimeManager_CreateDebugRuntimeCredential_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "debug_runtimes", "credentials"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_RuntimeManager_DescribeRuntimeCredentials_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "runtimes", "credentials"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_RuntimeManager_DescribeDebugRuntimeCredentials_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "debug_runtimes", "credentials"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_RuntimeManager_ModifyRuntimeCredential_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "runtimes", "credentials"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_RuntimeManager_DeleteRuntimeCredentials_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "runtimes", "credentials"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_RuntimeManager_ValidateRuntimeCredential_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "runtimes", "credentials"}, "validate", runtime.AssumeColonVerbOpt(true))) - - pattern_RuntimeManager_DescribeRuntimeProviderZones_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "runtimes", "zones"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_RuntimeManager_GetRuntimeStatistics_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "runtimes", "statistics"}, "", runtime.AssumeColonVerbOpt(true))) -) - -var ( - forward_RuntimeManager_CreateRuntime_0 = runtime.ForwardResponseMessage - - forward_RuntimeManager_CreateDebugRuntime_0 = runtime.ForwardResponseMessage - - forward_RuntimeManager_DescribeRuntimes_0 = runtime.ForwardResponseMessage - - forward_RuntimeManager_DescribeDebugRuntimes_0 = runtime.ForwardResponseMessage - - forward_RuntimeManager_ModifyRuntime_0 = runtime.ForwardResponseMessage - - forward_RuntimeManager_DeleteRuntimes_0 = runtime.ForwardResponseMessage - - forward_RuntimeManager_CreateRuntimeCredential_0 = runtime.ForwardResponseMessage - - forward_RuntimeManager_CreateDebugRuntimeCredential_0 = runtime.ForwardResponseMessage - - forward_RuntimeManager_DescribeRuntimeCredentials_0 = runtime.ForwardResponseMessage - - forward_RuntimeManager_DescribeDebugRuntimeCredentials_0 = runtime.ForwardResponseMessage - - forward_RuntimeManager_ModifyRuntimeCredential_0 = runtime.ForwardResponseMessage - - forward_RuntimeManager_DeleteRuntimeCredentials_0 = runtime.ForwardResponseMessage - - forward_RuntimeManager_ValidateRuntimeCredential_0 = runtime.ForwardResponseMessage - - forward_RuntimeManager_DescribeRuntimeProviderZones_0 = runtime.ForwardResponseMessage - - forward_RuntimeManager_GetRuntimeStatistics_0 = runtime.ForwardResponseMessage -) diff --git a/vendor/openpitrix.io/openpitrix/pkg/pb/runtime_provider.pb.go b/vendor/openpitrix.io/openpitrix/pkg/pb/runtime_provider.pb.go deleted file mode 100644 index c3e0a7879d..0000000000 --- a/vendor/openpitrix.io/openpitrix/pkg/pb/runtime_provider.pb.go +++ /dev/null @@ -1,1659 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// source: runtime_provider.proto - -package pb - -import ( - context "context" - fmt "fmt" - math "math" - - proto "github.com/golang/protobuf/proto" - timestamp "github.com/golang/protobuf/ptypes/timestamp" - wrappers "github.com/golang/protobuf/ptypes/wrappers" - _ "github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger/options" - _ "google.golang.org/genproto/googleapis/api/annotations" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" -) - -// 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 - -type RegisterRuntimeProviderRequest struct { - // required, runtime provider.eg:[qingcloud|aliyun|aws|kubernetes] - Provider *wrappers.StringValue `protobuf:"bytes,1,opt,name=provider,proto3" json:"provider,omitempty"` - // required, configure of runtime provider - Config *wrappers.StringValue `protobuf:"bytes,2,opt,name=config,proto3" json:"config,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *RegisterRuntimeProviderRequest) Reset() { *m = RegisterRuntimeProviderRequest{} } -func (m *RegisterRuntimeProviderRequest) String() string { return proto.CompactTextString(m) } -func (*RegisterRuntimeProviderRequest) ProtoMessage() {} -func (*RegisterRuntimeProviderRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_2998074df425fa49, []int{0} -} - -func (m *RegisterRuntimeProviderRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_RegisterRuntimeProviderRequest.Unmarshal(m, b) -} -func (m *RegisterRuntimeProviderRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_RegisterRuntimeProviderRequest.Marshal(b, m, deterministic) -} -func (m *RegisterRuntimeProviderRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_RegisterRuntimeProviderRequest.Merge(m, src) -} -func (m *RegisterRuntimeProviderRequest) XXX_Size() int { - return xxx_messageInfo_RegisterRuntimeProviderRequest.Size(m) -} -func (m *RegisterRuntimeProviderRequest) XXX_DiscardUnknown() { - xxx_messageInfo_RegisterRuntimeProviderRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_RegisterRuntimeProviderRequest proto.InternalMessageInfo - -func (m *RegisterRuntimeProviderRequest) GetProvider() *wrappers.StringValue { - if m != nil { - return m.Provider - } - return nil -} - -func (m *RegisterRuntimeProviderRequest) GetConfig() *wrappers.StringValue { - if m != nil { - return m.Config - } - return nil -} - -type RegisterRuntimeProviderResponse struct { - // register ok or not - Ok *wrappers.BoolValue `protobuf:"bytes,1,opt,name=ok,proto3" json:"ok,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *RegisterRuntimeProviderResponse) Reset() { *m = RegisterRuntimeProviderResponse{} } -func (m *RegisterRuntimeProviderResponse) String() string { return proto.CompactTextString(m) } -func (*RegisterRuntimeProviderResponse) ProtoMessage() {} -func (*RegisterRuntimeProviderResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_2998074df425fa49, []int{1} -} - -func (m *RegisterRuntimeProviderResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_RegisterRuntimeProviderResponse.Unmarshal(m, b) -} -func (m *RegisterRuntimeProviderResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_RegisterRuntimeProviderResponse.Marshal(b, m, deterministic) -} -func (m *RegisterRuntimeProviderResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_RegisterRuntimeProviderResponse.Merge(m, src) -} -func (m *RegisterRuntimeProviderResponse) XXX_Size() int { - return xxx_messageInfo_RegisterRuntimeProviderResponse.Size(m) -} -func (m *RegisterRuntimeProviderResponse) XXX_DiscardUnknown() { - xxx_messageInfo_RegisterRuntimeProviderResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_RegisterRuntimeProviderResponse proto.InternalMessageInfo - -func (m *RegisterRuntimeProviderResponse) GetOk() *wrappers.BoolValue { - if m != nil { - return m.Ok - } - return nil -} - -type ParseClusterConfRequest struct { - // required, runtime id - RuntimeId *wrappers.StringValue `protobuf:"bytes,1,opt,name=runtime_id,json=runtimeId,proto3" json:"runtime_id,omitempty"` - // version id - VersionId *wrappers.StringValue `protobuf:"bytes,2,opt,name=version_id,json=versionId,proto3" json:"version_id,omitempty"` - // required, configure - Conf *wrappers.StringValue `protobuf:"bytes,3,opt,name=conf,proto3" json:"conf,omitempty"` - // cluster in the runtime - Cluster *Cluster `protobuf:"bytes,4,opt,name=cluster,proto3" json:"cluster,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ParseClusterConfRequest) Reset() { *m = ParseClusterConfRequest{} } -func (m *ParseClusterConfRequest) String() string { return proto.CompactTextString(m) } -func (*ParseClusterConfRequest) ProtoMessage() {} -func (*ParseClusterConfRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_2998074df425fa49, []int{2} -} - -func (m *ParseClusterConfRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ParseClusterConfRequest.Unmarshal(m, b) -} -func (m *ParseClusterConfRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ParseClusterConfRequest.Marshal(b, m, deterministic) -} -func (m *ParseClusterConfRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_ParseClusterConfRequest.Merge(m, src) -} -func (m *ParseClusterConfRequest) XXX_Size() int { - return xxx_messageInfo_ParseClusterConfRequest.Size(m) -} -func (m *ParseClusterConfRequest) XXX_DiscardUnknown() { - xxx_messageInfo_ParseClusterConfRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_ParseClusterConfRequest proto.InternalMessageInfo - -func (m *ParseClusterConfRequest) GetRuntimeId() *wrappers.StringValue { - if m != nil { - return m.RuntimeId - } - return nil -} - -func (m *ParseClusterConfRequest) GetVersionId() *wrappers.StringValue { - if m != nil { - return m.VersionId - } - return nil -} - -func (m *ParseClusterConfRequest) GetConf() *wrappers.StringValue { - if m != nil { - return m.Conf - } - return nil -} - -func (m *ParseClusterConfRequest) GetCluster() *Cluster { - if m != nil { - return m.Cluster - } - return nil -} - -type ParseClusterConfResponse struct { - // cluster - Cluster *Cluster `protobuf:"bytes,1,opt,name=cluster,proto3" json:"cluster,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ParseClusterConfResponse) Reset() { *m = ParseClusterConfResponse{} } -func (m *ParseClusterConfResponse) String() string { return proto.CompactTextString(m) } -func (*ParseClusterConfResponse) ProtoMessage() {} -func (*ParseClusterConfResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_2998074df425fa49, []int{3} -} - -func (m *ParseClusterConfResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ParseClusterConfResponse.Unmarshal(m, b) -} -func (m *ParseClusterConfResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ParseClusterConfResponse.Marshal(b, m, deterministic) -} -func (m *ParseClusterConfResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_ParseClusterConfResponse.Merge(m, src) -} -func (m *ParseClusterConfResponse) XXX_Size() int { - return xxx_messageInfo_ParseClusterConfResponse.Size(m) -} -func (m *ParseClusterConfResponse) XXX_DiscardUnknown() { - xxx_messageInfo_ParseClusterConfResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_ParseClusterConfResponse proto.InternalMessageInfo - -func (m *ParseClusterConfResponse) GetCluster() *Cluster { - if m != nil { - return m.Cluster - } - return nil -} - -type SplitJobIntoTasksRequest struct { - // required, runtime id - RuntimeId *wrappers.StringValue `protobuf:"bytes,1,opt,name=runtime_id,json=runtimeId,proto3" json:"runtime_id,omitempty"` - // required, job to split - Job *Job `protobuf:"bytes,2,opt,name=job,proto3" json:"job,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *SplitJobIntoTasksRequest) Reset() { *m = SplitJobIntoTasksRequest{} } -func (m *SplitJobIntoTasksRequest) String() string { return proto.CompactTextString(m) } -func (*SplitJobIntoTasksRequest) ProtoMessage() {} -func (*SplitJobIntoTasksRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_2998074df425fa49, []int{4} -} - -func (m *SplitJobIntoTasksRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_SplitJobIntoTasksRequest.Unmarshal(m, b) -} -func (m *SplitJobIntoTasksRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_SplitJobIntoTasksRequest.Marshal(b, m, deterministic) -} -func (m *SplitJobIntoTasksRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_SplitJobIntoTasksRequest.Merge(m, src) -} -func (m *SplitJobIntoTasksRequest) XXX_Size() int { - return xxx_messageInfo_SplitJobIntoTasksRequest.Size(m) -} -func (m *SplitJobIntoTasksRequest) XXX_DiscardUnknown() { - xxx_messageInfo_SplitJobIntoTasksRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_SplitJobIntoTasksRequest proto.InternalMessageInfo - -func (m *SplitJobIntoTasksRequest) GetRuntimeId() *wrappers.StringValue { - if m != nil { - return m.RuntimeId - } - return nil -} - -func (m *SplitJobIntoTasksRequest) GetJob() *Job { - if m != nil { - return m.Job - } - return nil -} - -type SplitJobIntoTasksResponse struct { - // job will split to TaskLayer - TaskLayer *TaskLayer `protobuf:"bytes,1,opt,name=taskLayer,proto3" json:"taskLayer,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *SplitJobIntoTasksResponse) Reset() { *m = SplitJobIntoTasksResponse{} } -func (m *SplitJobIntoTasksResponse) String() string { return proto.CompactTextString(m) } -func (*SplitJobIntoTasksResponse) ProtoMessage() {} -func (*SplitJobIntoTasksResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_2998074df425fa49, []int{5} -} - -func (m *SplitJobIntoTasksResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_SplitJobIntoTasksResponse.Unmarshal(m, b) -} -func (m *SplitJobIntoTasksResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_SplitJobIntoTasksResponse.Marshal(b, m, deterministic) -} -func (m *SplitJobIntoTasksResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_SplitJobIntoTasksResponse.Merge(m, src) -} -func (m *SplitJobIntoTasksResponse) XXX_Size() int { - return xxx_messageInfo_SplitJobIntoTasksResponse.Size(m) -} -func (m *SplitJobIntoTasksResponse) XXX_DiscardUnknown() { - xxx_messageInfo_SplitJobIntoTasksResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_SplitJobIntoTasksResponse proto.InternalMessageInfo - -func (m *SplitJobIntoTasksResponse) GetTaskLayer() *TaskLayer { - if m != nil { - return m.TaskLayer - } - return nil -} - -type HandleSubtaskRequest struct { - // required, runtime id - RuntimeId *wrappers.StringValue `protobuf:"bytes,1,opt,name=runtime_id,json=runtimeId,proto3" json:"runtime_id,omitempty"` - // required, task to handle - Task *Task `protobuf:"bytes,2,opt,name=task,proto3" json:"task,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *HandleSubtaskRequest) Reset() { *m = HandleSubtaskRequest{} } -func (m *HandleSubtaskRequest) String() string { return proto.CompactTextString(m) } -func (*HandleSubtaskRequest) ProtoMessage() {} -func (*HandleSubtaskRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_2998074df425fa49, []int{6} -} - -func (m *HandleSubtaskRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_HandleSubtaskRequest.Unmarshal(m, b) -} -func (m *HandleSubtaskRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_HandleSubtaskRequest.Marshal(b, m, deterministic) -} -func (m *HandleSubtaskRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_HandleSubtaskRequest.Merge(m, src) -} -func (m *HandleSubtaskRequest) XXX_Size() int { - return xxx_messageInfo_HandleSubtaskRequest.Size(m) -} -func (m *HandleSubtaskRequest) XXX_DiscardUnknown() { - xxx_messageInfo_HandleSubtaskRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_HandleSubtaskRequest proto.InternalMessageInfo - -func (m *HandleSubtaskRequest) GetRuntimeId() *wrappers.StringValue { - if m != nil { - return m.RuntimeId - } - return nil -} - -func (m *HandleSubtaskRequest) GetTask() *Task { - if m != nil { - return m.Task - } - return nil -} - -type HandleSubtaskResponse struct { - // task handled - Task *Task `protobuf:"bytes,1,opt,name=task,proto3" json:"task,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *HandleSubtaskResponse) Reset() { *m = HandleSubtaskResponse{} } -func (m *HandleSubtaskResponse) String() string { return proto.CompactTextString(m) } -func (*HandleSubtaskResponse) ProtoMessage() {} -func (*HandleSubtaskResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_2998074df425fa49, []int{7} -} - -func (m *HandleSubtaskResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_HandleSubtaskResponse.Unmarshal(m, b) -} -func (m *HandleSubtaskResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_HandleSubtaskResponse.Marshal(b, m, deterministic) -} -func (m *HandleSubtaskResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_HandleSubtaskResponse.Merge(m, src) -} -func (m *HandleSubtaskResponse) XXX_Size() int { - return xxx_messageInfo_HandleSubtaskResponse.Size(m) -} -func (m *HandleSubtaskResponse) XXX_DiscardUnknown() { - xxx_messageInfo_HandleSubtaskResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_HandleSubtaskResponse proto.InternalMessageInfo - -func (m *HandleSubtaskResponse) GetTask() *Task { - if m != nil { - return m.Task - } - return nil -} - -type WaitSubtaskRequest struct { - // required, runtime id - RuntimeId *wrappers.StringValue `protobuf:"bytes,1,opt,name=runtime_id,json=runtimeId,proto3" json:"runtime_id,omitempty"` - // required, task to wait - Task *Task `protobuf:"bytes,2,opt,name=task,proto3" json:"task,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *WaitSubtaskRequest) Reset() { *m = WaitSubtaskRequest{} } -func (m *WaitSubtaskRequest) String() string { return proto.CompactTextString(m) } -func (*WaitSubtaskRequest) ProtoMessage() {} -func (*WaitSubtaskRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_2998074df425fa49, []int{8} -} - -func (m *WaitSubtaskRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_WaitSubtaskRequest.Unmarshal(m, b) -} -func (m *WaitSubtaskRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_WaitSubtaskRequest.Marshal(b, m, deterministic) -} -func (m *WaitSubtaskRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_WaitSubtaskRequest.Merge(m, src) -} -func (m *WaitSubtaskRequest) XXX_Size() int { - return xxx_messageInfo_WaitSubtaskRequest.Size(m) -} -func (m *WaitSubtaskRequest) XXX_DiscardUnknown() { - xxx_messageInfo_WaitSubtaskRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_WaitSubtaskRequest proto.InternalMessageInfo - -func (m *WaitSubtaskRequest) GetRuntimeId() *wrappers.StringValue { - if m != nil { - return m.RuntimeId - } - return nil -} - -func (m *WaitSubtaskRequest) GetTask() *Task { - if m != nil { - return m.Task - } - return nil -} - -type WaitSubtaskResponse struct { - // task waited - Task *Task `protobuf:"bytes,1,opt,name=task,proto3" json:"task,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *WaitSubtaskResponse) Reset() { *m = WaitSubtaskResponse{} } -func (m *WaitSubtaskResponse) String() string { return proto.CompactTextString(m) } -func (*WaitSubtaskResponse) ProtoMessage() {} -func (*WaitSubtaskResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_2998074df425fa49, []int{9} -} - -func (m *WaitSubtaskResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_WaitSubtaskResponse.Unmarshal(m, b) -} -func (m *WaitSubtaskResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_WaitSubtaskResponse.Marshal(b, m, deterministic) -} -func (m *WaitSubtaskResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_WaitSubtaskResponse.Merge(m, src) -} -func (m *WaitSubtaskResponse) XXX_Size() int { - return xxx_messageInfo_WaitSubtaskResponse.Size(m) -} -func (m *WaitSubtaskResponse) XXX_DiscardUnknown() { - xxx_messageInfo_WaitSubtaskResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_WaitSubtaskResponse proto.InternalMessageInfo - -func (m *WaitSubtaskResponse) GetTask() *Task { - if m != nil { - return m.Task - } - return nil -} - -type CheckResourceRequest struct { - // required, runtime id - RuntimeId *wrappers.StringValue `protobuf:"bytes,1,opt,name=runtime_id,json=runtimeId,proto3" json:"runtime_id,omitempty"` - // required, cluster to check - Cluster *Cluster `protobuf:"bytes,2,opt,name=cluster,proto3" json:"cluster,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *CheckResourceRequest) Reset() { *m = CheckResourceRequest{} } -func (m *CheckResourceRequest) String() string { return proto.CompactTextString(m) } -func (*CheckResourceRequest) ProtoMessage() {} -func (*CheckResourceRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_2998074df425fa49, []int{10} -} - -func (m *CheckResourceRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_CheckResourceRequest.Unmarshal(m, b) -} -func (m *CheckResourceRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_CheckResourceRequest.Marshal(b, m, deterministic) -} -func (m *CheckResourceRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_CheckResourceRequest.Merge(m, src) -} -func (m *CheckResourceRequest) XXX_Size() int { - return xxx_messageInfo_CheckResourceRequest.Size(m) -} -func (m *CheckResourceRequest) XXX_DiscardUnknown() { - xxx_messageInfo_CheckResourceRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_CheckResourceRequest proto.InternalMessageInfo - -func (m *CheckResourceRequest) GetRuntimeId() *wrappers.StringValue { - if m != nil { - return m.RuntimeId - } - return nil -} - -func (m *CheckResourceRequest) GetCluster() *Cluster { - if m != nil { - return m.Cluster - } - return nil -} - -type CheckResourceResponse struct { - // check ok or not - Ok *wrappers.BoolValue `protobuf:"bytes,1,opt,name=ok,proto3" json:"ok,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *CheckResourceResponse) Reset() { *m = CheckResourceResponse{} } -func (m *CheckResourceResponse) String() string { return proto.CompactTextString(m) } -func (*CheckResourceResponse) ProtoMessage() {} -func (*CheckResourceResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_2998074df425fa49, []int{11} -} - -func (m *CheckResourceResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_CheckResourceResponse.Unmarshal(m, b) -} -func (m *CheckResourceResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_CheckResourceResponse.Marshal(b, m, deterministic) -} -func (m *CheckResourceResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_CheckResourceResponse.Merge(m, src) -} -func (m *CheckResourceResponse) XXX_Size() int { - return xxx_messageInfo_CheckResourceResponse.Size(m) -} -func (m *CheckResourceResponse) XXX_DiscardUnknown() { - xxx_messageInfo_CheckResourceResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_CheckResourceResponse proto.InternalMessageInfo - -func (m *CheckResourceResponse) GetOk() *wrappers.BoolValue { - if m != nil { - return m.Ok - } - return nil -} - -type DescribeVpcRequest struct { - // required, get vpc of runtime - RuntimeId *wrappers.StringValue `protobuf:"bytes,1,opt,name=runtime_id,json=runtimeId,proto3" json:"runtime_id,omitempty"` - // required, use vpc id to get vpc in runtime - VpcId *wrappers.StringValue `protobuf:"bytes,2,opt,name=vpc_id,json=vpcId,proto3" json:"vpc_id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *DescribeVpcRequest) Reset() { *m = DescribeVpcRequest{} } -func (m *DescribeVpcRequest) String() string { return proto.CompactTextString(m) } -func (*DescribeVpcRequest) ProtoMessage() {} -func (*DescribeVpcRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_2998074df425fa49, []int{12} -} - -func (m *DescribeVpcRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_DescribeVpcRequest.Unmarshal(m, b) -} -func (m *DescribeVpcRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_DescribeVpcRequest.Marshal(b, m, deterministic) -} -func (m *DescribeVpcRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_DescribeVpcRequest.Merge(m, src) -} -func (m *DescribeVpcRequest) XXX_Size() int { - return xxx_messageInfo_DescribeVpcRequest.Size(m) -} -func (m *DescribeVpcRequest) XXX_DiscardUnknown() { - xxx_messageInfo_DescribeVpcRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_DescribeVpcRequest proto.InternalMessageInfo - -func (m *DescribeVpcRequest) GetRuntimeId() *wrappers.StringValue { - if m != nil { - return m.RuntimeId - } - return nil -} - -func (m *DescribeVpcRequest) GetVpcId() *wrappers.StringValue { - if m != nil { - return m.VpcId - } - return nil -} - -type Eip struct { - // elastic ip - EipId *wrappers.StringValue `protobuf:"bytes,1,opt,name=eip_id,json=eipId,proto3" json:"eip_id,omitempty"` - // eip name - Name *wrappers.StringValue `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - // eip address - Addr *wrappers.StringValue `protobuf:"bytes,3,opt,name=addr,proto3" json:"addr,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Eip) Reset() { *m = Eip{} } -func (m *Eip) String() string { return proto.CompactTextString(m) } -func (*Eip) ProtoMessage() {} -func (*Eip) Descriptor() ([]byte, []int) { - return fileDescriptor_2998074df425fa49, []int{13} -} - -func (m *Eip) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Eip.Unmarshal(m, b) -} -func (m *Eip) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Eip.Marshal(b, m, deterministic) -} -func (m *Eip) XXX_Merge(src proto.Message) { - xxx_messageInfo_Eip.Merge(m, src) -} -func (m *Eip) XXX_Size() int { - return xxx_messageInfo_Eip.Size(m) -} -func (m *Eip) XXX_DiscardUnknown() { - xxx_messageInfo_Eip.DiscardUnknown(m) -} - -var xxx_messageInfo_Eip proto.InternalMessageInfo - -func (m *Eip) GetEipId() *wrappers.StringValue { - if m != nil { - return m.EipId - } - return nil -} - -func (m *Eip) GetName() *wrappers.StringValue { - if m != nil { - return m.Name - } - return nil -} - -func (m *Eip) GetAddr() *wrappers.StringValue { - if m != nil { - return m.Addr - } - return nil -} - -type Vpc struct { - // vpc id - VpcId *wrappers.StringValue `protobuf:"bytes,1,opt,name=vpc_id,json=vpcId,proto3" json:"vpc_id,omitempty"` - // vpc name - Name *wrappers.StringValue `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - // the time when vpc create - CreateTime *timestamp.Timestamp `protobuf:"bytes,3,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty"` - // vpc description - Description *wrappers.StringValue `protobuf:"bytes,4,opt,name=description,proto3" json:"description,omitempty"` - // cluster status eg.[pending|running|stopped|suspended|terminated|ceased] - Status *wrappers.StringValue `protobuf:"bytes,5,opt,name=status,proto3" json:"status,omitempty"` - // cluster transition status eg.[creating|starting|stopping|restarting|suspending|resuming|terminating|recovering|resetting] - TransitionStatus *wrappers.StringValue `protobuf:"bytes,6,opt,name=transition_status,json=transitionStatus,proto3" json:"transition_status,omitempty"` - // list subnet, a vpc contain one more subnet - Subnets []string `protobuf:"bytes,7,rep,name=subnets,proto3" json:"subnets,omitempty"` - // elastic ip, a vpc has a eip - Eip *Eip `protobuf:"bytes,8,opt,name=eip,proto3" json:"eip,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Vpc) Reset() { *m = Vpc{} } -func (m *Vpc) String() string { return proto.CompactTextString(m) } -func (*Vpc) ProtoMessage() {} -func (*Vpc) Descriptor() ([]byte, []int) { - return fileDescriptor_2998074df425fa49, []int{14} -} - -func (m *Vpc) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Vpc.Unmarshal(m, b) -} -func (m *Vpc) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Vpc.Marshal(b, m, deterministic) -} -func (m *Vpc) XXX_Merge(src proto.Message) { - xxx_messageInfo_Vpc.Merge(m, src) -} -func (m *Vpc) XXX_Size() int { - return xxx_messageInfo_Vpc.Size(m) -} -func (m *Vpc) XXX_DiscardUnknown() { - xxx_messageInfo_Vpc.DiscardUnknown(m) -} - -var xxx_messageInfo_Vpc proto.InternalMessageInfo - -func (m *Vpc) GetVpcId() *wrappers.StringValue { - if m != nil { - return m.VpcId - } - return nil -} - -func (m *Vpc) GetName() *wrappers.StringValue { - if m != nil { - return m.Name - } - return nil -} - -func (m *Vpc) GetCreateTime() *timestamp.Timestamp { - if m != nil { - return m.CreateTime - } - return nil -} - -func (m *Vpc) GetDescription() *wrappers.StringValue { - if m != nil { - return m.Description - } - return nil -} - -func (m *Vpc) GetStatus() *wrappers.StringValue { - if m != nil { - return m.Status - } - return nil -} - -func (m *Vpc) GetTransitionStatus() *wrappers.StringValue { - if m != nil { - return m.TransitionStatus - } - return nil -} - -func (m *Vpc) GetSubnets() []string { - if m != nil { - return m.Subnets - } - return nil -} - -func (m *Vpc) GetEip() *Eip { - if m != nil { - return m.Eip - } - return nil -} - -type DescribeVpcResponse struct { - // vpc - Vpc *Vpc `protobuf:"bytes,1,opt,name=vpc,proto3" json:"vpc,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *DescribeVpcResponse) Reset() { *m = DescribeVpcResponse{} } -func (m *DescribeVpcResponse) String() string { return proto.CompactTextString(m) } -func (*DescribeVpcResponse) ProtoMessage() {} -func (*DescribeVpcResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_2998074df425fa49, []int{15} -} - -func (m *DescribeVpcResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_DescribeVpcResponse.Unmarshal(m, b) -} -func (m *DescribeVpcResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_DescribeVpcResponse.Marshal(b, m, deterministic) -} -func (m *DescribeVpcResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_DescribeVpcResponse.Merge(m, src) -} -func (m *DescribeVpcResponse) XXX_Size() int { - return xxx_messageInfo_DescribeVpcResponse.Size(m) -} -func (m *DescribeVpcResponse) XXX_DiscardUnknown() { - xxx_messageInfo_DescribeVpcResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_DescribeVpcResponse proto.InternalMessageInfo - -func (m *DescribeVpcResponse) GetVpc() *Vpc { - if m != nil { - return m.Vpc - } - return nil -} - -type DescribeClusterDetailsRequest struct { - // required, get detail of cluster in runtime - RuntimeId *wrappers.StringValue `protobuf:"bytes,1,opt,name=runtime_id,json=runtimeId,proto3" json:"runtime_id,omitempty"` - // required, cluster in the runtime - Cluster *Cluster `protobuf:"bytes,2,opt,name=cluster,proto3" json:"cluster,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *DescribeClusterDetailsRequest) Reset() { *m = DescribeClusterDetailsRequest{} } -func (m *DescribeClusterDetailsRequest) String() string { return proto.CompactTextString(m) } -func (*DescribeClusterDetailsRequest) ProtoMessage() {} -func (*DescribeClusterDetailsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_2998074df425fa49, []int{16} -} - -func (m *DescribeClusterDetailsRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_DescribeClusterDetailsRequest.Unmarshal(m, b) -} -func (m *DescribeClusterDetailsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_DescribeClusterDetailsRequest.Marshal(b, m, deterministic) -} -func (m *DescribeClusterDetailsRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_DescribeClusterDetailsRequest.Merge(m, src) -} -func (m *DescribeClusterDetailsRequest) XXX_Size() int { - return xxx_messageInfo_DescribeClusterDetailsRequest.Size(m) -} -func (m *DescribeClusterDetailsRequest) XXX_DiscardUnknown() { - xxx_messageInfo_DescribeClusterDetailsRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_DescribeClusterDetailsRequest proto.InternalMessageInfo - -func (m *DescribeClusterDetailsRequest) GetRuntimeId() *wrappers.StringValue { - if m != nil { - return m.RuntimeId - } - return nil -} - -func (m *DescribeClusterDetailsRequest) GetCluster() *Cluster { - if m != nil { - return m.Cluster - } - return nil -} - -type DescribeClusterDetailsResponse struct { - // cluster info - Cluster *Cluster `protobuf:"bytes,1,opt,name=cluster,proto3" json:"cluster,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *DescribeClusterDetailsResponse) Reset() { *m = DescribeClusterDetailsResponse{} } -func (m *DescribeClusterDetailsResponse) String() string { return proto.CompactTextString(m) } -func (*DescribeClusterDetailsResponse) ProtoMessage() {} -func (*DescribeClusterDetailsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_2998074df425fa49, []int{17} -} - -func (m *DescribeClusterDetailsResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_DescribeClusterDetailsResponse.Unmarshal(m, b) -} -func (m *DescribeClusterDetailsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_DescribeClusterDetailsResponse.Marshal(b, m, deterministic) -} -func (m *DescribeClusterDetailsResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_DescribeClusterDetailsResponse.Merge(m, src) -} -func (m *DescribeClusterDetailsResponse) XXX_Size() int { - return xxx_messageInfo_DescribeClusterDetailsResponse.Size(m) -} -func (m *DescribeClusterDetailsResponse) XXX_DiscardUnknown() { - xxx_messageInfo_DescribeClusterDetailsResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_DescribeClusterDetailsResponse proto.InternalMessageInfo - -func (m *DescribeClusterDetailsResponse) GetCluster() *Cluster { - if m != nil { - return m.Cluster - } - return nil -} - -type ValidateRuntimeRequest struct { - // required, id of runtime to validate - RuntimeId *wrappers.StringValue `protobuf:"bytes,1,opt,name=runtime_id,json=runtimeId,proto3" json:"runtime_id,omitempty"` - // required, runtime zone - Zone *wrappers.StringValue `protobuf:"bytes,2,opt,name=zone,proto3" json:"zone,omitempty"` - // required, runtime credential - RuntimeCredential *RuntimeCredential `protobuf:"bytes,3,opt,name=runtime_credential,json=runtimeCredential,proto3" json:"runtime_credential,omitempty"` - // need create or not - NeedCreate *wrappers.BoolValue `protobuf:"bytes,4,opt,name=need_create,json=needCreate,proto3" json:"need_create,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ValidateRuntimeRequest) Reset() { *m = ValidateRuntimeRequest{} } -func (m *ValidateRuntimeRequest) String() string { return proto.CompactTextString(m) } -func (*ValidateRuntimeRequest) ProtoMessage() {} -func (*ValidateRuntimeRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_2998074df425fa49, []int{18} -} - -func (m *ValidateRuntimeRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ValidateRuntimeRequest.Unmarshal(m, b) -} -func (m *ValidateRuntimeRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ValidateRuntimeRequest.Marshal(b, m, deterministic) -} -func (m *ValidateRuntimeRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_ValidateRuntimeRequest.Merge(m, src) -} -func (m *ValidateRuntimeRequest) XXX_Size() int { - return xxx_messageInfo_ValidateRuntimeRequest.Size(m) -} -func (m *ValidateRuntimeRequest) XXX_DiscardUnknown() { - xxx_messageInfo_ValidateRuntimeRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_ValidateRuntimeRequest proto.InternalMessageInfo - -func (m *ValidateRuntimeRequest) GetRuntimeId() *wrappers.StringValue { - if m != nil { - return m.RuntimeId - } - return nil -} - -func (m *ValidateRuntimeRequest) GetZone() *wrappers.StringValue { - if m != nil { - return m.Zone - } - return nil -} - -func (m *ValidateRuntimeRequest) GetRuntimeCredential() *RuntimeCredential { - if m != nil { - return m.RuntimeCredential - } - return nil -} - -func (m *ValidateRuntimeRequest) GetNeedCreate() *wrappers.BoolValue { - if m != nil { - return m.NeedCreate - } - return nil -} - -type ValidateRuntimeResponse struct { - // validate ok or not - Ok *wrappers.BoolValue `protobuf:"bytes,1,opt,name=ok,proto3" json:"ok,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ValidateRuntimeResponse) Reset() { *m = ValidateRuntimeResponse{} } -func (m *ValidateRuntimeResponse) String() string { return proto.CompactTextString(m) } -func (*ValidateRuntimeResponse) ProtoMessage() {} -func (*ValidateRuntimeResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_2998074df425fa49, []int{19} -} - -func (m *ValidateRuntimeResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ValidateRuntimeResponse.Unmarshal(m, b) -} -func (m *ValidateRuntimeResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ValidateRuntimeResponse.Marshal(b, m, deterministic) -} -func (m *ValidateRuntimeResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_ValidateRuntimeResponse.Merge(m, src) -} -func (m *ValidateRuntimeResponse) XXX_Size() int { - return xxx_messageInfo_ValidateRuntimeResponse.Size(m) -} -func (m *ValidateRuntimeResponse) XXX_DiscardUnknown() { - xxx_messageInfo_ValidateRuntimeResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_ValidateRuntimeResponse proto.InternalMessageInfo - -func (m *ValidateRuntimeResponse) GetOk() *wrappers.BoolValue { - if m != nil { - return m.Ok - } - return nil -} - -type DescribeZonesRequest struct { - // required, get zone of runtime provider - Provider *wrappers.StringValue `protobuf:"bytes,1,opt,name=provider,proto3" json:"provider,omitempty"` - // required, runtime credential - RuntimeCredential *RuntimeCredential `protobuf:"bytes,2,opt,name=runtime_credential,json=runtimeCredential,proto3" json:"runtime_credential,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *DescribeZonesRequest) Reset() { *m = DescribeZonesRequest{} } -func (m *DescribeZonesRequest) String() string { return proto.CompactTextString(m) } -func (*DescribeZonesRequest) ProtoMessage() {} -func (*DescribeZonesRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_2998074df425fa49, []int{20} -} - -func (m *DescribeZonesRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_DescribeZonesRequest.Unmarshal(m, b) -} -func (m *DescribeZonesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_DescribeZonesRequest.Marshal(b, m, deterministic) -} -func (m *DescribeZonesRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_DescribeZonesRequest.Merge(m, src) -} -func (m *DescribeZonesRequest) XXX_Size() int { - return xxx_messageInfo_DescribeZonesRequest.Size(m) -} -func (m *DescribeZonesRequest) XXX_DiscardUnknown() { - xxx_messageInfo_DescribeZonesRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_DescribeZonesRequest proto.InternalMessageInfo - -func (m *DescribeZonesRequest) GetProvider() *wrappers.StringValue { - if m != nil { - return m.Provider - } - return nil -} - -func (m *DescribeZonesRequest) GetRuntimeCredential() *RuntimeCredential { - if m != nil { - return m.RuntimeCredential - } - return nil -} - -type DescribeZonesResponse struct { - // list of zones in runtime provider - Zones []string `protobuf:"bytes,1,rep,name=zones,proto3" json:"zones,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *DescribeZonesResponse) Reset() { *m = DescribeZonesResponse{} } -func (m *DescribeZonesResponse) String() string { return proto.CompactTextString(m) } -func (*DescribeZonesResponse) ProtoMessage() {} -func (*DescribeZonesResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_2998074df425fa49, []int{21} -} - -func (m *DescribeZonesResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_DescribeZonesResponse.Unmarshal(m, b) -} -func (m *DescribeZonesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_DescribeZonesResponse.Marshal(b, m, deterministic) -} -func (m *DescribeZonesResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_DescribeZonesResponse.Merge(m, src) -} -func (m *DescribeZonesResponse) XXX_Size() int { - return xxx_messageInfo_DescribeZonesResponse.Size(m) -} -func (m *DescribeZonesResponse) XXX_DiscardUnknown() { - xxx_messageInfo_DescribeZonesResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_DescribeZonesResponse proto.InternalMessageInfo - -func (m *DescribeZonesResponse) GetZones() []string { - if m != nil { - return m.Zones - } - return nil -} - -func init() { - proto.RegisterType((*RegisterRuntimeProviderRequest)(nil), "openpitrix.RegisterRuntimeProviderRequest") - proto.RegisterType((*RegisterRuntimeProviderResponse)(nil), "openpitrix.RegisterRuntimeProviderResponse") - proto.RegisterType((*ParseClusterConfRequest)(nil), "openpitrix.ParseClusterConfRequest") - proto.RegisterType((*ParseClusterConfResponse)(nil), "openpitrix.ParseClusterConfResponse") - proto.RegisterType((*SplitJobIntoTasksRequest)(nil), "openpitrix.SplitJobIntoTasksRequest") - proto.RegisterType((*SplitJobIntoTasksResponse)(nil), "openpitrix.SplitJobIntoTasksResponse") - proto.RegisterType((*HandleSubtaskRequest)(nil), "openpitrix.HandleSubtaskRequest") - proto.RegisterType((*HandleSubtaskResponse)(nil), "openpitrix.HandleSubtaskResponse") - proto.RegisterType((*WaitSubtaskRequest)(nil), "openpitrix.WaitSubtaskRequest") - proto.RegisterType((*WaitSubtaskResponse)(nil), "openpitrix.WaitSubtaskResponse") - proto.RegisterType((*CheckResourceRequest)(nil), "openpitrix.CheckResourceRequest") - proto.RegisterType((*CheckResourceResponse)(nil), "openpitrix.CheckResourceResponse") - proto.RegisterType((*DescribeVpcRequest)(nil), "openpitrix.DescribeVpcRequest") - proto.RegisterType((*Eip)(nil), "openpitrix.Eip") - proto.RegisterType((*Vpc)(nil), "openpitrix.Vpc") - proto.RegisterType((*DescribeVpcResponse)(nil), "openpitrix.DescribeVpcResponse") - proto.RegisterType((*DescribeClusterDetailsRequest)(nil), "openpitrix.DescribeClusterDetailsRequest") - proto.RegisterType((*DescribeClusterDetailsResponse)(nil), "openpitrix.DescribeClusterDetailsResponse") - proto.RegisterType((*ValidateRuntimeRequest)(nil), "openpitrix.ValidateRuntimeRequest") - proto.RegisterType((*ValidateRuntimeResponse)(nil), "openpitrix.ValidateRuntimeResponse") - proto.RegisterType((*DescribeZonesRequest)(nil), "openpitrix.DescribeZonesRequest") - proto.RegisterType((*DescribeZonesResponse)(nil), "openpitrix.DescribeZonesResponse") -} - -func init() { proto.RegisterFile("runtime_provider.proto", fileDescriptor_2998074df425fa49) } - -var fileDescriptor_2998074df425fa49 = []byte{ - // 1059 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x56, 0xcf, 0x6f, 0xdb, 0x36, - 0x14, 0x86, 0xec, 0xfc, 0x7c, 0x41, 0xd0, 0x44, 0xf9, 0xa5, 0x09, 0x6d, 0x7e, 0xa8, 0x1d, 0xd0, - 0x65, 0x8b, 0x53, 0x34, 0x3b, 0x14, 0x08, 0xb6, 0x43, 0xdd, 0x00, 0x73, 0xd1, 0x76, 0x81, 0x62, - 0x64, 0x40, 0x80, 0x21, 0xa3, 0x24, 0xc6, 0x63, 0xe3, 0x90, 0x1c, 0x49, 0x3b, 0x6b, 0x8f, 0x3b, - 0xec, 0xb2, 0xcb, 0xb0, 0xd3, 0x4e, 0xbd, 0xee, 0x1f, 0xdc, 0x1f, 0x30, 0x50, 0xa2, 0x62, 0x49, - 0x96, 0x3d, 0xcd, 0x33, 0xb6, 0x53, 0x62, 0xf1, 0xfb, 0x1e, 0xdf, 0xf7, 0xf1, 0xf1, 0xf1, 0xc1, - 0xa6, 0xe8, 0x51, 0x45, 0x6e, 0xf0, 0x25, 0x17, 0xac, 0x4f, 0x22, 0x2c, 0x1a, 0x5c, 0x30, 0xc5, - 0x6c, 0x60, 0x1c, 0x53, 0x4e, 0x94, 0x20, 0x3f, 0xba, 0xdb, 0x1d, 0xc6, 0x3a, 0x5d, 0x7c, 0x18, - 0xaf, 0x04, 0xbd, 0xab, 0xc3, 0x5b, 0x81, 0x38, 0xc7, 0x42, 0x26, 0x58, 0x77, 0xa7, 0xb8, 0xae, - 0x03, 0x4a, 0x85, 0x6e, 0xb8, 0x01, 0xdc, 0x37, 0x00, 0xc4, 0xc9, 0x21, 0xa2, 0x94, 0x29, 0xa4, - 0x08, 0xa3, 0x29, 0xfd, 0xb3, 0xf8, 0x4f, 0x78, 0xd0, 0xc1, 0xf4, 0x40, 0xde, 0xa2, 0x4e, 0x07, - 0x8b, 0x43, 0xc6, 0x63, 0x44, 0x09, 0x7a, 0x39, 0xec, 0xf6, 0xa4, 0x4a, 0xf3, 0x74, 0x97, 0x4d, - 0xfe, 0xe6, 0xe7, 0xe2, 0x5b, 0x16, 0x98, 0x7f, 0x41, 0x21, 0x79, 0x9d, 0xfc, 0xef, 0xfd, 0x6a, - 0xc1, 0xb6, 0x8f, 0x3b, 0x44, 0x13, 0xfd, 0x84, 0x70, 0x6a, 0xf4, 0xfa, 0xf8, 0x87, 0x1e, 0x96, - 0xca, 0x7e, 0x06, 0x0b, 0xa9, 0x05, 0x8e, 0xb5, 0x6b, 0x3d, 0x5e, 0x7a, 0x7a, 0xbf, 0x91, 0xa4, - 0xdd, 0x48, 0x75, 0x35, 0xce, 0x94, 0x20, 0xb4, 0x73, 0x8e, 0xba, 0x3d, 0xec, 0xdf, 0xa1, 0xed, - 0xcf, 0x61, 0x2e, 0x64, 0xf4, 0x8a, 0x74, 0x9c, 0x5a, 0x05, 0x9e, 0xc1, 0x7a, 0xaf, 0x61, 0x67, - 0x64, 0x46, 0x92, 0x33, 0x2a, 0xb1, 0xbd, 0x0f, 0x35, 0x76, 0x6d, 0x92, 0x71, 0x87, 0x82, 0x3e, - 0x67, 0xac, 0x9b, 0x84, 0xac, 0xb1, 0x6b, 0xef, 0x4f, 0x0b, 0xb6, 0x4e, 0x91, 0x90, 0xb8, 0x99, - 0xd8, 0xd3, 0x64, 0xf4, 0x2a, 0x95, 0x76, 0x0c, 0x90, 0x9e, 0x32, 0x89, 0x2a, 0x89, 0x5b, 0x34, - 0xf8, 0x56, 0xa4, 0xc9, 0x7d, 0x2c, 0x24, 0x61, 0x54, 0x93, 0xab, 0x28, 0x5c, 0x34, 0xf8, 0x56, - 0x64, 0x3f, 0x81, 0x19, 0x2d, 0xd7, 0xa9, 0x57, 0xa0, 0xc5, 0x48, 0xfb, 0x00, 0xe6, 0xcd, 0x01, - 0x3b, 0x33, 0x31, 0x69, 0xad, 0x31, 0xa8, 0xc4, 0x86, 0x11, 0xe7, 0xa7, 0x18, 0xaf, 0x05, 0xce, - 0xb0, 0x6a, 0x63, 0x5f, 0x26, 0x94, 0x55, 0x21, 0xd4, 0x7b, 0x70, 0xce, 0x78, 0x97, 0xa8, 0x97, - 0x2c, 0x68, 0x51, 0xc5, 0xda, 0x48, 0x5e, 0xcb, 0xa9, 0x38, 0xb8, 0x07, 0xf5, 0xb7, 0x2c, 0x30, - 0xd6, 0xdd, 0xcb, 0xe6, 0xf0, 0x92, 0x05, 0xbe, 0x5e, 0xf3, 0x4e, 0xe1, 0xa3, 0x92, 0xbd, 0x8d, - 0x8e, 0x23, 0x58, 0xd4, 0xa5, 0xfc, 0x0a, 0xbd, 0xbb, 0x53, 0xb2, 0x91, 0x8d, 0xd2, 0x4e, 0x17, - 0xfd, 0x01, 0xce, 0x7b, 0x07, 0xeb, 0x5f, 0x21, 0x1a, 0x75, 0xf1, 0x59, 0x2f, 0xd0, 0x5f, 0xa7, - 0xa2, 0xe4, 0x11, 0xcc, 0xe8, 0x58, 0x46, 0xca, 0x4a, 0x31, 0x09, 0x3f, 0x5e, 0xf5, 0xbe, 0x80, - 0x8d, 0xc2, 0xd6, 0x46, 0x48, 0x4a, 0xb7, 0xc6, 0xd2, 0x6f, 0xc1, 0xfe, 0x06, 0x11, 0xf5, 0xdf, - 0xe7, 0x7d, 0x0c, 0x6b, 0xb9, 0x8d, 0xff, 0x51, 0xd6, 0x3f, 0x59, 0xb0, 0xde, 0xfc, 0x1e, 0x87, - 0x9a, 0xc7, 0x7a, 0x22, 0xc4, 0x53, 0x49, 0x3c, 0x53, 0xc2, 0xb5, 0x0a, 0x25, 0xdc, 0x84, 0x8d, - 0x42, 0x0e, 0x13, 0x74, 0x92, 0x9f, 0x2d, 0xb0, 0x5f, 0x60, 0x19, 0x0a, 0x12, 0xe0, 0x73, 0x1e, - 0x4e, 0x45, 0xc7, 0x11, 0xcc, 0xf5, 0x79, 0x58, 0xb5, 0x81, 0xcc, 0xf6, 0x79, 0xd8, 0x8a, 0xbc, - 0x0f, 0x16, 0xd4, 0x4f, 0x08, 0xd7, 0x64, 0x4c, 0x78, 0xd5, 0x5d, 0x67, 0x31, 0xe1, 0x49, 0xe7, - 0xa1, 0xe8, 0x06, 0x57, 0xda, 0x2f, 0x46, 0x6a, 0x06, 0x8a, 0x22, 0x51, 0xad, 0x57, 0x69, 0xa4, - 0xf7, 0x47, 0x1d, 0xea, 0xe7, 0x3c, 0xcc, 0xa8, 0xb3, 0x2a, 0xab, 0x9b, 0x20, 0xc1, 0x63, 0x58, - 0x0a, 0x05, 0x46, 0x0a, 0x5f, 0x6a, 0x57, 0x4d, 0x9e, 0xc3, 0xa7, 0xd9, 0x4e, 0x1f, 0x5f, 0x1f, - 0x12, 0xb8, 0xfe, 0x60, 0x7f, 0x09, 0x4b, 0x51, 0x7c, 0xa8, 0xf1, 0xc3, 0x6a, 0x7a, 0xeb, 0xf8, - 0x5d, 0xb3, 0x04, 0xfd, 0xc8, 0x49, 0x85, 0x54, 0x4f, 0x3a, 0xb3, 0x55, 0x1e, 0xb9, 0x04, 0x6b, - 0xb7, 0x60, 0x55, 0x09, 0x44, 0x25, 0xd1, 0x31, 0x2e, 0x4d, 0x80, 0xb9, 0x0a, 0x01, 0x56, 0x06, - 0xb4, 0xb3, 0x24, 0x94, 0x03, 0xf3, 0xb2, 0x17, 0x50, 0xac, 0xa4, 0x33, 0xbf, 0x5b, 0x7f, 0xbc, - 0xe8, 0xa7, 0x3f, 0x75, 0x7f, 0xc5, 0x84, 0x3b, 0x0b, 0xc3, 0xfd, 0xf5, 0x84, 0x70, 0x5f, 0xaf, - 0x79, 0xcf, 0x60, 0x2d, 0x57, 0xd2, 0xe6, 0x5a, 0xec, 0x41, 0xbd, 0xcf, 0x43, 0x73, 0x6a, 0x39, - 0xa6, 0x46, 0xe9, 0x35, 0xef, 0x17, 0x0b, 0x1e, 0xa4, 0x54, 0x73, 0xdf, 0x5e, 0x60, 0x85, 0x48, - 0x57, 0xfe, 0x1f, 0x17, 0xfc, 0x6b, 0xd8, 0x1e, 0x95, 0xcc, 0x64, 0x8f, 0xde, 0x6f, 0x35, 0xd8, - 0x3c, 0x47, 0x5d, 0x12, 0x21, 0x85, 0xcd, 0x18, 0x32, 0x15, 0x5d, 0x4f, 0x60, 0xe6, 0x3d, 0xa3, - 0x15, 0xab, 0x5b, 0x23, 0xed, 0x57, 0x60, 0xa7, 0xdb, 0x85, 0x02, 0x47, 0x98, 0x2a, 0x82, 0xba, - 0xa6, 0xc8, 0x1f, 0x64, 0x35, 0x98, 0x34, 0x9b, 0x77, 0x20, 0x7f, 0x55, 0x14, 0x3f, 0xe9, 0xbb, - 0x42, 0x31, 0x8e, 0x2e, 0x93, 0x1b, 0x60, 0xca, 0x7d, 0x5c, 0xe7, 0x03, 0x0d, 0x6f, 0xc6, 0x68, - 0xef, 0x04, 0xb6, 0x86, 0x3c, 0x99, 0xa0, 0x91, 0x7e, 0xb0, 0x60, 0x3d, 0x3d, 0xad, 0x0b, 0x46, - 0xb1, 0xfc, 0xf7, 0xa3, 0x66, 0xb9, 0x49, 0xb5, 0xc9, 0x4c, 0xf2, 0x0e, 0x60, 0xa3, 0x90, 0x9f, - 0x51, 0xb9, 0x0e, 0xb3, 0xfa, 0x4c, 0xa4, 0x63, 0xc5, 0x37, 0x2d, 0xf9, 0xf1, 0xf4, 0xf7, 0x05, - 0xd8, 0x2c, 0x8c, 0xaa, 0xaf, 0x11, 0x45, 0x1d, 0x2c, 0x6c, 0x01, 0x5b, 0x23, 0x86, 0x59, 0x7b, - 0x3f, 0x97, 0xd6, 0xd8, 0x19, 0xdc, 0xfd, 0xb4, 0x12, 0xd6, 0x24, 0xf9, 0x2d, 0xac, 0x14, 0x47, - 0x3f, 0xfb, 0x61, 0x36, 0xc0, 0x88, 0x71, 0xd8, 0x7d, 0x34, 0x1e, 0x64, 0xc2, 0x7f, 0x07, 0xab, - 0x43, 0x23, 0x99, 0x9d, 0xa3, 0x8e, 0x9a, 0x16, 0xdd, 0x8f, 0xff, 0x06, 0x65, 0x76, 0x68, 0xc3, - 0x72, 0x6e, 0x4e, 0xb2, 0x77, 0xb3, 0xbc, 0xb2, 0xe9, 0xcd, 0xdd, 0x1b, 0x83, 0x30, 0x51, 0xdf, - 0xc0, 0x52, 0x66, 0x8a, 0xb1, 0xb7, 0xb3, 0x8c, 0xe1, 0xb9, 0xca, 0xdd, 0x19, 0xb9, 0x6e, 0xe2, - 0x5d, 0xc0, 0xbd, 0xb4, 0x48, 0xce, 0x4c, 0xc3, 0xf5, 0xb2, 0x9c, 0xc2, 0x62, 0x1a, 0xf7, 0xe1, - 0x58, 0xcc, 0xc0, 0x81, 0xdc, 0xbc, 0x92, 0x77, 0xa0, 0x6c, 0x9c, 0xca, 0x3b, 0x50, 0x3e, 0xec, - 0xbc, 0x81, 0xa5, 0x4c, 0xb3, 0xcf, 0x3b, 0x30, 0x3c, 0xd8, 0xe4, 0x1d, 0x28, 0x7b, 0x25, 0x18, - 0x6c, 0x96, 0x37, 0x5d, 0xfb, 0x93, 0x32, 0x6a, 0xe9, 0x2b, 0xe1, 0xee, 0x57, 0x81, 0x0e, 0x2c, - 0x2f, 0xf4, 0x9f, 0xbc, 0xe5, 0xe5, 0x0d, 0x3b, 0x6f, 0xf9, 0xa8, 0x06, 0xd6, 0x86, 0xe5, 0xdc, - 0x9d, 0xcf, 0x5b, 0x5e, 0xd6, 0xae, 0xf2, 0x96, 0x97, 0x36, 0x8c, 0xe7, 0x33, 0x17, 0x35, 0x1e, - 0x04, 0x73, 0x71, 0xf7, 0x3a, 0xfa, 0x2b, 0x00, 0x00, 0xff, 0xff, 0x66, 0xae, 0xc1, 0x8e, 0x54, - 0x10, 0x00, 0x00, -} - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConn - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion4 - -// RuntimeProviderManagerClient is the client API for RuntimeProviderManager service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type RuntimeProviderManagerClient interface { - RegisterRuntimeProvider(ctx context.Context, in *RegisterRuntimeProviderRequest, opts ...grpc.CallOption) (*RegisterRuntimeProviderResponse, error) - // cluster - ParseClusterConf(ctx context.Context, in *ParseClusterConfRequest, opts ...grpc.CallOption) (*ParseClusterConfResponse, error) - SplitJobIntoTasks(ctx context.Context, in *SplitJobIntoTasksRequest, opts ...grpc.CallOption) (*SplitJobIntoTasksResponse, error) - HandleSubtask(ctx context.Context, in *HandleSubtaskRequest, opts ...grpc.CallOption) (*HandleSubtaskResponse, error) - WaitSubtask(ctx context.Context, in *WaitSubtaskRequest, opts ...grpc.CallOption) (*WaitSubtaskResponse, error) - DescribeSubnets(ctx context.Context, in *DescribeSubnetsRequest, opts ...grpc.CallOption) (*DescribeSubnetsResponse, error) - CheckResource(ctx context.Context, in *CheckResourceRequest, opts ...grpc.CallOption) (*CheckResourceResponse, error) - DescribeVpc(ctx context.Context, in *DescribeVpcRequest, opts ...grpc.CallOption) (*DescribeVpcResponse, error) - DescribeClusterDetails(ctx context.Context, in *DescribeClusterDetailsRequest, opts ...grpc.CallOption) (*DescribeClusterDetailsResponse, error) - // runtime - ValidateRuntime(ctx context.Context, in *ValidateRuntimeRequest, opts ...grpc.CallOption) (*ValidateRuntimeResponse, error) - DescribeZones(ctx context.Context, in *DescribeZonesRequest, opts ...grpc.CallOption) (*DescribeZonesResponse, error) -} - -type runtimeProviderManagerClient struct { - cc *grpc.ClientConn -} - -func NewRuntimeProviderManagerClient(cc *grpc.ClientConn) RuntimeProviderManagerClient { - return &runtimeProviderManagerClient{cc} -} - -func (c *runtimeProviderManagerClient) RegisterRuntimeProvider(ctx context.Context, in *RegisterRuntimeProviderRequest, opts ...grpc.CallOption) (*RegisterRuntimeProviderResponse, error) { - out := new(RegisterRuntimeProviderResponse) - err := c.cc.Invoke(ctx, "/openpitrix.RuntimeProviderManager/RegisterRuntimeProvider", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *runtimeProviderManagerClient) ParseClusterConf(ctx context.Context, in *ParseClusterConfRequest, opts ...grpc.CallOption) (*ParseClusterConfResponse, error) { - out := new(ParseClusterConfResponse) - err := c.cc.Invoke(ctx, "/openpitrix.RuntimeProviderManager/ParseClusterConf", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *runtimeProviderManagerClient) SplitJobIntoTasks(ctx context.Context, in *SplitJobIntoTasksRequest, opts ...grpc.CallOption) (*SplitJobIntoTasksResponse, error) { - out := new(SplitJobIntoTasksResponse) - err := c.cc.Invoke(ctx, "/openpitrix.RuntimeProviderManager/SplitJobIntoTasks", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *runtimeProviderManagerClient) HandleSubtask(ctx context.Context, in *HandleSubtaskRequest, opts ...grpc.CallOption) (*HandleSubtaskResponse, error) { - out := new(HandleSubtaskResponse) - err := c.cc.Invoke(ctx, "/openpitrix.RuntimeProviderManager/HandleSubtask", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *runtimeProviderManagerClient) WaitSubtask(ctx context.Context, in *WaitSubtaskRequest, opts ...grpc.CallOption) (*WaitSubtaskResponse, error) { - out := new(WaitSubtaskResponse) - err := c.cc.Invoke(ctx, "/openpitrix.RuntimeProviderManager/WaitSubtask", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *runtimeProviderManagerClient) DescribeSubnets(ctx context.Context, in *DescribeSubnetsRequest, opts ...grpc.CallOption) (*DescribeSubnetsResponse, error) { - out := new(DescribeSubnetsResponse) - err := c.cc.Invoke(ctx, "/openpitrix.RuntimeProviderManager/DescribeSubnets", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *runtimeProviderManagerClient) CheckResource(ctx context.Context, in *CheckResourceRequest, opts ...grpc.CallOption) (*CheckResourceResponse, error) { - out := new(CheckResourceResponse) - err := c.cc.Invoke(ctx, "/openpitrix.RuntimeProviderManager/CheckResource", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *runtimeProviderManagerClient) DescribeVpc(ctx context.Context, in *DescribeVpcRequest, opts ...grpc.CallOption) (*DescribeVpcResponse, error) { - out := new(DescribeVpcResponse) - err := c.cc.Invoke(ctx, "/openpitrix.RuntimeProviderManager/DescribeVpc", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *runtimeProviderManagerClient) DescribeClusterDetails(ctx context.Context, in *DescribeClusterDetailsRequest, opts ...grpc.CallOption) (*DescribeClusterDetailsResponse, error) { - out := new(DescribeClusterDetailsResponse) - err := c.cc.Invoke(ctx, "/openpitrix.RuntimeProviderManager/DescribeClusterDetails", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *runtimeProviderManagerClient) ValidateRuntime(ctx context.Context, in *ValidateRuntimeRequest, opts ...grpc.CallOption) (*ValidateRuntimeResponse, error) { - out := new(ValidateRuntimeResponse) - err := c.cc.Invoke(ctx, "/openpitrix.RuntimeProviderManager/ValidateRuntime", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *runtimeProviderManagerClient) DescribeZones(ctx context.Context, in *DescribeZonesRequest, opts ...grpc.CallOption) (*DescribeZonesResponse, error) { - out := new(DescribeZonesResponse) - err := c.cc.Invoke(ctx, "/openpitrix.RuntimeProviderManager/DescribeZones", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// RuntimeProviderManagerServer is the server API for RuntimeProviderManager service. -type RuntimeProviderManagerServer interface { - RegisterRuntimeProvider(context.Context, *RegisterRuntimeProviderRequest) (*RegisterRuntimeProviderResponse, error) - // cluster - ParseClusterConf(context.Context, *ParseClusterConfRequest) (*ParseClusterConfResponse, error) - SplitJobIntoTasks(context.Context, *SplitJobIntoTasksRequest) (*SplitJobIntoTasksResponse, error) - HandleSubtask(context.Context, *HandleSubtaskRequest) (*HandleSubtaskResponse, error) - WaitSubtask(context.Context, *WaitSubtaskRequest) (*WaitSubtaskResponse, error) - DescribeSubnets(context.Context, *DescribeSubnetsRequest) (*DescribeSubnetsResponse, error) - CheckResource(context.Context, *CheckResourceRequest) (*CheckResourceResponse, error) - DescribeVpc(context.Context, *DescribeVpcRequest) (*DescribeVpcResponse, error) - DescribeClusterDetails(context.Context, *DescribeClusterDetailsRequest) (*DescribeClusterDetailsResponse, error) - // runtime - ValidateRuntime(context.Context, *ValidateRuntimeRequest) (*ValidateRuntimeResponse, error) - DescribeZones(context.Context, *DescribeZonesRequest) (*DescribeZonesResponse, error) -} - -// UnimplementedRuntimeProviderManagerServer can be embedded to have forward compatible implementations. -type UnimplementedRuntimeProviderManagerServer struct { -} - -func (*UnimplementedRuntimeProviderManagerServer) RegisterRuntimeProvider(ctx context.Context, req *RegisterRuntimeProviderRequest) (*RegisterRuntimeProviderResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method RegisterRuntimeProvider not implemented") -} -func (*UnimplementedRuntimeProviderManagerServer) ParseClusterConf(ctx context.Context, req *ParseClusterConfRequest) (*ParseClusterConfResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ParseClusterConf not implemented") -} -func (*UnimplementedRuntimeProviderManagerServer) SplitJobIntoTasks(ctx context.Context, req *SplitJobIntoTasksRequest) (*SplitJobIntoTasksResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method SplitJobIntoTasks not implemented") -} -func (*UnimplementedRuntimeProviderManagerServer) HandleSubtask(ctx context.Context, req *HandleSubtaskRequest) (*HandleSubtaskResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method HandleSubtask not implemented") -} -func (*UnimplementedRuntimeProviderManagerServer) WaitSubtask(ctx context.Context, req *WaitSubtaskRequest) (*WaitSubtaskResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method WaitSubtask not implemented") -} -func (*UnimplementedRuntimeProviderManagerServer) DescribeSubnets(ctx context.Context, req *DescribeSubnetsRequest) (*DescribeSubnetsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method DescribeSubnets not implemented") -} -func (*UnimplementedRuntimeProviderManagerServer) CheckResource(ctx context.Context, req *CheckResourceRequest) (*CheckResourceResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method CheckResource not implemented") -} -func (*UnimplementedRuntimeProviderManagerServer) DescribeVpc(ctx context.Context, req *DescribeVpcRequest) (*DescribeVpcResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method DescribeVpc not implemented") -} -func (*UnimplementedRuntimeProviderManagerServer) DescribeClusterDetails(ctx context.Context, req *DescribeClusterDetailsRequest) (*DescribeClusterDetailsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method DescribeClusterDetails not implemented") -} -func (*UnimplementedRuntimeProviderManagerServer) ValidateRuntime(ctx context.Context, req *ValidateRuntimeRequest) (*ValidateRuntimeResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ValidateRuntime not implemented") -} -func (*UnimplementedRuntimeProviderManagerServer) DescribeZones(ctx context.Context, req *DescribeZonesRequest) (*DescribeZonesResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method DescribeZones not implemented") -} - -func RegisterRuntimeProviderManagerServer(s *grpc.Server, srv RuntimeProviderManagerServer) { - s.RegisterService(&_RuntimeProviderManager_serviceDesc, srv) -} - -func _RuntimeProviderManager_RegisterRuntimeProvider_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(RegisterRuntimeProviderRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(RuntimeProviderManagerServer).RegisterRuntimeProvider(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/openpitrix.RuntimeProviderManager/RegisterRuntimeProvider", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(RuntimeProviderManagerServer).RegisterRuntimeProvider(ctx, req.(*RegisterRuntimeProviderRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _RuntimeProviderManager_ParseClusterConf_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ParseClusterConfRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(RuntimeProviderManagerServer).ParseClusterConf(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/openpitrix.RuntimeProviderManager/ParseClusterConf", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(RuntimeProviderManagerServer).ParseClusterConf(ctx, req.(*ParseClusterConfRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _RuntimeProviderManager_SplitJobIntoTasks_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(SplitJobIntoTasksRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(RuntimeProviderManagerServer).SplitJobIntoTasks(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/openpitrix.RuntimeProviderManager/SplitJobIntoTasks", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(RuntimeProviderManagerServer).SplitJobIntoTasks(ctx, req.(*SplitJobIntoTasksRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _RuntimeProviderManager_HandleSubtask_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(HandleSubtaskRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(RuntimeProviderManagerServer).HandleSubtask(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/openpitrix.RuntimeProviderManager/HandleSubtask", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(RuntimeProviderManagerServer).HandleSubtask(ctx, req.(*HandleSubtaskRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _RuntimeProviderManager_WaitSubtask_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(WaitSubtaskRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(RuntimeProviderManagerServer).WaitSubtask(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/openpitrix.RuntimeProviderManager/WaitSubtask", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(RuntimeProviderManagerServer).WaitSubtask(ctx, req.(*WaitSubtaskRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _RuntimeProviderManager_DescribeSubnets_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DescribeSubnetsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(RuntimeProviderManagerServer).DescribeSubnets(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/openpitrix.RuntimeProviderManager/DescribeSubnets", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(RuntimeProviderManagerServer).DescribeSubnets(ctx, req.(*DescribeSubnetsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _RuntimeProviderManager_CheckResource_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CheckResourceRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(RuntimeProviderManagerServer).CheckResource(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/openpitrix.RuntimeProviderManager/CheckResource", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(RuntimeProviderManagerServer).CheckResource(ctx, req.(*CheckResourceRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _RuntimeProviderManager_DescribeVpc_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DescribeVpcRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(RuntimeProviderManagerServer).DescribeVpc(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/openpitrix.RuntimeProviderManager/DescribeVpc", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(RuntimeProviderManagerServer).DescribeVpc(ctx, req.(*DescribeVpcRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _RuntimeProviderManager_DescribeClusterDetails_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DescribeClusterDetailsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(RuntimeProviderManagerServer).DescribeClusterDetails(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/openpitrix.RuntimeProviderManager/DescribeClusterDetails", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(RuntimeProviderManagerServer).DescribeClusterDetails(ctx, req.(*DescribeClusterDetailsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _RuntimeProviderManager_ValidateRuntime_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ValidateRuntimeRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(RuntimeProviderManagerServer).ValidateRuntime(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/openpitrix.RuntimeProviderManager/ValidateRuntime", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(RuntimeProviderManagerServer).ValidateRuntime(ctx, req.(*ValidateRuntimeRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _RuntimeProviderManager_DescribeZones_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DescribeZonesRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(RuntimeProviderManagerServer).DescribeZones(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/openpitrix.RuntimeProviderManager/DescribeZones", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(RuntimeProviderManagerServer).DescribeZones(ctx, req.(*DescribeZonesRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _RuntimeProviderManager_serviceDesc = grpc.ServiceDesc{ - ServiceName: "openpitrix.RuntimeProviderManager", - HandlerType: (*RuntimeProviderManagerServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "RegisterRuntimeProvider", - Handler: _RuntimeProviderManager_RegisterRuntimeProvider_Handler, - }, - { - MethodName: "ParseClusterConf", - Handler: _RuntimeProviderManager_ParseClusterConf_Handler, - }, - { - MethodName: "SplitJobIntoTasks", - Handler: _RuntimeProviderManager_SplitJobIntoTasks_Handler, - }, - { - MethodName: "HandleSubtask", - Handler: _RuntimeProviderManager_HandleSubtask_Handler, - }, - { - MethodName: "WaitSubtask", - Handler: _RuntimeProviderManager_WaitSubtask_Handler, - }, - { - MethodName: "DescribeSubnets", - Handler: _RuntimeProviderManager_DescribeSubnets_Handler, - }, - { - MethodName: "CheckResource", - Handler: _RuntimeProviderManager_CheckResource_Handler, - }, - { - MethodName: "DescribeVpc", - Handler: _RuntimeProviderManager_DescribeVpc_Handler, - }, - { - MethodName: "DescribeClusterDetails", - Handler: _RuntimeProviderManager_DescribeClusterDetails_Handler, - }, - { - MethodName: "ValidateRuntime", - Handler: _RuntimeProviderManager_ValidateRuntime_Handler, - }, - { - MethodName: "DescribeZones", - Handler: _RuntimeProviderManager_DescribeZones_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "runtime_provider.proto", -} diff --git a/vendor/openpitrix.io/openpitrix/pkg/pb/service_config.pb.go b/vendor/openpitrix.io/openpitrix/pkg/pb/service_config.pb.go deleted file mode 100644 index f6ab35b73c..0000000000 --- a/vendor/openpitrix.io/openpitrix/pkg/pb/service_config.pb.go +++ /dev/null @@ -1,802 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// source: service_config.proto - -package pb - -import ( - context "context" - fmt "fmt" - math "math" - - proto "github.com/golang/protobuf/proto" - wrappers "github.com/golang/protobuf/ptypes/wrappers" - _ "github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger/options" - _ "google.golang.org/genproto/googleapis/api/annotations" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" -) - -// 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 - -type EmailServiceConfig struct { - // protocol - Protocol *wrappers.StringValue `protobuf:"bytes,1,opt,name=protocol,proto3" json:"protocol,omitempty"` - // email host - EmailHost *wrappers.StringValue `protobuf:"bytes,2,opt,name=email_host,json=emailHost,proto3" json:"email_host,omitempty"` - // port - Port *wrappers.UInt32Value `protobuf:"bytes,3,opt,name=port,proto3" json:"port,omitempty"` - // display sender - DisplaySender *wrappers.StringValue `protobuf:"bytes,4,opt,name=display_sender,json=displaySender,proto3" json:"display_sender,omitempty"` - // email - Email *wrappers.StringValue `protobuf:"bytes,5,opt,name=email,proto3" json:"email,omitempty"` - // password - Password *wrappers.StringValue `protobuf:"bytes,6,opt,name=password,proto3" json:"password,omitempty"` - // use ssl or not - SslEnable *wrappers.BoolValue `protobuf:"bytes,7,opt,name=ssl_enable,json=sslEnable,proto3" json:"ssl_enable,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *EmailServiceConfig) Reset() { *m = EmailServiceConfig{} } -func (m *EmailServiceConfig) String() string { return proto.CompactTextString(m) } -func (*EmailServiceConfig) ProtoMessage() {} -func (*EmailServiceConfig) Descriptor() ([]byte, []int) { - return fileDescriptor_452b382cbc0cfd24, []int{0} -} - -func (m *EmailServiceConfig) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_EmailServiceConfig.Unmarshal(m, b) -} -func (m *EmailServiceConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_EmailServiceConfig.Marshal(b, m, deterministic) -} -func (m *EmailServiceConfig) XXX_Merge(src proto.Message) { - xxx_messageInfo_EmailServiceConfig.Merge(m, src) -} -func (m *EmailServiceConfig) XXX_Size() int { - return xxx_messageInfo_EmailServiceConfig.Size(m) -} -func (m *EmailServiceConfig) XXX_DiscardUnknown() { - xxx_messageInfo_EmailServiceConfig.DiscardUnknown(m) -} - -var xxx_messageInfo_EmailServiceConfig proto.InternalMessageInfo - -func (m *EmailServiceConfig) GetProtocol() *wrappers.StringValue { - if m != nil { - return m.Protocol - } - return nil -} - -func (m *EmailServiceConfig) GetEmailHost() *wrappers.StringValue { - if m != nil { - return m.EmailHost - } - return nil -} - -func (m *EmailServiceConfig) GetPort() *wrappers.UInt32Value { - if m != nil { - return m.Port - } - return nil -} - -func (m *EmailServiceConfig) GetDisplaySender() *wrappers.StringValue { - if m != nil { - return m.DisplaySender - } - return nil -} - -func (m *EmailServiceConfig) GetEmail() *wrappers.StringValue { - if m != nil { - return m.Email - } - return nil -} - -func (m *EmailServiceConfig) GetPassword() *wrappers.StringValue { - if m != nil { - return m.Password - } - return nil -} - -func (m *EmailServiceConfig) GetSslEnable() *wrappers.BoolValue { - if m != nil { - return m.SslEnable - } - return nil -} - -type NotificationConfig struct { - // email service sonfig - EmailServiceConfig *EmailServiceConfig `protobuf:"bytes,1,opt,name=email_service_config,json=emailServiceConfig,proto3" json:"email_service_config,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *NotificationConfig) Reset() { *m = NotificationConfig{} } -func (m *NotificationConfig) String() string { return proto.CompactTextString(m) } -func (*NotificationConfig) ProtoMessage() {} -func (*NotificationConfig) Descriptor() ([]byte, []int) { - return fileDescriptor_452b382cbc0cfd24, []int{1} -} - -func (m *NotificationConfig) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_NotificationConfig.Unmarshal(m, b) -} -func (m *NotificationConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_NotificationConfig.Marshal(b, m, deterministic) -} -func (m *NotificationConfig) XXX_Merge(src proto.Message) { - xxx_messageInfo_NotificationConfig.Merge(m, src) -} -func (m *NotificationConfig) XXX_Size() int { - return xxx_messageInfo_NotificationConfig.Size(m) -} -func (m *NotificationConfig) XXX_DiscardUnknown() { - xxx_messageInfo_NotificationConfig.DiscardUnknown(m) -} - -var xxx_messageInfo_NotificationConfig proto.InternalMessageInfo - -func (m *NotificationConfig) GetEmailServiceConfig() *EmailServiceConfig { - if m != nil { - return m.EmailServiceConfig - } - return nil -} - -type RuntimeItemConfig struct { - // runtime name eg.[qingcloud|aliyun|aws|kubernetes] - Name *wrappers.StringValue `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - // whether runtime is available - Enable *wrappers.BoolValue `protobuf:"bytes,2,opt,name=enable,proto3" json:"enable,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *RuntimeItemConfig) Reset() { *m = RuntimeItemConfig{} } -func (m *RuntimeItemConfig) String() string { return proto.CompactTextString(m) } -func (*RuntimeItemConfig) ProtoMessage() {} -func (*RuntimeItemConfig) Descriptor() ([]byte, []int) { - return fileDescriptor_452b382cbc0cfd24, []int{2} -} - -func (m *RuntimeItemConfig) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_RuntimeItemConfig.Unmarshal(m, b) -} -func (m *RuntimeItemConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_RuntimeItemConfig.Marshal(b, m, deterministic) -} -func (m *RuntimeItemConfig) XXX_Merge(src proto.Message) { - xxx_messageInfo_RuntimeItemConfig.Merge(m, src) -} -func (m *RuntimeItemConfig) XXX_Size() int { - return xxx_messageInfo_RuntimeItemConfig.Size(m) -} -func (m *RuntimeItemConfig) XXX_DiscardUnknown() { - xxx_messageInfo_RuntimeItemConfig.DiscardUnknown(m) -} - -var xxx_messageInfo_RuntimeItemConfig proto.InternalMessageInfo - -func (m *RuntimeItemConfig) GetName() *wrappers.StringValue { - if m != nil { - return m.Name - } - return nil -} - -func (m *RuntimeItemConfig) GetEnable() *wrappers.BoolValue { - if m != nil { - return m.Enable - } - return nil -} - -type RuntimeConfig struct { - // runtime item config - ConfigSet []*RuntimeItemConfig `protobuf:"bytes,1,rep,name=config_set,json=configSet,proto3" json:"config_set,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *RuntimeConfig) Reset() { *m = RuntimeConfig{} } -func (m *RuntimeConfig) String() string { return proto.CompactTextString(m) } -func (*RuntimeConfig) ProtoMessage() {} -func (*RuntimeConfig) Descriptor() ([]byte, []int) { - return fileDescriptor_452b382cbc0cfd24, []int{3} -} - -func (m *RuntimeConfig) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_RuntimeConfig.Unmarshal(m, b) -} -func (m *RuntimeConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_RuntimeConfig.Marshal(b, m, deterministic) -} -func (m *RuntimeConfig) XXX_Merge(src proto.Message) { - xxx_messageInfo_RuntimeConfig.Merge(m, src) -} -func (m *RuntimeConfig) XXX_Size() int { - return xxx_messageInfo_RuntimeConfig.Size(m) -} -func (m *RuntimeConfig) XXX_DiscardUnknown() { - xxx_messageInfo_RuntimeConfig.DiscardUnknown(m) -} - -var xxx_messageInfo_RuntimeConfig proto.InternalMessageInfo - -func (m *RuntimeConfig) GetConfigSet() []*RuntimeItemConfig { - if m != nil { - return m.ConfigSet - } - return nil -} - -type BasicConfig struct { - // platform name - PlatformName *wrappers.StringValue `protobuf:"bytes,1,opt,name=platform_name,json=platformName,proto3" json:"platform_name,omitempty"` - // platform url - PlatformUrl *wrappers.StringValue `protobuf:"bytes,2,opt,name=platform_url,json=platformUrl,proto3" json:"platform_url,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *BasicConfig) Reset() { *m = BasicConfig{} } -func (m *BasicConfig) String() string { return proto.CompactTextString(m) } -func (*BasicConfig) ProtoMessage() {} -func (*BasicConfig) Descriptor() ([]byte, []int) { - return fileDescriptor_452b382cbc0cfd24, []int{4} -} - -func (m *BasicConfig) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_BasicConfig.Unmarshal(m, b) -} -func (m *BasicConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_BasicConfig.Marshal(b, m, deterministic) -} -func (m *BasicConfig) XXX_Merge(src proto.Message) { - xxx_messageInfo_BasicConfig.Merge(m, src) -} -func (m *BasicConfig) XXX_Size() int { - return xxx_messageInfo_BasicConfig.Size(m) -} -func (m *BasicConfig) XXX_DiscardUnknown() { - xxx_messageInfo_BasicConfig.DiscardUnknown(m) -} - -var xxx_messageInfo_BasicConfig proto.InternalMessageInfo - -func (m *BasicConfig) GetPlatformName() *wrappers.StringValue { - if m != nil { - return m.PlatformName - } - return nil -} - -func (m *BasicConfig) GetPlatformUrl() *wrappers.StringValue { - if m != nil { - return m.PlatformUrl - } - return nil -} - -type SetServiceConfigRequest struct { - // notification config - NotificationConfig *NotificationConfig `protobuf:"bytes,1,opt,name=notification_config,json=notificationConfig,proto3" json:"notification_config,omitempty"` - // runtime config - RuntimeConfig *RuntimeConfig `protobuf:"bytes,2,opt,name=runtime_config,json=runtimeConfig,proto3" json:"runtime_config,omitempty"` - // basic config - BasicConfig *BasicConfig `protobuf:"bytes,3,opt,name=basic_config,json=basicConfig,proto3" json:"basic_config,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *SetServiceConfigRequest) Reset() { *m = SetServiceConfigRequest{} } -func (m *SetServiceConfigRequest) String() string { return proto.CompactTextString(m) } -func (*SetServiceConfigRequest) ProtoMessage() {} -func (*SetServiceConfigRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_452b382cbc0cfd24, []int{5} -} - -func (m *SetServiceConfigRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_SetServiceConfigRequest.Unmarshal(m, b) -} -func (m *SetServiceConfigRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_SetServiceConfigRequest.Marshal(b, m, deterministic) -} -func (m *SetServiceConfigRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_SetServiceConfigRequest.Merge(m, src) -} -func (m *SetServiceConfigRequest) XXX_Size() int { - return xxx_messageInfo_SetServiceConfigRequest.Size(m) -} -func (m *SetServiceConfigRequest) XXX_DiscardUnknown() { - xxx_messageInfo_SetServiceConfigRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_SetServiceConfigRequest proto.InternalMessageInfo - -func (m *SetServiceConfigRequest) GetNotificationConfig() *NotificationConfig { - if m != nil { - return m.NotificationConfig - } - return nil -} - -func (m *SetServiceConfigRequest) GetRuntimeConfig() *RuntimeConfig { - if m != nil { - return m.RuntimeConfig - } - return nil -} - -func (m *SetServiceConfigRequest) GetBasicConfig() *BasicConfig { - if m != nil { - return m.BasicConfig - } - return nil -} - -type SetServiceConfigResponse struct { - // set service config ok or not - IsSucc *wrappers.BoolValue `protobuf:"bytes,1,opt,name=is_succ,json=isSucc,proto3" json:"is_succ,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *SetServiceConfigResponse) Reset() { *m = SetServiceConfigResponse{} } -func (m *SetServiceConfigResponse) String() string { return proto.CompactTextString(m) } -func (*SetServiceConfigResponse) ProtoMessage() {} -func (*SetServiceConfigResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_452b382cbc0cfd24, []int{6} -} - -func (m *SetServiceConfigResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_SetServiceConfigResponse.Unmarshal(m, b) -} -func (m *SetServiceConfigResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_SetServiceConfigResponse.Marshal(b, m, deterministic) -} -func (m *SetServiceConfigResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_SetServiceConfigResponse.Merge(m, src) -} -func (m *SetServiceConfigResponse) XXX_Size() int { - return xxx_messageInfo_SetServiceConfigResponse.Size(m) -} -func (m *SetServiceConfigResponse) XXX_DiscardUnknown() { - xxx_messageInfo_SetServiceConfigResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_SetServiceConfigResponse proto.InternalMessageInfo - -func (m *SetServiceConfigResponse) GetIsSucc() *wrappers.BoolValue { - if m != nil { - return m.IsSucc - } - return nil -} - -type GetServiceConfigRequest struct { - // service type eg.[runtime] - ServiceType []string `protobuf:"bytes,1,rep,name=service_type,json=serviceType,proto3" json:"service_type,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *GetServiceConfigRequest) Reset() { *m = GetServiceConfigRequest{} } -func (m *GetServiceConfigRequest) String() string { return proto.CompactTextString(m) } -func (*GetServiceConfigRequest) ProtoMessage() {} -func (*GetServiceConfigRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_452b382cbc0cfd24, []int{7} -} - -func (m *GetServiceConfigRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_GetServiceConfigRequest.Unmarshal(m, b) -} -func (m *GetServiceConfigRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_GetServiceConfigRequest.Marshal(b, m, deterministic) -} -func (m *GetServiceConfigRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetServiceConfigRequest.Merge(m, src) -} -func (m *GetServiceConfigRequest) XXX_Size() int { - return xxx_messageInfo_GetServiceConfigRequest.Size(m) -} -func (m *GetServiceConfigRequest) XXX_DiscardUnknown() { - xxx_messageInfo_GetServiceConfigRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_GetServiceConfigRequest proto.InternalMessageInfo - -func (m *GetServiceConfigRequest) GetServiceType() []string { - if m != nil { - return m.ServiceType - } - return nil -} - -type GetServiceConfigResponse struct { - // notification config - NotificationConfig *NotificationConfig `protobuf:"bytes,1,opt,name=notification_config,json=notificationConfig,proto3" json:"notification_config,omitempty"` - // runtime config - RuntimeConfig *RuntimeConfig `protobuf:"bytes,2,opt,name=runtime_config,json=runtimeConfig,proto3" json:"runtime_config,omitempty"` - // basic config - BasicConfig *BasicConfig `protobuf:"bytes,3,opt,name=basic_config,json=basicConfig,proto3" json:"basic_config,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *GetServiceConfigResponse) Reset() { *m = GetServiceConfigResponse{} } -func (m *GetServiceConfigResponse) String() string { return proto.CompactTextString(m) } -func (*GetServiceConfigResponse) ProtoMessage() {} -func (*GetServiceConfigResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_452b382cbc0cfd24, []int{8} -} - -func (m *GetServiceConfigResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_GetServiceConfigResponse.Unmarshal(m, b) -} -func (m *GetServiceConfigResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_GetServiceConfigResponse.Marshal(b, m, deterministic) -} -func (m *GetServiceConfigResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetServiceConfigResponse.Merge(m, src) -} -func (m *GetServiceConfigResponse) XXX_Size() int { - return xxx_messageInfo_GetServiceConfigResponse.Size(m) -} -func (m *GetServiceConfigResponse) XXX_DiscardUnknown() { - xxx_messageInfo_GetServiceConfigResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_GetServiceConfigResponse proto.InternalMessageInfo - -func (m *GetServiceConfigResponse) GetNotificationConfig() *NotificationConfig { - if m != nil { - return m.NotificationConfig - } - return nil -} - -func (m *GetServiceConfigResponse) GetRuntimeConfig() *RuntimeConfig { - if m != nil { - return m.RuntimeConfig - } - return nil -} - -func (m *GetServiceConfigResponse) GetBasicConfig() *BasicConfig { - if m != nil { - return m.BasicConfig - } - return nil -} - -type ValidateEmailServiceRequest struct { - // email service config - EmailServiceConfig *EmailServiceConfig `protobuf:"bytes,1,opt,name=email_service_config,json=emailServiceConfig,proto3" json:"email_service_config,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ValidateEmailServiceRequest) Reset() { *m = ValidateEmailServiceRequest{} } -func (m *ValidateEmailServiceRequest) String() string { return proto.CompactTextString(m) } -func (*ValidateEmailServiceRequest) ProtoMessage() {} -func (*ValidateEmailServiceRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_452b382cbc0cfd24, []int{9} -} - -func (m *ValidateEmailServiceRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ValidateEmailServiceRequest.Unmarshal(m, b) -} -func (m *ValidateEmailServiceRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ValidateEmailServiceRequest.Marshal(b, m, deterministic) -} -func (m *ValidateEmailServiceRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_ValidateEmailServiceRequest.Merge(m, src) -} -func (m *ValidateEmailServiceRequest) XXX_Size() int { - return xxx_messageInfo_ValidateEmailServiceRequest.Size(m) -} -func (m *ValidateEmailServiceRequest) XXX_DiscardUnknown() { - xxx_messageInfo_ValidateEmailServiceRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_ValidateEmailServiceRequest proto.InternalMessageInfo - -func (m *ValidateEmailServiceRequest) GetEmailServiceConfig() *EmailServiceConfig { - if m != nil { - return m.EmailServiceConfig - } - return nil -} - -type ValidateEmailServiceResponse struct { - // validate email service ok or not - IsSucc *wrappers.BoolValue `protobuf:"bytes,1,opt,name=is_succ,json=isSucc,proto3" json:"is_succ,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ValidateEmailServiceResponse) Reset() { *m = ValidateEmailServiceResponse{} } -func (m *ValidateEmailServiceResponse) String() string { return proto.CompactTextString(m) } -func (*ValidateEmailServiceResponse) ProtoMessage() {} -func (*ValidateEmailServiceResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_452b382cbc0cfd24, []int{10} -} - -func (m *ValidateEmailServiceResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ValidateEmailServiceResponse.Unmarshal(m, b) -} -func (m *ValidateEmailServiceResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ValidateEmailServiceResponse.Marshal(b, m, deterministic) -} -func (m *ValidateEmailServiceResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_ValidateEmailServiceResponse.Merge(m, src) -} -func (m *ValidateEmailServiceResponse) XXX_Size() int { - return xxx_messageInfo_ValidateEmailServiceResponse.Size(m) -} -func (m *ValidateEmailServiceResponse) XXX_DiscardUnknown() { - xxx_messageInfo_ValidateEmailServiceResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_ValidateEmailServiceResponse proto.InternalMessageInfo - -func (m *ValidateEmailServiceResponse) GetIsSucc() *wrappers.BoolValue { - if m != nil { - return m.IsSucc - } - return nil -} - -func init() { - proto.RegisterType((*EmailServiceConfig)(nil), "openpitrix.EmailServiceConfig") - proto.RegisterType((*NotificationConfig)(nil), "openpitrix.NotificationConfig") - proto.RegisterType((*RuntimeItemConfig)(nil), "openpitrix.RuntimeItemConfig") - proto.RegisterType((*RuntimeConfig)(nil), "openpitrix.RuntimeConfig") - proto.RegisterType((*BasicConfig)(nil), "openpitrix.BasicConfig") - proto.RegisterType((*SetServiceConfigRequest)(nil), "openpitrix.SetServiceConfigRequest") - proto.RegisterType((*SetServiceConfigResponse)(nil), "openpitrix.SetServiceConfigResponse") - proto.RegisterType((*GetServiceConfigRequest)(nil), "openpitrix.GetServiceConfigRequest") - proto.RegisterType((*GetServiceConfigResponse)(nil), "openpitrix.GetServiceConfigResponse") - proto.RegisterType((*ValidateEmailServiceRequest)(nil), "openpitrix.ValidateEmailServiceRequest") - proto.RegisterType((*ValidateEmailServiceResponse)(nil), "openpitrix.ValidateEmailServiceResponse") -} - -func init() { proto.RegisterFile("service_config.proto", fileDescriptor_452b382cbc0cfd24) } - -var fileDescriptor_452b382cbc0cfd24 = []byte{ - // 750 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xdc, 0x55, 0xd1, 0x4e, 0x13, 0x41, - 0x14, 0xcd, 0x96, 0x02, 0x72, 0x4b, 0x89, 0x8e, 0xc4, 0xae, 0xb5, 0x92, 0xba, 0x9a, 0x48, 0x88, - 0x74, 0xb1, 0xbc, 0x28, 0x92, 0x20, 0x10, 0x52, 0x79, 0x10, 0x48, 0x2b, 0x3c, 0xf8, 0xb2, 0xd9, - 0x6e, 0xa7, 0xeb, 0x24, 0xdb, 0x9d, 0x75, 0x66, 0x0a, 0xf6, 0xd5, 0x1f, 0x30, 0xe2, 0xbb, 0x3f, - 0xe0, 0x27, 0xf8, 0x19, 0xfe, 0x82, 0x0f, 0xfa, 0x17, 0xa6, 0x33, 0xb3, 0xd0, 0xba, 0x6d, 0xd9, - 0xa8, 0x4f, 0x3e, 0x35, 0xb3, 0x7b, 0xce, 0xbd, 0xe7, 0x9e, 0x7b, 0xa6, 0x0b, 0x8b, 0x1c, 0xb3, - 0x53, 0xe2, 0x61, 0xc7, 0xa3, 0x61, 0x9b, 0xf8, 0x95, 0x88, 0x51, 0x41, 0x11, 0xd0, 0x08, 0x87, - 0x11, 0x11, 0x8c, 0xbc, 0x2b, 0x96, 0x7c, 0x4a, 0xfd, 0x00, 0xdb, 0x6e, 0x44, 0x6c, 0x37, 0x0c, - 0xa9, 0x70, 0x05, 0xa1, 0x21, 0x57, 0xc8, 0xe2, 0x92, 0x7e, 0x2b, 0x4f, 0xcd, 0x6e, 0xdb, 0x3e, - 0x63, 0x6e, 0x14, 0x61, 0x16, 0xbf, 0x7f, 0x24, 0x7f, 0xbc, 0x55, 0x1f, 0x87, 0xab, 0xfc, 0xcc, - 0xf5, 0x7d, 0xcc, 0x6c, 0x1a, 0xc9, 0x0a, 0xc9, 0x6a, 0xd6, 0x97, 0x29, 0x40, 0x7b, 0x1d, 0x97, - 0x04, 0x0d, 0xa5, 0x6a, 0x57, 0x8a, 0x42, 0x4f, 0xe0, 0x9a, 0x2a, 0x43, 0x03, 0xd3, 0x28, 0x1b, - 0xcb, 0xb9, 0x6a, 0xa9, 0xa2, 0xfa, 0x56, 0xe2, 0xbe, 0x95, 0x86, 0x60, 0x24, 0xf4, 0x4f, 0xdc, - 0xa0, 0x8b, 0xeb, 0x17, 0x68, 0xf4, 0x0c, 0x00, 0xf7, 0xeb, 0x39, 0x6f, 0x28, 0x17, 0x66, 0x26, - 0x05, 0x77, 0x4e, 0xe2, 0x5f, 0x50, 0x2e, 0xd0, 0x1a, 0x64, 0x23, 0xca, 0x84, 0x39, 0x35, 0x86, - 0x76, 0xbc, 0x1f, 0x8a, 0xf5, 0xaa, 0xa2, 0x49, 0x24, 0xda, 0x85, 0x85, 0x16, 0xe1, 0x51, 0xe0, - 0xf6, 0x1c, 0x8e, 0xc3, 0x16, 0x66, 0x66, 0x36, 0x45, 0xcb, 0xbc, 0xe6, 0x34, 0x24, 0x05, 0x55, - 0x61, 0x5a, 0x6a, 0x30, 0xa7, 0x53, 0x70, 0x15, 0x54, 0x3a, 0xe4, 0x72, 0x7e, 0x46, 0x59, 0xcb, - 0x9c, 0x49, 0xe5, 0x90, 0x46, 0xa3, 0xa7, 0x00, 0x9c, 0x07, 0x0e, 0x0e, 0xdd, 0x66, 0x80, 0xcd, - 0x59, 0xc9, 0x2d, 0x26, 0xb8, 0x3b, 0x94, 0x06, 0xda, 0x1f, 0xce, 0x83, 0x3d, 0x09, 0xb6, 0xda, - 0x80, 0x0e, 0xa8, 0x20, 0x6d, 0xe2, 0xc9, 0x25, 0xea, 0x65, 0x1d, 0xc1, 0xa2, 0xb2, 0x7c, 0x38, - 0x59, 0x7a, 0x71, 0x4b, 0x95, 0xcb, 0x68, 0x55, 0x92, 0xab, 0xae, 0x23, 0x9c, 0x78, 0x66, 0xf5, - 0xe0, 0x46, 0xbd, 0x1b, 0x0a, 0xd2, 0xc1, 0xfb, 0x02, 0x77, 0x74, 0x9b, 0x35, 0xc8, 0x86, 0x6e, - 0x07, 0xa7, 0xca, 0x83, 0x44, 0xa2, 0x2a, 0xcc, 0xe8, 0x29, 0x33, 0x57, 0x4e, 0xa9, 0x91, 0xd6, - 0x4b, 0xc8, 0xeb, 0xd6, 0xba, 0xed, 0x26, 0x80, 0x9a, 0xc7, 0xe1, 0x58, 0x98, 0x46, 0x79, 0x6a, - 0x39, 0x57, 0xbd, 0x3b, 0x38, 0x53, 0x42, 0x69, 0x7d, 0x4e, 0x11, 0x1a, 0x58, 0x58, 0x1f, 0x0d, - 0xc8, 0xed, 0xb8, 0x9c, 0x78, 0xba, 0xda, 0x36, 0xe4, 0xa3, 0xc0, 0x15, 0x6d, 0xca, 0x3a, 0x4e, - 0xea, 0x69, 0xe6, 0x63, 0xca, 0x41, 0x7f, 0xaa, 0x2d, 0xb8, 0x38, 0x3b, 0x5d, 0x16, 0xa4, 0xca, - 0x78, 0x2e, 0x66, 0x1c, 0xb3, 0xc0, 0xfa, 0x61, 0x40, 0xa1, 0x81, 0xc5, 0xf0, 0x1a, 0xf0, 0xdb, - 0x2e, 0xe6, 0x02, 0x1d, 0xc2, 0xcd, 0x70, 0x60, 0xc3, 0x13, 0x56, 0x99, 0x0c, 0x42, 0x1d, 0x85, - 0xc9, 0x70, 0x3c, 0x87, 0x05, 0xa6, 0x0c, 0x8a, 0x6b, 0x29, 0xbd, 0xb7, 0x47, 0x58, 0xa8, 0xcb, - 0xe4, 0xd9, 0xd0, 0x02, 0x36, 0x60, 0xbe, 0xd9, 0x77, 0x30, 0xe6, 0xab, 0xcb, 0x59, 0x18, 0xe4, - 0x0f, 0x38, 0x5c, 0xcf, 0x35, 0x2f, 0x0f, 0xd6, 0x21, 0x98, 0xc9, 0x49, 0x79, 0x44, 0x43, 0x8e, - 0xd1, 0x3a, 0xcc, 0x12, 0xee, 0xf0, 0xae, 0xe7, 0xe9, 0xf1, 0x26, 0xc6, 0x83, 0xf0, 0x46, 0xd7, - 0xf3, 0xac, 0x4d, 0x28, 0xd4, 0xc6, 0x58, 0x77, 0x0f, 0xe6, 0xe3, 0x0b, 0x20, 0x7a, 0x11, 0x96, - 0x51, 0x99, 0xab, 0xe7, 0xf4, 0xb3, 0x57, 0xbd, 0x08, 0x5b, 0x3f, 0x0d, 0x30, 0x6b, 0xe3, 0xf4, - 0xfc, 0x67, 0xd6, 0x53, 0xb8, 0x73, 0xe2, 0x06, 0xa4, 0xe5, 0x0a, 0x3c, 0x78, 0xeb, 0x63, 0xb7, - 0xfe, 0xfd, 0x9f, 0x46, 0x03, 0x4a, 0xa3, 0x1b, 0xfe, 0xc5, 0xbe, 0xab, 0x1f, 0xb2, 0x90, 0x1f, - 0xfe, 0x34, 0x7d, 0x36, 0xe0, 0xfa, 0xef, 0x99, 0x42, 0xf7, 0x07, 0xf5, 0x8e, 0xb9, 0x5b, 0xc5, - 0x07, 0x93, 0x41, 0x4a, 0xa6, 0xb5, 0x75, 0xbe, 0x5d, 0x44, 0xfd, 0xd4, 0x96, 0xb5, 0x33, 0x65, - 0xe5, 0x0c, 0x93, 0xab, 0x7d, 0xff, 0xed, 0xfb, 0xa7, 0x4c, 0xc9, 0x2a, 0xd8, 0xa7, 0x8f, 0xed, - 0x61, 0xe7, 0xb8, 0xcd, 0xb1, 0xd8, 0x30, 0x56, 0xa4, 0xc0, 0xda, 0x44, 0x81, 0xb5, 0x34, 0x02, - 0x6b, 0x93, 0x05, 0xd6, 0xfe, 0x40, 0xa0, 0xaf, 0x04, 0x7e, 0x35, 0x60, 0x71, 0xd4, 0xa6, 0xd0, - 0xc3, 0xc1, 0xfe, 0x13, 0xc2, 0x53, 0x5c, 0xbe, 0x1a, 0xa8, 0xc5, 0x1e, 0x9d, 0x6f, 0x9b, 0xe8, - 0x56, 0x0c, 0x29, 0xcb, 0xd8, 0xc4, 0xba, 0xa5, 0x54, 0xdb, 0x5a, 0x19, 0x25, 0xf5, 0x54, 0x33, - 0x9c, 0xa1, 0x90, 0x6e, 0x18, 0x2b, 0x3b, 0xd9, 0xd7, 0x99, 0xa8, 0xd9, 0x9c, 0x91, 0x99, 0x59, - 0xff, 0x15, 0x00, 0x00, 0xff, 0xff, 0x92, 0x91, 0xe8, 0x28, 0x4e, 0x09, 0x00, 0x00, -} - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConn - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion4 - -// ServiceConfigClient is the client API for ServiceConfig service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type ServiceConfigClient interface { - // Set service configration - SetServiceConfig(ctx context.Context, in *SetServiceConfigRequest, opts ...grpc.CallOption) (*SetServiceConfigResponse, error) - // Get service configration - GetServiceConfig(ctx context.Context, in *GetServiceConfigRequest, opts ...grpc.CallOption) (*GetServiceConfigResponse, error) - // Validate email service - ValidateEmailService(ctx context.Context, in *ValidateEmailServiceRequest, opts ...grpc.CallOption) (*ValidateEmailServiceResponse, error) -} - -type serviceConfigClient struct { - cc *grpc.ClientConn -} - -func NewServiceConfigClient(cc *grpc.ClientConn) ServiceConfigClient { - return &serviceConfigClient{cc} -} - -func (c *serviceConfigClient) SetServiceConfig(ctx context.Context, in *SetServiceConfigRequest, opts ...grpc.CallOption) (*SetServiceConfigResponse, error) { - out := new(SetServiceConfigResponse) - err := c.cc.Invoke(ctx, "/openpitrix.ServiceConfig/SetServiceConfig", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *serviceConfigClient) GetServiceConfig(ctx context.Context, in *GetServiceConfigRequest, opts ...grpc.CallOption) (*GetServiceConfigResponse, error) { - out := new(GetServiceConfigResponse) - err := c.cc.Invoke(ctx, "/openpitrix.ServiceConfig/GetServiceConfig", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *serviceConfigClient) ValidateEmailService(ctx context.Context, in *ValidateEmailServiceRequest, opts ...grpc.CallOption) (*ValidateEmailServiceResponse, error) { - out := new(ValidateEmailServiceResponse) - err := c.cc.Invoke(ctx, "/openpitrix.ServiceConfig/ValidateEmailService", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// ServiceConfigServer is the server API for ServiceConfig service. -type ServiceConfigServer interface { - // Set service configration - SetServiceConfig(context.Context, *SetServiceConfigRequest) (*SetServiceConfigResponse, error) - // Get service configration - GetServiceConfig(context.Context, *GetServiceConfigRequest) (*GetServiceConfigResponse, error) - // Validate email service - ValidateEmailService(context.Context, *ValidateEmailServiceRequest) (*ValidateEmailServiceResponse, error) -} - -// UnimplementedServiceConfigServer can be embedded to have forward compatible implementations. -type UnimplementedServiceConfigServer struct { -} - -func (*UnimplementedServiceConfigServer) SetServiceConfig(ctx context.Context, req *SetServiceConfigRequest) (*SetServiceConfigResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method SetServiceConfig not implemented") -} -func (*UnimplementedServiceConfigServer) GetServiceConfig(ctx context.Context, req *GetServiceConfigRequest) (*GetServiceConfigResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetServiceConfig not implemented") -} -func (*UnimplementedServiceConfigServer) ValidateEmailService(ctx context.Context, req *ValidateEmailServiceRequest) (*ValidateEmailServiceResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ValidateEmailService not implemented") -} - -func RegisterServiceConfigServer(s *grpc.Server, srv ServiceConfigServer) { - s.RegisterService(&_ServiceConfig_serviceDesc, srv) -} - -func _ServiceConfig_SetServiceConfig_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(SetServiceConfigRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ServiceConfigServer).SetServiceConfig(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/openpitrix.ServiceConfig/SetServiceConfig", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ServiceConfigServer).SetServiceConfig(ctx, req.(*SetServiceConfigRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _ServiceConfig_GetServiceConfig_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetServiceConfigRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ServiceConfigServer).GetServiceConfig(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/openpitrix.ServiceConfig/GetServiceConfig", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ServiceConfigServer).GetServiceConfig(ctx, req.(*GetServiceConfigRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _ServiceConfig_ValidateEmailService_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ValidateEmailServiceRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ServiceConfigServer).ValidateEmailService(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/openpitrix.ServiceConfig/ValidateEmailService", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ServiceConfigServer).ValidateEmailService(ctx, req.(*ValidateEmailServiceRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _ServiceConfig_serviceDesc = grpc.ServiceDesc{ - ServiceName: "openpitrix.ServiceConfig", - HandlerType: (*ServiceConfigServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "SetServiceConfig", - Handler: _ServiceConfig_SetServiceConfig_Handler, - }, - { - MethodName: "GetServiceConfig", - Handler: _ServiceConfig_GetServiceConfig_Handler, - }, - { - MethodName: "ValidateEmailService", - Handler: _ServiceConfig_ValidateEmailService_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "service_config.proto", -} diff --git a/vendor/openpitrix.io/openpitrix/pkg/pb/service_config.pb.gw.go b/vendor/openpitrix.io/openpitrix/pkg/pb/service_config.pb.gw.go deleted file mode 100644 index 0c72cbfa0a..0000000000 --- a/vendor/openpitrix.io/openpitrix/pkg/pb/service_config.pb.gw.go +++ /dev/null @@ -1,319 +0,0 @@ -// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: service_config.proto - -/* -Package pb is a reverse proxy. - -It translates gRPC into RESTful JSON APIs. -*/ -package pb - -import ( - "context" - "io" - "net/http" - - "github.com/golang/protobuf/descriptor" - "github.com/golang/protobuf/proto" - "github.com/grpc-ecosystem/grpc-gateway/runtime" - "github.com/grpc-ecosystem/grpc-gateway/utilities" - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/grpclog" - "google.golang.org/grpc/status" -) - -// Suppress "imported and not used" errors -var _ codes.Code -var _ io.Reader -var _ status.Status -var _ = runtime.String -var _ = utilities.NewDoubleArray -var _ = descriptor.ForMessage - -func request_ServiceConfig_SetServiceConfig_0(ctx context.Context, marshaler runtime.Marshaler, client ServiceConfigClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq SetServiceConfigRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.SetServiceConfig(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_ServiceConfig_SetServiceConfig_0(ctx context.Context, marshaler runtime.Marshaler, server ServiceConfigServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq SetServiceConfigRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.SetServiceConfig(ctx, &protoReq) - return msg, metadata, err - -} - -func request_ServiceConfig_GetServiceConfig_0(ctx context.Context, marshaler runtime.Marshaler, client ServiceConfigClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq GetServiceConfigRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.GetServiceConfig(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_ServiceConfig_GetServiceConfig_0(ctx context.Context, marshaler runtime.Marshaler, server ServiceConfigServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq GetServiceConfigRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.GetServiceConfig(ctx, &protoReq) - return msg, metadata, err - -} - -func request_ServiceConfig_ValidateEmailService_0(ctx context.Context, marshaler runtime.Marshaler, client ServiceConfigClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ValidateEmailServiceRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.ValidateEmailService(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_ServiceConfig_ValidateEmailService_0(ctx context.Context, marshaler runtime.Marshaler, server ServiceConfigServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ValidateEmailServiceRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.ValidateEmailService(ctx, &protoReq) - return msg, metadata, err - -} - -// RegisterServiceConfigHandlerServer registers the http handlers for service ServiceConfig to "mux". -// UnaryRPC :call ServiceConfigServer directly. -// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. -func RegisterServiceConfigHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ServiceConfigServer) error { - - mux.Handle("POST", pattern_ServiceConfig_SetServiceConfig_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_ServiceConfig_SetServiceConfig_0(rctx, inboundMarshaler, server, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_ServiceConfig_SetServiceConfig_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_ServiceConfig_GetServiceConfig_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_ServiceConfig_GetServiceConfig_0(rctx, inboundMarshaler, server, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_ServiceConfig_GetServiceConfig_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_ServiceConfig_ValidateEmailService_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_ServiceConfig_ValidateEmailService_0(rctx, inboundMarshaler, server, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_ServiceConfig_ValidateEmailService_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -// RegisterServiceConfigHandlerFromEndpoint is same as RegisterServiceConfigHandler but -// automatically dials to "endpoint" and closes the connection when "ctx" gets done. -func RegisterServiceConfigHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { - conn, err := grpc.Dial(endpoint, opts...) - if err != nil { - return err - } - defer func() { - if err != nil { - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - return - } - go func() { - <-ctx.Done() - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - }() - }() - - return RegisterServiceConfigHandler(ctx, mux, conn) -} - -// RegisterServiceConfigHandler registers the http handlers for service ServiceConfig to "mux". -// The handlers forward requests to the grpc endpoint over "conn". -func RegisterServiceConfigHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { - return RegisterServiceConfigHandlerClient(ctx, mux, NewServiceConfigClient(conn)) -} - -// RegisterServiceConfigHandlerClient registers the http handlers for service ServiceConfig -// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "ServiceConfigClient". -// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "ServiceConfigClient" -// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in -// "ServiceConfigClient" to call the correct interceptors. -func RegisterServiceConfigHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ServiceConfigClient) error { - - mux.Handle("POST", pattern_ServiceConfig_SetServiceConfig_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_ServiceConfig_SetServiceConfig_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_ServiceConfig_SetServiceConfig_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_ServiceConfig_GetServiceConfig_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_ServiceConfig_GetServiceConfig_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_ServiceConfig_GetServiceConfig_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_ServiceConfig_ValidateEmailService_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_ServiceConfig_ValidateEmailService_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_ServiceConfig_ValidateEmailService_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -var ( - pattern_ServiceConfig_SetServiceConfig_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "service_configs", "set"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_ServiceConfig_GetServiceConfig_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "service_configs", "get"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_ServiceConfig_ValidateEmailService_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "service_configs", "validate_email_service"}, "", runtime.AssumeColonVerbOpt(true))) -) - -var ( - forward_ServiceConfig_SetServiceConfig_0 = runtime.ForwardResponseMessage - - forward_ServiceConfig_GetServiceConfig_0 = runtime.ForwardResponseMessage - - forward_ServiceConfig_ValidateEmailService_0 = runtime.ForwardResponseMessage -) diff --git a/vendor/openpitrix.io/openpitrix/pkg/pb/task.pb.go b/vendor/openpitrix.io/openpitrix/pkg/pb/task.pb.go deleted file mode 100644 index dd4b9b6e87..0000000000 --- a/vendor/openpitrix.io/openpitrix/pkg/pb/task.pb.go +++ /dev/null @@ -1,880 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// source: task.proto - -package pb - -import ( - context "context" - fmt "fmt" - math "math" - - proto "github.com/golang/protobuf/proto" - timestamp "github.com/golang/protobuf/ptypes/timestamp" - wrappers "github.com/golang/protobuf/ptypes/wrappers" - _ "github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger/options" - _ "google.golang.org/genproto/googleapis/api/annotations" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" -) - -// 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 - -type CreateTaskRequest struct { - // id of job(jod will split to one more task) to split - JobId *wrappers.StringValue `protobuf:"bytes,1,opt,name=job_id,json=jobId,proto3" json:"job_id,omitempty"` - // node(task run in node) id - NodeId *wrappers.StringValue `protobuf:"bytes,2,opt,name=node_id,json=nodeId,proto3" json:"node_id,omitempty"` - // describe where the task running eg.[runtime|pilot] - Target *wrappers.StringValue `protobuf:"bytes,3,opt,name=target,proto3" json:"target,omitempty"` - // directive, a kv string, describe the info of running the action - TaskAction *wrappers.StringValue `protobuf:"bytes,4,opt,name=task_action,json=taskAction,proto3" json:"task_action,omitempty"` - // describe the action of the task eg.[WaitFrontgateAvailable|PingFrontgate|AttachVolumes|StartInstances|...] - Directive *wrappers.StringValue `protobuf:"bytes,5,opt,name=directive,proto3" json:"directive,omitempty"` - // allow failure or not - FailureAllowed *wrappers.BoolValue `protobuf:"bytes,6,opt,name=failure_allowed,json=failureAllowed,proto3" json:"failure_allowed,omitempty"` - // task status eg.[running|success|failed|pending] - Status *wrappers.StringValue `protobuf:"bytes,7,opt,name=status,proto3" json:"status,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *CreateTaskRequest) Reset() { *m = CreateTaskRequest{} } -func (m *CreateTaskRequest) String() string { return proto.CompactTextString(m) } -func (*CreateTaskRequest) ProtoMessage() {} -func (*CreateTaskRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_ce5d8dd45b4a91ff, []int{0} -} - -func (m *CreateTaskRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_CreateTaskRequest.Unmarshal(m, b) -} -func (m *CreateTaskRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_CreateTaskRequest.Marshal(b, m, deterministic) -} -func (m *CreateTaskRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_CreateTaskRequest.Merge(m, src) -} -func (m *CreateTaskRequest) XXX_Size() int { - return xxx_messageInfo_CreateTaskRequest.Size(m) -} -func (m *CreateTaskRequest) XXX_DiscardUnknown() { - xxx_messageInfo_CreateTaskRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_CreateTaskRequest proto.InternalMessageInfo - -func (m *CreateTaskRequest) GetJobId() *wrappers.StringValue { - if m != nil { - return m.JobId - } - return nil -} - -func (m *CreateTaskRequest) GetNodeId() *wrappers.StringValue { - if m != nil { - return m.NodeId - } - return nil -} - -func (m *CreateTaskRequest) GetTarget() *wrappers.StringValue { - if m != nil { - return m.Target - } - return nil -} - -func (m *CreateTaskRequest) GetTaskAction() *wrappers.StringValue { - if m != nil { - return m.TaskAction - } - return nil -} - -func (m *CreateTaskRequest) GetDirective() *wrappers.StringValue { - if m != nil { - return m.Directive - } - return nil -} - -func (m *CreateTaskRequest) GetFailureAllowed() *wrappers.BoolValue { - if m != nil { - return m.FailureAllowed - } - return nil -} - -func (m *CreateTaskRequest) GetStatus() *wrappers.StringValue { - if m != nil { - return m.Status - } - return nil -} - -type CreateTaskResponse struct { - // id of task created - TaskId *wrappers.StringValue `protobuf:"bytes,1,opt,name=task_id,json=taskId,proto3" json:"task_id,omitempty"` - // id of job created - JobId *wrappers.StringValue `protobuf:"bytes,2,opt,name=job_id,json=jobId,proto3" json:"job_id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *CreateTaskResponse) Reset() { *m = CreateTaskResponse{} } -func (m *CreateTaskResponse) String() string { return proto.CompactTextString(m) } -func (*CreateTaskResponse) ProtoMessage() {} -func (*CreateTaskResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_ce5d8dd45b4a91ff, []int{1} -} - -func (m *CreateTaskResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_CreateTaskResponse.Unmarshal(m, b) -} -func (m *CreateTaskResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_CreateTaskResponse.Marshal(b, m, deterministic) -} -func (m *CreateTaskResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_CreateTaskResponse.Merge(m, src) -} -func (m *CreateTaskResponse) XXX_Size() int { - return xxx_messageInfo_CreateTaskResponse.Size(m) -} -func (m *CreateTaskResponse) XXX_DiscardUnknown() { - xxx_messageInfo_CreateTaskResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_CreateTaskResponse proto.InternalMessageInfo - -func (m *CreateTaskResponse) GetTaskId() *wrappers.StringValue { - if m != nil { - return m.TaskId - } - return nil -} - -func (m *CreateTaskResponse) GetJobId() *wrappers.StringValue { - if m != nil { - return m.JobId - } - return nil -} - -type RetryTasksRequest struct { - // ids of task to retry - TaskId []string `protobuf:"bytes,1,rep,name=task_id,json=taskId,proto3" json:"task_id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *RetryTasksRequest) Reset() { *m = RetryTasksRequest{} } -func (m *RetryTasksRequest) String() string { return proto.CompactTextString(m) } -func (*RetryTasksRequest) ProtoMessage() {} -func (*RetryTasksRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_ce5d8dd45b4a91ff, []int{2} -} - -func (m *RetryTasksRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_RetryTasksRequest.Unmarshal(m, b) -} -func (m *RetryTasksRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_RetryTasksRequest.Marshal(b, m, deterministic) -} -func (m *RetryTasksRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_RetryTasksRequest.Merge(m, src) -} -func (m *RetryTasksRequest) XXX_Size() int { - return xxx_messageInfo_RetryTasksRequest.Size(m) -} -func (m *RetryTasksRequest) XXX_DiscardUnknown() { - xxx_messageInfo_RetryTasksRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_RetryTasksRequest proto.InternalMessageInfo - -func (m *RetryTasksRequest) GetTaskId() []string { - if m != nil { - return m.TaskId - } - return nil -} - -type RetryTasksResponse struct { - // list of task retried - TaskSet []*Task `protobuf:"bytes,1,rep,name=task_set,json=taskSet,proto3" json:"task_set,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *RetryTasksResponse) Reset() { *m = RetryTasksResponse{} } -func (m *RetryTasksResponse) String() string { return proto.CompactTextString(m) } -func (*RetryTasksResponse) ProtoMessage() {} -func (*RetryTasksResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_ce5d8dd45b4a91ff, []int{3} -} - -func (m *RetryTasksResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_RetryTasksResponse.Unmarshal(m, b) -} -func (m *RetryTasksResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_RetryTasksResponse.Marshal(b, m, deterministic) -} -func (m *RetryTasksResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_RetryTasksResponse.Merge(m, src) -} -func (m *RetryTasksResponse) XXX_Size() int { - return xxx_messageInfo_RetryTasksResponse.Size(m) -} -func (m *RetryTasksResponse) XXX_DiscardUnknown() { - xxx_messageInfo_RetryTasksResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_RetryTasksResponse proto.InternalMessageInfo - -func (m *RetryTasksResponse) GetTaskSet() []*Task { - if m != nil { - return m.TaskSet - } - return nil -} - -type TaskLayer struct { - // task in task layer, a task layer contain one more task - Tasks []*Task `protobuf:"bytes,1,rep,name=tasks,proto3" json:"tasks,omitempty"` - // a task layer point to another task layer - Child *TaskLayer `protobuf:"bytes,2,opt,name=child,proto3" json:"child,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *TaskLayer) Reset() { *m = TaskLayer{} } -func (m *TaskLayer) String() string { return proto.CompactTextString(m) } -func (*TaskLayer) ProtoMessage() {} -func (*TaskLayer) Descriptor() ([]byte, []int) { - return fileDescriptor_ce5d8dd45b4a91ff, []int{4} -} - -func (m *TaskLayer) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_TaskLayer.Unmarshal(m, b) -} -func (m *TaskLayer) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_TaskLayer.Marshal(b, m, deterministic) -} -func (m *TaskLayer) XXX_Merge(src proto.Message) { - xxx_messageInfo_TaskLayer.Merge(m, src) -} -func (m *TaskLayer) XXX_Size() int { - return xxx_messageInfo_TaskLayer.Size(m) -} -func (m *TaskLayer) XXX_DiscardUnknown() { - xxx_messageInfo_TaskLayer.DiscardUnknown(m) -} - -var xxx_messageInfo_TaskLayer proto.InternalMessageInfo - -func (m *TaskLayer) GetTasks() []*Task { - if m != nil { - return m.Tasks - } - return nil -} - -func (m *TaskLayer) GetChild() *TaskLayer { - if m != nil { - return m.Child - } - return nil -} - -type Task struct { - // task id - TaskId *wrappers.StringValue `protobuf:"bytes,1,opt,name=task_id,json=taskId,proto3" json:"task_id,omitempty"` - // job id,job will be split to one more task - JobId *wrappers.StringValue `protobuf:"bytes,2,opt,name=job_id,json=jobId,proto3" json:"job_id,omitempty"` - // describe the action of the task eg.[WaitFrontgateAvailable|PingFrontgate|AttachVolumes|StartInstances|...] - TaskAction *wrappers.StringValue `protobuf:"bytes,3,opt,name=task_action,json=taskAction,proto3" json:"task_action,omitempty"` - // task status eg.[running|successful|failed|pending] - Status *wrappers.StringValue `protobuf:"bytes,4,opt,name=status,proto3" json:"status,omitempty"` - // error code - ErrorCode *wrappers.UInt32Value `protobuf:"bytes,5,opt,name=error_code,json=errorCode,proto3" json:"error_code,omitempty"` - // directive,a json string, describe the info of running the task action - Directive *wrappers.StringValue `protobuf:"bytes,6,opt,name=directive,proto3" json:"directive,omitempty"` - // host name of server - Executor *wrappers.StringValue `protobuf:"bytes,7,opt,name=executor,proto3" json:"executor,omitempty"` - // owner path, concat string group_path:user_id - OwnerPath *wrappers.StringValue `protobuf:"bytes,8,opt,name=owner_path,json=ownerPath,proto3" json:"owner_path,omitempty"` - // describe where the task running eg.[runtime|pilot] - Target *wrappers.StringValue `protobuf:"bytes,9,opt,name=target,proto3" json:"target,omitempty"` - // the cluster contain one more node - NodeId *wrappers.StringValue `protobuf:"bytes,10,opt,name=node_id,json=nodeId,proto3" json:"node_id,omitempty"` - // the time when task create - CreateTime *timestamp.Timestamp `protobuf:"bytes,11,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty"` - // record the status changed time - StatusTime *timestamp.Timestamp `protobuf:"bytes,12,opt,name=status_time,json=statusTime,proto3" json:"status_time,omitempty"` - // allow task run failed or not - FailureAllowed *wrappers.BoolValue `protobuf:"bytes,13,opt,name=failure_allowed,json=failureAllowed,proto3" json:"failure_allowed,omitempty"` - // owner - Owner *wrappers.StringValue `protobuf:"bytes,14,opt,name=owner,proto3" json:"owner,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Task) Reset() { *m = Task{} } -func (m *Task) String() string { return proto.CompactTextString(m) } -func (*Task) ProtoMessage() {} -func (*Task) Descriptor() ([]byte, []int) { - return fileDescriptor_ce5d8dd45b4a91ff, []int{5} -} - -func (m *Task) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Task.Unmarshal(m, b) -} -func (m *Task) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Task.Marshal(b, m, deterministic) -} -func (m *Task) XXX_Merge(src proto.Message) { - xxx_messageInfo_Task.Merge(m, src) -} -func (m *Task) XXX_Size() int { - return xxx_messageInfo_Task.Size(m) -} -func (m *Task) XXX_DiscardUnknown() { - xxx_messageInfo_Task.DiscardUnknown(m) -} - -var xxx_messageInfo_Task proto.InternalMessageInfo - -func (m *Task) GetTaskId() *wrappers.StringValue { - if m != nil { - return m.TaskId - } - return nil -} - -func (m *Task) GetJobId() *wrappers.StringValue { - if m != nil { - return m.JobId - } - return nil -} - -func (m *Task) GetTaskAction() *wrappers.StringValue { - if m != nil { - return m.TaskAction - } - return nil -} - -func (m *Task) GetStatus() *wrappers.StringValue { - if m != nil { - return m.Status - } - return nil -} - -func (m *Task) GetErrorCode() *wrappers.UInt32Value { - if m != nil { - return m.ErrorCode - } - return nil -} - -func (m *Task) GetDirective() *wrappers.StringValue { - if m != nil { - return m.Directive - } - return nil -} - -func (m *Task) GetExecutor() *wrappers.StringValue { - if m != nil { - return m.Executor - } - return nil -} - -func (m *Task) GetOwnerPath() *wrappers.StringValue { - if m != nil { - return m.OwnerPath - } - return nil -} - -func (m *Task) GetTarget() *wrappers.StringValue { - if m != nil { - return m.Target - } - return nil -} - -func (m *Task) GetNodeId() *wrappers.StringValue { - if m != nil { - return m.NodeId - } - return nil -} - -func (m *Task) GetCreateTime() *timestamp.Timestamp { - if m != nil { - return m.CreateTime - } - return nil -} - -func (m *Task) GetStatusTime() *timestamp.Timestamp { - if m != nil { - return m.StatusTime - } - return nil -} - -func (m *Task) GetFailureAllowed() *wrappers.BoolValue { - if m != nil { - return m.FailureAllowed - } - return nil -} - -func (m *Task) GetOwner() *wrappers.StringValue { - if m != nil { - return m.Owner - } - return nil -} - -type DescribeTasksRequest struct { - // query key, support these fields(job_id, task_id, executor, status, owner) - SearchWord *wrappers.StringValue `protobuf:"bytes,1,opt,name=search_word,json=searchWord,proto3" json:"search_word,omitempty"` - // sort key, order by sort_key, default create_time - SortKey *wrappers.StringValue `protobuf:"bytes,2,opt,name=sort_key,json=sortKey,proto3" json:"sort_key,omitempty"` - // value = 0 sort ASC, value = 1 sort DESC - Reverse *wrappers.BoolValue `protobuf:"bytes,3,opt,name=reverse,proto3" json:"reverse,omitempty"` - // data limit per page, default value 20, max value 200 - Limit uint32 `protobuf:"varint,4,opt,name=limit,proto3" json:"limit,omitempty"` - // data offset, default 0 - Offset uint32 `protobuf:"varint,5,opt,name=offset,proto3" json:"offset,omitempty"` - // select columns to display - DisplayColumns []string `protobuf:"bytes,6,rep,name=display_columns,json=displayColumns,proto3" json:"display_columns,omitempty"` - // task ids - TaskId []string `protobuf:"bytes,11,rep,name=task_id,json=taskId,proto3" json:"task_id,omitempty"` - // job ids - JobId []string `protobuf:"bytes,12,rep,name=job_id,json=jobId,proto3" json:"job_id,omitempty"` - // host name of server - Executor *wrappers.StringValue `protobuf:"bytes,13,opt,name=executor,proto3" json:"executor,omitempty"` - // target eg.[runtime|pilot] - Target *wrappers.StringValue `protobuf:"bytes,14,opt,name=target,proto3" json:"target,omitempty"` - // task status eg.[running|successful|failed|pending] - Status []string `protobuf:"bytes,15,rep,name=status,proto3" json:"status,omitempty"` - // owner - Owner []string `protobuf:"bytes,16,rep,name=owner,proto3" json:"owner,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *DescribeTasksRequest) Reset() { *m = DescribeTasksRequest{} } -func (m *DescribeTasksRequest) String() string { return proto.CompactTextString(m) } -func (*DescribeTasksRequest) ProtoMessage() {} -func (*DescribeTasksRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_ce5d8dd45b4a91ff, []int{6} -} - -func (m *DescribeTasksRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_DescribeTasksRequest.Unmarshal(m, b) -} -func (m *DescribeTasksRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_DescribeTasksRequest.Marshal(b, m, deterministic) -} -func (m *DescribeTasksRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_DescribeTasksRequest.Merge(m, src) -} -func (m *DescribeTasksRequest) XXX_Size() int { - return xxx_messageInfo_DescribeTasksRequest.Size(m) -} -func (m *DescribeTasksRequest) XXX_DiscardUnknown() { - xxx_messageInfo_DescribeTasksRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_DescribeTasksRequest proto.InternalMessageInfo - -func (m *DescribeTasksRequest) GetSearchWord() *wrappers.StringValue { - if m != nil { - return m.SearchWord - } - return nil -} - -func (m *DescribeTasksRequest) GetSortKey() *wrappers.StringValue { - if m != nil { - return m.SortKey - } - return nil -} - -func (m *DescribeTasksRequest) GetReverse() *wrappers.BoolValue { - if m != nil { - return m.Reverse - } - return nil -} - -func (m *DescribeTasksRequest) GetLimit() uint32 { - if m != nil { - return m.Limit - } - return 0 -} - -func (m *DescribeTasksRequest) GetOffset() uint32 { - if m != nil { - return m.Offset - } - return 0 -} - -func (m *DescribeTasksRequest) GetDisplayColumns() []string { - if m != nil { - return m.DisplayColumns - } - return nil -} - -func (m *DescribeTasksRequest) GetTaskId() []string { - if m != nil { - return m.TaskId - } - return nil -} - -func (m *DescribeTasksRequest) GetJobId() []string { - if m != nil { - return m.JobId - } - return nil -} - -func (m *DescribeTasksRequest) GetExecutor() *wrappers.StringValue { - if m != nil { - return m.Executor - } - return nil -} - -func (m *DescribeTasksRequest) GetTarget() *wrappers.StringValue { - if m != nil { - return m.Target - } - return nil -} - -func (m *DescribeTasksRequest) GetStatus() []string { - if m != nil { - return m.Status - } - return nil -} - -func (m *DescribeTasksRequest) GetOwner() []string { - if m != nil { - return m.Owner - } - return nil -} - -type DescribeTasksResponse struct { - // total count of task - TotalCount uint32 `protobuf:"varint,1,opt,name=total_count,json=totalCount,proto3" json:"total_count,omitempty"` - // list of task - TaskSet []*Task `protobuf:"bytes,2,rep,name=task_set,json=taskSet,proto3" json:"task_set,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *DescribeTasksResponse) Reset() { *m = DescribeTasksResponse{} } -func (m *DescribeTasksResponse) String() string { return proto.CompactTextString(m) } -func (*DescribeTasksResponse) ProtoMessage() {} -func (*DescribeTasksResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_ce5d8dd45b4a91ff, []int{7} -} - -func (m *DescribeTasksResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_DescribeTasksResponse.Unmarshal(m, b) -} -func (m *DescribeTasksResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_DescribeTasksResponse.Marshal(b, m, deterministic) -} -func (m *DescribeTasksResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_DescribeTasksResponse.Merge(m, src) -} -func (m *DescribeTasksResponse) XXX_Size() int { - return xxx_messageInfo_DescribeTasksResponse.Size(m) -} -func (m *DescribeTasksResponse) XXX_DiscardUnknown() { - xxx_messageInfo_DescribeTasksResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_DescribeTasksResponse proto.InternalMessageInfo - -func (m *DescribeTasksResponse) GetTotalCount() uint32 { - if m != nil { - return m.TotalCount - } - return 0 -} - -func (m *DescribeTasksResponse) GetTaskSet() []*Task { - if m != nil { - return m.TaskSet - } - return nil -} - -func init() { - proto.RegisterType((*CreateTaskRequest)(nil), "openpitrix.CreateTaskRequest") - proto.RegisterType((*CreateTaskResponse)(nil), "openpitrix.CreateTaskResponse") - proto.RegisterType((*RetryTasksRequest)(nil), "openpitrix.RetryTasksRequest") - proto.RegisterType((*RetryTasksResponse)(nil), "openpitrix.RetryTasksResponse") - proto.RegisterType((*TaskLayer)(nil), "openpitrix.TaskLayer") - proto.RegisterType((*Task)(nil), "openpitrix.Task") - proto.RegisterType((*DescribeTasksRequest)(nil), "openpitrix.DescribeTasksRequest") - proto.RegisterType((*DescribeTasksResponse)(nil), "openpitrix.DescribeTasksResponse") -} - -func init() { proto.RegisterFile("task.proto", fileDescriptor_ce5d8dd45b4a91ff) } - -var fileDescriptor_ce5d8dd45b4a91ff = []byte{ - // 950 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x56, 0x41, 0x8f, 0xdb, 0x44, - 0x14, 0x56, 0x92, 0x8d, 0x77, 0xf3, 0xdc, 0xec, 0xb6, 0xa3, 0xdd, 0x62, 0x45, 0xa5, 0x35, 0x3e, - 0xc0, 0xd2, 0xa6, 0x89, 0xc8, 0x16, 0x81, 0x5a, 0xf5, 0x90, 0x06, 0x09, 0xad, 0x0a, 0x12, 0x4a, - 0x0b, 0x48, 0x5c, 0xcc, 0xc4, 0x7e, 0x49, 0xdc, 0x75, 0x3c, 0x66, 0x66, 0xbc, 0x69, 0x6e, 0xc0, - 0x4f, 0x28, 0x3f, 0x03, 0x89, 0x2b, 0x3f, 0x84, 0x0b, 0x3f, 0x80, 0x0b, 0xff, 0x02, 0xcd, 0x8c, - 0xb3, 0x71, 0x36, 0xdd, 0xae, 0x73, 0xe1, 0x14, 0xf9, 0xcd, 0xf7, 0xcd, 0xbc, 0x79, 0xef, 0x7b, - 0xdf, 0x04, 0x40, 0x52, 0x71, 0xd6, 0x49, 0x39, 0x93, 0x8c, 0x00, 0x4b, 0x31, 0x49, 0x23, 0xc9, - 0xa3, 0xd7, 0xad, 0xbb, 0x13, 0xc6, 0x26, 0x31, 0x76, 0xf5, 0xca, 0x28, 0x1b, 0x77, 0xe7, 0x9c, - 0xa6, 0x29, 0x72, 0x61, 0xb0, 0xad, 0x7b, 0x97, 0xd7, 0x65, 0x34, 0x43, 0x21, 0xe9, 0x2c, 0xcd, - 0x01, 0x77, 0x72, 0x00, 0x4d, 0xa3, 0x2e, 0x4d, 0x12, 0x26, 0xa9, 0x8c, 0x58, 0xb2, 0xa4, 0xb7, - 0xf5, 0x4f, 0xf0, 0x70, 0x82, 0xc9, 0x43, 0x31, 0xa7, 0x93, 0x09, 0xf2, 0x2e, 0x4b, 0x35, 0x62, - 0x13, 0xed, 0xfd, 0x5e, 0x83, 0x5b, 0x03, 0x8e, 0x54, 0xe2, 0x4b, 0x2a, 0xce, 0x86, 0xf8, 0x53, - 0x86, 0x42, 0x92, 0x13, 0xb0, 0x5e, 0xb1, 0x91, 0x1f, 0x85, 0x4e, 0xc5, 0xad, 0x1c, 0xdb, 0xbd, - 0x3b, 0x1d, 0x73, 0x64, 0x67, 0x99, 0x53, 0xe7, 0x85, 0xe4, 0x51, 0x32, 0xf9, 0x8e, 0xc6, 0x19, - 0x0e, 0xeb, 0xaf, 0xd8, 0xe8, 0x34, 0x24, 0x9f, 0xc2, 0x6e, 0xc2, 0x42, 0x54, 0xac, 0x6a, 0x09, - 0x96, 0xa5, 0xc0, 0xa7, 0x21, 0x79, 0x04, 0x96, 0xa4, 0x7c, 0x82, 0xd2, 0xa9, 0x95, 0x61, 0x19, - 0x2c, 0x79, 0x0a, 0xb6, 0x2a, 0xaf, 0x4f, 0x03, 0x75, 0x1b, 0x67, 0xa7, 0x04, 0x55, 0xf7, 0xa3, - 0xaf, 0xf1, 0xe4, 0x31, 0x34, 0xc2, 0x88, 0x63, 0x20, 0xa3, 0x73, 0x74, 0xea, 0x25, 0xc8, 0x2b, - 0x38, 0x19, 0xc0, 0xc1, 0x98, 0x46, 0x71, 0xc6, 0xd1, 0xa7, 0x71, 0xcc, 0xe6, 0x18, 0x3a, 0x96, - 0xde, 0xa1, 0xb5, 0xb1, 0xc3, 0x33, 0xc6, 0x62, 0xc3, 0xdf, 0xcf, 0x29, 0x7d, 0xc3, 0x50, 0xb7, - 0x16, 0x92, 0xca, 0x4c, 0x38, 0xbb, 0x65, 0x6e, 0x6d, 0xb0, 0xde, 0xcf, 0x15, 0x20, 0xc5, 0x6e, - 0x89, 0x94, 0x25, 0x02, 0x55, 0xe5, 0x75, 0x31, 0x4a, 0xf6, 0xcb, 0x52, 0xe0, 0xd3, 0xb0, 0xd0, - 0xe5, 0x6a, 0xe9, 0x2e, 0x7b, 0x6d, 0xb8, 0x35, 0x44, 0xc9, 0x17, 0x2a, 0x01, 0xb1, 0xd4, 0xcb, - 0x7b, 0xc5, 0x04, 0x6a, 0xc7, 0x8d, 0xe5, 0x11, 0x5e, 0x1f, 0x48, 0x11, 0x9d, 0xe7, 0xfb, 0x00, - 0xf6, 0x34, 0x5c, 0xa0, 0xd4, 0x78, 0xbb, 0x77, 0xb3, 0xb3, 0x1a, 0x90, 0x8e, 0xbe, 0x9b, 0xde, - 0xf0, 0x05, 0x4a, 0xef, 0x47, 0x68, 0xa8, 0xc0, 0x57, 0x74, 0x81, 0x9c, 0x7c, 0x08, 0x75, 0x15, - 0x17, 0x57, 0xd2, 0xcc, 0x32, 0x79, 0x00, 0xf5, 0x60, 0x1a, 0xc5, 0xcb, 0x9b, 0x1d, 0x5d, 0xc6, - 0xe9, 0xdd, 0x86, 0x06, 0xe3, 0xfd, 0x69, 0xc1, 0x8e, 0x0a, 0xfe, 0x9f, 0x75, 0xbc, 0x2c, 0xe0, - 0xda, 0x96, 0x02, 0x5e, 0xe9, 0x67, 0xa7, 0xbc, 0x7e, 0xc8, 0x13, 0x00, 0xe4, 0x9c, 0x71, 0x3f, - 0x60, 0xe1, 0xd5, 0xba, 0xff, 0xf6, 0x34, 0x91, 0x27, 0xbd, 0x5c, 0xf7, 0x1a, 0x3f, 0x60, 0x21, - 0xae, 0xcf, 0x8c, 0xb5, 0xdd, 0xcc, 0x7c, 0x0e, 0x7b, 0xf8, 0x1a, 0x83, 0x4c, 0x32, 0x5e, 0x4a, - 0xf0, 0x17, 0x68, 0x95, 0x32, 0x9b, 0x27, 0xc8, 0xfd, 0x94, 0xca, 0xa9, 0xb3, 0x57, 0xe6, 0x58, - 0x8d, 0xff, 0x86, 0xca, 0x69, 0xc1, 0x5b, 0x1a, 0x5b, 0x78, 0x4b, 0xc1, 0xc8, 0x60, 0x0b, 0x23, - 0x7b, 0x02, 0x76, 0xa0, 0x67, 0xd3, 0x57, 0x86, 0xed, 0xd8, 0x57, 0x78, 0xc2, 0xcb, 0xa5, 0x9b, - 0x0f, 0xc1, 0xc0, 0x55, 0x40, 0x91, 0x4d, 0x8f, 0x0c, 0xf9, 0xc6, 0xf5, 0x64, 0x03, 0xd7, 0xe4, - 0xb7, 0x38, 0x52, 0x73, 0x6b, 0x47, 0xea, 0x41, 0x5d, 0x17, 0xce, 0xd9, 0x2f, 0x23, 0x62, 0x0d, - 0xf5, 0xfe, 0xad, 0xc1, 0xe1, 0x17, 0x28, 0x02, 0x1e, 0x8d, 0x70, 0xcd, 0x10, 0x9e, 0x82, 0x2d, - 0x90, 0xf2, 0x60, 0xea, 0xcf, 0x19, 0x2f, 0x37, 0x4d, 0x60, 0x08, 0xdf, 0x33, 0x1e, 0x92, 0xcf, - 0x60, 0x4f, 0x30, 0x2e, 0xfd, 0x33, 0x5c, 0x94, 0x9a, 0xa9, 0x5d, 0x85, 0x7e, 0x8e, 0x0b, 0xf2, - 0x08, 0x76, 0x39, 0x9e, 0x23, 0x17, 0x98, 0x4f, 0xd4, 0xbb, 0x2a, 0xb0, 0x84, 0x92, 0x43, 0xa8, - 0xc7, 0xd1, 0x2c, 0x92, 0x7a, 0x96, 0x9a, 0x43, 0xf3, 0x41, 0x6e, 0x83, 0xc5, 0xc6, 0x63, 0xe5, - 0x51, 0x75, 0x1d, 0xce, 0xbf, 0xc8, 0x47, 0x70, 0x10, 0x46, 0x22, 0x8d, 0xe9, 0xc2, 0x0f, 0x58, - 0x9c, 0xcd, 0x12, 0xe1, 0x58, 0xda, 0xf4, 0xf6, 0xf3, 0xf0, 0xc0, 0x44, 0x8b, 0xae, 0x68, 0x17, - 0x5d, 0x91, 0x1c, 0x5d, 0x18, 0xc6, 0x0d, 0x1d, 0xcf, 0x2d, 0xa1, 0x38, 0x24, 0xcd, 0xad, 0x86, - 0x64, 0xa5, 0xf3, 0xfd, 0x2d, 0x74, 0x7e, 0xfb, 0xc2, 0x43, 0x0e, 0x4c, 0x7a, 0xb9, 0x4b, 0x1c, - 0x2e, 0x95, 0x70, 0xd3, 0x64, 0x67, 0x7a, 0x8d, 0x70, 0x74, 0xa9, 0xd5, 0xb9, 0x9b, 0xdf, 0x03, - 0x5b, 0x32, 0x49, 0x63, 0x3f, 0x60, 0x59, 0x22, 0x75, 0xaf, 0x9b, 0x43, 0xd0, 0xa1, 0x81, 0x8a, - 0xac, 0xd9, 0x7d, 0xf5, 0x1a, 0xbb, 0xef, 0xfd, 0x51, 0x03, 0x5b, 0x45, 0xbe, 0xa6, 0x09, 0x9d, - 0x20, 0x27, 0xcf, 0x01, 0x56, 0x2f, 0x1e, 0x79, 0xbf, 0x48, 0xdc, 0xf8, 0xdf, 0xd2, 0xba, 0x7b, - 0xd5, 0x72, 0x9e, 0xea, 0xdf, 0x15, 0x68, 0xae, 0x5d, 0x82, 0xb8, 0x45, 0xc6, 0xdb, 0xa4, 0xdc, - 0xfa, 0xe0, 0x1d, 0x08, 0xb3, 0xad, 0xf7, 0x4b, 0xe5, 0x4d, 0x7f, 0x46, 0xce, 0xbe, 0x44, 0xe9, - 0xea, 0xe7, 0xa7, 0xed, 0x06, 0x34, 0x71, 0xc7, 0x51, 0x2c, 0x91, 0xbb, 0xf3, 0x48, 0x4e, 0x5d, - 0x39, 0x45, 0x81, 0xee, 0x38, 0xc2, 0x38, 0x14, 0xc7, 0xa6, 0xf7, 0x6d, 0x37, 0x17, 0x47, 0xdb, - 0x5d, 0xf6, 0xb1, 0xed, 0x9a, 0x0e, 0xb4, 0x5d, 0x5d, 0xf2, 0x8f, 0xdb, 0x6e, 0x88, 0x63, 0x9a, - 0xc5, 0xd2, 0xe5, 0x28, 0x33, 0x9e, 0xb8, 0x34, 0x8e, 0xcd, 0x09, 0xbf, 0xfe, 0xf5, 0xcf, 0x6f, - 0x55, 0x9b, 0x34, 0xba, 0xe7, 0x9f, 0x74, 0xcd, 0x8b, 0x37, 0x07, 0x58, 0xbd, 0xb4, 0xeb, 0x75, - 0xda, 0x78, 0xaf, 0xd7, 0xeb, 0xb4, 0xf9, 0x40, 0x7b, 0xf7, 0xdf, 0xf4, 0x9b, 0xc4, 0xd6, 0x0b, - 0x85, 0xf3, 0x0e, 0xbd, 0x83, 0x8b, 0xf3, 0xba, 0x5c, 0x2d, 0x3e, 0xae, 0xdc, 0x7f, 0xb6, 0xf3, - 0x43, 0x35, 0x1d, 0x8d, 0x2c, 0xad, 0xb4, 0x93, 0xff, 0x02, 0x00, 0x00, 0xff, 0xff, 0x3b, 0x80, - 0x63, 0x5e, 0xf5, 0x0a, 0x00, 0x00, -} - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConn - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion4 - -// TaskManagerClient is the client API for TaskManager service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type TaskManagerClient interface { - CreateTask(ctx context.Context, in *CreateTaskRequest, opts ...grpc.CallOption) (*CreateTaskResponse, error) - // Get tasks, can filter with these fields(job_id, task_id, executor, status, owner), default return all tasks - DescribeTasks(ctx context.Context, in *DescribeTasksRequest, opts ...grpc.CallOption) (*DescribeTasksResponse, error) - // Retry tasks - RetryTasks(ctx context.Context, in *RetryTasksRequest, opts ...grpc.CallOption) (*RetryTasksResponse, error) -} - -type taskManagerClient struct { - cc *grpc.ClientConn -} - -func NewTaskManagerClient(cc *grpc.ClientConn) TaskManagerClient { - return &taskManagerClient{cc} -} - -func (c *taskManagerClient) CreateTask(ctx context.Context, in *CreateTaskRequest, opts ...grpc.CallOption) (*CreateTaskResponse, error) { - out := new(CreateTaskResponse) - err := c.cc.Invoke(ctx, "/openpitrix.TaskManager/CreateTask", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *taskManagerClient) DescribeTasks(ctx context.Context, in *DescribeTasksRequest, opts ...grpc.CallOption) (*DescribeTasksResponse, error) { - out := new(DescribeTasksResponse) - err := c.cc.Invoke(ctx, "/openpitrix.TaskManager/DescribeTasks", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *taskManagerClient) RetryTasks(ctx context.Context, in *RetryTasksRequest, opts ...grpc.CallOption) (*RetryTasksResponse, error) { - out := new(RetryTasksResponse) - err := c.cc.Invoke(ctx, "/openpitrix.TaskManager/RetryTasks", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// TaskManagerServer is the server API for TaskManager service. -type TaskManagerServer interface { - CreateTask(context.Context, *CreateTaskRequest) (*CreateTaskResponse, error) - // Get tasks, can filter with these fields(job_id, task_id, executor, status, owner), default return all tasks - DescribeTasks(context.Context, *DescribeTasksRequest) (*DescribeTasksResponse, error) - // Retry tasks - RetryTasks(context.Context, *RetryTasksRequest) (*RetryTasksResponse, error) -} - -// UnimplementedTaskManagerServer can be embedded to have forward compatible implementations. -type UnimplementedTaskManagerServer struct { -} - -func (*UnimplementedTaskManagerServer) CreateTask(ctx context.Context, req *CreateTaskRequest) (*CreateTaskResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method CreateTask not implemented") -} -func (*UnimplementedTaskManagerServer) DescribeTasks(ctx context.Context, req *DescribeTasksRequest) (*DescribeTasksResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method DescribeTasks not implemented") -} -func (*UnimplementedTaskManagerServer) RetryTasks(ctx context.Context, req *RetryTasksRequest) (*RetryTasksResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method RetryTasks not implemented") -} - -func RegisterTaskManagerServer(s *grpc.Server, srv TaskManagerServer) { - s.RegisterService(&_TaskManager_serviceDesc, srv) -} - -func _TaskManager_CreateTask_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CreateTaskRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(TaskManagerServer).CreateTask(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/openpitrix.TaskManager/CreateTask", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(TaskManagerServer).CreateTask(ctx, req.(*CreateTaskRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _TaskManager_DescribeTasks_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DescribeTasksRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(TaskManagerServer).DescribeTasks(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/openpitrix.TaskManager/DescribeTasks", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(TaskManagerServer).DescribeTasks(ctx, req.(*DescribeTasksRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _TaskManager_RetryTasks_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(RetryTasksRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(TaskManagerServer).RetryTasks(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/openpitrix.TaskManager/RetryTasks", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(TaskManagerServer).RetryTasks(ctx, req.(*RetryTasksRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _TaskManager_serviceDesc = grpc.ServiceDesc{ - ServiceName: "openpitrix.TaskManager", - HandlerType: (*TaskManagerServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "CreateTask", - Handler: _TaskManager_CreateTask_Handler, - }, - { - MethodName: "DescribeTasks", - Handler: _TaskManager_DescribeTasks_Handler, - }, - { - MethodName: "RetryTasks", - Handler: _TaskManager_RetryTasks_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "task.proto", -} diff --git a/vendor/openpitrix.io/openpitrix/pkg/pb/task.pb.gw.go b/vendor/openpitrix.io/openpitrix/pkg/pb/task.pb.gw.go deleted file mode 100644 index bd4816d46c..0000000000 --- a/vendor/openpitrix.io/openpitrix/pkg/pb/task.pb.gw.go +++ /dev/null @@ -1,240 +0,0 @@ -// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: task.proto - -/* -Package pb is a reverse proxy. - -It translates gRPC into RESTful JSON APIs. -*/ -package pb - -import ( - "context" - "io" - "net/http" - - "github.com/golang/protobuf/descriptor" - "github.com/golang/protobuf/proto" - "github.com/grpc-ecosystem/grpc-gateway/runtime" - "github.com/grpc-ecosystem/grpc-gateway/utilities" - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/grpclog" - "google.golang.org/grpc/status" -) - -// Suppress "imported and not used" errors -var _ codes.Code -var _ io.Reader -var _ status.Status -var _ = runtime.String -var _ = utilities.NewDoubleArray -var _ = descriptor.ForMessage - -var ( - filter_TaskManager_DescribeTasks_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_TaskManager_DescribeTasks_0(ctx context.Context, marshaler runtime.Marshaler, client TaskManagerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq DescribeTasksRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_TaskManager_DescribeTasks_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.DescribeTasks(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_TaskManager_DescribeTasks_0(ctx context.Context, marshaler runtime.Marshaler, server TaskManagerServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq DescribeTasksRequest - var metadata runtime.ServerMetadata - - if err := runtime.PopulateQueryParameters(&protoReq, req.URL.Query(), filter_TaskManager_DescribeTasks_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.DescribeTasks(ctx, &protoReq) - return msg, metadata, err - -} - -func request_TaskManager_RetryTasks_0(ctx context.Context, marshaler runtime.Marshaler, client TaskManagerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq RetryTasksRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.RetryTasks(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_TaskManager_RetryTasks_0(ctx context.Context, marshaler runtime.Marshaler, server TaskManagerServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq RetryTasksRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.RetryTasks(ctx, &protoReq) - return msg, metadata, err - -} - -// RegisterTaskManagerHandlerServer registers the http handlers for service TaskManager to "mux". -// UnaryRPC :call TaskManagerServer directly. -// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. -func RegisterTaskManagerHandlerServer(ctx context.Context, mux *runtime.ServeMux, server TaskManagerServer) error { - - mux.Handle("GET", pattern_TaskManager_DescribeTasks_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_TaskManager_DescribeTasks_0(rctx, inboundMarshaler, server, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_TaskManager_DescribeTasks_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_TaskManager_RetryTasks_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_TaskManager_RetryTasks_0(rctx, inboundMarshaler, server, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_TaskManager_RetryTasks_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -// RegisterTaskManagerHandlerFromEndpoint is same as RegisterTaskManagerHandler but -// automatically dials to "endpoint" and closes the connection when "ctx" gets done. -func RegisterTaskManagerHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { - conn, err := grpc.Dial(endpoint, opts...) - if err != nil { - return err - } - defer func() { - if err != nil { - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - return - } - go func() { - <-ctx.Done() - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - }() - }() - - return RegisterTaskManagerHandler(ctx, mux, conn) -} - -// RegisterTaskManagerHandler registers the http handlers for service TaskManager to "mux". -// The handlers forward requests to the grpc endpoint over "conn". -func RegisterTaskManagerHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { - return RegisterTaskManagerHandlerClient(ctx, mux, NewTaskManagerClient(conn)) -} - -// RegisterTaskManagerHandlerClient registers the http handlers for service TaskManager -// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "TaskManagerClient". -// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "TaskManagerClient" -// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in -// "TaskManagerClient" to call the correct interceptors. -func RegisterTaskManagerHandlerClient(ctx context.Context, mux *runtime.ServeMux, client TaskManagerClient) error { - - mux.Handle("GET", pattern_TaskManager_DescribeTasks_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_TaskManager_DescribeTasks_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_TaskManager_DescribeTasks_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_TaskManager_RetryTasks_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_TaskManager_RetryTasks_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_TaskManager_RetryTasks_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -var ( - pattern_TaskManager_DescribeTasks_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "tasks"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_TaskManager_RetryTasks_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "tasks", "retry"}, "", runtime.AssumeColonVerbOpt(true))) -) - -var ( - forward_TaskManager_DescribeTasks_0 = runtime.ForwardResponseMessage - - forward_TaskManager_RetryTasks_0 = runtime.ForwardResponseMessage -) diff --git a/vendor/openpitrix.io/openpitrix/pkg/pb/types.pb.go b/vendor/openpitrix.io/openpitrix/pkg/pb/types.pb.go deleted file mode 100644 index 57dc1ab48a..0000000000 --- a/vendor/openpitrix.io/openpitrix/pkg/pb/types.pb.go +++ /dev/null @@ -1,179 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// source: types.proto - -package pb - -import ( - fmt "fmt" - math "math" - - proto "github.com/golang/protobuf/proto" - timestamp "github.com/golang/protobuf/ptypes/timestamp" - wrappers "github.com/golang/protobuf/ptypes/wrappers" -) - -// 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 - -type ErrorDetail struct { - ErrorName string `protobuf:"bytes,1,opt,name=error_name,json=errorName,proto3" json:"error_name,omitempty"` - Cause string `protobuf:"bytes,2,opt,name=cause,proto3" json:"cause,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ErrorDetail) Reset() { *m = ErrorDetail{} } -func (m *ErrorDetail) String() string { return proto.CompactTextString(m) } -func (*ErrorDetail) ProtoMessage() {} -func (*ErrorDetail) Descriptor() ([]byte, []int) { - return fileDescriptor_d938547f84707355, []int{0} -} - -func (m *ErrorDetail) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ErrorDetail.Unmarshal(m, b) -} -func (m *ErrorDetail) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ErrorDetail.Marshal(b, m, deterministic) -} -func (m *ErrorDetail) XXX_Merge(src proto.Message) { - xxx_messageInfo_ErrorDetail.Merge(m, src) -} -func (m *ErrorDetail) XXX_Size() int { - return xxx_messageInfo_ErrorDetail.Size(m) -} -func (m *ErrorDetail) XXX_DiscardUnknown() { - xxx_messageInfo_ErrorDetail.DiscardUnknown(m) -} - -var xxx_messageInfo_ErrorDetail proto.InternalMessageInfo - -func (m *ErrorDetail) GetErrorName() string { - if m != nil { - return m.ErrorName - } - return "" -} - -func (m *ErrorDetail) GetCause() string { - if m != nil { - return m.Cause - } - return "" -} - -type ResourceCategory struct { - CategoryId *wrappers.StringValue `protobuf:"bytes,1,opt,name=category_id,json=categoryId,proto3" json:"category_id,omitempty"` - Name *wrappers.StringValue `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - Locale *wrappers.StringValue `protobuf:"bytes,3,opt,name=locale,proto3" json:"locale,omitempty"` - Status *wrappers.StringValue `protobuf:"bytes,4,opt,name=status,proto3" json:"status,omitempty"` - CreateTime *timestamp.Timestamp `protobuf:"bytes,5,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty"` - StatusTime *timestamp.Timestamp `protobuf:"bytes,6,opt,name=status_time,json=statusTime,proto3" json:"status_time,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ResourceCategory) Reset() { *m = ResourceCategory{} } -func (m *ResourceCategory) String() string { return proto.CompactTextString(m) } -func (*ResourceCategory) ProtoMessage() {} -func (*ResourceCategory) Descriptor() ([]byte, []int) { - return fileDescriptor_d938547f84707355, []int{1} -} - -func (m *ResourceCategory) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ResourceCategory.Unmarshal(m, b) -} -func (m *ResourceCategory) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ResourceCategory.Marshal(b, m, deterministic) -} -func (m *ResourceCategory) XXX_Merge(src proto.Message) { - xxx_messageInfo_ResourceCategory.Merge(m, src) -} -func (m *ResourceCategory) XXX_Size() int { - return xxx_messageInfo_ResourceCategory.Size(m) -} -func (m *ResourceCategory) XXX_DiscardUnknown() { - xxx_messageInfo_ResourceCategory.DiscardUnknown(m) -} - -var xxx_messageInfo_ResourceCategory proto.InternalMessageInfo - -func (m *ResourceCategory) GetCategoryId() *wrappers.StringValue { - if m != nil { - return m.CategoryId - } - return nil -} - -func (m *ResourceCategory) GetName() *wrappers.StringValue { - if m != nil { - return m.Name - } - return nil -} - -func (m *ResourceCategory) GetLocale() *wrappers.StringValue { - if m != nil { - return m.Locale - } - return nil -} - -func (m *ResourceCategory) GetStatus() *wrappers.StringValue { - if m != nil { - return m.Status - } - return nil -} - -func (m *ResourceCategory) GetCreateTime() *timestamp.Timestamp { - if m != nil { - return m.CreateTime - } - return nil -} - -func (m *ResourceCategory) GetStatusTime() *timestamp.Timestamp { - if m != nil { - return m.StatusTime - } - return nil -} - -func init() { - proto.RegisterType((*ErrorDetail)(nil), "openpitrix.ErrorDetail") - proto.RegisterType((*ResourceCategory)(nil), "openpitrix.ResourceCategory") -} - -func init() { proto.RegisterFile("types.proto", fileDescriptor_d938547f84707355) } - -var fileDescriptor_d938547f84707355 = []byte{ - // 282 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x90, 0x3d, 0x4f, 0xc3, 0x30, - 0x10, 0x86, 0xd5, 0xd0, 0x56, 0xea, 0x65, 0x41, 0x16, 0x43, 0x14, 0xf1, 0xa5, 0x4e, 0x4c, 0x29, - 0x02, 0x36, 0xc4, 0x52, 0x60, 0x60, 0x61, 0x08, 0x88, 0x81, 0x25, 0x72, 0xd2, 0x23, 0xb2, 0x94, - 0xc4, 0xd6, 0xf9, 0x22, 0xe8, 0x4f, 0xe6, 0x5f, 0x20, 0xdb, 0xc9, 0x02, 0x03, 0xd9, 0xec, 0x7b, - 0x9f, 0xe7, 0xf4, 0xea, 0x20, 0xe6, 0xbd, 0x41, 0x9b, 0x19, 0xd2, 0xac, 0x05, 0x68, 0x83, 0x9d, - 0x51, 0x4c, 0xea, 0x2b, 0x3d, 0xad, 0xb5, 0xae, 0x1b, 0xdc, 0xf8, 0xa4, 0xec, 0x3f, 0x36, 0x9f, - 0x24, 0x8d, 0x41, 0x1a, 0xd8, 0xf4, 0xec, 0x77, 0xce, 0xaa, 0x45, 0xcb, 0xb2, 0x35, 0x01, 0x58, - 0x6f, 0x21, 0x7e, 0x24, 0xd2, 0xf4, 0x80, 0x2c, 0x55, 0x23, 0x4e, 0x00, 0xd0, 0x7d, 0x8b, 0x4e, - 0xb6, 0x98, 0xcc, 0xce, 0x67, 0x17, 0xab, 0x7c, 0xe5, 0x27, 0xcf, 0xb2, 0x45, 0x71, 0x04, 0x8b, - 0x4a, 0xf6, 0x16, 0x93, 0xc8, 0x27, 0xe1, 0xb3, 0xfe, 0x8e, 0xe0, 0x30, 0x47, 0xab, 0x7b, 0xaa, - 0xf0, 0x5e, 0x32, 0xd6, 0x9a, 0xf6, 0xe2, 0x0e, 0xe2, 0x6a, 0x78, 0x17, 0x6a, 0xe7, 0x57, 0xc5, - 0x57, 0xc7, 0x59, 0xe8, 0x93, 0x8d, 0x7d, 0xb2, 0x17, 0x26, 0xd5, 0xd5, 0x6f, 0xb2, 0xe9, 0x31, - 0x87, 0x51, 0x78, 0xda, 0x89, 0x4b, 0x98, 0xfb, 0x0a, 0xd1, 0x04, 0xcf, 0x93, 0xe2, 0x06, 0x96, - 0x8d, 0xae, 0x64, 0x83, 0xc9, 0xc1, 0x04, 0x67, 0x60, 0x9d, 0x65, 0x59, 0x72, 0x6f, 0x93, 0xf9, - 0x14, 0x2b, 0xb0, 0xe2, 0x16, 0xe2, 0x8a, 0x50, 0x32, 0x16, 0xee, 0x9e, 0xc9, 0xc2, 0xab, 0xe9, - 0x1f, 0xf5, 0x75, 0x3c, 0x76, 0x0e, 0x01, 0x77, 0x03, 0x27, 0x87, 0x35, 0x41, 0x5e, 0xfe, 0x2f, - 0x07, 0xdc, 0x0d, 0xb6, 0xf3, 0xf7, 0xc8, 0x94, 0xe5, 0xd2, 0x53, 0xd7, 0x3f, 0x01, 0x00, 0x00, - 0xff, 0xff, 0xf2, 0xd9, 0xc8, 0xa8, 0x18, 0x02, 0x00, 0x00, -} diff --git a/vendor/openpitrix.io/openpitrix/pkg/sender/owner_path.go b/vendor/openpitrix.io/openpitrix/pkg/sender/owner_path.go deleted file mode 100644 index 4003b00b8c..0000000000 --- a/vendor/openpitrix.io/openpitrix/pkg/sender/owner_path.go +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright 2018 The OpenPitrix Authors. All rights reserved. -// Use of this source code is governed by a Apache license -// that can be found in the LICENSE file. - -package sender - -import ( - "strings" - - "github.com/golang/protobuf/ptypes/wrappers" -) - -// ${group_path}:${user_id} -type OwnerPath string - -func (o OwnerPath) match(accessPath OwnerPath) bool { - if string(accessPath) == "" { - return true - } - return strings.HasPrefix(string(o), string(accessPath)) -} - -func (o OwnerPath) CheckOwnerPathPermission(ownerPaths ...string) bool { - for _, ownerPath := range ownerPaths { - if !OwnerPath(ownerPath).match(o) { - return false - } - } - return true -} - -func (o OwnerPath) CheckPermission(s *Sender) bool { - return o.match(s.GetAccessPath()) -} - -func (o OwnerPath) Owner() string { - s := strings.Split(string(o), ":") - if len(s) < 2 { - return "" - } - return s[1] -} - -func (o OwnerPath) ToProtoString() *wrappers.StringValue { - return &wrappers.StringValue{Value: string(o)} -} diff --git a/vendor/openpitrix.io/openpitrix/pkg/sender/sender.go b/vendor/openpitrix.io/openpitrix/pkg/sender/sender.go deleted file mode 100644 index 10b90ff443..0000000000 --- a/vendor/openpitrix.io/openpitrix/pkg/sender/sender.go +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright 2018 The OpenPitrix Authors. All rights reserved. -// Use of this source code is governed by a Apache license -// that can be found in the LICENSE file. - -package sender - -import ( - "fmt" - - "encoding/json" - - "openpitrix.io/openpitrix/pkg/constants" -) - -type Sender struct { - UserId string `json:"user_id,omitempty"` - OwnerPath OwnerPath `json:"owner_path,omitempty"` - AccessPath OwnerPath `json:"access_path,omitempty"` -} - -func GetSystemSender() *Sender { - return &Sender{ - UserId: constants.UserSystem, - OwnerPath: ":" + constants.UserSystem, - AccessPath: "", - } -} - -func New(userId string, ownerPath, accessPath OwnerPath) *Sender { - return &Sender{ - UserId: userId, - OwnerPath: ownerPath, - AccessPath: accessPath, - } -} - -func (s Sender) GetOwnerPath() OwnerPath { - if len(s.OwnerPath) > 0 { - return s.OwnerPath - } - // group1.group2.group3:user1 - return OwnerPath(fmt.Sprintf(":%s", s.UserId)) -} - -func (s Sender) GetAccessPath() OwnerPath { - // system can access all data - if s.UserId == constants.UserSystem { - return OwnerPath("") - } - - return s.AccessPath -} - -func (s *Sender) ToJson() string { - b, err := json.Marshal(s) - if err != nil { - panic(err) - } - return string(b) -} diff --git a/vendor/openpitrix.io/openpitrix/pkg/util/ctxutil/ctx.go b/vendor/openpitrix.io/openpitrix/pkg/util/ctxutil/ctx.go deleted file mode 100644 index 2de9c1f1b6..0000000000 --- a/vendor/openpitrix.io/openpitrix/pkg/util/ctxutil/ctx.go +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright 2018 The OpenPitrix Authors. All rights reserved. -// Use of this source code is governed by a Apache license -// that can be found in the LICENSE file. - -package ctxutil - -import ( - "context" - - "google.golang.org/grpc/metadata" -) - -const ( - messageIdKey = "x-message-id" - requestIdKey = "x-request-id" - localeKey = "locale" -) - -type getMetadataFromContext func(ctx context.Context) (md metadata.MD, ok bool) - -var getMetadataFromContextFunc = []getMetadataFromContext{ - metadata.FromOutgoingContext, - metadata.FromIncomingContext, -} - -func GetValueFromContext(ctx context.Context, key string) []string { - if ctx == nil { - return []string{} - } - for _, f := range getMetadataFromContextFunc { - md, ok := f(ctx) - if !ok { - continue - } - m, ok := md[key] - if ok && len(m) > 0 { - return m - } - } - m, ok := ctx.Value(key).([]string) - if ok && len(m) > 0 { - return m - } - s, ok := ctx.Value(key).(string) - if ok && len(s) > 0 { - return []string{s} - } - return []string{} -} - -func Copy(src, dst context.Context) context.Context { - ContextWithSender(dst, GetSender(src)) - SetMessageId(dst, GetMessageId(src)) - SetRequestId(dst, GetRequestId(src)) - return SetLocale(dst, GetLocale(src)) -} diff --git a/vendor/openpitrix.io/openpitrix/pkg/util/ctxutil/locale.go b/vendor/openpitrix.io/openpitrix/pkg/util/ctxutil/locale.go deleted file mode 100644 index 19c2be6219..0000000000 --- a/vendor/openpitrix.io/openpitrix/pkg/util/ctxutil/locale.go +++ /dev/null @@ -1,25 +0,0 @@ -package ctxutil - -import ( - "context" - - "google.golang.org/grpc/metadata" -) - -func GetLocale(ctx context.Context) string { - locale := GetValueFromContext(ctx, localeKey) - if len(locale) == 0 { - return "" - } - return locale[0] -} - -func SetLocale(ctx context.Context, locale string) context.Context { - ctx = context.WithValue(ctx, localeKey, []string{locale}) - md, ok := metadata.FromOutgoingContext(ctx) - if !ok { - md = metadata.MD{} - } - md[localeKey] = []string{locale} - return metadata.NewOutgoingContext(ctx, md) -} diff --git a/vendor/openpitrix.io/openpitrix/pkg/util/ctxutil/message.go b/vendor/openpitrix.io/openpitrix/pkg/util/ctxutil/message.go deleted file mode 100644 index aca8a32387..0000000000 --- a/vendor/openpitrix.io/openpitrix/pkg/util/ctxutil/message.go +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright 2018 The OpenPitrix Authors. All rights reserved. -// Use of this source code is governed by a Apache license -// that can be found in the LICENSE file. - -package ctxutil - -import ( - "context" - - "google.golang.org/grpc/metadata" -) - -func GetMessageId(ctx context.Context) []string { - return GetValueFromContext(ctx, messageIdKey) -} - -func SetMessageId(ctx context.Context, messageId []string) context.Context { - ctx = context.WithValue(ctx, messageIdKey, messageId) - md, ok := metadata.FromOutgoingContext(ctx) - if !ok { - md = metadata.MD{} - } - md[messageIdKey] = messageId - return metadata.NewOutgoingContext(ctx, md) -} - -func AddMessageId(ctx context.Context, messageId ...string) context.Context { - m := GetMessageId(ctx) - m = append(m, messageId...) - return SetMessageId(ctx, m) -} - -func ClearMessageId(ctx context.Context) context.Context { - return SetMessageId(ctx, []string{}) -} diff --git a/vendor/openpitrix.io/openpitrix/pkg/util/ctxutil/request.go b/vendor/openpitrix.io/openpitrix/pkg/util/ctxutil/request.go deleted file mode 100644 index 6e8d3107bb..0000000000 --- a/vendor/openpitrix.io/openpitrix/pkg/util/ctxutil/request.go +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright 2018 The OpenPitrix Authors. All rights reserved. -// Use of this source code is governed by a Apache license -// that can be found in the LICENSE file. - -package ctxutil - -import ( - "context" - - "google.golang.org/grpc/metadata" -) - -func GetRequestId(ctx context.Context) string { - rid := GetValueFromContext(ctx, requestIdKey) - if len(rid) == 0 { - return "" - } - return rid[0] -} - -func SetRequestId(ctx context.Context, requestId string) context.Context { - ctx = context.WithValue(ctx, requestIdKey, []string{requestId}) - md, ok := metadata.FromOutgoingContext(ctx) - if !ok { - md = metadata.MD{} - } - md[requestIdKey] = []string{requestId} - return metadata.NewOutgoingContext(ctx, md) -} diff --git a/vendor/openpitrix.io/openpitrix/pkg/util/ctxutil/sender.go b/vendor/openpitrix.io/openpitrix/pkg/util/ctxutil/sender.go deleted file mode 100644 index c2ab244827..0000000000 --- a/vendor/openpitrix.io/openpitrix/pkg/util/ctxutil/sender.go +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright 2018 The OpenPitrix Authors. All rights reserved. -// Use of this source code is governed by a Apache license -// that can be found in the LICENSE file. - -package ctxutil - -import ( - "context" - "encoding/json" - - "google.golang.org/grpc/metadata" - - "openpitrix.io/openpitrix/pkg/sender" -) - -const ( - SenderKey = "sender" - TokenType = "Bearer" -) - -func GetSender(ctx context.Context) *sender.Sender { - values := GetValueFromContext(ctx, SenderKey) - if len(values) == 0 || len(values[0]) == 0 { - return nil - } - s := sender.Sender{} - err := json.Unmarshal([]byte(values[0]), &s) - if err != nil { - panic(err) - } - return &s -} - -func ContextWithSender(ctx context.Context, user *sender.Sender) context.Context { - if user == nil { - return ctx - } - ctx = context.WithValue(ctx, SenderKey, []string{user.ToJson()}) - md, ok := metadata.FromOutgoingContext(ctx) - if !ok { - md = metadata.MD{} - } - md[SenderKey] = []string{user.ToJson()} - return metadata.NewOutgoingContext(ctx, md) -} diff --git a/vendor/openpitrix.io/openpitrix/pkg/util/pbutil/pb.go b/vendor/openpitrix.io/openpitrix/pkg/util/pbutil/pb.go deleted file mode 100644 index bc56a56f89..0000000000 --- a/vendor/openpitrix.io/openpitrix/pkg/util/pbutil/pb.go +++ /dev/null @@ -1,139 +0,0 @@ -// Copyright 2017 The OpenPitrix Authors. All rights reserved. -// Use of this source code is governed by a Apache license -// that can be found in the LICENSE file. - -package pbutil - -import ( - "context" - "time" - - "github.com/golang/protobuf/ptypes" - "github.com/golang/protobuf/ptypes/timestamp" - "github.com/golang/protobuf/ptypes/wrappers" - - "openpitrix.io/openpitrix/pkg/db" - "openpitrix.io/openpitrix/pkg/logger" -) - -type RequestHadOffset interface { - GetOffset() uint32 -} - -type RequestHadLimit interface { - GetLimit() uint32 -} - -const ( - DefaultOffset = uint64(0) - DefaultLimit = uint64(20) -) - -func GetOffsetFromRequest(req RequestHadOffset) uint64 { - n := req.GetOffset() - if n == 0 { - return DefaultOffset - } - return db.GetOffset(uint64(n)) -} - -func GetLimitFromRequest(req RequestHadLimit) uint64 { - n := req.GetLimit() - if n == 0 { - return DefaultLimit - } - return db.GetLimit(uint64(n)) -} - -func GetTime(t *timestamp.Timestamp) (tt time.Time) { - if t == nil { - return time.Now() - } else { - return FromProtoTimestamp(t) - } -} - -func FromProtoTimestamp(t *timestamp.Timestamp) (tt time.Time) { - tt, err := ptypes.Timestamp(t) - if err != nil { - logger.Critical(nil, "Cannot convert timestamp [T] to time.Time [%+v]: %+v", t, err) - panic(err) - } - return -} - -func ToProtoTimestamp(t time.Time) (tt *timestamp.Timestamp) { - if t.IsZero() { - return nil - } - tt, err := ptypes.TimestampProto(t) - if err != nil { - logger.Critical(nil, "Cannot convert time.Time [%+v] to ToProtoTimestamp[T]: %+v", t, err) - panic(err) - } - return -} - -func ToProtoString(str string) *wrappers.StringValue { - return &wrappers.StringValue{Value: str} -} - -func ToProtoUInt32(uint32 uint32) *wrappers.UInt32Value { - return &wrappers.UInt32Value{Value: uint32} -} - -func ToProtoInt32(i int32) *wrappers.Int32Value { - return &wrappers.Int32Value{Value: i} -} - -func ToProtoBool(bool bool) *wrappers.BoolValue { - return &wrappers.BoolValue{Value: bool} -} - -func ToProtoBytes(bytes []byte) *wrappers.BytesValue { - return &wrappers.BytesValue{Value: bytes} -} - -type DescribeResponse interface { - GetTotalCount() uint32 -} - -type DescribeApi interface { - SetRequest(ctx context.Context, req interface{}, limit, offset uint32) error - Describe(ctx context.Context, req interface{}, advancedParams ...string) (DescribeResponse, error) -} - -func DescribeAllResponses(ctx context.Context, describeApi DescribeApi, req interface{}, advancedParams ...string) ([]DescribeResponse, error) { - limit := uint32(db.DefaultSelectLimit) - offset := uint32(0) - var responses []DescribeResponse - - if err := describeApi.SetRequest(ctx, req, limit, offset); err != nil { - return nil, err - } - response, err := describeApi.Describe(ctx, req, advancedParams...) - if err != nil { - return nil, err - } - - totalCount := response.GetTotalCount() - - responses = append(responses, response) - offset = offset + db.DefaultSelectLimit - for { - if totalCount > uint32(offset) { - if err := describeApi.SetRequest(ctx, req, limit, offset); err != nil { - return nil, err - } - response, err = describeApi.Describe(ctx, req) - if err != nil { - return nil, err - } - responses = append(responses, response) - offset = offset + db.DefaultSelectLimit - } else { - break - } - } - return responses, nil -} diff --git a/vendor/openpitrix.io/openpitrix/pkg/util/reflectutil/reflect.go b/vendor/openpitrix.io/openpitrix/pkg/util/reflectutil/reflect.go deleted file mode 100644 index ff90f1d84d..0000000000 --- a/vendor/openpitrix.io/openpitrix/pkg/util/reflectutil/reflect.go +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright 2018 The OpenPitrix Authors. All rights reserved. -// Use of this source code is governed by a Apache license -// that can be found in the LICENSE file. - -package reflectutil - -import "reflect" - -func In(value interface{}, container interface{}) bool { - containerValue := reflect.ValueOf(container) - switch reflect.TypeOf(container).Kind() { - case reflect.Slice, reflect.Array: - for i := 0; i < containerValue.Len(); i++ { - if containerValue.Index(i).Interface() == value { - return true - } - } - case reflect.Map: - if containerValue.MapIndex(reflect.ValueOf(value)).IsValid() { - return true - } - default: - return false - } - return false -} - -func ValueIsNil(value reflect.Value) bool { - k := value.Kind() - switch k { - case reflect.Chan, reflect.Func, reflect.Map, reflect.Ptr, reflect.Interface, reflect.Slice: - return value.IsNil() - case reflect.Invalid: - return true - } - // base type had default value, is not nil - return false -} diff --git a/vendor/openpitrix.io/openpitrix/pkg/util/stringutil/base64.go b/vendor/openpitrix.io/openpitrix/pkg/util/stringutil/base64.go deleted file mode 100644 index cb8eef4317..0000000000 --- a/vendor/openpitrix.io/openpitrix/pkg/util/stringutil/base64.go +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright 2018 The OpenPitrix Authors. All rights reserved. -// Use of this source code is governed by a Apache license -// that can be found in the LICENSE file. - -package stringutil - -import ( - "bytes" - "encoding/base64" - "io/ioutil" -) - -func DecodeBase64(i string) ([]byte, error) { - return ioutil.ReadAll(base64.NewDecoder(base64.StdEncoding, bytes.NewBufferString(i))) -} diff --git a/vendor/openpitrix.io/openpitrix/pkg/util/stringutil/string.go b/vendor/openpitrix.io/openpitrix/pkg/util/stringutil/string.go deleted file mode 100644 index e50fa5e75a..0000000000 --- a/vendor/openpitrix.io/openpitrix/pkg/util/stringutil/string.go +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright 2018 The OpenPitrix Authors. All rights reserved. -// Use of this source code is governed by a Apache license -// that can be found in the LICENSE file. - -package stringutil - -import ( - "unicode/utf8" - - "github.com/asaskevich/govalidator" -) - -// Creates an slice of slice values not included in the other given slice. -func Diff(base, exclude []string) (result []string) { - excludeMap := make(map[string]bool) - for _, s := range exclude { - excludeMap[s] = true - } - for _, s := range base { - if !excludeMap[s] { - result = append(result, s) - } - } - return result -} - -func Unique(ss []string) (result []string) { - smap := make(map[string]bool) - for _, s := range ss { - smap[s] = true - } - for s := range smap { - result = append(result, s) - } - return result -} - -func CamelCaseToUnderscore(str string) string { - return govalidator.CamelCaseToUnderscore(str) -} - -func UnderscoreToCamelCase(str string) string { - return govalidator.UnderscoreToCamelCase(str) -} - -func FindString(array []string, str string) int { - for index, s := range array { - if str == s { - return index - } - } - return -1 -} - -func StringIn(str string, array []string) bool { - return FindString(array, str) > -1 -} - -func Reverse(s string) string { - size := len(s) - buf := make([]byte, size) - for start := 0; start < size; { - r, n := utf8.DecodeRuneInString(s[start:]) - start += n - utf8.EncodeRune(buf[size-start:], r) - } - return string(buf) -} diff --git a/vendor/openpitrix.io/openpitrix/pkg/util/yamlutil/yaml.go b/vendor/openpitrix.io/openpitrix/pkg/util/yamlutil/yaml.go deleted file mode 100644 index e86a40c182..0000000000 --- a/vendor/openpitrix.io/openpitrix/pkg/util/yamlutil/yaml.go +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright 2018 The OpenPitrix Authors. All rights reserved. -// Use of this source code is governed by a Apache license -// that can be found in the LICENSE file. - -package yamlutil - -import ( - "github.com/ghodss/yaml" -) - -// Marshals the object into JSON then converts JSON to YAML and returns the -// YAML. -func Encode(o interface{}) ([]byte, error) { - return yaml.Marshal(o) -} - -// Converts YAML to JSON then uses JSON to unmarshal into an object. -func Decode(y []byte, o interface{}) error { - return yaml.Unmarshal(y, o) -} diff --git a/vendor/openpitrix.io/openpitrix/pkg/version/.gitignore b/vendor/openpitrix.io/openpitrix/pkg/version/.gitignore deleted file mode 100644 index 0c28e42de3..0000000000 --- a/vendor/openpitrix.io/openpitrix/pkg/version/.gitignore +++ /dev/null @@ -1 +0,0 @@ -z_update_version.go diff --git a/vendor/openpitrix.io/openpitrix/pkg/version/Makefile b/vendor/openpitrix.io/openpitrix/pkg/version/Makefile deleted file mode 100644 index eea3389f14..0000000000 --- a/vendor/openpitrix.io/openpitrix/pkg/version/Makefile +++ /dev/null @@ -1,9 +0,0 @@ -# Copyright 2017 The OpenPitrix Authors. All rights reserved. -# Use of this source code is governed by a Apache license -# that can be found in the LICENSE file. - -default: - go generate - -clean: - -rm z_update_version.go diff --git a/vendor/openpitrix.io/openpitrix/pkg/version/version.go b/vendor/openpitrix.io/openpitrix/pkg/version/version.go deleted file mode 100644 index d294af078b..0000000000 --- a/vendor/openpitrix.io/openpitrix/pkg/version/version.go +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright 2017 The OpenPitrix Authors. All rights reserved. -// Use of this source code is governed by a Apache license -// that can be found in the LICENSE file. - -//go:generate go run gen_helper.go -//go:generate go fmt - -package version - -import "fmt" - -var ( - ShortVersion = "dev" - GitSha1Version = "git-sha1" - BuildDate = "2017-01-01" -) - -func PrintVersionInfo(printer func(string, ...interface{})) { - printer("Release OpVersion: %s", ShortVersion) - printer("Git Commit Hash: %s", GitSha1Version) - printer("Build Time: %s", BuildDate) -} - -func GetVersionString() string { - return fmt.Sprintf("%s; git: %s; build time: %s", ShortVersion, GitSha1Version, BuildDate) -} diff --git a/vendor/sigs.k8s.io/kustomize/LICENSE b/vendor/sigs.k8s.io/kustomize/LICENSE new file mode 100644 index 0000000000..8dada3edaf --- /dev/null +++ b/vendor/sigs.k8s.io/kustomize/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/sigs.k8s.io/kustomize/pkg/commands/build/build.go b/vendor/sigs.k8s.io/kustomize/pkg/commands/build/build.go new file mode 100644 index 0000000000..e62747e329 --- /dev/null +++ b/vendor/sigs.k8s.io/kustomize/pkg/commands/build/build.go @@ -0,0 +1,129 @@ +/* +Copyright 2017 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package build + +import ( + "io" + + "github.com/pkg/errors" + "github.com/spf13/cobra" + "sigs.k8s.io/kustomize/pkg/constants" + "sigs.k8s.io/kustomize/pkg/fs" + "sigs.k8s.io/kustomize/pkg/ifc/transformer" + "sigs.k8s.io/kustomize/pkg/loader" + "sigs.k8s.io/kustomize/pkg/resmap" + "sigs.k8s.io/kustomize/pkg/target" +) + +// Options contain the options for running a build +type Options struct { + kustomizationPath string + outputPath string +} + +// NewOptions creates a Options object +func NewOptions(p, o string) *Options { + return &Options{ + kustomizationPath: p, + outputPath: o, + } +} + +var examples = ` +Use the file somedir/kustomization.yaml to generate a set of api resources: + build somedir + +Use a url pointing to a remote directory/kustomization.yaml to generate a set of api resources: + build url +The url should follow hashicorp/go-getter URL format described in +https://github.com/hashicorp/go-getter#url-format + +url examples: + sigs.k8s.io/kustomize//examples/multibases?ref=v1.0.6 + github.com/Liujingfang1/mysql + github.com/Liujingfang1/kustomize//examples/helloWorld?ref=repoUrl2 +` + +// NewCmdBuild creates a new build command. +func NewCmdBuild( + out io.Writer, fs fs.FileSystem, + rf *resmap.Factory, + ptf transformer.Factory) *cobra.Command { + var o Options + + cmd := &cobra.Command{ + Use: "build [path]", + Short: "Print current configuration per contents of " + constants.KustomizationFileNames[0], + Example: examples, + SilenceUsage: true, + RunE: func(cmd *cobra.Command, args []string) error { + err := o.Validate(args) + if err != nil { + return err + } + return o.RunBuild(out, fs, rf, ptf) + }, + } + cmd.Flags().StringVarP( + &o.outputPath, + "output", "o", "", + "If specified, write the build output to this path.") + return cmd +} + +// Validate validates build command. +func (o *Options) Validate(args []string) error { + if len(args) > 1 { + return errors.New("specify one path to " + constants.KustomizationFileNames[0]) + } + if len(args) == 0 { + o.kustomizationPath = "./" + } else { + o.kustomizationPath = args[0] + } + + return nil +} + +// RunBuild runs build command. +func (o *Options) RunBuild( + out io.Writer, fSys fs.FileSystem, + rf *resmap.Factory, ptf transformer.Factory) error { + ldr, err := loader.NewLoader(o.kustomizationPath, fSys) + if err != nil { + return err + } + defer ldr.Cleanup() + kt, err := target.NewKustTarget(ldr, rf, ptf) + if err != nil { + return err + } + allResources, err := kt.MakeCustomizedResMap() + if err != nil { + return err + } + // Output the objects. + res, err := allResources.EncodeAsYaml() + if err != nil { + return err + } + if o.outputPath != "" { + return fSys.WriteFile(o.outputPath, res) + } + _, err = out.Write(res) + return err +} diff --git a/vendor/sigs.k8s.io/kustomize/pkg/constants/constants.go b/vendor/sigs.k8s.io/kustomize/pkg/constants/constants.go new file mode 100644 index 0000000000..dd50230fbd --- /dev/null +++ b/vendor/sigs.k8s.io/kustomize/pkg/constants/constants.go @@ -0,0 +1,28 @@ +/* +Copyright 2017 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Package constants holds global constants for the kustomize tool. +package constants + +// KustomizationFileNames is a list of filenames that can be recognized and consumbed +// by Kustomize. +// In each directory, Kustomize searches for file with the name in this list. +// Only one match is allowed. +var KustomizationFileNames = []string{ + "kustomization.yaml", + "kustomization.yml", + "Kustomization", +} diff --git a/vendor/sigs.k8s.io/kustomize/pkg/expansion/expand.go b/vendor/sigs.k8s.io/kustomize/pkg/expansion/expand.go new file mode 100644 index 0000000000..de55e46148 --- /dev/null +++ b/vendor/sigs.k8s.io/kustomize/pkg/expansion/expand.go @@ -0,0 +1,121 @@ +/* +Copyright 2018 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Package expansion provides functions find and replace $(FOO) style variables in strings. +package expansion + +import ( + "bytes" +) + +const ( + operator = '$' + referenceOpener = '(' + referenceCloser = ')' +) + +// syntaxWrap returns the input string wrapped by the expansion syntax. +func syntaxWrap(input string) string { + return string(operator) + string(referenceOpener) + input + string(referenceCloser) +} + +// MappingFuncFor returns a mapping function for use with Expand that +// implements the expansion semantics defined in the expansion spec; it +// returns the input string wrapped in the expansion syntax if no mapping +// for the input is found. +func MappingFuncFor( + counts map[string]int, + context ...map[string]string) func(string) string { + return func(input string) string { + for _, vars := range context { + val, ok := vars[input] + if ok { + counts[input]++ + return val + } + } + return syntaxWrap(input) + } +} + +// Expand replaces variable references in the input string according to +// the expansion spec using the given mapping function to resolve the +// values of variables. +func Expand(input string, mapping func(string) string) string { + var buf bytes.Buffer + checkpoint := 0 + for cursor := 0; cursor < len(input); cursor++ { + if input[cursor] == operator && cursor+1 < len(input) { + // Copy the portion of the input string since the last + // checkpoint into the buffer + buf.WriteString(input[checkpoint:cursor]) + + // Attempt to read the variable name as defined by the + // syntax from the input string + read, isVar, advance := tryReadVariableName(input[cursor+1:]) + + if isVar { + // We were able to read a variable name correctly; + // apply the mapping to the variable name and copy the + // bytes into the buffer + buf.WriteString(mapping(read)) + } else { + // Not a variable name; copy the read bytes into the buffer + buf.WriteString(read) + } + + // Advance the cursor in the input string to account for + // bytes consumed to read the variable name expression + cursor += advance + + // Advance the checkpoint in the input string + checkpoint = cursor + 1 + } + } + + // Return the buffer and any remaining unwritten bytes in the + // input string. + return buf.String() + input[checkpoint:] +} + +// tryReadVariableName attempts to read a variable name from the input +// string and returns the content read from the input, whether that content +// represents a variable name to perform mapping on, and the number of bytes +// consumed in the input string. +// +// The input string is assumed not to contain the initial operator. +func tryReadVariableName(input string) (string, bool, int) { + switch input[0] { + case operator: + // Escaped operator; return it. + return input[0:1], false, 1 + case referenceOpener: + // Scan to expression closer + for i := 1; i < len(input); i++ { + if input[i] == referenceCloser { + return input[1:i], true, i + 1 + } + } + + // Incomplete reference; return it. + return string(operator) + string(referenceOpener), false, 1 + default: + // Not the beginning of an expression, ie, an operator + // that doesn't begin an expression. Return the operator + // and the first rune in the string. + return string(operator) + string(input[0]), false, 1 + } +} diff --git a/vendor/sigs.k8s.io/kustomize/pkg/factory/factory.go b/vendor/sigs.k8s.io/kustomize/pkg/factory/factory.go new file mode 100644 index 0000000000..e71669a871 --- /dev/null +++ b/vendor/sigs.k8s.io/kustomize/pkg/factory/factory.go @@ -0,0 +1,39 @@ +/* +Copyright 2018 The Kubernetes Authors. + Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 + Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +// Package factory provides factories for kustomize. +package factory + +import ( + "sigs.k8s.io/kustomize/pkg/ifc" + "sigs.k8s.io/kustomize/pkg/ifc/transformer" + "sigs.k8s.io/kustomize/pkg/resmap" + "sigs.k8s.io/kustomize/pkg/resource" +) + +// KustFactory provides different factories for kustomize +type KustFactory struct { + ResmapF *resmap.Factory + TransformerF transformer.Factory + ValidatorF ifc.Validator + UnstructF ifc.KunstructuredFactory +} + +// NewKustFactory creats a KustFactory instance +func NewKustFactory(u ifc.KunstructuredFactory, v ifc.Validator, t transformer.Factory) *KustFactory { + return &KustFactory{ + ResmapF: resmap.NewFactory(resource.NewFactory(u)), + TransformerF: t, + ValidatorF: v, + UnstructF: u, + } +} diff --git a/vendor/sigs.k8s.io/kustomize/pkg/fs/confirmeddir.go b/vendor/sigs.k8s.io/kustomize/pkg/fs/confirmeddir.go new file mode 100644 index 0000000000..5d12bf0779 --- /dev/null +++ b/vendor/sigs.k8s.io/kustomize/pkg/fs/confirmeddir.go @@ -0,0 +1,93 @@ +/* +Copyright 2018 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package fs + +import ( + "io/ioutil" + "path/filepath" + "strings" +) + +// ConfirmedDir is a clean, absolute, delinkified path +// that was confirmed to point to an existing directory. +type ConfirmedDir string + +// NewTmpConfirmedDir returns a temporary dir, else error. +// The directory is cleaned, no symlinks, etc. so its +// returned as a ConfirmedDir. +func NewTmpConfirmedDir() (ConfirmedDir, error) { + n, err := ioutil.TempDir("", "kustomize-") + if err != nil { + return "", err + } + + // In MacOs `ioutil.TempDir` creates a directory + // with root in the `/var` folder, which is in turn a symlinked path + // to `/private/var`. + // Function `filepath.EvalSymlinks`is used to + // resolve the real absolute path. + deLinked, err := filepath.EvalSymlinks(n) + return ConfirmedDir(deLinked), err + +} + +// HasPrefix returns true if the directory argument +// is a prefix of self (d) from the point of view of +// a file system. +// +// I.e., it's true if the argument equals or contains +// self (d) in a file path sense. +// +// HasPrefix emulates the semantics of strings.HasPrefix +// such that the following are true: +// +// strings.HasPrefix("foobar", "foobar") +// strings.HasPrefix("foobar", "foo") +// strings.HasPrefix("foobar", "") +// +// d := fSys.ConfirmDir("/foo/bar") +// d.HasPrefix("/foo/bar") +// d.HasPrefix("/foo") +// d.HasPrefix("/") +// +// Not contacting a file system here to check for +// actual path existence. +// +// This is tested on linux, but will have trouble +// on other operating systems. +// TODO(monopole) Refactor when #golang/go/18358 closes. +// See also: +// https://github.com/golang/go/issues/18358 +// https://github.com/golang/dep/issues/296 +// https://github.com/golang/dep/blob/master/internal/fs/fs.go#L33 +// https://codereview.appspot.com/5712045 +func (d ConfirmedDir) HasPrefix(path ConfirmedDir) bool { + if path.String() == string(filepath.Separator) || path == d { + return true + } + return strings.HasPrefix( + string(d), + string(path)+string(filepath.Separator)) +} + +func (d ConfirmedDir) Join(path string) string { + return filepath.Join(string(d), path) +} + +func (d ConfirmedDir) String() string { + return string(d) +} diff --git a/vendor/sigs.k8s.io/kustomize/pkg/fs/fakefile.go b/vendor/sigs.k8s.io/kustomize/pkg/fs/fakefile.go new file mode 100644 index 0000000000..64bc55685f --- /dev/null +++ b/vendor/sigs.k8s.io/kustomize/pkg/fs/fakefile.go @@ -0,0 +1,69 @@ +/* +Copyright 2018 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package fs + +import ( + "bytes" + "os" +) + +var _ File = &FakeFile{} + +// FakeFile implements File in-memory for tests. +type FakeFile struct { + name string + content []byte + dir bool + open bool +} + +// makeDir makes a fake directory. +func makeDir(name string) *FakeFile { + return &FakeFile{name: name, dir: true} +} + +// Close marks the fake file closed. +func (f *FakeFile) Close() error { + f.open = false + return nil +} + +// Read never fails, and doesn't mutate p. +func (f *FakeFile) Read(p []byte) (n int, err error) { + return len(p), nil +} + +// Write saves the contents of the argument to memory. +func (f *FakeFile) Write(p []byte) (n int, err error) { + f.content = p + return len(p), nil +} + +// ContentMatches returns true if v matches fake file's content. +func (f *FakeFile) ContentMatches(v []byte) bool { + return bytes.Equal(v, f.content) +} + +// GetContent the content of a fake file. +func (f *FakeFile) GetContent() []byte { + return f.content +} + +// Stat returns nil. +func (f *FakeFile) Stat() (os.FileInfo, error) { + return nil, nil +} diff --git a/vendor/sigs.k8s.io/kustomize/pkg/fs/fakefileinfo.go b/vendor/sigs.k8s.io/kustomize/pkg/fs/fakefileinfo.go new file mode 100644 index 0000000000..6ccca91509 --- /dev/null +++ b/vendor/sigs.k8s.io/kustomize/pkg/fs/fakefileinfo.go @@ -0,0 +1,47 @@ +/* +Copyright 2018 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package fs + +import ( + "os" + "time" +) + +var _ os.FileInfo = &Fakefileinfo{} + +// Fakefileinfo implements Fakefileinfo using a fake in-memory filesystem. +type Fakefileinfo struct { + *FakeFile +} + +// Name returns the name of the file +func (fi *Fakefileinfo) Name() string { return fi.name } + +// Size returns the size of the file +func (fi *Fakefileinfo) Size() int64 { return int64(len(fi.content)) } + +// Mode returns the file mode +func (fi *Fakefileinfo) Mode() os.FileMode { return 0777 } + +// ModTime returns the modification time +func (fi *Fakefileinfo) ModTime() time.Time { return time.Time{} } + +// IsDir returns if it is a directory +func (fi *Fakefileinfo) IsDir() bool { return fi.dir } + +// Sys should return underlying data source, but it now returns nil +func (fi *Fakefileinfo) Sys() interface{} { return nil } diff --git a/vendor/sigs.k8s.io/kustomize/pkg/fs/fakefs.go b/vendor/sigs.k8s.io/kustomize/pkg/fs/fakefs.go new file mode 100644 index 0000000000..59c0966b21 --- /dev/null +++ b/vendor/sigs.k8s.io/kustomize/pkg/fs/fakefs.go @@ -0,0 +1,185 @@ +/* +Copyright 2018 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package fs + +import ( + "fmt" + "path/filepath" + "sort" + "strings" + + "sigs.k8s.io/kustomize/pkg/constants" +) + +var _ FileSystem = &fakeFs{} + +// fakeFs implements FileSystem using a fake in-memory filesystem. +type fakeFs struct { + m map[string]*FakeFile +} + +// MakeFakeFS returns an instance of fakeFs with no files in it. +func MakeFakeFS() *fakeFs { + result := &fakeFs{m: map[string]*FakeFile{}} + result.Mkdir("/") + return result +} + +// kustomizationContent is used in tests. +const kustomizationContent = `apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +namePrefix: some-prefix +nameSuffix: some-suffix +# Labels to add to all objects and selectors. +# These labels would also be used to form the selector for apply --prune +# Named differently than “labels” to avoid confusion with metadata for this object +commonLabels: + app: helloworld +commonAnnotations: + note: This is an example annotation +resources: [] +#- service.yaml +#- ../some-dir/ +# There could also be configmaps in Base, which would make these overlays +configMapGenerator: [] +# There could be secrets in Base, if just using a fork/rebase workflow +secretGenerator: [] +` + +// Create assures a fake file appears in the in-memory file system. +func (fs *fakeFs) Create(name string) (File, error) { + f := &FakeFile{} + f.open = true + fs.m[name] = f + return fs.m[name], nil +} + +// Mkdir assures a fake directory appears in the in-memory file system. +func (fs *fakeFs) Mkdir(name string) error { + fs.m[name] = makeDir(name) + return nil +} + +// MkdirAll delegates to Mkdir +func (fs *fakeFs) MkdirAll(name string) error { + return fs.Mkdir(name) +} + +// RemoveAll presumably does rm -r on a path. +// There's no error. +func (fs *fakeFs) RemoveAll(name string) error { + var toRemove []string + for k := range fs.m { + if strings.HasPrefix(k, name) { + toRemove = append(toRemove, k) + } + } + for _, k := range toRemove { + delete(fs.m, k) + } + return nil +} + +// Open returns a fake file in the open state. +func (fs *fakeFs) Open(name string) (File, error) { + if _, found := fs.m[name]; !found { + return nil, fmt.Errorf("file %q cannot be opened", name) + } + return fs.m[name], nil +} + +// CleanedAbs cannot fail. +func (fs *fakeFs) CleanedAbs(path string) (ConfirmedDir, string, error) { + if fs.IsDir(path) { + return ConfirmedDir(path), "", nil + } + d := filepath.Dir(path) + if d == path { + return ConfirmedDir(d), "", nil + } + return ConfirmedDir(d), filepath.Base(path), nil +} + +// Exists returns true if file is known. +func (fs *fakeFs) Exists(name string) bool { + _, found := fs.m[name] + return found +} + +// Glob returns the list of matching files +func (fs *fakeFs) Glob(pattern string) ([]string, error) { + var result []string + for p := range fs.m { + if fs.pathMatch(p, pattern) { + result = append(result, p) + } + } + sort.Strings(result) + return result, nil +} + +// IsDir returns true if the file exists and is a directory. +func (fs *fakeFs) IsDir(name string) bool { + f, found := fs.m[name] + if found && f.dir { + return true + } + if !strings.HasSuffix(name, "/") { + name = name + "/" + } + for k := range fs.m { + if strings.HasPrefix(k, name) { + return true + } + } + return false +} + +// ReadFile always returns an empty bytes and error depending on content of m. +func (fs *fakeFs) ReadFile(name string) ([]byte, error) { + if ff, found := fs.m[name]; found { + return ff.content, nil + } + return nil, fmt.Errorf("cannot read file %q", name) +} + +func (fs *fakeFs) ReadTestKustomization() ([]byte, error) { + return fs.ReadFile(constants.KustomizationFileNames[0]) +} + +// WriteFile always succeeds and does nothing. +func (fs *fakeFs) WriteFile(name string, c []byte) error { + ff := &FakeFile{} + ff.Write(c) + fs.m[name] = ff + return nil +} + +// WriteTestKustomization writes a standard test file. +func (fs *fakeFs) WriteTestKustomization() { + fs.WriteTestKustomizationWith([]byte(kustomizationContent)) +} + +// WriteTestKustomizationWith writes a standard test file. +func (fs *fakeFs) WriteTestKustomizationWith(bytes []byte) { + fs.WriteFile(constants.KustomizationFileNames[0], bytes) +} + +func (fs *fakeFs) pathMatch(path, pattern string) bool { + match, _ := filepath.Match(pattern, path) + return match +} diff --git a/vendor/sigs.k8s.io/kustomize/pkg/fs/fs.go b/vendor/sigs.k8s.io/kustomize/pkg/fs/fs.go new file mode 100644 index 0000000000..4b47dba648 --- /dev/null +++ b/vendor/sigs.k8s.io/kustomize/pkg/fs/fs.go @@ -0,0 +1,44 @@ +/* +Copyright 2018 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Package fs provides a file system abstraction layer. +package fs + +import ( + "io" + "os" +) + +// FileSystem groups basic os filesystem methods. +type FileSystem interface { + Create(name string) (File, error) + Mkdir(name string) error + MkdirAll(name string) error + RemoveAll(name string) error + Open(name string) (File, error) + IsDir(name string) bool + CleanedAbs(path string) (ConfirmedDir, string, error) + Exists(name string) bool + Glob(pattern string) ([]string, error) + ReadFile(name string) ([]byte, error) + WriteFile(name string, data []byte) error +} + +// File groups the basic os.File methods. +type File interface { + io.ReadWriteCloser + Stat() (os.FileInfo, error) +} diff --git a/vendor/sigs.k8s.io/kustomize/pkg/fs/realfile.go b/vendor/sigs.k8s.io/kustomize/pkg/fs/realfile.go new file mode 100644 index 0000000000..5bfec55abe --- /dev/null +++ b/vendor/sigs.k8s.io/kustomize/pkg/fs/realfile.go @@ -0,0 +1,40 @@ +/* +Copyright 2018 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package fs + +import ( + "os" +) + +var _ File = &realFile{} + +// realFile implements File using the local filesystem. +type realFile struct { + file *os.File +} + +// Close closes a file. +func (f *realFile) Close() error { return f.file.Close() } + +// Read reads a file's content. +func (f *realFile) Read(p []byte) (n int, err error) { return f.file.Read(p) } + +// Write writes bytes to a file +func (f *realFile) Write(p []byte) (n int, err error) { return f.file.Write(p) } + +// Stat returns an interface which has all the information regarding the file. +func (f *realFile) Stat() (os.FileInfo, error) { return f.file.Stat() } diff --git a/vendor/sigs.k8s.io/kustomize/pkg/fs/realfs.go b/vendor/sigs.k8s.io/kustomize/pkg/fs/realfs.go new file mode 100644 index 0000000000..11e5813b78 --- /dev/null +++ b/vendor/sigs.k8s.io/kustomize/pkg/fs/realfs.go @@ -0,0 +1,122 @@ +/* +Copyright 2018 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package fs + +import ( + "fmt" + "io/ioutil" + "log" + "os" + "path/filepath" +) + +var _ FileSystem = realFS{} + +// realFS implements FileSystem using the local filesystem. +type realFS struct{} + +// MakeRealFS makes an instance of realFS. +func MakeRealFS() FileSystem { + return realFS{} +} + +// Create delegates to os.Create. +func (realFS) Create(name string) (File, error) { return os.Create(name) } + +// Mkdir delegates to os.Mkdir. +func (realFS) Mkdir(name string) error { + return os.Mkdir(name, 0777|os.ModeDir) +} + +// MkdirAll delegates to os.MkdirAll. +func (realFS) MkdirAll(name string) error { + return os.MkdirAll(name, 0777|os.ModeDir) +} + +// RemoveAll delegates to os.RemoveAll. +func (realFS) RemoveAll(name string) error { + return os.RemoveAll(name) +} + +// Open delegates to os.Open. +func (realFS) Open(name string) (File, error) { return os.Open(name) } + +// CleanedAbs returns a cleaned, absolute path +// with no symbolic links split into directory +// and file components. If the entire path is +// a directory, the file component is an empty +// string. +func (x realFS) CleanedAbs( + path string) (ConfirmedDir, string, error) { + absRoot, err := filepath.Abs(path) + if err != nil { + return "", "", fmt.Errorf( + "abs path error on '%s' : %v", path, err) + } + deLinked, err := filepath.EvalSymlinks(absRoot) + if err != nil { + return "", "", fmt.Errorf( + "evalsymlink failure on '%s' : %v", path, err) + } + if x.IsDir(deLinked) { + return ConfirmedDir(deLinked), "", nil + } + d := filepath.Dir(deLinked) + if !x.IsDir(d) { + // Programmer/assumption error. + log.Fatalf("first part of '%s' not a directory", deLinked) + } + if d == deLinked { + // Programmer/assumption error. + log.Fatalf("d '%s' should be a subset of deLinked", d) + } + f := filepath.Base(deLinked) + if filepath.Join(d, f) != deLinked { + // Programmer/assumption error. + log.Fatalf("these should be equal: '%s', '%s'", + filepath.Join(d, f), deLinked) + } + return ConfirmedDir(d), f, nil +} + +// Exists returns true if os.Stat succeeds. +func (realFS) Exists(name string) bool { + _, err := os.Stat(name) + return err == nil +} + +// Glob returns the list of matching files +func (realFS) Glob(pattern string) ([]string, error) { + return filepath.Glob(pattern) +} + +// IsDir delegates to os.Stat and FileInfo.IsDir +func (realFS) IsDir(name string) bool { + info, err := os.Stat(name) + if err != nil { + return false + } + return info.IsDir() +} + +// ReadFile delegates to ioutil.ReadFile. +func (realFS) ReadFile(name string) ([]byte, error) { return ioutil.ReadFile(name) } + +// WriteFile delegates to ioutil.WriteFile with read/write permissions. +func (realFS) WriteFile(name string, c []byte) error { + return ioutil.WriteFile(name, c, 0666) +} diff --git a/vendor/sigs.k8s.io/kustomize/pkg/git/cloner.go b/vendor/sigs.k8s.io/kustomize/pkg/git/cloner.go new file mode 100644 index 0000000000..465fdb1d13 --- /dev/null +++ b/vendor/sigs.k8s.io/kustomize/pkg/git/cloner.go @@ -0,0 +1,75 @@ +/* +Copyright 2018 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package git + +import ( + "bytes" + "os/exec" + + "github.com/pkg/errors" + "sigs.k8s.io/kustomize/pkg/fs" +) + +// Cloner is a function that can clone a git repo. +type Cloner func(repoSpec *RepoSpec) error + +// ClonerUsingGitExec uses a local git install, as opposed +// to say, some remote API, to obtain a local clone of +// a remote repo. +func ClonerUsingGitExec(repoSpec *RepoSpec) error { + gitProgram, err := exec.LookPath("git") + if err != nil { + return errors.Wrap(err, "no 'git' program on path") + } + repoSpec.cloneDir, err = fs.NewTmpConfirmedDir() + if err != nil { + return err + } + cmd := exec.Command( + gitProgram, + "clone", + repoSpec.CloneSpec(), + repoSpec.cloneDir.String()) + var out bytes.Buffer + cmd.Stdout = &out + err = cmd.Run() + if err != nil { + return errors.Wrapf(err, "trouble cloning %s", repoSpec.raw) + } + if repoSpec.ref == "" { + return nil + } + cmd = exec.Command(gitProgram, "checkout", repoSpec.ref) + cmd.Dir = repoSpec.cloneDir.String() + err = cmd.Run() + if err != nil { + return errors.Wrapf( + err, "trouble checking out href %s", repoSpec.ref) + } + return nil +} + +// DoNothingCloner returns a cloner that only sets +// cloneDir field in the repoSpec. It's assumed that +// the cloneDir is associated with some fake filesystem +// used in a test. +func DoNothingCloner(dir fs.ConfirmedDir) Cloner { + return func(rs *RepoSpec) error { + rs.cloneDir = dir + return nil + } +} diff --git a/vendor/sigs.k8s.io/kustomize/pkg/git/repospec.go b/vendor/sigs.k8s.io/kustomize/pkg/git/repospec.go new file mode 100644 index 0000000000..b3251f6535 --- /dev/null +++ b/vendor/sigs.k8s.io/kustomize/pkg/git/repospec.go @@ -0,0 +1,214 @@ +/* +Copyright 2018 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package git + +import ( + "fmt" + "path/filepath" + "strings" + + "sigs.k8s.io/kustomize/pkg/fs" +) + +// Used as a temporary non-empty occupant of the cloneDir +// field, as something distinguishable from the empty string +// in various outputs (especially tests). Not using an +// actual directory name here, as that's a temporary directory +// with a unique name that isn't created until clone time. +const notCloned = fs.ConfirmedDir("/notCloned") + +// RepoSpec specifies a git repository and a branch and path therein. +type RepoSpec struct { + // Raw, original spec, used to look for cycles. + // TODO(monopole): Drop raw, use processed fields instead. + raw string + + // Host, e.g. github.com + host string + + // orgRepo name (organization/repoName), + // e.g. kubernetes-sigs/kustomize + orgRepo string + + // ConfirmedDir where the orgRepo is cloned to. + cloneDir fs.ConfirmedDir + + // Relative path in the repository, and in the cloneDir, + // to a Kustomization. + path string + + // Branch or tag reference. + ref string +} + +// CloneSpec returns a string suitable for "git clone {spec}". +func (x *RepoSpec) CloneSpec() string { + if isAzureHost(x.host) || isAWSHost(x.host) { + return x.host + x.orgRepo + } + return x.host + x.orgRepo + gitSuffix +} + +func (x *RepoSpec) CloneDir() fs.ConfirmedDir { + return x.cloneDir +} + +func (x *RepoSpec) Raw() string { + return x.raw +} + +func (x *RepoSpec) AbsPath() string { + return x.cloneDir.Join(x.path) +} + +func (x *RepoSpec) Cleaner(fSys fs.FileSystem) func() error { + return func() error { return fSys.RemoveAll(x.cloneDir.String()) } +} + +// From strings like git@github.com:someOrg/someRepo.git or +// https://github.com/someOrg/someRepo?ref=someHash, extract +// the parts. +func NewRepoSpecFromUrl(n string) (*RepoSpec, error) { + if filepath.IsAbs(n) { + return nil, fmt.Errorf("uri looks like abs path: %s", n) + } + host, orgRepo, path, gitRef := parseGithubUrl(n) + if orgRepo == "" { + return nil, fmt.Errorf("url lacks orgRepo: %s", n) + } + if host == "" { + return nil, fmt.Errorf("url lacks host: %s", n) + } + return &RepoSpec{ + raw: n, host: host, orgRepo: orgRepo, + cloneDir: notCloned, path: path, ref: gitRef}, nil +} + +const ( + refQuery = "?ref=" + gitSuffix = ".git" +) + +// From strings like git@github.com:someOrg/someRepo.git or +// https://github.com/someOrg/someRepo?ref=someHash, extract +// the parts. +func parseGithubUrl(n string) ( + host string, orgRepo string, path string, gitRef string) { + host, n = parseHostSpec(n) + + if strings.Contains(n, gitSuffix) { + index := strings.Index(n, gitSuffix) + orgRepo = n[0:index] + n = n[index+len(gitSuffix):] + path, gitRef = peelQuery(n) + return + } + + i := strings.Index(n, "/") + if i < 1 { + return "", "", "", "" + } + j := strings.Index(n[i+1:], "/") + if j >= 0 { + j += i + 1 + orgRepo = n[:j] + path, gitRef = peelQuery(n[j+1:]) + } else { + path = "" + orgRepo, gitRef = peelQuery(n) + } + return +} + +func peelQuery(arg string) (string, string) { + j := strings.Index(arg, refQuery) + if j >= 0 { + return arg[:j], arg[j+len(refQuery):] + } + return arg, "" +} + +func parseHostSpec(n string) (string, string) { + var host string + // Start accumulating the host part. + for _, p := range []string{ + // Order matters here. + "git::", "gh:", "ssh://", "https://", "http://", + "git@", "github.com:", "github.com/"} { + if len(p) < len(n) && strings.ToLower(n[:len(p)]) == p { + n = n[len(p):] + host += p + } + } + if host == "git@" { + i := strings.Index(n, "/") + if i > -1 { + host += n[:i+1] + n = n[i+1:] + } else { + i = strings.Index(n, ":") + if i > -1 { + host += n[:i+1] + n = n[i+1:] + } + } + return host, n + } + + // If host is a http(s) or ssh URL, grab the domain part. + for _, p := range []string{ + "ssh://", "https://", "http://"} { + if strings.HasSuffix(host, p) { + i := strings.Index(n, "/") + if i > -1 { + host = host + n[0:i+1] + n = n[i+1:] + } + break + } + } + + return normalizeGitHostSpec(host), n +} + +func normalizeGitHostSpec(host string) string { + s := strings.ToLower(host) + if strings.Contains(s, "github.com") { + if strings.Contains(s, "git@") || strings.Contains(s, "ssh:") { + host = "git@github.com:" + } else { + host = "https://github.com/" + } + } + if strings.HasPrefix(s, "git::") { + host = strings.TrimLeft(s, "git::") + } + return host +} + +// The format of Azure repo URL is documented +// https://docs.microsoft.com/en-us/azure/devops/repos/git/clone?view=vsts&tabs=visual-studio#clone_url +func isAzureHost(host string) bool { + return strings.Contains(host, "dev.azure.com") || + strings.Contains(host, "visualstudio.com") +} + +// The format of AWS repo URL is documented +// https://docs.aws.amazon.com/codecommit/latest/userguide/regions.html +func isAWSHost(host string) bool { + return strings.Contains(host, "amazonaws.com") +} diff --git a/vendor/sigs.k8s.io/kustomize/pkg/gvk/gvk.go b/vendor/sigs.k8s.io/kustomize/pkg/gvk/gvk.go new file mode 100644 index 0000000000..890c8e8b53 --- /dev/null +++ b/vendor/sigs.k8s.io/kustomize/pkg/gvk/gvk.go @@ -0,0 +1,180 @@ +/* +Copyright 2018 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package gvk + +import ( + "strings" +) + +// Gvk identifies a Kubernetes API type. +// https://github.com/kubernetes/community/blob/master/contributors/design-proposals/api-machinery/api-group.md +type Gvk struct { + Group string `json:"group,omitempty" yaml:"group,omitempty"` + Version string `json:"version,omitempty" yaml:"version,omitempty"` + Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` +} + +// FromKind makes a Gvk with only the kind specified. +func FromKind(k string) Gvk { + return Gvk{ + Kind: k, + } +} + +// Values that are brief but meaningful in logs. +const ( + noGroup = "~G" + noVersion = "~V" + noKind = "~K" + separator = "_" +) + +// String returns a string representation of the GVK. +func (x Gvk) String() string { + g := x.Group + if g == "" { + g = noGroup + } + v := x.Version + if v == "" { + v = noVersion + } + k := x.Kind + if k == "" { + k = noKind + } + return strings.Join([]string{g, v, k}, separator) +} + +// Equals returns true if the Gvk's have equal fields. +func (x Gvk) Equals(o Gvk) bool { + return x.Group == o.Group && x.Version == o.Version && x.Kind == o.Kind +} + +// An attempt to order things to help k8s, e.g. +// a Service should come before things that refer to it. +// Namespace should be first. +// In some cases order just specified to provide determinism. +var order = []string{ + "Namespace", + "StorageClass", + "CustomResourceDefinition", + "MutatingWebhookConfiguration", + "ValidatingWebhookConfiguration", + "ServiceAccount", + "Role", + "ClusterRole", + "RoleBinding", + "ClusterRoleBinding", + "ConfigMap", + "Secret", + "Service", + "Deployment", + "StatefulSet", + "CronJob", + "PodDisruptionBudget", +} +var typeOrders = func() map[string]int { + m := map[string]int{} + for i, n := range order { + m[n] = i + } + return m +}() + +// IsLessThan returns true if self is less than the argument. +func (x Gvk) IsLessThan(o Gvk) bool { + indexI, foundI := typeOrders[x.Kind] + indexJ, foundJ := typeOrders[o.Kind] + if foundI && foundJ { + if indexI != indexJ { + return indexI < indexJ + } + } + if foundI && !foundJ { + return true + } + if !foundI && foundJ { + return false + } + return x.String() < o.String() +} + +// IsSelected returns true if `selector` selects `x`; otherwise, false. +// If `selector` and `x` are the same, return true. +// If `selector` is nil, it is considered a wildcard match, returning true. +// If selector fields are empty, they are considered wildcards matching +// anything in the corresponding fields, e.g. +// +// this item: +// +// +// is selected by +// +// +// but rejected by +// +// +func (x Gvk) IsSelected(selector *Gvk) bool { + if selector == nil { + return true + } + if len(selector.Group) > 0 { + if x.Group != selector.Group { + return false + } + } + if len(selector.Version) > 0 { + if x.Version != selector.Version { + return false + } + } + if len(selector.Kind) > 0 { + if x.Kind != selector.Kind { + return false + } + } + return true +} + +var clusterLevelKinds = []string{ + "APIService", + "ClusterRoleBinding", + "ClusterRole", + "CustomResourceDefinition", + "Namespace", + "PersistentVolume", +} + +// IsClusterKind returns true if x is a cluster-level Gvk +func (x Gvk) IsClusterKind() bool { + for _, k := range clusterLevelKinds { + if k == x.Kind { + return true + } + } + return false +} + +// ClusterLevelGvks returns a slice of cluster-level Gvks +func ClusterLevelGvks() []Gvk { + var result []Gvk + for _, k := range clusterLevelKinds { + result = append(result, Gvk{Kind: k}) + } + return result +} diff --git a/vendor/sigs.k8s.io/kustomize/pkg/ifc/ifc.go b/vendor/sigs.k8s.io/kustomize/pkg/ifc/ifc.go new file mode 100644 index 0000000000..e6267cae25 --- /dev/null +++ b/vendor/sigs.k8s.io/kustomize/pkg/ifc/ifc.go @@ -0,0 +1,73 @@ +/* +Copyright 2018 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Package ifc holds miscellaneous interfaces used by kustomize. +package ifc + +import ( + "sigs.k8s.io/kustomize/pkg/gvk" + "sigs.k8s.io/kustomize/pkg/types" +) + +// Validator provides functions to validate annotations and labels +type Validator interface { + MakeAnnotationValidator() func(map[string]string) error + MakeLabelValidator() func(map[string]string) error + ValidateNamespace(string) []string +} + +// Loader interface exposes methods to read bytes. +type Loader interface { + // Root returns the root location for this Loader. + Root() string + // New returns Loader located at newRoot. + New(newRoot string) (Loader, error) + // Load returns the bytes read from the location or an error. + Load(location string) ([]byte, error) + // Cleanup cleans the loader + Cleanup() error +} + +// Kunstructured allows manipulation of k8s objects +// that do not have Golang structs. +type Kunstructured interface { + Map() map[string]interface{} + SetMap(map[string]interface{}) + Copy() Kunstructured + GetFieldValue(string) (string, error) + MarshalJSON() ([]byte, error) + UnmarshalJSON([]byte) error + GetGvk() gvk.Gvk + GetKind() string + GetName() string + SetName(string) + GetLabels() map[string]string + SetLabels(map[string]string) + GetAnnotations() map[string]string + SetAnnotations(map[string]string) +} + +// KunstructuredFactory makes instances of Kunstructured. +type KunstructuredFactory interface { + SliceFromBytes([]byte) ([]Kunstructured, error) + FromMap(m map[string]interface{}) Kunstructured + MakeConfigMap(args *types.ConfigMapArgs, options *types.GeneratorOptions) (Kunstructured, error) + MakeSecret(args *types.SecretArgs, options *types.GeneratorOptions) (Kunstructured, error) + Set(ldr Loader) +} + +// See core.v1.SecretTypeOpaque +const SecretTypeOpaque = "Opaque" diff --git a/vendor/sigs.k8s.io/kustomize/pkg/ifc/transformer/factory.go b/vendor/sigs.k8s.io/kustomize/pkg/ifc/transformer/factory.go new file mode 100644 index 0000000000..0a74c28093 --- /dev/null +++ b/vendor/sigs.k8s.io/kustomize/pkg/ifc/transformer/factory.go @@ -0,0 +1,29 @@ +/* +Copyright 2018 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Package patch holds miscellaneous interfaces used by kustomize. +package transformer + +import ( + "sigs.k8s.io/kustomize/pkg/resource" + "sigs.k8s.io/kustomize/pkg/transformers" +) + +// Factory makes transformers +type Factory interface { + MakePatchTransformer(slice []*resource.Resource, rf *resource.Factory) (transformers.Transformer, error) + MakeHashTransformer() transformers.Transformer +} diff --git a/vendor/sigs.k8s.io/kustomize/pkg/image/deprecatedimage.go b/vendor/sigs.k8s.io/kustomize/pkg/image/deprecatedimage.go new file mode 100644 index 0000000000..65db4051b3 --- /dev/null +++ b/vendor/sigs.k8s.io/kustomize/pkg/image/deprecatedimage.go @@ -0,0 +1,32 @@ +/* +Copyright 2019 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package image + +// DeprecatedImage contains an image and a new tag, +// which will replace the original tag. +// Deprecated, instead use Image. +type DeprecatedImage struct { + // Name is a tag-less image name. + Name string `json:"name,omitempty" yaml:"name,omitempty"` + + // NewTag is the value to use in replacing the original tag. + NewTag string `json:"newTag,omitempty" yaml:"newTag,omitempty"` + + // Digest is the value used to replace the original image tag. + // If digest is present NewTag value is ignored. + Digest string `json:"digest,omitempty" yaml:"digest,omitempty"` +} diff --git a/vendor/sigs.k8s.io/kustomize/pkg/image/image.go b/vendor/sigs.k8s.io/kustomize/pkg/image/image.go new file mode 100644 index 0000000000..dbe3b8b175 --- /dev/null +++ b/vendor/sigs.k8s.io/kustomize/pkg/image/image.go @@ -0,0 +1,36 @@ +/* +Copyright 2019 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Package image provides struct definitions and libraries +// for image overwriting of names, tags and digest. +package image + +// Image contains an image name, a new name, a new tag or digest, +// which will replace the original name and tag. +type Image struct { + // Name is a tag-less image name. + Name string `json:"name,omitempty" yaml:"name,omitempty"` + + // NewName is the value used to replace the original name. + NewName string `json:"newName,omitempty" yaml:"newName,omitempty"` + + // NewTag is the value used to replace the original tag. + NewTag string `json:"newTag,omitempty" yaml:"newTag,omitempty"` + + // Digest is the value used to replace the original image tag. + // If digest is present NewTag value is ignored. + Digest string `json:"digest,omitempty" yaml:"digest,omitempty"` +} diff --git a/vendor/sigs.k8s.io/kustomize/pkg/internal/error/configmaperror.go b/vendor/sigs.k8s.io/kustomize/pkg/internal/error/configmaperror.go new file mode 100644 index 0000000000..1d60d78a23 --- /dev/null +++ b/vendor/sigs.k8s.io/kustomize/pkg/internal/error/configmaperror.go @@ -0,0 +1,30 @@ +/* +Copyright 2018 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Package error has contextual error types. +package error + +import "fmt" + +// ConfigmapError represents error with a configmap. +type ConfigmapError struct { + Path string + ErrorMsg string +} + +func (e ConfigmapError) Error() string { + return fmt.Sprintf("Kustomization file [%s] encounters a configmap error: %s\n", e.Path, e.ErrorMsg) +} diff --git a/vendor/sigs.k8s.io/kustomize/pkg/internal/error/kustomizationerror.go b/vendor/sigs.k8s.io/kustomize/pkg/internal/error/kustomizationerror.go new file mode 100644 index 0000000000..0d53ca9b89 --- /dev/null +++ b/vendor/sigs.k8s.io/kustomize/pkg/internal/error/kustomizationerror.go @@ -0,0 +1,61 @@ +/* +Copyright 2018 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package error + +import ( + "fmt" +) + +// KustomizationError represents an error with a kustomization. +type KustomizationError struct { + KustomizationPath string + ErrorMsg string +} + +func (ke KustomizationError) Error() string { + return fmt.Sprintf("Kustomization File [%s]: %s\n", ke.KustomizationPath, ke.ErrorMsg) +} + +// KustomizationErrors collects all errors. +type KustomizationErrors struct { + kErrors []error +} + +func (ke *KustomizationErrors) Error() string { + errormsg := "" + for _, e := range ke.kErrors { + errormsg += e.Error() + "\n" + } + return errormsg +} + +// Append adds error to a collection of errors. +func (ke *KustomizationErrors) Append(e error) { + ke.kErrors = append(ke.kErrors, e) +} + +// Get returns all collected errors. +func (ke *KustomizationErrors) Get() []error { + return ke.kErrors +} + +// BatchAppend adds all errors from another KustomizationErrors +func (ke *KustomizationErrors) BatchAppend(e KustomizationErrors) { + for _, err := range e.Get() { + ke.kErrors = append(ke.kErrors, err) + } +} diff --git a/vendor/sigs.k8s.io/kustomize/pkg/internal/error/patcherror.go b/vendor/sigs.k8s.io/kustomize/pkg/internal/error/patcherror.go new file mode 100644 index 0000000000..60c9f80e5b --- /dev/null +++ b/vendor/sigs.k8s.io/kustomize/pkg/internal/error/patcherror.go @@ -0,0 +1,32 @@ +/* +Copyright 2018 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package error + +import ( + "fmt" +) + +// PatchError represents error during Patch. +type PatchError struct { + KustomizationPath string + PatchFilepath string + ErrorMsg string +} + +func (e PatchError) Error() string { + return fmt.Sprintf("Kustomization file [%s] encounters a patch error for [%s]: %s\n", e.KustomizationPath, e.PatchFilepath, e.ErrorMsg) +} diff --git a/vendor/sigs.k8s.io/kustomize/pkg/internal/error/resourceerror.go b/vendor/sigs.k8s.io/kustomize/pkg/internal/error/resourceerror.go new file mode 100644 index 0000000000..ef3566dd1f --- /dev/null +++ b/vendor/sigs.k8s.io/kustomize/pkg/internal/error/resourceerror.go @@ -0,0 +1,30 @@ +/* +Copyright 2018 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package error + +import "fmt" + +// ResourceError represents error in a resource. +type ResourceError struct { + KustomizationPath string + ResourceFilepath string + ErrorMsg string +} + +func (e ResourceError) Error() string { + return fmt.Sprintf("Kustomization file [%s] encounters a resource error for [%s]: %s\n", e.KustomizationPath, e.ResourceFilepath, e.ErrorMsg) +} diff --git a/vendor/sigs.k8s.io/kustomize/pkg/internal/error/secreterror.go b/vendor/sigs.k8s.io/kustomize/pkg/internal/error/secreterror.go new file mode 100644 index 0000000000..cd72759ce6 --- /dev/null +++ b/vendor/sigs.k8s.io/kustomize/pkg/internal/error/secreterror.go @@ -0,0 +1,30 @@ +/* +Copyright 2018 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package error + +import "fmt" + +// SecretError represents error with a secret. +type SecretError struct { + KustomizationPath string + // ErrorMsg is an error message + ErrorMsg string +} + +func (e SecretError) Error() string { + return fmt.Sprintf("Kustomization file [%s] encounters a secret error: %s\n", e.KustomizationPath, e.ErrorMsg) +} diff --git a/vendor/sigs.k8s.io/kustomize/pkg/internal/error/yamlformaterror.go b/vendor/sigs.k8s.io/kustomize/pkg/internal/error/yamlformaterror.go new file mode 100644 index 0000000000..4c27d30d71 --- /dev/null +++ b/vendor/sigs.k8s.io/kustomize/pkg/internal/error/yamlformaterror.go @@ -0,0 +1,48 @@ +/* +Copyright 2018 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Package error has contextual error types. +package error + +import ( + "fmt" + "strings" +) + +// YamlFormatError represents error with yaml file name where json/yaml format error happens. +type YamlFormatError struct { + Path string + ErrorMsg string +} + +func (e YamlFormatError) Error() string { + return fmt.Sprintf("YAML file [%s] encounters a format error.\n%s\n", e.Path, e.ErrorMsg) +} + +// Handler handles YamlFormatError +func Handler(e error, path string) error { + if isYAMLSyntaxError(e) { + return YamlFormatError{ + Path: path, + ErrorMsg: e.Error(), + } + } + return e +} + +func isYAMLSyntaxError(e error) bool { + return strings.Contains(e.Error(), "error converting YAML to JSON") || strings.Contains(e.Error(), "error unmarshaling JSON") +} diff --git a/vendor/sigs.k8s.io/kustomize/pkg/loader/fileloader.go b/vendor/sigs.k8s.io/kustomize/pkg/loader/fileloader.go new file mode 100644 index 0000000000..4fa5dca67c --- /dev/null +++ b/vendor/sigs.k8s.io/kustomize/pkg/loader/fileloader.go @@ -0,0 +1,312 @@ +/* +Copyright 2018 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package loader + +import ( + "fmt" + "log" + "path/filepath" + "strings" + + "sigs.k8s.io/kustomize/pkg/fs" + "sigs.k8s.io/kustomize/pkg/git" + "sigs.k8s.io/kustomize/pkg/ifc" +) + +// fileLoader is a kustomization's interface to files. +// +// The directory in which a kustomization file sits +// is referred to below as the kustomization's root. +// +// An instance of fileLoader has an immutable root, +// and offers a `New` method returning a new loader +// with a new root. +// +// A kustomization file refers to two kinds of files: +// +// * supplemental data paths +// +// `Load` is used to visit these paths. +// +// They must terminate in or below the root. +// +// They hold things like resources, patches, +// data for ConfigMaps, etc. +// +// * bases; other kustomizations +// +// `New` is used to load bases. +// +// A base can be either a remote git repo URL, or +// a directory specified relative to the current +// root. In the former case, the repo is locally +// cloned, and the new loader is rooted on a path +// in that clone. +// +// As loaders create new loaders, a root history +// is established, and used to disallow: +// +// - A base that is a repository that, in turn, +// specifies a base repository seen previously +// in the loading stack (a cycle). +// +// - An overlay depending on a base positioned at +// or above it. I.e. '../foo' is OK, but '.', +// '..', '../..', etc. are disallowed. Allowing +// such a base has no advantages and encourages +// cycles, particularly if some future change +// were to introduce globbing to file +// specifications in the kustomization file. +// +// These restrictions assure that kustomizations +// are self-contained and relocatable, and impose +// some safety when relying on remote kustomizations, +// e.g. a ConfigMap generator specified to read +// from /etc/passwd will fail. +// +type fileLoader struct { + // Loader that spawned this loader. + // Used to avoid cycles. + referrer *fileLoader + // An absolute, cleaned path to a directory. + // The Load function reads from this directory, + // or directories below it. + root fs.ConfirmedDir + // If this is non-nil, the files were + // obtained from the given repository. + repoSpec *git.RepoSpec + // File system utilities. + fSys fs.FileSystem + // Used to clone repositories. + cloner git.Cloner + // Used to clean up, as needed. + cleaner func() error +} + +// NewFileLoaderAtCwd returns a loader that loads from ".". +func NewFileLoaderAtCwd(fSys fs.FileSystem) *fileLoader { + return newLoaderOrDie(fSys, ".") +} + +// NewFileLoaderAtRoot returns a loader that loads from "/". +func NewFileLoaderAtRoot(fSys fs.FileSystem) *fileLoader { + return newLoaderOrDie(fSys, string(filepath.Separator)) +} + +// Root returns the absolute path that is prepended to any +// relative paths used in Load. +func (l *fileLoader) Root() string { + return l.root.String() +} + +func newLoaderOrDie(fSys fs.FileSystem, path string) *fileLoader { + root, err := demandDirectoryRoot(fSys, path) + if err != nil { + log.Fatalf("unable to make loader at '%s'; %v", path, err) + } + return newLoaderAtConfirmedDir( + root, fSys, nil, git.ClonerUsingGitExec) +} + +// newLoaderAtConfirmedDir returns a new fileLoader with given root. +func newLoaderAtConfirmedDir( + root fs.ConfirmedDir, fSys fs.FileSystem, + referrer *fileLoader, cloner git.Cloner) *fileLoader { + return &fileLoader{ + root: root, + referrer: referrer, + fSys: fSys, + cloner: cloner, + cleaner: func() error { return nil }, + } +} + +// Assure that the given path is in fact a directory. +func demandDirectoryRoot( + fSys fs.FileSystem, path string) (fs.ConfirmedDir, error) { + if path == "" { + return "", fmt.Errorf( + "loader root cannot be empty") + } + d, f, err := fSys.CleanedAbs(path) + if err != nil { + return "", fmt.Errorf( + "absolute path error in '%s' : %v", path, err) + } + if f != "" { + return "", fmt.Errorf( + "got file '%s', but '%s' must be a directory to be a root", + f, path) + } + return d, nil +} + +// New returns a new Loader, rooted relative to current loader, +// or rooted in a temp directory holding a git repo clone. +func (l *fileLoader) New(path string) (ifc.Loader, error) { + if path == "" { + return nil, fmt.Errorf("new root cannot be empty") + } + repoSpec, err := git.NewRepoSpecFromUrl(path) + if err == nil { + // Treat this as git repo clone request. + if err := l.errIfRepoCycle(repoSpec); err != nil { + return nil, err + } + return newLoaderAtGitClone(repoSpec, l.fSys, l.referrer, l.cloner) + } + if filepath.IsAbs(path) { + return nil, fmt.Errorf("new root '%s' cannot be absolute", path) + } + root, err := demandDirectoryRoot(l.fSys, l.root.Join(path)) + if err != nil { + return nil, err + } + if err := l.errIfGitContainmentViolation(root); err != nil { + return nil, err + } + if err := l.errIfArgEqualOrHigher(root); err != nil { + return nil, err + } + return newLoaderAtConfirmedDir( + root, l.fSys, l, l.cloner), nil +} + +// newLoaderAtGitClone returns a new Loader pinned to a temporary +// directory holding a cloned git repo. +func newLoaderAtGitClone( + repoSpec *git.RepoSpec, fSys fs.FileSystem, + referrer *fileLoader, cloner git.Cloner) (ifc.Loader, error) { + err := cloner(repoSpec) + if err != nil { + return nil, err + } + root, f, err := fSys.CleanedAbs(repoSpec.AbsPath()) + if err != nil { + return nil, err + } + // We don't know that the path requested in repoSpec + // is a directory until we actually clone it and look + // inside. That just happened, hence the error check + // is here. + if f != "" { + return nil, fmt.Errorf( + "'%s' refers to file '%s'; expecting directory", + repoSpec.AbsPath(), f) + } + return &fileLoader{ + root: root, + referrer: referrer, + repoSpec: repoSpec, + fSys: fSys, + cloner: cloner, + cleaner: repoSpec.Cleaner(fSys), + }, nil +} + +func (l *fileLoader) errIfGitContainmentViolation( + base fs.ConfirmedDir) error { + containingRepo := l.containingRepo() + if containingRepo == nil { + return nil + } + if !base.HasPrefix(containingRepo.CloneDir()) { + return fmt.Errorf( + "security; bases in kustomizations found in "+ + "cloned git repos must be within the repo, "+ + "but base '%s' is outside '%s'", + base, containingRepo.CloneDir()) + } + return nil +} + +// Looks back through referrers for a git repo, returning nil +// if none found. +func (l *fileLoader) containingRepo() *git.RepoSpec { + if l.repoSpec != nil { + return l.repoSpec + } + if l.referrer == nil { + return nil + } + return l.referrer.containingRepo() +} + +// errIfArgEqualOrHigher tests whether the argument, +// is equal to or above the root of any ancestor. +func (l *fileLoader) errIfArgEqualOrHigher( + candidateRoot fs.ConfirmedDir) error { + if l.root.HasPrefix(candidateRoot) { + return fmt.Errorf( + "cycle detected: candidate root '%s' contains visited root '%s'", + candidateRoot, l.root) + } + if l.referrer == nil { + return nil + } + return l.referrer.errIfArgEqualOrHigher(candidateRoot) +} + +// TODO(monopole): Distinguish branches? +// I.e. Allow a distinction between git URI with +// path foo and tag bar and a git URI with the same +// path but a different tag? +func (l *fileLoader) errIfRepoCycle(newRepoSpec *git.RepoSpec) error { + // TODO(monopole): Use parsed data instead of Raw(). + if l.repoSpec != nil && + strings.HasPrefix(l.repoSpec.Raw(), newRepoSpec.Raw()) { + return fmt.Errorf( + "cycle detected: URI '%s' referenced by previous URI '%s'", + newRepoSpec.Raw(), l.repoSpec.Raw()) + } + if l.referrer == nil { + return nil + } + return l.referrer.errIfRepoCycle(newRepoSpec) +} + +// Load returns content of file at the given relative path, +// else an error. The path must refer to a file in or +// below the current root. +func (l *fileLoader) Load(path string) ([]byte, error) { + if filepath.IsAbs(path) { + return nil, l.loadOutOfBounds(path) + } + d, f, err := l.fSys.CleanedAbs(l.root.Join(path)) + if err != nil { + return nil, err + } + if f == "" { + return nil, fmt.Errorf( + "'%s' must be a file (got d='%s')", path, d) + } + if !d.HasPrefix(l.root) { + return nil, l.loadOutOfBounds(path) + } + return l.fSys.ReadFile(d.Join(f)) +} + +func (l *fileLoader) loadOutOfBounds(path string) error { + return fmt.Errorf( + "security; file '%s' is not in or below '%s'", + path, l.root) +} + +// Cleanup runs the cleaner. +func (l *fileLoader) Cleanup() error { + return l.cleaner() +} diff --git a/vendor/sigs.k8s.io/kustomize/pkg/loader/loader.go b/vendor/sigs.k8s.io/kustomize/pkg/loader/loader.go new file mode 100644 index 0000000000..53de6553a7 --- /dev/null +++ b/vendor/sigs.k8s.io/kustomize/pkg/loader/loader.go @@ -0,0 +1,39 @@ +/* +Copyright 2018 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Package loader has a data loading interface and various implementations. +package loader + +import ( + "sigs.k8s.io/kustomize/pkg/fs" + "sigs.k8s.io/kustomize/pkg/git" + "sigs.k8s.io/kustomize/pkg/ifc" +) + +// NewLoader returns a Loader. +func NewLoader(path string, fSys fs.FileSystem) (ifc.Loader, error) { + repoSpec, err := git.NewRepoSpecFromUrl(path) + if err == nil { + return newLoaderAtGitClone( + repoSpec, fSys, nil, git.ClonerUsingGitExec) + } + root, err := demandDirectoryRoot(fSys, path) + if err != nil { + return nil, err + } + return newLoaderAtConfirmedDir( + root, fSys, nil, git.ClonerUsingGitExec), nil +} diff --git a/vendor/sigs.k8s.io/kustomize/pkg/patch/json6902.go b/vendor/sigs.k8s.io/kustomize/pkg/patch/json6902.go new file mode 100644 index 0000000000..9ddb1faa10 --- /dev/null +++ b/vendor/sigs.k8s.io/kustomize/pkg/patch/json6902.go @@ -0,0 +1,40 @@ +/* +Copyright 2018 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package patch + +import "sigs.k8s.io/kustomize/pkg/gvk" + +// Json6902 represents a json patch for an object +// with format documented https://tools.ietf.org/html/rfc6902. +type Json6902 struct { + // Target refers to a Kubernetes object that the json patch will be + // applied to. It must refer to a Kubernetes resource under the + // purview of this kustomization. Target should use the + // raw name of the object (the name specified in its YAML, + // before addition of a namePrefix and a nameSuffix). + Target *Target `json:"target" yaml:"target"` + + // relative file path for a json patch file inside a kustomization + Path string `json:"path,omitempty" yaml:"path,omitempty"` +} + +// Target represents the kubernetes object that the patch is applied to +type Target struct { + gvk.Gvk `json:",inline,omitempty" yaml:",inline,omitempty"` + Namespace string `json:"namespace,omitempty" yaml:"namespace,omitempty"` + Name string `json:"name" yaml:"name"` +} diff --git a/vendor/sigs.k8s.io/kustomize/pkg/patch/strategicmerge.go b/vendor/sigs.k8s.io/kustomize/pkg/patch/strategicmerge.go new file mode 100644 index 0000000000..596cc346de --- /dev/null +++ b/vendor/sigs.k8s.io/kustomize/pkg/patch/strategicmerge.go @@ -0,0 +1,40 @@ +/* +Copyright 2018 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package patch + +// StrategicMerge represents a relative path to a +// stategic merge patch with the format +// https://github.com/kubernetes/community/blob/master/contributors/devel/strategic-merge-patch.md +type StrategicMerge string + +// Append appends a slice of patch paths to a StrategicMerge slice +func Append(patches []StrategicMerge, paths ...string) []StrategicMerge { + for _, p := range paths { + patches = append(patches, StrategicMerge(p)) + } + return patches +} + +// Exist determines if a patch path exists in a slice of StrategicMerge +func Exist(patches []StrategicMerge, path string) bool { + for _, p := range patches { + if p == StrategicMerge(path) { + return true + } + } + return false +} diff --git a/vendor/sigs.k8s.io/kustomize/pkg/patch/transformer/factory.go b/vendor/sigs.k8s.io/kustomize/pkg/patch/transformer/factory.go new file mode 100644 index 0000000000..b373dfb721 --- /dev/null +++ b/vendor/sigs.k8s.io/kustomize/pkg/patch/transformer/factory.go @@ -0,0 +1,83 @@ +/* +Copyright 2018 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package transformer + +import ( + "fmt" + "sigs.k8s.io/kustomize/pkg/ifc" + "sigs.k8s.io/kustomize/pkg/resid" + + "sigs.k8s.io/kustomize/pkg/gvk" + "sigs.k8s.io/kustomize/pkg/patch" + "sigs.k8s.io/kustomize/pkg/transformers" +) + +// PatchJson6902Factory makes Json6902 transformers +type PatchJson6902Factory struct { + loader ifc.Loader +} + +// NewPatchJson6902Factory returns a new PatchJson6902Factory. +func NewPatchJson6902Factory(l ifc.Loader) PatchJson6902Factory { + return PatchJson6902Factory{loader: l} +} + +// MakePatchJson6902Transformer returns a transformer for applying Json6902 patch +func (f PatchJson6902Factory) MakePatchJson6902Transformer(patches []patch.Json6902) (transformers.Transformer, error) { + var ts []transformers.Transformer + for _, p := range patches { + t, err := f.makeOnePatchJson6902Transformer(p) + if err != nil { + return nil, err + } + if t != nil { + ts = append(ts, t) + } + } + return transformers.NewMultiTransformerWithConflictCheck(ts), nil +} + +func (f PatchJson6902Factory) makeOnePatchJson6902Transformer(p patch.Json6902) (transformers.Transformer, error) { + if p.Target == nil { + return nil, fmt.Errorf("must specify the target field in patchesJson6902") + } + if p.Path == "" { + return nil, fmt.Errorf("must specify the path for a json patch file") + } + + targetId := resid.NewResIdWithPrefixNamespace( + gvk.Gvk{ + Group: p.Target.Group, + Version: p.Target.Version, + Kind: p.Target.Kind, + }, + p.Target.Name, + "", + p.Target.Namespace, + ) + + rawOp, err := f.loader.Load(p.Path) + if err != nil { + return nil, err + } + + return newPatchJson6902JSONTransformer(targetId, rawOp) +} + +func isJsonFormat(data []byte) bool { + return data[0] == '[' +} diff --git a/vendor/sigs.k8s.io/kustomize/pkg/patch/transformer/patchjson6902json.go b/vendor/sigs.k8s.io/kustomize/pkg/patch/transformer/patchjson6902json.go new file mode 100644 index 0000000000..1f09939d1d --- /dev/null +++ b/vendor/sigs.k8s.io/kustomize/pkg/patch/transformer/patchjson6902json.go @@ -0,0 +1,108 @@ +/* +Copyright 2018 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package transformer + +import ( + "fmt" + + "github.com/evanphx/json-patch" + "github.com/ghodss/yaml" + "github.com/pkg/errors" + "sigs.k8s.io/kustomize/pkg/resid" + "sigs.k8s.io/kustomize/pkg/resmap" + "sigs.k8s.io/kustomize/pkg/resource" + "sigs.k8s.io/kustomize/pkg/transformers" +) + +// patchJson6902JSONTransformer applies patches. +type patchJson6902JSONTransformer struct { + target resid.ResId + patch jsonpatch.Patch + rawOp []byte +} + +var _ transformers.Transformer = &patchJson6902JSONTransformer{} + +// newPatchJson6902JSONTransformer constructs a PatchJson6902 transformer. +func newPatchJson6902JSONTransformer( + id resid.ResId, rawOp []byte) (transformers.Transformer, error) { + op := rawOp + var err error + if !isJsonFormat(op) { + // if it isn't JSON, try to parse it as YAML + op, err = yaml.YAMLToJSON(rawOp) + if err != nil { + return nil, err + } + } + decodedPatch, err := jsonpatch.DecodePatch(op) + if err != nil { + return nil, err + } + if len(decodedPatch) == 0 { + return transformers.NewNoOpTransformer(), nil + } + return &patchJson6902JSONTransformer{target: id, patch: decodedPatch, rawOp: rawOp}, nil +} + +// Transform apply the json patches on top of the base resources. +func (t *patchJson6902JSONTransformer) Transform(m resmap.ResMap) error { + obj, err := t.findTargetObj(m) + if err != nil { + return err + } + rawObj, err := obj.MarshalJSON() + if err != nil { + return err + } + modifiedObj, err := t.patch.Apply(rawObj) + if err != nil { + return errors.Wrapf(err, "failed to apply json patch '%s'", string(t.rawOp)) + } + err = obj.UnmarshalJSON(modifiedObj) + if err != nil { + return err + } + return nil +} + +func (t *patchJson6902JSONTransformer) findTargetObj( + m resmap.ResMap) (*resource.Resource, error) { + var matched []resid.ResId + // TODO(monopole): namespace bug in json patch? + // Since introduction in PR #300 + // (see pkg/patch/transformer/util.go), + // this code has treated an empty namespace like a wildcard + // rather than like an additional restriction to match + // only the empty namespace. No test coverage to confirm. + // Not sure if desired, keeping it for now. + if t.target.Namespace() != "" { + matched = m.GetMatchingIds(t.target.NsGvknEquals) + } else { + matched = m.GetMatchingIds(t.target.GvknEquals) + } + if len(matched) == 0 { + return nil, fmt.Errorf( + "couldn't find target %v for json patch", t.target) + } + if len(matched) > 1 { + return nil, fmt.Errorf( + "found multiple targets %v matching %v for json patch", + matched, t.target) + } + return m[matched[0]], nil +} diff --git a/vendor/sigs.k8s.io/kustomize/pkg/resid/resid.go b/vendor/sigs.k8s.io/kustomize/pkg/resid/resid.go new file mode 100644 index 0000000000..dbf9a3e929 --- /dev/null +++ b/vendor/sigs.k8s.io/kustomize/pkg/resid/resid.go @@ -0,0 +1,207 @@ +/* +Copyright 2018 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package resid + +import ( + "strings" + + "sigs.k8s.io/kustomize/pkg/gvk" +) + +// ResId is an immutable identifier of a k8s resource object. +type ResId struct { + // Gvk of the resource. + gvKind gvk.Gvk + + // name of the resource before transformation. + name string + + // namePrefix of the resource. + // An untransformed resource has no prefix. + // A fully transformed resource has an arbitrary + // number of prefixes concatenated together. + prefix string + + // nameSuffix of the resource. + // An untransformed resource has no suffix. + // A fully transformed resource has an arbitrary + // number of suffixes concatenated together. + suffix string + + // Namespace the resource belongs to. + // An untransformed resource has no namespace. + // A fully transformed resource has the namespace + // from the top most overlay. + namespace string +} + +// NewResIdWithPrefixSuffixNamespace creates new resource identifier with a prefix, suffix and a namespace +func NewResIdWithPrefixSuffixNamespace(k gvk.Gvk, n, p, s, ns string) ResId { + return ResId{gvKind: k, name: n, prefix: p, suffix: s, namespace: ns} +} + +// NewResIdWithPrefixNamespace creates new resource identifier with a prefix and a namespace +func NewResIdWithPrefixNamespace(k gvk.Gvk, n, p, ns string) ResId { + return ResId{gvKind: k, name: n, prefix: p, namespace: ns} +} + +// NewResIdWithSuffixNamespace creates new resource identifier with a suffix and a namespace +func NewResIdWithSuffixNamespace(k gvk.Gvk, n, s, ns string) ResId { + return ResId{gvKind: k, name: n, suffix: s, namespace: ns} +} + +// NewResIdWithPrefixSuffix creates new resource identifier with a prefix and suffix +func NewResIdWithPrefixSuffix(k gvk.Gvk, n, p, s string) ResId { + return ResId{gvKind: k, name: n, prefix: p, suffix: s} +} + +// NewResId creates new resource identifier +func NewResId(k gvk.Gvk, n string) ResId { + return ResId{gvKind: k, name: n} +} + +// NewResIdKindOnly creates new resource identifier +func NewResIdKindOnly(k string, n string) ResId { + return ResId{gvKind: gvk.FromKind(k), name: n} +} + +const ( + noNamespace = "~X" + noPrefix = "~P" + noName = "~N" + noSuffix = "~S" + separator = "|" +) + +// String of ResId based on GVK, name and prefix +func (n ResId) String() string { + ns := n.namespace + if ns == "" { + ns = noNamespace + } + p := n.prefix + if p == "" { + p = noPrefix + } + nm := n.name + if nm == "" { + nm = noName + } + s := n.suffix + if s == "" { + s = noSuffix + } + + return strings.Join( + []string{n.gvKind.String(), ns, p, nm, s}, separator) +} + +// GvknString of ResId based on GVK and name +func (n ResId) GvknString() string { + return n.gvKind.String() + separator + n.name +} + +// GvknEquals returns true if the other id matches +// Group/Version/Kind/name. +func (n ResId) GvknEquals(id ResId) bool { + return n.name == id.name && n.gvKind.Equals(id.gvKind) +} + +// NsGvknEquals returns true if the other id matches +// namespace/Group/Version/Kind/name. +func (n ResId) NsGvknEquals(id ResId) bool { + return n.namespace == id.namespace && n.GvknEquals(id) +} + +// Gvk returns Group/Version/Kind of the resource. +func (n ResId) Gvk() gvk.Gvk { + return n.gvKind +} + +// Name returns resource name. +func (n ResId) Name() string { + return n.name +} + +// Namespace returns resource namespace. +func (n ResId) Namespace() string { + return n.namespace +} + +// CopyWithNewPrefixSuffix make a new copy from current ResId +// and append a new prefix and suffix +func (n ResId) CopyWithNewPrefixSuffix(p, s string) ResId { + result := n + if p != "" { + result.prefix = n.concatPrefix(p) + } + if s != "" { + result.suffix = n.concatSuffix(s) + } + return result +} + +// CopyWithNewNamespace make a new copy from current ResId and set a new namespace +func (n ResId) CopyWithNewNamespace(ns string) ResId { + result := n + result.namespace = ns + return result +} + +// HasSameLeftmostPrefix check if two ResIds have the same +// left most prefix. +func (n ResId) HasSameLeftmostPrefix(id ResId) bool { + prefixes1 := n.prefixList() + prefixes2 := id.prefixList() + return prefixes1[0] == prefixes2[0] +} + +// HasSameRightmostSuffix check if two ResIds have the same +// right most suffix. +func (n ResId) HasSameRightmostSuffix(id ResId) bool { + suffixes1 := n.suffixList() + suffixes2 := id.suffixList() + return suffixes1[len(suffixes1)-1] == suffixes2[len(suffixes2)-1] +} + +func (n ResId) concatPrefix(p string) string { + if p == "" { + return n.prefix + } + if n.prefix == "" { + return p + } + return p + ":" + n.prefix +} + +func (n ResId) concatSuffix(s string) string { + if s == "" { + return n.suffix + } + if n.suffix == "" { + return s + } + return n.suffix + ":" + s +} + +func (n ResId) prefixList() []string { + return strings.Split(n.prefix, ":") +} + +func (n ResId) suffixList() []string { + return strings.Split(n.suffix, ":") +} diff --git a/vendor/sigs.k8s.io/kustomize/pkg/resmap/factory.go b/vendor/sigs.k8s.io/kustomize/pkg/resmap/factory.go new file mode 100644 index 0000000000..923cde2325 --- /dev/null +++ b/vendor/sigs.k8s.io/kustomize/pkg/resmap/factory.go @@ -0,0 +1,123 @@ +/* +Copyright 2018 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package resmap + +import ( + "fmt" + + "github.com/pkg/errors" + "sigs.k8s.io/kustomize/pkg/ifc" + internal "sigs.k8s.io/kustomize/pkg/internal/error" + "sigs.k8s.io/kustomize/pkg/resource" + "sigs.k8s.io/kustomize/pkg/types" +) + +// Factory makes instances of ResMap. +type Factory struct { + resF *resource.Factory +} + +// NewFactory returns a new resmap.Factory. +func NewFactory(rf *resource.Factory) *Factory { + return &Factory{resF: rf} +} + +// RF returns a resource.Factory. +func (rmF *Factory) RF() *resource.Factory { + return rmF.resF +} + +// FromFiles returns a ResMap given a resource path slice. +func (rmF *Factory) FromFiles( + loader ifc.Loader, paths []string) (ResMap, error) { + var result []ResMap + for _, path := range paths { + content, err := loader.Load(path) + if err != nil { + return nil, errors.Wrap(err, "Load from path "+path+" failed") + } + res, err := rmF.NewResMapFromBytes(content) + if err != nil { + return nil, internal.Handler(err, path) + } + result = append(result, res) + } + return MergeWithErrorOnIdCollision(result...) +} + +// newResMapFromBytes decodes a list of objects in byte array format. +func (rmF *Factory) NewResMapFromBytes(b []byte) (ResMap, error) { + resources, err := rmF.resF.SliceFromBytes(b) + if err != nil { + return nil, err + } + + result := ResMap{} + for _, res := range resources { + id := res.Id() + if _, found := result[id]; found { + return result, fmt.Errorf("GroupVersionKindName: %#v already exists b the map", id) + } + result[id] = res + } + return result, nil +} + +// NewResMapFromConfigMapArgs returns a Resource slice given +// a configmap metadata slice from kustomization file. +func (rmF *Factory) NewResMapFromConfigMapArgs(argList []types.ConfigMapArgs, options *types.GeneratorOptions) (ResMap, error) { + var resources []*resource.Resource + for _, args := range argList { + res, err := rmF.resF.MakeConfigMap(&args, options) + if err != nil { + return nil, errors.Wrap(err, "NewResMapFromConfigMapArgs") + } + resources = append(resources, res) + } + return newResMapFromResourceSlice(resources) +} + +// NewResMapFromSecretArgs takes a SecretArgs slice, generates +// secrets from each entry, and accumulates them in a ResMap. +func (rmF *Factory) NewResMapFromSecretArgs(argsList []types.SecretArgs, options *types.GeneratorOptions) (ResMap, error) { + var resources []*resource.Resource + for _, args := range argsList { + res, err := rmF.resF.MakeSecret(&args, options) + if err != nil { + return nil, errors.Wrap(err, "NewResMapFromSecretArgs") + } + resources = append(resources, res) + } + return newResMapFromResourceSlice(resources) +} + +// Set sets the loader for the underlying factory +func (rmF *Factory) Set(ldr ifc.Loader) { + rmF.resF.Set(ldr) +} + +func newResMapFromResourceSlice(resources []*resource.Resource) (ResMap, error) { + result := ResMap{} + for _, res := range resources { + id := res.Id() + if _, found := result[id]; found { + return nil, fmt.Errorf("duplicated %#v is not allowed", id) + } + result[id] = res + } + return result, nil +} diff --git a/vendor/sigs.k8s.io/kustomize/pkg/resmap/idslice.go b/vendor/sigs.k8s.io/kustomize/pkg/resmap/idslice.go new file mode 100644 index 0000000000..cdf759203b --- /dev/null +++ b/vendor/sigs.k8s.io/kustomize/pkg/resmap/idslice.go @@ -0,0 +1,37 @@ +/* +Copyright 2018 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package resmap + +import ( + "sort" + + "sigs.k8s.io/kustomize/pkg/resid" +) + +// IdSlice implements the sort interface. +type IdSlice []resid.ResId + +var _ sort.Interface = IdSlice{} + +func (a IdSlice) Len() int { return len(a) } +func (a IdSlice) Swap(i, j int) { a[i], a[j] = a[j], a[i] } +func (a IdSlice) Less(i, j int) bool { + if !a[i].Gvk().Equals(a[j].Gvk()) { + return a[i].Gvk().IsLessThan(a[j].Gvk()) + } + return a[i].String() < a[j].String() +} diff --git a/vendor/sigs.k8s.io/kustomize/pkg/resmap/resmap.go b/vendor/sigs.k8s.io/kustomize/pkg/resmap/resmap.go new file mode 100644 index 0000000000..ca1e723980 --- /dev/null +++ b/vendor/sigs.k8s.io/kustomize/pkg/resmap/resmap.go @@ -0,0 +1,200 @@ +/* +Copyright 2018 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Package resmap implements a map from ResId to Resource that tracks all resources in a kustomization. +package resmap + +import ( + "bytes" + "fmt" + "reflect" + "sort" + + "github.com/ghodss/yaml" + "sigs.k8s.io/kustomize/pkg/resid" + "sigs.k8s.io/kustomize/pkg/resource" + "sigs.k8s.io/kustomize/pkg/types" +) + +// ResMap is a map from ResId to Resource. +type ResMap map[resid.ResId]*resource.Resource + +type IdMatcher func(resid.ResId) bool + +// GetMatchingIds returns a slice of ResId keys from the map +// that all satisfy the given matcher function. +func (m ResMap) GetMatchingIds(matches IdMatcher) []resid.ResId { + var result []resid.ResId + for id := range m { + if matches(id) { + result = append(result, id) + } + } + return result +} + +// EncodeAsYaml encodes a ResMap to YAML; encoded objects separated by `---`. +func (m ResMap) EncodeAsYaml() ([]byte, error) { + var ids []resid.ResId + for id := range m { + ids = append(ids, id) + } + sort.Sort(IdSlice(ids)) + + firstObj := true + var b []byte + buf := bytes.NewBuffer(b) + for _, id := range ids { + obj := m[id] + out, err := yaml.Marshal(obj.Map()) + if err != nil { + return nil, err + } + if firstObj { + firstObj = false + } else { + _, err = buf.WriteString("---\n") + if err != nil { + return nil, err + } + } + _, err = buf.Write(out) + if err != nil { + return nil, err + } + } + return buf.Bytes(), nil +} + +// ErrorIfNotEqual returns error if maps are not equal. +func (m ResMap) ErrorIfNotEqual(m2 ResMap) error { + if len(m) != len(m2) { + var keySet1 []resid.ResId + var keySet2 []resid.ResId + for id := range m { + keySet1 = append(keySet1, id) + } + for id := range m2 { + keySet2 = append(keySet2, id) + } + return fmt.Errorf("maps has different number of entries: %#v doesn't equals %#v", keySet1, keySet2) + } + for id, obj1 := range m { + obj2, found := m2[id] + if !found { + return fmt.Errorf("%#v doesn't exist in %#v", id, m2) + } + if !reflect.DeepEqual(obj1, obj2) { + return fmt.Errorf("%#v doesn't deep equal %#v", obj1, obj2) + } + } + return nil +} + +// DeepCopy clone the resmap into a new one +func (m ResMap) DeepCopy(rf *resource.Factory) ResMap { + mcopy := make(ResMap) + for id, obj := range m { + mcopy[id] = obj.DeepCopy() + } + return mcopy +} + +// FilterBy returns a subset ResMap containing ResIds with +// the same namespace and leftmost name prefix and rightmost name +// as the inputId. If inputId is a cluster level resource, this +// returns the original ResMap. +func (m ResMap) FilterBy(inputId resid.ResId) ResMap { + if inputId.Gvk().IsClusterKind() { + return m + } + result := ResMap{} + for id, res := range m { + if id.Gvk().IsClusterKind() || id.Namespace() == inputId.Namespace() && + id.HasSameLeftmostPrefix(inputId) && + id.HasSameRightmostSuffix(inputId) { + result[id] = res + } + } + return result +} + +// MergeWithErrorOnIdCollision combines multiple ResMap instances, failing on +// key collision and skipping nil maps. +// If all of the maps are nil, an empty ResMap is returned. +func MergeWithErrorOnIdCollision(maps ...ResMap) (ResMap, error) { + result := ResMap{} + for _, m := range maps { + if m == nil { + continue + } + for id, res := range m { + if _, found := result[id]; found { + return nil, fmt.Errorf("id '%q' already used", id) + } + result[id] = res + } + } + return result, nil +} + +// MergeWithOverride combines multiple ResMap instances, allowing and sometimes +// demanding certain collisions and skipping nil maps. +// A collision would be demanded, say, when a generated ConfigMap has the +// "replace" option in its generation instructions, meaning it is supposed +// to replace something from the raw resources list. +// If all of the maps are nil, an empty ResMap is returned. +// When looping over the instances to combine them, if a resource id for +// resource X is found to be already in the combined map, then the behavior +// field for X must be BehaviorMerge or BehaviorReplace. If X is not in the +// map, then it's behavior cannot be merge or replace. +func MergeWithOverride(maps ...ResMap) (ResMap, error) { + result := maps[0] + if result == nil { + result = ResMap{} + } + for _, m := range maps[1:] { + if m == nil { + continue + } + for id, r := range m { + matchedId := result.GetMatchingIds(id.GvknEquals) + if len(matchedId) == 1 { + id = matchedId[0] + switch r.Behavior() { + case types.BehaviorReplace: + r.Replace(result[id]) + result[id] = r + case types.BehaviorMerge: + r.Merge(result[id]) + result[id] = r + default: + return nil, fmt.Errorf("id %#v exists; must merge or replace", id) + } + } else if len(matchedId) == 0 { + switch r.Behavior() { + case types.BehaviorMerge, types.BehaviorReplace: + return nil, fmt.Errorf("id %#v does not exist; cannot merge or replace", id) + default: + result[id] = r + } + } else { + return nil, fmt.Errorf("merge conflict, found multiple objects %v the Resmap %v can merge into", matchedId, id) + } + } + } + return result, nil +} diff --git a/vendor/sigs.k8s.io/kustomize/pkg/resource/factory.go b/vendor/sigs.k8s.io/kustomize/pkg/resource/factory.go new file mode 100644 index 0000000000..148323dd6b --- /dev/null +++ b/vendor/sigs.k8s.io/kustomize/pkg/resource/factory.go @@ -0,0 +1,148 @@ +/* +Copyright 2018 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package resource + +import ( + "encoding/json" + "fmt" + "log" + "strings" + + "sigs.k8s.io/kustomize/pkg/ifc" + internal "sigs.k8s.io/kustomize/pkg/internal/error" + "sigs.k8s.io/kustomize/pkg/patch" + "sigs.k8s.io/kustomize/pkg/types" +) + +// Factory makes instances of Resource. +type Factory struct { + kf ifc.KunstructuredFactory +} + +// NewFactory makes an instance of Factory. +func NewFactory(kf ifc.KunstructuredFactory) *Factory { + return &Factory{kf: kf} +} + +// FromMap returns a new instance of Resource. +func (rf *Factory) FromMap(m map[string]interface{}) *Resource { + return &Resource{ + Kunstructured: rf.kf.FromMap(m), + options: types.NewGenArgs(nil, nil), + } +} + +// FromMapAndOption returns a new instance of Resource with given options. +func (rf *Factory) FromMapAndOption(m map[string]interface{}, args *types.GeneratorArgs, option *types.GeneratorOptions) *Resource { + return &Resource{ + Kunstructured: rf.kf.FromMap(m), + options: types.NewGenArgs(args, option), + } +} + +// FromKunstructured returns a new instance of Resource. +func (rf *Factory) FromKunstructured( + u ifc.Kunstructured) *Resource { + if u == nil { + log.Fatal("unstruct ifc must not be null") + } + return &Resource{ + Kunstructured: u, + options: types.NewGenArgs(nil, nil), + } +} + +// SliceFromPatches returns a slice of resources given a patch path +// slice from a kustomization file. +func (rf *Factory) SliceFromPatches( + ldr ifc.Loader, paths []patch.StrategicMerge) ([]*Resource, error) { + var result []*Resource + for _, path := range paths { + content, err := ldr.Load(string(path)) + if err != nil { + return nil, err + } + res, err := rf.SliceFromBytes(content) + if err != nil { + return nil, internal.Handler(err, string(path)) + } + result = append(result, res...) + } + return result, nil +} + +// SliceFromBytes unmarshalls bytes into a Resource slice. +func (rf *Factory) SliceFromBytes(in []byte) ([]*Resource, error) { + kunStructs, err := rf.kf.SliceFromBytes(in) + if err != nil { + return nil, err + } + var result []*Resource + for len(kunStructs) > 0 { + u := kunStructs[0] + kunStructs = kunStructs[1:] + if strings.HasSuffix(u.GetKind(), "List") { + items := u.Map()["items"] + itemsSlice, ok := items.([]interface{}) + if !ok { + if items == nil { + // an empty list + continue + } + return nil, fmt.Errorf("items in List is type %T, expected array", items) + } + for _, item := range itemsSlice { + itemJSON, err := json.Marshal(item) + if err != nil { + return nil, err + } + innerU, err := rf.kf.SliceFromBytes(itemJSON) + if err != nil { + return nil, err + } + // append innerU to kunStructs so nested Lists can be handled + kunStructs = append(kunStructs, innerU...) + } + } else { + result = append(result, rf.FromKunstructured(u)) + } + } + return result, nil +} + +// Set sets the loader for the underlying factory +func (rf *Factory) Set(ldr ifc.Loader) { + rf.kf.Set(ldr) +} + +// MakeConfigMap makes an instance of Resource for ConfigMap +func (rf *Factory) MakeConfigMap(args *types.ConfigMapArgs, options *types.GeneratorOptions) (*Resource, error) { + u, err := rf.kf.MakeConfigMap(args, options) + if err != nil { + return nil, err + } + return &Resource{Kunstructured: u, options: types.NewGenArgs(&types.GeneratorArgs{Behavior: args.Behavior}, options)}, nil +} + +// MakeSecret makes an instance of Resource for Secret +func (rf *Factory) MakeSecret(args *types.SecretArgs, options *types.GeneratorOptions) (*Resource, error) { + u, err := rf.kf.MakeSecret(args, options) + if err != nil { + return nil, err + } + return &Resource{Kunstructured: u, options: types.NewGenArgs(&types.GeneratorArgs{Behavior: args.Behavior}, options)}, nil +} diff --git a/vendor/sigs.k8s.io/kustomize/pkg/resource/resource.go b/vendor/sigs.k8s.io/kustomize/pkg/resource/resource.go new file mode 100644 index 0000000000..1e0e3764b8 --- /dev/null +++ b/vendor/sigs.k8s.io/kustomize/pkg/resource/resource.go @@ -0,0 +1,107 @@ +/* +Copyright 2018 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Package resource implements representations of k8s API resources as "unstructured" objects. +package resource + +import ( + "strings" + + "sigs.k8s.io/kustomize/pkg/ifc" + "sigs.k8s.io/kustomize/pkg/resid" + "sigs.k8s.io/kustomize/pkg/types" +) + +// Resource is map representation of a Kubernetes API resource object +// paired with a GenerationBehavior. +type Resource struct { + ifc.Kunstructured + options *types.GenArgs +} + +// String returns resource as JSON. +func (r *Resource) String() string { + bs, err := r.MarshalJSON() + if err != nil { + return "<" + err.Error() + ">" + } + return strings.TrimSpace(string(bs)) + r.options.String() +} + +// DeepCopy returns a new copy of resource +func (r *Resource) DeepCopy() *Resource { + return &Resource{ + Kunstructured: r.Kunstructured.Copy(), + options: r.options, + } +} + +// Behavior returns the behavior for the resource. +func (r *Resource) Behavior() types.GenerationBehavior { + return r.options.Behavior() +} + +// NeedAppendHash checks if the resource need a hash suffix +func (r *Resource) NeedHashSuffix() bool { + return r.options != nil && r.options.NeedsHashSuffix() +} + +// Id returns the ResId for the resource. +func (r *Resource) Id() resid.ResId { + namespace, _ := r.GetFieldValue("metadata.namespace") + return resid.NewResIdWithPrefixNamespace(r.GetGvk(), r.GetName(), "", namespace) +} + +// Merge performs merge with other resource. +func (r *Resource) Merge(other *Resource) { + r.Replace(other) + mergeConfigmap(r.Map(), other.Map(), r.Map()) +} + +// Replace performs replace with other resource. +func (r *Resource) Replace(other *Resource) { + r.SetLabels(mergeStringMaps(other.GetLabels(), r.GetLabels())) + r.SetAnnotations( + mergeStringMaps(other.GetAnnotations(), r.GetAnnotations())) + r.SetName(other.GetName()) + r.options = other.options +} + +// TODO: Add BinaryData once we sync to new k8s.io/api +func mergeConfigmap( + mergedTo map[string]interface{}, + maps ...map[string]interface{}) { + mergedMap := map[string]interface{}{} + for _, m := range maps { + datamap, ok := m["data"].(map[string]interface{}) + if ok { + for key, value := range datamap { + mergedMap[key] = value + } + } + } + mergedTo["data"] = mergedMap +} + +func mergeStringMaps(maps ...map[string]string) map[string]string { + result := map[string]string{} + for _, m := range maps { + for key, value := range m { + result[key] = value + } + } + return result +} diff --git a/vendor/sigs.k8s.io/kustomize/pkg/target/kusttarget.go b/vendor/sigs.k8s.io/kustomize/pkg/target/kusttarget.go new file mode 100644 index 0000000000..f136b2683b --- /dev/null +++ b/vendor/sigs.k8s.io/kustomize/pkg/target/kusttarget.go @@ -0,0 +1,315 @@ +/* +Copyright 2018 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Package target implements state for the set of all resources to customize. +package target + +import ( + "bytes" + "encoding/json" + "fmt" + "strings" + + "github.com/ghodss/yaml" + "github.com/pkg/errors" + "sigs.k8s.io/kustomize/pkg/constants" + "sigs.k8s.io/kustomize/pkg/ifc" + "sigs.k8s.io/kustomize/pkg/ifc/transformer" + interror "sigs.k8s.io/kustomize/pkg/internal/error" + patchtransformer "sigs.k8s.io/kustomize/pkg/patch/transformer" + "sigs.k8s.io/kustomize/pkg/resmap" + "sigs.k8s.io/kustomize/pkg/resource" + "sigs.k8s.io/kustomize/pkg/transformers" + "sigs.k8s.io/kustomize/pkg/transformers/config" + "sigs.k8s.io/kustomize/pkg/types" +) + +// KustTarget encapsulates the entirety of a kustomization build. +type KustTarget struct { + kustomization *types.Kustomization + ldr ifc.Loader + rFactory *resmap.Factory + tFactory transformer.Factory +} + +// NewKustTarget returns a new instance of KustTarget primed with a Loader. +func NewKustTarget( + ldr ifc.Loader, + rFactory *resmap.Factory, + tFactory transformer.Factory) (*KustTarget, error) { + content, err := loadKustFile(ldr) + if err != nil { + return nil, err + } + content = types.DealWithDeprecatedFields(content) + var k types.Kustomization + err = unmarshal(content, &k) + if err != nil { + return nil, err + } + errs := k.EnforceFields() + if len(errs) > 0 { + return nil, fmt.Errorf("Failed to read kustomization file under %s:\n"+strings.Join(errs, "\n"), ldr.Root()) + } + return &KustTarget{ + kustomization: &k, + ldr: ldr, + rFactory: rFactory, + tFactory: tFactory, + }, nil +} + +func quoted(l []string) []string { + r := make([]string, len(l)) + for i, v := range l { + r[i] = "'" + v + "'" + } + return r +} + +func commaOr(q []string) string { + return strings.Join(q[:len(q)-1], ", ") + " or " + q[len(q)-1] +} + +func loadKustFile(ldr ifc.Loader) ([]byte, error) { + var content []byte + match := 0 + for _, kf := range constants.KustomizationFileNames { + c, err := ldr.Load(kf) + if err == nil { + match += 1 + content = c + } + } + switch match { + case 0: + return nil, fmt.Errorf( + "unable to find one of %v in directory '%s'", + commaOr(quoted(constants.KustomizationFileNames)), ldr.Root()) + case 1: + return content, nil + default: + return nil, fmt.Errorf("Found multiple kustomization files under: %s\n", ldr.Root()) + } +} + +func unmarshal(y []byte, o interface{}) error { + j, err := yaml.YAMLToJSON(y) + if err != nil { + return err + } + dec := json.NewDecoder(bytes.NewReader(j)) + dec.DisallowUnknownFields() + return dec.Decode(o) +} + +// MakeCustomizedResMap creates a ResMap per kustomization instructions. +// The Resources in the returned ResMap are fully customized. +func (kt *KustTarget) MakeCustomizedResMap() (resmap.ResMap, error) { + ra, err := kt.AccumulateTarget() + if err != nil { + return nil, err + } + err = ra.Transform(kt.tFactory.MakeHashTransformer()) + if err != nil { + return nil, err + } + // Given that names have changed (prefixs/suffixes added), + // fix all the back references to those names. + err = ra.FixBackReferences() + if err != nil { + return nil, err + } + // With all the back references fixed, it's OK to resolve Vars. + err = ra.ResolveVars() + return ra.ResMap(), err +} + +func (kt *KustTarget) shouldAddHashSuffixesToGeneratedResources() bool { + return kt.kustomization.GeneratorOptions == nil || + !kt.kustomization.GeneratorOptions.DisableNameSuffixHash +} + +// AccumulateTarget returns a new ResAccumulator, +// holding customized resources and the data/rules used +// to do so. The name back references and vars are +// not yet fixed. +func (kt *KustTarget) AccumulateTarget() ( + ra *ResAccumulator, err error) { + // TODO(monopole): Get rid of the KustomizationErrors accumulator. + // It's not consistently used, and complicates tests. + errs := &interror.KustomizationErrors{} + ra, errs = kt.accumulateBases() + resources, err := kt.rFactory.FromFiles( + kt.ldr, kt.kustomization.Resources) + if err != nil { + errs.Append(errors.Wrap(err, "rawResources failed to read Resources")) + } + if len(errs.Get()) > 0 { + return ra, errs + } + err = ra.MergeResourcesWithErrorOnIdCollision(resources) + if err != nil { + errs.Append(errors.Wrap(err, "MergeResourcesWithErrorOnIdCollision")) + } + tConfig, err := config.MakeTransformerConfig( + kt.ldr, kt.kustomization.Configurations) + if err != nil { + return nil, err + } + err = ra.MergeConfig(tConfig) + if err != nil { + errs.Append(errors.Wrap(err, "MergeConfig")) + } + err = ra.MergeVars(kt.kustomization.Vars) + if err != nil { + errs.Append(errors.Wrap(err, "MergeVars")) + } + crdTc, err := config.LoadConfigFromCRDs(kt.ldr, kt.kustomization.Crds) + if err != nil { + errs.Append(errors.Wrap(err, "LoadCRDs")) + } + err = ra.MergeConfig(crdTc) + if err != nil { + errs.Append(errors.Wrap(err, "merge CRDs")) + } + resMap, err := kt.generateConfigMapsAndSecrets(errs) + if err != nil { + errs.Append(errors.Wrap(err, "generateConfigMapsAndSecrets")) + } + err = ra.MergeResourcesWithOverride(resMap) + if err != nil { + return nil, err + } + patches, err := kt.rFactory.RF().SliceFromPatches( + kt.ldr, kt.kustomization.PatchesStrategicMerge) + if err != nil { + errs.Append(errors.Wrap(err, "SliceFromPatches")) + } + if len(errs.Get()) > 0 { + return nil, errs + } + t, err := kt.newTransformer(patches, ra.tConfig) + if err != nil { + return nil, err + } + err = ra.Transform(t) + if err != nil { + return nil, err + } + return ra, nil +} + +func (kt *KustTarget) generateConfigMapsAndSecrets( + errs *interror.KustomizationErrors) (resmap.ResMap, error) { + kt.rFactory.Set(kt.ldr) + cms, err := kt.rFactory.NewResMapFromConfigMapArgs( + kt.kustomization.ConfigMapGenerator, kt.kustomization.GeneratorOptions) + if err != nil { + errs.Append(errors.Wrap(err, "NewResMapFromConfigMapArgs")) + } + secrets, err := kt.rFactory.NewResMapFromSecretArgs( + kt.kustomization.SecretGenerator, kt.kustomization.GeneratorOptions) + if err != nil { + errs.Append(errors.Wrap(err, "NewResMapFromSecretArgs")) + } + return resmap.MergeWithErrorOnIdCollision(cms, secrets) +} + +// accumulateBases returns a new ResAccumulator +// holding customized resources and the data/rules +// used to customized them from only the _bases_ +// of this KustTarget. +func (kt *KustTarget) accumulateBases() ( + ra *ResAccumulator, errs *interror.KustomizationErrors) { + errs = &interror.KustomizationErrors{} + ra = MakeEmptyAccumulator() + + for _, path := range kt.kustomization.Bases { + ldr, err := kt.ldr.New(path) + if err != nil { + errs.Append(errors.Wrap(err, "couldn't make loader for "+path)) + continue + } + subKt, err := NewKustTarget( + ldr, kt.rFactory, kt.tFactory) + if err != nil { + errs.Append(errors.Wrap(err, "couldn't make target for "+path)) + ldr.Cleanup() + continue + } + subRa, err := subKt.AccumulateTarget() + if err != nil { + errs.Append(errors.Wrap(err, "AccumulateTarget")) + ldr.Cleanup() + continue + } + err = ra.MergeAccumulator(subRa) + if err != nil { + errs.Append(errors.Wrap(err, path)) + } + ldr.Cleanup() + } + return ra, errs +} + +// newTransformer makes a Transformer that does a collection +// of object transformations. +func (kt *KustTarget) newTransformer( + patches []*resource.Resource, tConfig *config.TransformerConfig) ( + transformers.Transformer, error) { + var r []transformers.Transformer + t, err := kt.tFactory.MakePatchTransformer(patches, kt.rFactory.RF()) + if err != nil { + return nil, err + } + r = append(r, t) + r = append(r, transformers.NewNamespaceTransformer( + string(kt.kustomization.Namespace), tConfig.NameSpace)) + t, err = transformers.NewNamePrefixSuffixTransformer( + string(kt.kustomization.NamePrefix), + string(kt.kustomization.NameSuffix), + tConfig.NamePrefix, + ) + if err != nil { + return nil, err + } + r = append(r, t) + t, err = transformers.NewLabelsMapTransformer( + kt.kustomization.CommonLabels, tConfig.CommonLabels) + if err != nil { + return nil, err + } + r = append(r, t) + t, err = transformers.NewAnnotationsMapTransformer( + kt.kustomization.CommonAnnotations, tConfig.CommonAnnotations) + if err != nil { + return nil, err + } + r = append(r, t) + t, err = patchtransformer.NewPatchJson6902Factory(kt.ldr). + MakePatchJson6902Transformer(kt.kustomization.PatchesJson6902) + if err != nil { + return nil, err + } + r = append(r, t) + t, err = transformers.NewImageTransformer(kt.kustomization.Images) + if err != nil { + return nil, err + } + r = append(r, t) + return transformers.NewMultiTransformer(r), nil +} diff --git a/vendor/sigs.k8s.io/kustomize/pkg/target/resaccumulator.go b/vendor/sigs.k8s.io/kustomize/pkg/target/resaccumulator.go new file mode 100644 index 0000000000..b8c45015a5 --- /dev/null +++ b/vendor/sigs.k8s.io/kustomize/pkg/target/resaccumulator.go @@ -0,0 +1,161 @@ +/* +Copyright 2018 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package target + +import ( + "fmt" + "log" + "strings" + + "sigs.k8s.io/kustomize/pkg/resid" + "sigs.k8s.io/kustomize/pkg/resmap" + "sigs.k8s.io/kustomize/pkg/transformers" + "sigs.k8s.io/kustomize/pkg/transformers/config" + "sigs.k8s.io/kustomize/pkg/types" +) + +// ResAccumulator accumulates resources and the rules +// used to customize those resources. +// TODO(monopole): Move to "accumulator" package and make members private. +// This will make a better separation between KustTarget, which should +// be mainly concerned with data loading, and this class, which could +// become the home of all transformation data and logic. +type ResAccumulator struct { + resMap resmap.ResMap + tConfig *config.TransformerConfig + varSet types.VarSet +} + +func MakeEmptyAccumulator() *ResAccumulator { + ra := &ResAccumulator{} + ra.resMap = make(resmap.ResMap) + ra.tConfig = &config.TransformerConfig{} + ra.varSet = types.VarSet{} + return ra +} + +// ResMap returns a copy of the internal resMap. +func (ra *ResAccumulator) ResMap() resmap.ResMap { + result := make(resmap.ResMap) + for k, v := range ra.resMap { + result[k] = v + } + return result +} + +// Vars returns a copy of underlying vars. +func (ra *ResAccumulator) Vars() []types.Var { + return ra.varSet.Set() +} + +func (ra *ResAccumulator) MergeResourcesWithErrorOnIdCollision( + resources resmap.ResMap) (err error) { + ra.resMap, err = resmap.MergeWithErrorOnIdCollision( + resources, ra.resMap) + return err +} + +func (ra *ResAccumulator) MergeResourcesWithOverride( + resources resmap.ResMap) (err error) { + ra.resMap, err = resmap.MergeWithOverride( + ra.resMap, resources) + return err +} + +func (ra *ResAccumulator) MergeConfig( + tConfig *config.TransformerConfig) (err error) { + ra.tConfig, err = ra.tConfig.Merge(tConfig) + return err +} + +func (ra *ResAccumulator) MergeVars(incoming []types.Var) error { + return ra.varSet.MergeSlice(incoming) +} + +func (ra *ResAccumulator) MergeAccumulator(other *ResAccumulator) (err error) { + err = ra.MergeResourcesWithErrorOnIdCollision(other.resMap) + if err != nil { + return err + } + err = ra.MergeConfig(other.tConfig) + if err != nil { + return err + } + return ra.varSet.MergeSet(&other.varSet) +} + +// makeVarReplacementMap returns a map of Var names to +// their final values. The values are strings intended +// for substitution wherever the $(var.Name) occurs. +func (ra *ResAccumulator) makeVarReplacementMap() (map[string]string, error) { + result := map[string]string{} + for _, v := range ra.Vars() { + matched := ra.resMap.GetMatchingIds( + resid.NewResId(v.ObjRef.GVK(), v.ObjRef.Name).GvknEquals) + if len(matched) > 1 { + return nil, fmt.Errorf( + "found %d resId matches for var %s "+ + "(unable to disambiguate)", + len(matched), v) + } + if len(matched) == 1 { + s, err := ra.resMap[matched[0]].GetFieldValue(v.FieldRef.FieldPath) + if err != nil { + return nil, fmt.Errorf( + "field specified in var '%v' "+ + "not found in corresponding resource", v) + } + result[v.Name] = s + } else { + return nil, fmt.Errorf( + "var '%v' cannot be mapped to a field "+ + "in the set of known resources", v) + } + } + return result, nil +} + +func (ra *ResAccumulator) Transform(t transformers.Transformer) error { + return t.Transform(ra.resMap) +} + +func (ra *ResAccumulator) ResolveVars() error { + replacementMap, err := ra.makeVarReplacementMap() + if err != nil { + return err + } + if len(replacementMap) == 0 { + return nil + } + t := transformers.NewRefVarTransformer( + replacementMap, ra.tConfig.VarReference) + err = ra.Transform(t) + if len(t.UnusedVars()) > 0 { + log.Printf( + "well-defined vars that were never replaced: %s\n", + strings.Join(t.UnusedVars(), ",")) + } + return err +} + +func (ra *ResAccumulator) FixBackReferences() (err error) { + if ra.tConfig.NameReference == nil { + return nil + } + return ra.Transform(transformers.NewNameReferenceTransformer( + ra.tConfig.NameReference)) +} diff --git a/vendor/sigs.k8s.io/kustomize/pkg/transformers/config/defaultconfig/commonannotations.go b/vendor/sigs.k8s.io/kustomize/pkg/transformers/config/defaultconfig/commonannotations.go new file mode 100644 index 0000000000..2754559042 --- /dev/null +++ b/vendor/sigs.k8s.io/kustomize/pkg/transformers/config/defaultconfig/commonannotations.go @@ -0,0 +1,60 @@ +/* +Copyright 2018 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package defaultconfig + +const commonAnnotationFieldSpecs = ` +commonAnnotations: +- path: metadata/annotations + create: true + +- path: spec/template/metadata/annotations + create: true + version: v1 + kind: ReplicationController + +- path: spec/template/metadata/annotations + create: true + kind: Deployment + +- path: spec/template/metadata/annotations + create: true + kind: ReplicaSet + +- path: spec/template/metadata/annotations + create: true + kind: DaemonSet + +- path: spec/template/metadata/annotations + create: true + kind: StatefulSet + +- path: spec/template/metadata/annotations + create: true + group: batch + kind: Job + +- path: spec/jobTemplate/metadata/annotations + create: true + group: batch + kind: CronJob + +- path: spec/jobTemplate/spec/template/metadata/annotations + create: true + group: batch + kind: CronJob + +` diff --git a/vendor/sigs.k8s.io/kustomize/pkg/transformers/config/defaultconfig/commonlabels.go b/vendor/sigs.k8s.io/kustomize/pkg/transformers/config/defaultconfig/commonlabels.go new file mode 100644 index 0000000000..66943c1ed0 --- /dev/null +++ b/vendor/sigs.k8s.io/kustomize/pkg/transformers/config/defaultconfig/commonlabels.go @@ -0,0 +1,162 @@ +/* +Copyright 2018 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package defaultconfig + +const commonLabelFieldSpecs = ` +commonLabels: +- path: metadata/labels + create: true + +- path: spec/selector + create: true + version: v1 + kind: Service + +- path: spec/selector + create: true + version: v1 + kind: ReplicationController + +- path: spec/template/metadata/labels + create: true + version: v1 + kind: ReplicationController + +- path: spec/selector/matchLabels + create: true + kind: Deployment + +- path: spec/template/metadata/labels + create: true + kind: Deployment + +- path: spec/template/spec/affinity/podAffinity/preferredDuringSchedulingIgnoredDuringExecution/podAffinityTerm/labelSelector/matchLabels + create: false + group: apps + kind: Deployment + +- path: spec/template/spec/affinity/podAffinity/requiredDuringSchedulingIgnoredDuringExecution/labelSelector/matchLabels + create: false + group: apps + kind: Deployment + +- path: spec/template/spec/affinity/podAntiAffinity/preferredDuringSchedulingIgnoredDuringExecution/podAffinityTerm/labelSelector/matchLabels + create: false + group: apps + kind: Deployment + +- path: spec/template/spec/affinity/podAntiAffinity/requiredDuringSchedulingIgnoredDuringExecution/labelSelector/matchLabels + create: false + group: apps + kind: Deployment + +- path: spec/selector/matchLabels + create: true + kind: ReplicaSet + +- path: spec/template/metadata/labels + create: true + kind: ReplicaSet + +- path: spec/selector/matchLabels + create: true + kind: DaemonSet + +- path: spec/template/metadata/labels + create: true + kind: DaemonSet + +- path: spec/selector/matchLabels + create: true + group: apps + kind: StatefulSet + +- path: spec/template/metadata/labels + create: true + group: apps + kind: StatefulSet + +- path: spec/template/spec/affinity/podAffinity/preferredDuringSchedulingIgnoredDuringExecution/podAffinityTerm/labelSelector/matchLabels + create: false + group: apps + kind: StatefulSet + +- path: spec/template/spec/affinity/podAffinity/requiredDuringSchedulingIgnoredDuringExecution/labelSelector/matchLabels + create: false + group: apps + kind: StatefulSet + +- path: spec/template/spec/affinity/podAntiAffinity/preferredDuringSchedulingIgnoredDuringExecution/podAffinityTerm/labelSelector/matchLabels + create: false + group: apps + kind: StatefulSet + +- path: spec/template/spec/affinity/podAntiAffinity/requiredDuringSchedulingIgnoredDuringExecution/labelSelector/matchLabels + create: false + group: apps + kind: StatefulSet + +- path: spec/volumeClaimTemplates/metadata/labels + create: true + group: apps + kind: StatefulSet + +- path: spec/selector/matchLabels + create: false + group: batch + kind: Job + +- path: spec/template/metadata/labels + create: true + group: batch + kind: Job + +- path: spec/jobTemplate/spec/selector/matchLabels + create: false + group: batch + kind: CronJob + +- path: spec/jobTemplate/metadata/labels + create: true + group: batch + kind: CronJob + +- path: spec/jobTemplate/spec/template/metadata/labels + create: true + group: batch + kind: CronJob + +- path: spec/selector/matchLabels + create: false + group: policy + kind: PodDisruptionBudget + +- path: spec/podSelector/matchLabels + create: false + group: networking.k8s.io + kind: NetworkPolicy + +- path: spec/ingress/from/podSelector/matchLabels + create: false + group: networking.k8s.io + kind: NetworkPolicy + +- path: spec/egress/to/podSelector/matchLabels + create: false + group: networking.k8s.io + kind: NetworkPolicy +` diff --git a/vendor/sigs.k8s.io/kustomize/pkg/transformers/config/defaultconfig/defaultconfig.go b/vendor/sigs.k8s.io/kustomize/pkg/transformers/config/defaultconfig/defaultconfig.go new file mode 100644 index 0000000000..d96639a8ab --- /dev/null +++ b/vendor/sigs.k8s.io/kustomize/pkg/transformers/config/defaultconfig/defaultconfig.go @@ -0,0 +1,49 @@ +/* +Copyright 2018 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Package defaultconfig provides the default +// transformer configurations +package defaultconfig + +import ( + "bytes" +) + +// GetDefaultFieldSpecs returns default fieldSpecs. +func GetDefaultFieldSpecs() []byte { + configData := [][]byte{ + []byte(namePrefixFieldSpecs), + []byte(commonLabelFieldSpecs), + []byte(commonAnnotationFieldSpecs), + []byte(namespaceFieldSpecs), + []byte(varReferenceFieldSpecs), + []byte(nameReferenceFieldSpecs), + } + return bytes.Join(configData, []byte("\n")) +} + +// GetDefaultFieldSpecsAsMap returns default fieldSpecs +// as a string->string map. +func GetDefaultFieldSpecsAsMap() map[string]string { + result := make(map[string]string) + result["nameprefix"] = namePrefixFieldSpecs + result["commonlabels"] = commonLabelFieldSpecs + result["commonannotations"] = commonAnnotationFieldSpecs + result["namespace"] = namespaceFieldSpecs + result["varreference"] = varReferenceFieldSpecs + result["namereference"] = nameReferenceFieldSpecs + return result +} diff --git a/vendor/sigs.k8s.io/kustomize/pkg/transformers/config/defaultconfig/nameprefix.go b/vendor/sigs.k8s.io/kustomize/pkg/transformers/config/defaultconfig/nameprefix.go new file mode 100644 index 0000000000..94fe07a485 --- /dev/null +++ b/vendor/sigs.k8s.io/kustomize/pkg/transformers/config/defaultconfig/nameprefix.go @@ -0,0 +1,24 @@ +/* +Copyright 2018 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package defaultconfig + +const ( + namePrefixFieldSpecs = ` +namePrefix: +- path: metadata/name +` +) diff --git a/vendor/sigs.k8s.io/kustomize/pkg/transformers/config/defaultconfig/namereference.go b/vendor/sigs.k8s.io/kustomize/pkg/transformers/config/defaultconfig/namereference.go new file mode 100644 index 0000000000..35d4b7de0a --- /dev/null +++ b/vendor/sigs.k8s.io/kustomize/pkg/transformers/config/defaultconfig/namereference.go @@ -0,0 +1,317 @@ +/* +Copyright 2018 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package defaultconfig + +const ( + nameReferenceFieldSpecs = ` +nameReference: +- kind: Deployment + fieldSpecs: + - path: spec/scaleTargetRef/name + kind: HorizontalPodAutoscaler + +- kind: ReplicationController + fieldSpecs: + - path: spec/scaleTargetRef/name + kind: HorizontalPodAutoscaler + +- kind: ReplicaSet + fieldSpecs: + - path: spec/scaleTargetRef/name + kind: HorizontalPodAutoscaler + +- kind: ConfigMap + version: v1 + fieldSpecs: + - path: spec/volumes/configMap/name + version: v1 + kind: Pod + - path: spec/containers/env/valueFrom/configMapKeyRef/name + version: v1 + kind: Pod + - path: spec/initContainers/env/valueFrom/configMapKeyRef/name + version: v1 + kind: Pod + - path: spec/containers/envFrom/configMapRef/name + version: v1 + kind: Pod + - path: spec/initContainers/envFrom/configMapRef/name + version: v1 + kind: Pod + - path: spec/template/spec/volumes/configMap/name + kind: Deployment + - path: spec/template/spec/containers/env/valueFrom/configMapKeyRef/name + kind: Deployment + - path: spec/template/spec/initContainers/env/valueFrom/configMapKeyRef/name + kind: Deployment + - path: spec/template/spec/containers/envFrom/configMapRef/name + kind: Deployment + - path: spec/template/spec/initContainers/envFrom/configMapRef/name + kind: Deployment + - path: spec/template/spec/volumes/projected/sources/configMap/name + kind: Deployment + - path: spec/template/spec/volumes/configMap/name + kind: ReplicaSet + - path: spec/template/spec/containers/env/valueFrom/configMapKeyRef/name + kind: ReplicaSet + - path: spec/template/spec/initContainers/env/valueFrom/configMapKeyRef/name + kind: ReplicaSet + - path: spec/template/spec/containers/envFrom/configMapRef/name + kind: ReplicaSet + - path: spec/template/spec/initContainers/envFrom/configMapRef/name + kind: ReplicaSet + - path: spec/template/spec/volumes/configMap/name + kind: DaemonSet + - path: spec/template/spec/containers/env/valueFrom/configMapKeyRef/name + kind: DaemonSet + - path: spec/template/spec/initContainers/env/valueFrom/configMapKeyRef/name + kind: DaemonSet + - path: spec/template/spec/containers/envFrom/configMapRef/name + kind: DaemonSet + - path: spec/template/spec/initContainers/envFrom/configMapRef/name + kind: DaemonSet + - path: spec/template/spec/volumes/configMap/name + kind: StatefulSet + - path: spec/template/spec/containers/env/valueFrom/configMapKeyRef/name + kind: StatefulSet + - path: spec/template/spec/initContainers/env/valueFrom/configMapKeyRef/name + kind: StatefulSet + - path: spec/template/spec/containers/envFrom/configMapRef/name + kind: StatefulSet + - path: spec/template/spec/initContainers/envFrom/configMapRef/name + kind: StatefulSet + - path: spec/template/spec/volumes/projected/sources/configMap/name + kind: StatefulSet + - path: spec/template/spec/volumes/configMap/name + kind: Job + - path: spec/template/spec/containers/env/valueFrom/configMapKeyRef/name + kind: Job + - path: spec/template/spec/initContainers/env/valueFrom/configMapKeyRef/name + kind: Job + - path: spec/template/spec/containers/envFrom/configMapRef/name + kind: Job + - path: spec/template/spec/initContainers/envFrom/configMapRef/name + kind: Job + - path: spec/jobTemplate/spec/template/spec/volumes/configMap/name + kind: CronJob + - path: spec/jobTemplate/spec/template/spec/containers/env/valueFrom/configMapKeyRef/name + kind: CronJob + - path: spec/jobTemplate/spec/template/spec/initContainers/env/valueFrom/configMapKeyRef/name + kind: CronJob + - path: spec/jobTemplate/spec/template/spec/containers/envFrom/configMapRef/name + kind: CronJob + - path: spec/jobTemplate/spec/template/spec/initContainers/envFrom/configmapRef/name + kind: CronJob + +- kind: Secret + version: v1 + fieldSpecs: + - path: spec/volumes/secret/secretName + version: v1 + kind: Pod + - path: spec/containers/env/valueFrom/secretKeyRef/name + version: v1 + kind: Pod + - path: spec/initContainers/env/valueFrom/secretKeyRef/name + version: v1 + kind: Pod + - path: spec/containers/envFrom/secretRef/name + version: v1 + kind: Pod + - path: spec/initContainers/envFrom/secretRef/name + version: v1 + kind: Pod + - path: spec/imagePullSecrets/name + version: v1 + kind: Pod + - path: spec/template/spec/volumes/secret/secretName + kind: Deployment + - path: spec/template/spec/containers/env/valueFrom/secretKeyRef/name + kind: Deployment + - path: spec/template/spec/initContainers/env/valueFrom/secretKeyRef/name + kind: Deployment + - path: spec/template/spec/containers/envFrom/secretRef/name + kind: Deployment + - path: spec/template/spec/initContainers/envFrom/secretRef/name + kind: Deployment + - path: spec/template/spec/imagePullSecrets/name + kind: Deployment + - path: spec/template/spec/volumes/projected/sources/secret/name + kind: Deployment + - path: spec/template/spec/volumes/secret/secretName + kind: ReplicaSet + - path: spec/template/spec/containers/env/valueFrom/secretKeyRef/name + kind: ReplicaSet + - path: spec/template/spec/initContainers/env/valueFrom/secretKeyRef/name + kind: ReplicaSet + - path: spec/template/spec/containers/envFrom/secretRef/name + kind: ReplicaSet + - path: spec/template/spec/initContainers/envFrom/secretRef/name + kind: ReplicaSet + - path: spec/template/spec/imagePullSecrets/name + kind: ReplicaSet + - path: spec/template/spec/volumes/secret/secretName + kind: DaemonSet + - path: spec/template/spec/containers/env/valueFrom/secretKeyRef/name + kind: DaemonSet + - path: spec/template/spec/initContainers/env/valueFrom/secretKeyRef/name + kind: DaemonSet + - path: spec/template/spec/containers/envFrom/secretRef/name + kind: DaemonSet + - path: spec/template/spec/initContainers/envFrom/secretRef/name + kind: DaemonSet + - path: spec/template/spec/imagePullSecrets/name + kind: DaemonSet + - path: spec/template/spec/volumes/secret/secretName + kind: StatefulSet + - path: spec/template/spec/containers/env/valueFrom/secretKeyRef/name + kind: StatefulSet + - path: spec/template/spec/initContainers/env/valueFrom/secretKeyRef/name + kind: StatefulSet + - path: spec/template/spec/containers/envFrom/secretRef/name + kind: StatefulSet + - path: spec/template/spec/initContainers/envFrom/secretRef/name + kind: StatefulSet + - path: spec/template/spec/imagePullSecrets/name + kind: StatefulSet + - path: spec/template/spec/volumes/projected/sources/secret/name + kind: StatefulSet + - path: spec/template/spec/volumes/secret/secretName + kind: Job + - path: spec/template/spec/containers/env/valueFrom/secretKeyRef/name + kind: Job + - path: spec/template/spec/initContainers/env/valueFrom/secretKeyRef/name + kind: Job + - path: spec/template/spec/containers/envFrom/secretRef/name + kind: Job + - path: spec/template/spec/initContainers/envFrom/secretRef/name + kind: Job + - path: spec/template/spec/imagePullSecrets/name + kind: Job + - path: spec/jobTemplate/spec/template/spec/volumes/secret/secretName + kind: CronJob + - path: spec/jobTemplate/spec/template/spec/containers/env/valueFrom/secretKeyRef/name + kind: CronJob + - path: spec/jobTemplate/spec/template/spec/initContainers/env/valueFrom/secretKeyRef/name + kind: CronJob + - path: spec/jobTemplate/spec/template/spec/containers/envFrom/secretRef/name + kind: CronJob + - path: spec/jobTemplate/spec/template/spec/initContainers/envFrom/secretRef/name + kind: CronJob + - path: spec/jobTemplate/spec/template/spec/imagePullSecrets/name + kind: CronJob + - path: spec/tls/secretName + kind: Ingress + - path: metadata/annotations/ingress.kubernetes.io\/auth-secret + kind: Ingress + - path: metadata/annotations/nginx.ingress.kubernetes.io\/auth-secret + kind: Ingress + - path: imagePullSecrets/name + kind: ServiceAccount + - path: parameters/secretName + kind: StorageClass + - path: parameters/adminSecretName + kind: StorageClass + - path: parameters/userSecretName + kind: StorageClass + - path: parameters/secretRef + kind: StorageClass + - path: rules/resourceNames + kind: Role + - path: rules/resourceNames + kind: ClusterRole + +- kind: Service + version: v1 + fieldSpecs: + - path: spec/serviceName + kind: StatefulSet + group: apps + - path: spec/rules/http/paths/backend/serviceName + kind: Ingress + - path: spec/backend/serviceName + kind: Ingress + - path: spec/service/name + kind: APIService + group: apiregistration.k8s.io + +- kind: Role + group: rbac.authorization.k8s.io + fieldSpecs: + - path: roleRef/name + kind: RoleBinding + group: rbac.authorization.k8s.io + +- kind: ClusterRole + group: rbac.authorization.k8s.io + fieldSpecs: + - path: roleRef/name + kind: RoleBinding + group: rbac.authorization.k8s.io + - path: roleRef/name + kind: ClusterRoleBinding + group: rbac.authorization.k8s.io + +- kind: ServiceAccount + version: v1 + fieldSpecs: + - path: subjects/name + kind: RoleBinding + group: rbac.authorization.k8s.io + - path: subjects/name + kind: ClusterRoleBinding + group: rbac.authorization.k8s.io + - path: spec/serviceAccountName + kind: Pod + - path: spec/template/spec/serviceAccountName + kind: StatefulSet + - path: spec/template/spec/serviceAccountName + kind: Deployment + - path: spec/template/spec/serviceAccountName + kind: ReplicationController + - path: spec/jobTemplate/spec/template/spec/serviceAccountName + kind: CronJob + - path: spec/template/spec/serviceAccountName + kind: job + - path: spec/template/spec/serviceAccountName + kind: DaemonSet + +- kind: PersistentVolumeClaim + version: v1 + fieldSpecs: + - path: spec/volumes/persistentVolumeClaim/claimName + kind: Pod + - path: spec/template/spec/volumes/persistentVolumeClaim/claimName + kind: StatefulSet + - path: spec/template/spec/volumes/persistentVolumeClaim/claimName + kind: Deployment + - path: spec/template/spec/volumes/persistentVolumeClaim/claimName + kind: ReplicationController + - path: spec/jobTemplate/spec/template/spec/volumes/persistentVolumeClaim/claimName + kind: CronJob + - path: spec/template/spec/volumes/persistentVolumeClaim/claimName + kind: Job + - path: spec/template/spec/volumes/persistentVolumeClaim/claimName + kind: DaemonSet + +- kind: PersistentVolume + version: v1 + fieldSpecs: + - path: spec/volumeName + kind: PersistentVolumeClaim +` +) diff --git a/vendor/sigs.k8s.io/kustomize/pkg/transformers/config/defaultconfig/namespace.go b/vendor/sigs.k8s.io/kustomize/pkg/transformers/config/defaultconfig/namespace.go new file mode 100644 index 0000000000..431eb07699 --- /dev/null +++ b/vendor/sigs.k8s.io/kustomize/pkg/transformers/config/defaultconfig/namespace.go @@ -0,0 +1,25 @@ +/* +Copyright 2018 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package defaultconfig + +const ( + namespaceFieldSpecs = ` +namespace: +- path: metadata/namespace + create: true +` +) diff --git a/vendor/sigs.k8s.io/kustomize/pkg/transformers/config/defaultconfig/varreference.go b/vendor/sigs.k8s.io/kustomize/pkg/transformers/config/defaultconfig/varreference.go new file mode 100644 index 0000000000..71953f5768 --- /dev/null +++ b/vendor/sigs.k8s.io/kustomize/pkg/transformers/config/defaultconfig/varreference.go @@ -0,0 +1,162 @@ +/* +Copyright 2018 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package defaultconfig + +const ( + varReferenceFieldSpecs = ` +varReference: +- path: spec/template/spec/initContainers/command + kind: StatefulSet + +- path: spec/template/spec/containers/command + kind: StatefulSet + +- path: spec/template/spec/initContainers/command + kind: Deployment + +- path: spec/template/spec/containers/command + kind: Deployment + +- path: spec/template/spec/initContainers/command + kind: DaemonSet + +- path: spec/template/spec/containers/command + kind: DaemonSet + +- path: spec/template/spec/containers/command + kind: Job + +- path: spec/jobTemplate/spec/template/spec/containers/command + kind: CronJob + +- path: spec/template/spec/initContainers/args + kind: StatefulSet + +- path: spec/template/spec/containers/args + kind: StatefulSet + +- path: spec/template/spec/initContainers/args + kind: Deployment + +- path: spec/template/spec/containers/args + kind: Deployment + +- path: spec/template/spec/initContainers/args + kind: DaemonSet + +- path: spec/template/spec/containers/args + kind: DaemonSet + +- path: spec/template/spec/containers/args + kind: Job + +- path: spec/jobTemplate/spec/template/spec/containers/args + kind: CronJob + +- path: spec/template/spec/initContainers/env/value + kind: StatefulSet + +- path: spec/template/spec/containers/env/value + kind: StatefulSet + +- path: spec/template/spec/initContainers/env/value + kind: Deployment + +- path: spec/template/spec/containers/env/value + kind: Deployment + +- path: spec/template/spec/initContainers/env/value + kind: DaemonSet + +- path: spec/template/spec/containers/env/value + kind: DaemonSet + +- path: spec/template/spec/containers/env/value + kind: Job + +- path: spec/jobTemplate/spec/template/spec/containers/env/value + kind: CronJob + +- path: spec/containers/command + kind: Pod + +- path: spec/containers/args + kind: Pod + +- path: spec/containers/env/value + kind: Pod + +- path: spec/initContainers/command + kind: Pod + +- path: spec/initContainers/args + kind: Pod + +- path: spec/initContainers/env/value + kind: Pod + +- path: spec/rules/host + kind: Ingress + +- path: spec/tls/hosts + kind: Ingress + +- path: spec/template/spec/containers/volumeMounts/mountPath + kind: StatefulSet + +- path: spec/template/spec/initContainers/volumeMounts/mountPath + kind: StatefulSet + +- path: spec/containers/volumeMounts/mountPath + kind: Pod + +- path: spec/initContainers/volumeMounts/mountPath + kind: Pod + +- path: spec/template/spec/containers/volumeMounts/mountPath + kind: ReplicaSet + +- path: spec/template/spec/initContainers/volumeMounts/mountPath + kind: ReplicaSet + +- path: spec/template/spec/containers/volumeMounts/mountPath + kind: Job + +- path: spec/template/spec/initContainers/volumeMounts/mountPath + kind: Job + +- path: spec/template/spec/containers/volumeMounts/mountPath + kind: CronJob + +- path: spec/template/spec/initContainers/volumeMounts/mountPath + kind: CronJob + +- path: spec/template/spec/containers/volumeMounts/mountPath + kind: DaemonSet + +- path: spec/template/spec/initContainers/volumeMounts/mountPath + kind: DaemonSet + +- path: spec/template/spec/containers/volumeMounts/mountPath + kind: Deployment + +- path: spec/template/spec/initContainers/volumeMounts/mountPath + kind: Deployment + +- path: metadata/labels +` +) diff --git a/vendor/sigs.k8s.io/kustomize/pkg/transformers/config/factory.go b/vendor/sigs.k8s.io/kustomize/pkg/transformers/config/factory.go new file mode 100644 index 0000000000..d0ea0d1dd8 --- /dev/null +++ b/vendor/sigs.k8s.io/kustomize/pkg/transformers/config/factory.go @@ -0,0 +1,87 @@ +/* +Copyright 2018 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package config + +import ( + "log" + + "github.com/ghodss/yaml" + "sigs.k8s.io/kustomize/pkg/ifc" +) + +// Factory makes instances of TransformerConfig. +type Factory struct { + ldr ifc.Loader +} + +// MakeTransformerConfig returns a merger of custom config, +// if any, with default config. +func MakeTransformerConfig( + ldr ifc.Loader, paths []string) (*TransformerConfig, error) { + t1 := MakeDefaultConfig() + if len(paths) == 0 { + return t1, nil + } + t2, err := NewFactory(ldr).FromFiles(paths) + if err != nil { + return nil, err + } + return t1.Merge(t2) +} + +func NewFactory(l ifc.Loader) *Factory { + return &Factory{ldr: l} +} + +func (tf *Factory) loader() ifc.Loader { + if tf.ldr.(ifc.Loader) == nil { + log.Fatal("no loader") + } + return tf.ldr +} + +// FromFiles returns a TranformerConfig object from a list of files +func (tf *Factory) FromFiles( + paths []string) (*TransformerConfig, error) { + result := &TransformerConfig{} + for _, path := range paths { + data, err := tf.loader().Load(path) + if err != nil { + return nil, err + } + t, err := makeTransformerConfigFromBytes(data) + if err != nil { + return nil, err + } + result, err = result.Merge(t) + if err != nil { + return nil, err + } + } + return result, nil +} + +// makeTransformerConfigFromBytes returns a TransformerConfig object from bytes +func makeTransformerConfigFromBytes(data []byte) (*TransformerConfig, error) { + var t TransformerConfig + err := yaml.Unmarshal(data, &t) + if err != nil { + return nil, err + } + t.sortFields() + return &t, nil +} diff --git a/vendor/sigs.k8s.io/kustomize/pkg/transformers/config/factorycrd.go b/vendor/sigs.k8s.io/kustomize/pkg/transformers/config/factorycrd.go new file mode 100644 index 0000000000..66a24dc868 --- /dev/null +++ b/vendor/sigs.k8s.io/kustomize/pkg/transformers/config/factorycrd.go @@ -0,0 +1,201 @@ +/* +Copyright 2018 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package config + +import ( + "encoding/json" + "strings" + + "github.com/ghodss/yaml" + "github.com/go-openapi/spec" + "github.com/pkg/errors" + "k8s.io/kube-openapi/pkg/common" + "sigs.k8s.io/kustomize/pkg/gvk" + "sigs.k8s.io/kustomize/pkg/ifc" +) + +type myProperties map[string]spec.Schema +type nameToApiMap map[string]common.OpenAPIDefinition + +// LoadConfigFromCRDs parse CRD schemas from paths into a TransformerConfig +func LoadConfigFromCRDs( + ldr ifc.Loader, paths []string) (*TransformerConfig, error) { + tc := MakeEmptyConfig() + for _, path := range paths { + content, err := ldr.Load(path) + if err != nil { + return nil, err + } + m, err := makeNameToApiMap(content) + if err != nil { + return nil, errors.Wrapf(err, "unable to parse open API definition from '%s'", path) + } + otherTc, err := makeConfigFromApiMap(m) + if err != nil { + return nil, err + } + tc, err = tc.Merge(otherTc) + if err != nil { + return nil, err + } + } + return tc, nil +} + +func makeNameToApiMap(content []byte) (result nameToApiMap, err error) { + if content[0] == '{' { + err = json.Unmarshal(content, &result) + } else { + err = yaml.Unmarshal(content, &result) + } + return +} + +func makeConfigFromApiMap(m nameToApiMap) (*TransformerConfig, error) { + result := MakeEmptyConfig() + for name, api := range m { + if !looksLikeAk8sType(api.Schema.SchemaProps.Properties) { + continue + } + tc := MakeEmptyConfig() + err := loadCrdIntoConfig( + tc, makeGvkFromTypeName(name), m, name, []string{}) + if err != nil { + return result, err + } + result, err = result.Merge(tc) + if err != nil { + return result, err + } + } + return result, nil +} + +// TODO: Get Group and Version for CRD from the +// openAPI definition once +// "x-kubernetes-group-version-kind" is available in CRD +func makeGvkFromTypeName(n string) gvk.Gvk { + names := strings.Split(n, ".") + kind := names[len(names)-1] + return gvk.Gvk{Kind: kind} +} + +func looksLikeAk8sType(properties myProperties) bool { + _, ok := properties["kind"] + if !ok { + return false + } + _, ok = properties["apiVersion"] + if !ok { + return false + } + _, ok = properties["metadata"] + if !ok { + return false + } + return true +} + +const ( + // "x-kubernetes-annotation": "" + xAnnotation = "x-kubernetes-annotation" + + // "x-kubernetes-label-selector": "" + xLabelSelector = "x-kubernetes-label-selector" + + // "x-kubernetes-identity": "" + xIdentity = "x-kubernetes-identity" + + // "x-kubernetes-object-ref-api-version": + xVersion = "x-kubernetes-object-ref-api-version" + + // "x-kubernetes-object-ref-kind": + xKind = "x-kubernetes-object-ref-kind" + + // "x-kubernetes-object-ref-name-key": "name" + // default is "name" + xNameKey = "x-kubernetes-object-ref-name-key" +) + +// loadCrdIntoConfig loads a CRD spec into a TransformerConfig +func loadCrdIntoConfig( + theConfig *TransformerConfig, theGvk gvk.Gvk, theMap nameToApiMap, + typeName string, path []string) (err error) { + api, ok := theMap[typeName] + if !ok { + return nil + } + for propName, property := range api.Schema.SchemaProps.Properties { + _, annotate := property.Extensions.GetString(xAnnotation) + if annotate { + err = theConfig.AddAnnotationFieldSpec( + makeFs(theGvk, append(path, propName))) + if err != nil { + return + } + } + _, label := property.Extensions.GetString(xLabelSelector) + if label { + err = theConfig.AddLabelFieldSpec( + makeFs(theGvk, append(path, propName))) + if err != nil { + return + } + } + _, identity := property.Extensions.GetString(xIdentity) + if identity { + err = theConfig.AddPrefixFieldSpec( + makeFs(theGvk, append(path, propName))) + if err != nil { + return + } + } + version, ok := property.Extensions.GetString(xVersion) + if ok { + kind, ok := property.Extensions.GetString(xKind) + if ok { + nameKey, ok := property.Extensions.GetString(xNameKey) + if !ok { + nameKey = "name" + } + err = theConfig.AddNamereferenceFieldSpec( + NameBackReferences{ + Gvk: gvk.Gvk{Kind: kind, Version: version}, + FieldSpecs: []FieldSpec{ + makeFs(theGvk, append(path, propName, nameKey))}, + }) + if err != nil { + return + } + } + } + if property.Ref.GetURL() != nil { + loadCrdIntoConfig( + theConfig, theGvk, theMap, + property.Ref.String(), append(path, propName)) + } + } + return nil +} + +func makeFs(in gvk.Gvk, path []string) FieldSpec { + return FieldSpec{ + CreateIfNotPresent: false, + Gvk: in, + Path: strings.Join(path, "/"), + } +} diff --git a/vendor/sigs.k8s.io/kustomize/pkg/transformers/config/fieldspec.go b/vendor/sigs.k8s.io/kustomize/pkg/transformers/config/fieldspec.go new file mode 100644 index 0000000000..5b0f6ee33a --- /dev/null +++ b/vendor/sigs.k8s.io/kustomize/pkg/transformers/config/fieldspec.go @@ -0,0 +1,139 @@ +/* +Copyright 2018 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package config + +import ( + "fmt" + "strings" + + "sigs.k8s.io/kustomize/pkg/gvk" +) + +// FieldSpec completely specifies a kustomizable field in +// an unstructured representation of a k8s API object. +// It helps define the operands of transformations. +// +// For example, a directive to add a common label to objects +// will need to know that a 'Deployment' object (in API group +// 'apps', any version) can have labels at field path +// 'spec/template/metadata/labels', and further that it is OK +// (or not OK) to add that field path to the object if the +// field path doesn't exist already. +// +// This would look like +// { +// group: apps +// kind: Deployment +// path: spec/template/metadata/labels +// create: true +// } +type FieldSpec struct { + gvk.Gvk `json:",inline,omitempty" yaml:",inline,omitempty"` + Path string `json:"path,omitempty" yaml:"path,omitempty"` + CreateIfNotPresent bool `json:"create,omitempty" yaml:"create,omitempty"` +} + +const ( + escapedForwardSlash = "\\/" + tempSlashReplacement = "???" +) + +func (fs FieldSpec) String() string { + return fmt.Sprintf( + "%s:%v:%s", fs.Gvk.String(), fs.CreateIfNotPresent, fs.Path) +} + +// If true, the primary key is the same, but other fields might not be. +func (fs FieldSpec) effectivelyEquals(other FieldSpec) bool { + return fs.IsSelected(&other.Gvk) && fs.Path == other.Path +} + +// PathSlice converts the path string to a slice of strings, +// separated by a '/'. Forward slash can be contained in a +// fieldname. such as ingress.kubernetes.io/auth-secret in +// Ingress annotations. To deal with this special case, the +// path to this field should be formatted as +// +// metadata/annotations/ingress.kubernetes.io\/auth-secret +// +// Then PathSlice will return +// +// []string{ +// "metadata", +// "annotations", +// "ingress.auth-secretkubernetes.io/auth-secret" +// } +func (fs FieldSpec) PathSlice() []string { + if !strings.Contains(fs.Path, escapedForwardSlash) { + return strings.Split(fs.Path, "/") + } + s := strings.Replace(fs.Path, escapedForwardSlash, tempSlashReplacement, -1) + paths := strings.Split(s, "/") + var result []string + for _, path := range paths { + result = append(result, strings.Replace(path, tempSlashReplacement, "/", -1)) + } + return result +} + +type fsSlice []FieldSpec + +func (s fsSlice) Len() int { return len(s) } +func (s fsSlice) Swap(i, j int) { s[i], s[j] = s[j], s[i] } +func (s fsSlice) Less(i, j int) bool { + return s[i].Gvk.IsLessThan(s[j].Gvk) +} + +// mergeAll merges the argument into this, returning the result. +// Items already present are ignored. +// Items that conflict (primary key matches, but remain data differs) +// result in an error. +func (s fsSlice) mergeAll(incoming fsSlice) (result fsSlice, err error) { + result = s + for _, x := range incoming { + result, err = result.mergeOne(x) + if err != nil { + return nil, err + } + } + return result, nil +} + +// mergeOne merges the argument into this, returning the result. +// If the item's primary key is already present, and there are no +// conflicts, it is ignored (we don't want duplicates). +// If there is a conflict, the merge fails. +func (s fsSlice) mergeOne(x FieldSpec) (fsSlice, error) { + i := s.index(x) + if i > -1 { + // It's already there. + if s[i].CreateIfNotPresent != x.CreateIfNotPresent { + return nil, fmt.Errorf("conflicting fieldspecs") + } + return s, nil + } + return append(s, x), nil +} + +func (s fsSlice) index(fs FieldSpec) int { + for i, x := range s { + if x.effectivelyEquals(fs) { + return i + } + } + return -1 +} diff --git a/vendor/sigs.k8s.io/kustomize/pkg/transformers/config/namebackreferences.go b/vendor/sigs.k8s.io/kustomize/pkg/transformers/config/namebackreferences.go new file mode 100644 index 0000000000..172e4b3ca5 --- /dev/null +++ b/vendor/sigs.k8s.io/kustomize/pkg/transformers/config/namebackreferences.go @@ -0,0 +1,105 @@ +/* +Copyright 2018 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package config + +import ( + "strings" + + "sigs.k8s.io/kustomize/pkg/gvk" +) + +// NameBackReferences is an association between a gvk.GVK and a list +// of FieldSpec instances that could refer to it. +// +// It is used to handle name changes, and can be thought of as a +// a contact list. If you change your own contact info (name, +// phone number, etc.), you must tell your contacts or they won't +// know about the change. +// +// For example, ConfigMaps can be used by Pods and everything that +// contains a Pod; Deployment, Job, StatefulSet, etc. To change +// the name of a ConfigMap instance from 'alice' to 'bob', one +// must visit all objects that could refer to the ConfigMap, see if +// they mention 'alice', and if so, change the reference to 'bob'. +// +// The NameBackReferences instance to aid in this could look like +// { +// kind: ConfigMap +// version: v1 +// FieldSpecs: +// - kind: Pod +// version: v1 +// path: spec/volumes/configMap/name +// - kind: Deployment +// path: spec/template/spec/volumes/configMap/name +// - kind: Job +// path: spec/template/spec/volumes/configMap/name +// (etc.) +// } +type NameBackReferences struct { + gvk.Gvk `json:",inline,omitempty" yaml:",inline,omitempty"` + FieldSpecs fsSlice `json:"FieldSpecs,omitempty" yaml:"FieldSpecs,omitempty"` +} + +func (n NameBackReferences) String() string { + var r []string + for _, f := range n.FieldSpecs { + r = append(r, f.String()) + } + return n.Gvk.String() + ": (\n" + + strings.Join(r, "\n") + "\n)" +} + +type nbrSlice []NameBackReferences + +func (s nbrSlice) Len() int { return len(s) } +func (s nbrSlice) Swap(i, j int) { s[i], s[j] = s[j], s[i] } +func (s nbrSlice) Less(i, j int) bool { + return s[i].Gvk.IsLessThan(s[j].Gvk) +} + +func (s nbrSlice) mergeAll(o nbrSlice) (result nbrSlice, err error) { + result = s + for _, r := range o { + result, err = result.mergeOne(r) + if err != nil { + return nil, err + } + } + return result, nil +} + +func (s nbrSlice) mergeOne(other NameBackReferences) (nbrSlice, error) { + var result nbrSlice + var err error + found := false + for _, c := range s { + if c.Gvk.Equals(other.Gvk) { + c.FieldSpecs, err = c.FieldSpecs.mergeAll(other.FieldSpecs) + if err != nil { + return nil, err + } + found = true + } + result = append(result, c) + } + + if !found { + result = append(result, other) + } + return result, nil +} diff --git a/vendor/sigs.k8s.io/kustomize/pkg/transformers/config/transformerconfig.go b/vendor/sigs.k8s.io/kustomize/pkg/transformers/config/transformerconfig.go new file mode 100644 index 0000000000..556f0b814c --- /dev/null +++ b/vendor/sigs.k8s.io/kustomize/pkg/transformers/config/transformerconfig.go @@ -0,0 +1,134 @@ +/* +Copyright 2018 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Package config provides the functions to load default or user provided configurations +// for different transformers +package config + +import ( + "log" + "sort" + + "sigs.k8s.io/kustomize/pkg/transformers/config/defaultconfig" +) + +// TransformerConfig holds the data needed to perform transformations. +type TransformerConfig struct { + NamePrefix fsSlice `json:"namePrefix,omitempty" yaml:"namePrefix,omitempty"` + NameSuffix fsSlice `json:"nameSuffix,omitempty" yaml:"nameSuffix,omitempty"` + NameSpace fsSlice `json:"namespace,omitempty" yaml:"namespace,omitempty"` + CommonLabels fsSlice `json:"commonLabels,omitempty" yaml:"commonLabels,omitempty"` + CommonAnnotations fsSlice `json:"commonAnnotations,omitempty" yaml:"commonAnnotations,omitempty"` + NameReference nbrSlice `json:"nameReference,omitempty" yaml:"nameReference,omitempty"` + VarReference fsSlice `json:"varReference,omitempty" yaml:"varReference,omitempty"` +} + +// MakeEmptyConfig returns an empty TransformerConfig object +func MakeEmptyConfig() *TransformerConfig { + return &TransformerConfig{} +} + +// MakeDefaultConfig returns a default TransformerConfig. +func MakeDefaultConfig() *TransformerConfig { + c, err := makeTransformerConfigFromBytes( + defaultconfig.GetDefaultFieldSpecs()) + if err != nil { + log.Fatalf("Unable to make default transformconfig: %v", err) + } + return c +} + +// sortFields provides determinism in logging, tests, etc. +func (t *TransformerConfig) sortFields() { + sort.Sort(t.NamePrefix) + sort.Sort(t.NameSpace) + sort.Sort(t.CommonLabels) + sort.Sort(t.CommonAnnotations) + sort.Sort(t.NameReference) + sort.Sort(t.VarReference) +} + +// AddPrefixFieldSpec adds a FieldSpec to NamePrefix +func (t *TransformerConfig) AddPrefixFieldSpec(fs FieldSpec) (err error) { + t.NamePrefix, err = t.NamePrefix.mergeOne(fs) + return err +} + +// AddSuffixFieldSpec adds a FieldSpec to NameSuffix +func (t *TransformerConfig) AddSuffixFieldSpec(fs FieldSpec) (err error) { + t.NameSuffix, err = t.NameSuffix.mergeOne(fs) + return err +} + +// AddLabelFieldSpec adds a FieldSpec to CommonLabels +func (t *TransformerConfig) AddLabelFieldSpec(fs FieldSpec) (err error) { + t.CommonLabels, err = t.CommonLabels.mergeOne(fs) + return err +} + +// AddAnnotationFieldSpec adds a FieldSpec to CommonAnnotations +func (t *TransformerConfig) AddAnnotationFieldSpec(fs FieldSpec) (err error) { + t.CommonAnnotations, err = t.CommonAnnotations.mergeOne(fs) + return err +} + +// AddNamereferenceFieldSpec adds a NameBackReferences to NameReference +func (t *TransformerConfig) AddNamereferenceFieldSpec( + nbrs NameBackReferences) (err error) { + t.NameReference, err = t.NameReference.mergeOne(nbrs) + return err +} + +// Merge merges two TransformerConfigs objects into +// a new TransformerConfig object +func (t *TransformerConfig) Merge(input *TransformerConfig) ( + merged *TransformerConfig, err error) { + if input == nil { + return t, nil + } + merged = &TransformerConfig{} + merged.NamePrefix, err = t.NamePrefix.mergeAll(input.NamePrefix) + if err != nil { + return nil, err + } + merged.NameSuffix, err = t.NameSuffix.mergeAll(input.NameSuffix) + if err != nil { + return nil, err + } + merged.NameSpace, err = t.NameSpace.mergeAll(input.NameSpace) + if err != nil { + return nil, err + } + merged.CommonAnnotations, err = t.CommonAnnotations.mergeAll( + input.CommonAnnotations) + if err != nil { + return nil, err + } + merged.CommonLabels, err = t.CommonLabels.mergeAll(input.CommonLabels) + if err != nil { + return nil, err + } + merged.VarReference, err = t.VarReference.mergeAll(input.VarReference) + if err != nil { + return nil, err + } + merged.NameReference, err = t.NameReference.mergeAll(input.NameReference) + if err != nil { + return nil, err + } + merged.sortFields() + return merged, nil +} diff --git a/vendor/sigs.k8s.io/kustomize/pkg/transformers/image.go b/vendor/sigs.k8s.io/kustomize/pkg/transformers/image.go new file mode 100644 index 0000000000..2e07976943 --- /dev/null +++ b/vendor/sigs.k8s.io/kustomize/pkg/transformers/image.go @@ -0,0 +1,171 @@ +/* +Copyright 2019 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package transformers + +import ( + "fmt" + "regexp" + "strings" + + "sigs.k8s.io/kustomize/pkg/image" + "sigs.k8s.io/kustomize/pkg/resmap" +) + +// imageTransformer replace image names and tags +type imageTransformer struct { + images []image.Image +} + +var _ Transformer = &imageTransformer{} + +// NewImageTransformer constructs an imageTransformer. +func NewImageTransformer(slice []image.Image) (Transformer, error) { + return &imageTransformer{slice}, nil +} + +// Transform finds the matching images and replaces name, tag and/or digest +func (pt *imageTransformer) Transform(resources resmap.ResMap) error { + if len(pt.images) == 0 { + return nil + } + for _, res := range resources { + err := pt.findAndReplaceImage(res.Map()) + if err != nil { + return err + } + } + return nil +} + +/* + findAndReplaceImage replaces the image name and tags inside one object + It searches the object for container session + then loops though all images inside containers session, + finds matched ones and update the image name and tag name +*/ +func (pt *imageTransformer) findAndReplaceImage(obj map[string]interface{}) error { + paths := []string{"containers", "initContainers"} + found := false + for _, path := range paths { + _, found = obj[path] + if found { + err := pt.updateContainers(obj, path) + if err != nil { + return err + } + } + } + if !found { + return pt.findContainers(obj) + } + return nil +} + +func (pt *imageTransformer) updateContainers(obj map[string]interface{}, path string) error { + containers, ok := obj[path].([]interface{}) + if !ok { + return fmt.Errorf("containers path is not of type []interface{} but %T", obj[path]) + } + for i := range containers { + container := containers[i].(map[string]interface{}) + containerImage, found := container["image"] + if !found { + continue + } + + imageName := containerImage.(string) + for _, img := range pt.images { + if !isImageMatched(imageName, img.Name) { + continue + } + name, tag := split(imageName) + if img.NewName != "" { + name = img.NewName + } + if img.NewTag != "" { + tag = ":" + img.NewTag + } + if img.Digest != "" { + tag = "@" + img.Digest + } + container["image"] = name + tag + break + } + } + return nil +} + +func (pt *imageTransformer) findContainers(obj map[string]interface{}) error { + for key := range obj { + switch typedV := obj[key].(type) { + case map[string]interface{}: + err := pt.findAndReplaceImage(typedV) + if err != nil { + return err + } + case []interface{}: + for i := range typedV { + item := typedV[i] + typedItem, ok := item.(map[string]interface{}) + if ok { + err := pt.findAndReplaceImage(typedItem) + if err != nil { + return err + } + } + } + } + } + return nil +} + +func isImageMatched(s, t string) bool { + // Tag values are limited to [a-zA-Z0-9_.-]. + pattern, _ := regexp.Compile("^" + t + "(:[a-zA-Z0-9_.-]*)?$") + return pattern.MatchString(s) +} + +// split separates and returns the name and tag parts +// from the image string using either colon `:` or at `@` separators. +// Note that the returned tag keeps its separator. +func split(imageName string) (name string, tag string) { + // check if image name contains a domain + // if domain is present, ignore domain and check for `:` + ic := -1 + if slashIndex := strings.Index(imageName, "/"); slashIndex < 0 { + ic = strings.LastIndex(imageName, ":") + } else { + lastIc := strings.LastIndex(imageName[slashIndex:], ":") + // set ic only if `:` is present + if lastIc > 0 { + ic = slashIndex + lastIc + } + } + ia := strings.LastIndex(imageName, "@") + if ic < 0 && ia < 0 { + return imageName, "" + } + + i := ic + if ic < 0 { + i = ia + } + + name = imageName[:i] + tag = imageName[i:] + return +} diff --git a/vendor/sigs.k8s.io/kustomize/pkg/transformers/labelsandannotations.go b/vendor/sigs.k8s.io/kustomize/pkg/transformers/labelsandannotations.go new file mode 100644 index 0000000000..836abcaa48 --- /dev/null +++ b/vendor/sigs.k8s.io/kustomize/pkg/transformers/labelsandannotations.go @@ -0,0 +1,86 @@ +/* +Copyright 2018 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package transformers + +import ( + "errors" + "fmt" + + "sigs.k8s.io/kustomize/pkg/resmap" + "sigs.k8s.io/kustomize/pkg/transformers/config" +) + +// mapTransformer applies a string->string map to fieldSpecs. +type mapTransformer struct { + m map[string]string + fieldSpecs []config.FieldSpec +} + +var _ Transformer = &mapTransformer{} + +// NewLabelsMapTransformer constructs a mapTransformer. +func NewLabelsMapTransformer( + m map[string]string, fs []config.FieldSpec) (Transformer, error) { + return NewMapTransformer(fs, m) +} + +// NewAnnotationsMapTransformer construct a mapTransformer. +func NewAnnotationsMapTransformer( + m map[string]string, fs []config.FieldSpec) (Transformer, error) { + return NewMapTransformer(fs, m) +} + +// NewMapTransformer construct a mapTransformer. +func NewMapTransformer( + pc []config.FieldSpec, m map[string]string) (Transformer, error) { + if m == nil { + return NewNoOpTransformer(), nil + } + if pc == nil { + return nil, errors.New("fieldSpecs is not expected to be nil") + } + return &mapTransformer{fieldSpecs: pc, m: m}, nil +} + +// Transform apply each pair in the mapTransformer to the +// fields specified in mapTransformer. +func (o *mapTransformer) Transform(m resmap.ResMap) error { + for id := range m { + objMap := m[id].Map() + for _, path := range o.fieldSpecs { + if !id.Gvk().IsSelected(&path.Gvk) { + continue + } + err := mutateField(objMap, path.PathSlice(), path.CreateIfNotPresent, o.addMap) + if err != nil { + return err + } + } + } + return nil +} + +func (o *mapTransformer) addMap(in interface{}) (interface{}, error) { + m, ok := in.(map[string]interface{}) + if !ok { + return nil, fmt.Errorf("%#v is expected to be %T", in, m) + } + for k, v := range o.m { + m[k] = v + } + return m, nil +} diff --git a/vendor/sigs.k8s.io/kustomize/pkg/transformers/multitransformer.go b/vendor/sigs.k8s.io/kustomize/pkg/transformers/multitransformer.go new file mode 100644 index 0000000000..d5921d1a92 --- /dev/null +++ b/vendor/sigs.k8s.io/kustomize/pkg/transformers/multitransformer.go @@ -0,0 +1,95 @@ +/* +Copyright 2018 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package transformers + +import ( + "fmt" + "sigs.k8s.io/kustomize/pkg/resource" + + "sigs.k8s.io/kustomize/pkg/resmap" +) + +// multiTransformer contains a list of transformers. +type multiTransformer struct { + transformers []Transformer + checkConflictEnabled bool + rf *resource.Factory +} + +var _ Transformer = &multiTransformer{} + +// NewMultiTransformer constructs a multiTransformer. +func NewMultiTransformer(t []Transformer) Transformer { + r := &multiTransformer{ + transformers: make([]Transformer, len(t)), + checkConflictEnabled: false} + copy(r.transformers, t) + return r +} + +// NewMultiTransformerWithConflictCheck constructs a multiTransformer with checking of conflicts. +func NewMultiTransformerWithConflictCheck(t []Transformer) Transformer { + r := &multiTransformer{ + transformers: make([]Transformer, len(t)), + checkConflictEnabled: true} + copy(r.transformers, t) + return r +} + +// Transform prepends the name prefix. +func (o *multiTransformer) Transform(m resmap.ResMap) error { + if o.checkConflictEnabled { + return o.transformWithCheckConflict(m) + } + return o.transform(m) +} +func (o *multiTransformer) transform(m resmap.ResMap) error { + for _, t := range o.transformers { + err := t.Transform(m) + if err != nil { + return err + } + } + return nil +} + +// Of the len(o.transformers)! possible transformer orderings, compare to a reversed order. +// A spot check to perform when the transformations are supposed to be commutative. +// Fail if there's a difference in the result. +func (o *multiTransformer) transformWithCheckConflict(m resmap.ResMap) error { + mcopy := m.DeepCopy(o.rf) + err := o.transform(m) + if err != nil { + return err + } + o.reverseTransformers() + err = o.transform(mcopy) + if err != nil { + return err + } + err = m.ErrorIfNotEqual(mcopy) + if err != nil { + return fmt.Errorf("found conflict between different patches\n%v", err) + } + return nil +} + +func (o *multiTransformer) reverseTransformers() { + for i, j := 0, len(o.transformers)-1; i < j; i, j = i+1, j-1 { + o.transformers[i], o.transformers[j] = o.transformers[j], o.transformers[i] + } +} diff --git a/vendor/sigs.k8s.io/kustomize/pkg/transformers/mutatefield.go b/vendor/sigs.k8s.io/kustomize/pkg/transformers/mutatefield.go new file mode 100644 index 0000000000..eddfeee20b --- /dev/null +++ b/vendor/sigs.k8s.io/kustomize/pkg/transformers/mutatefield.go @@ -0,0 +1,81 @@ +/* +Copyright 2018 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package transformers + +import ( + "fmt" + "log" + "strings" +) + +type mutateFunc func(interface{}) (interface{}, error) + +func mutateField( + m map[string]interface{}, + pathToField []string, + createIfNotPresent bool, + fns ...mutateFunc) error { + if len(pathToField) == 0 { + return nil + } + + _, found := m[pathToField[0]] + if !found { + if !createIfNotPresent { + return nil + } + m[pathToField[0]] = map[string]interface{}{} + } + + if len(pathToField) == 1 { + var err error + for _, fn := range fns { + m[pathToField[0]], err = fn(m[pathToField[0]]) + if err != nil { + return err + } + } + return nil + } + + v := m[pathToField[0]] + newPathToField := pathToField[1:] + switch typedV := v.(type) { + case nil: + log.Printf( + "nil value at `%s` ignored in mutation attempt", + strings.Join(pathToField, ".")) + return nil + case map[string]interface{}: + return mutateField(typedV, newPathToField, createIfNotPresent, fns...) + case []interface{}: + for i := range typedV { + item := typedV[i] + typedItem, ok := item.(map[string]interface{}) + if !ok { + return fmt.Errorf("%#v is expected to be %T", item, typedItem) + } + err := mutateField(typedItem, newPathToField, createIfNotPresent, fns...) + if err != nil { + return err + } + } + return nil + default: + return fmt.Errorf("%#v is not expected to be a primitive type", typedV) + } +} diff --git a/vendor/sigs.k8s.io/kustomize/pkg/transformers/namereference.go b/vendor/sigs.k8s.io/kustomize/pkg/transformers/namereference.go new file mode 100644 index 0000000000..a4e8a7f8ed --- /dev/null +++ b/vendor/sigs.k8s.io/kustomize/pkg/transformers/namereference.go @@ -0,0 +1,144 @@ +/* +Copyright 2018 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package transformers + +import ( + "fmt" + "log" + + "sigs.k8s.io/kustomize/pkg/gvk" + "sigs.k8s.io/kustomize/pkg/resmap" + "sigs.k8s.io/kustomize/pkg/transformers/config" +) + +type nameReferenceTransformer struct { + backRefs []config.NameBackReferences +} + +var _ Transformer = &nameReferenceTransformer{} + +// NewNameReferenceTransformer constructs a nameReferenceTransformer +// with a given slice of NameBackReferences. +func NewNameReferenceTransformer(br []config.NameBackReferences) Transformer { + if br == nil { + log.Fatal("backrefs not expected to be nil") + } + return &nameReferenceTransformer{backRefs: br} +} + +// Transform updates name references in resource A that refer to resource B, +// given that B's name may have changed. +// +// For example, a HorizontalPodAutoscaler (HPA) necessarily refers to a +// Deployment (the thing that the HPA scales). The Deployment name might change +// (e.g. prefix added), and the reference in the HPA has to be fixed. +// +// In the outer loop below, we encounter an HPA. In scanning backrefs, we +// find that HPA refers to a Deployment. So we find all resources in the same +// namespace as the HPA (and with the same prefix and suffix), and look through +// them to find all the Deployments with a resId that has a Name matching the +// field in HPA. For each match, we overwrite the HPA name field with the value +// found in the Deployment's name field (the name in the raw object - the +// modified name - not the unmodified name in the resId). +// +// This assumes that the name stored in a ResId (the ResMap key) isn't modified +// by name transformers. Name transformers should only modify the name in the +// body of the resource object (the value in the ResMap). +func (o *nameReferenceTransformer) Transform(m resmap.ResMap) error { + // TODO: Too much looping. + // Even more hidden loops in FilterBy, + // updateNameReference and FindByGVKN. + for id := range m { + for _, backRef := range o.backRefs { + for _, fSpec := range backRef.FieldSpecs { + if id.Gvk().IsSelected(&fSpec.Gvk) { + err := mutateField( + m[id].Map(), fSpec.PathSlice(), + fSpec.CreateIfNotPresent, + o.updateNameReference( + backRef.Gvk, m.FilterBy(id))) + if err != nil { + return err + } + } + } + } + } + return nil +} + +func (o *nameReferenceTransformer) updateNameReference( + backRef gvk.Gvk, m resmap.ResMap) func(in interface{}) (interface{}, error) { + return func(in interface{}) (interface{}, error) { + switch in.(type) { + case string: + s, _ := in.(string) + for id, res := range m { + if id.Gvk().IsSelected(&backRef) && id.Name() == s { + matchedIds := m.GetMatchingIds(id.GvknEquals) + // If there's more than one match, there's no way + // to know which one to pick, so emit error. + if len(matchedIds) > 1 { + return nil, fmt.Errorf( + "Multiple matches for name %s:\n %v", id, matchedIds) + } + // Return transformed name of the object, + // complete with prefixes, hashes, etc. + return res.GetName(), nil + } + } + return in, nil + case []interface{}: + l, _ := in.([]interface{}) + var names []string + for _, item := range l { + name, ok := item.(string) + if !ok { + return nil, fmt.Errorf("%#v is expected to be %T", item, name) + } + names = append(names, name) + } + for id, res := range m { + indexes := indexOf(id.Name(), names) + if id.Gvk().IsSelected(&backRef) && len(indexes) > 0 { + matchedIds := m.GetMatchingIds(id.GvknEquals) + if len(matchedIds) > 1 { + return nil, fmt.Errorf( + "Multiple matches for name %s:\n %v", id, matchedIds) + } + for _, index := range indexes { + l[index] = res.GetName() + } + return l, nil + } + } + return in, nil + default: + return nil, fmt.Errorf("%#v is expected to be either a string or a []interface{}", in) + } + } +} + +func indexOf(s string, slice []string) []int { + var index []int + for i, item := range slice { + if item == s { + index = append(index, i) + } + } + return index +} diff --git a/vendor/sigs.k8s.io/kustomize/pkg/transformers/namespace.go b/vendor/sigs.k8s.io/kustomize/pkg/transformers/namespace.go new file mode 100644 index 0000000000..5f0c064820 --- /dev/null +++ b/vendor/sigs.k8s.io/kustomize/pkg/transformers/namespace.go @@ -0,0 +1,121 @@ +/* +Copyright 2018 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package transformers + +import ( + "sigs.k8s.io/kustomize/pkg/gvk" + "sigs.k8s.io/kustomize/pkg/resmap" + "sigs.k8s.io/kustomize/pkg/transformers/config" +) + +type namespaceTransformer struct { + namespace string + fieldSpecsToUse []config.FieldSpec + fieldSpecsToSkip []config.FieldSpec +} + +var _ Transformer = &namespaceTransformer{} + +// NewNamespaceTransformer construct a namespaceTransformer. +func NewNamespaceTransformer(ns string, cf []config.FieldSpec) Transformer { + if len(ns) == 0 { + return NewNoOpTransformer() + } + var skip []config.FieldSpec + for _, g := range gvk.ClusterLevelGvks() { + skip = append(skip, config.FieldSpec{Gvk: g}) + } + return &namespaceTransformer{ + namespace: ns, + fieldSpecsToUse: cf, + fieldSpecsToSkip: skip, + } +} + +// Transform adds the namespace. +func (o *namespaceTransformer) Transform(m resmap.ResMap) error { + mf := resmap.ResMap{} + + for id := range m { + found := false + for _, path := range o.fieldSpecsToSkip { + if id.Gvk().IsSelected(&path.Gvk) { + found = true + break + } + } + if !found { + mf[id] = m[id] + delete(m, id) + } + } + + for id := range mf { + objMap := mf[id].Map() + for _, path := range o.fieldSpecsToUse { + if !id.Gvk().IsSelected(&path.Gvk) { + continue + } + + err := mutateField(objMap, path.PathSlice(), path.CreateIfNotPresent, func(_ interface{}) (interface{}, error) { + return o.namespace, nil + }) + if err != nil { + return err + } + newid := id.CopyWithNewNamespace(o.namespace) + m[newid] = mf[id] + } + + } + o.updateClusterRoleBinding(m) + return nil +} + +func (o *namespaceTransformer) updateClusterRoleBinding(m resmap.ResMap) { + saMap := map[string]bool{} + for id := range m { + if id.Gvk().Equals(gvk.Gvk{Version: "v1", Kind: "ServiceAccount"}) { + saMap[id.Name()] = true + } + } + + for id := range m { + if id.Gvk().Kind != "ClusterRoleBinding" && id.Gvk().Kind != "RoleBinding" { + continue + } + objMap := m[id].Map() + subjects := objMap["subjects"].([]interface{}) + for i := range subjects { + subject := subjects[i].(map[string]interface{}) + kind, foundk := subject["kind"] + name, foundn := subject["name"] + if !foundk || !foundn || kind.(string) != "ServiceAccount" { + continue + } + // a ServiceAccount named “default” exists in every active namespace + if name.(string) == "default" || saMap[name.(string)] { + subject := subjects[i].(map[string]interface{}) + mutateField(subject, []string{"namespace"}, true, func(_ interface{}) (interface{}, error) { + return o.namespace, nil + }) + subjects[i] = subject + } + } + objMap["subjects"] = subjects + } +} diff --git a/vendor/sigs.k8s.io/kustomize/pkg/transformers/nooptransformer.go b/vendor/sigs.k8s.io/kustomize/pkg/transformers/nooptransformer.go new file mode 100644 index 0000000000..c07389b31d --- /dev/null +++ b/vendor/sigs.k8s.io/kustomize/pkg/transformers/nooptransformer.go @@ -0,0 +1,34 @@ +/* +Copyright 2018 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package transformers + +import "sigs.k8s.io/kustomize/pkg/resmap" + +// noOpTransformer contains a no-op transformer. +type noOpTransformer struct{} + +var _ Transformer = &noOpTransformer{} + +// NewNoOpTransformer constructs a noOpTransformer. +func NewNoOpTransformer() Transformer { + return &noOpTransformer{} +} + +// Transform does nothing. +func (o *noOpTransformer) Transform(_ resmap.ResMap) error { + return nil +} diff --git a/vendor/sigs.k8s.io/kustomize/pkg/transformers/prefixsuffixname.go b/vendor/sigs.k8s.io/kustomize/pkg/transformers/prefixsuffixname.go new file mode 100644 index 0000000000..c4ca85f53a --- /dev/null +++ b/vendor/sigs.k8s.io/kustomize/pkg/transformers/prefixsuffixname.go @@ -0,0 +1,109 @@ +/* +Copyright 2018 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package transformers + +import ( + "errors" + "fmt" + + "sigs.k8s.io/kustomize/pkg/gvk" + "sigs.k8s.io/kustomize/pkg/resmap" + "sigs.k8s.io/kustomize/pkg/transformers/config" +) + +// namePrefixSuffixTransformer contains the prefix, suffix, and the FieldSpecs +// for each field needing a name prefix and suffix. +type namePrefixSuffixTransformer struct { + prefix string + suffix string + fieldSpecsToUse []config.FieldSpec + fieldSpecsToSkip []config.FieldSpec +} + +var _ Transformer = &namePrefixSuffixTransformer{} + +var prefixSuffixFieldSpecsToSkip = []config.FieldSpec{ + { + Gvk: gvk.Gvk{Kind: "CustomResourceDefinition"}, + }, +} + +// NewNamePrefixSuffixTransformer makes a namePrefixSuffixTransformer. +func NewNamePrefixSuffixTransformer( + np, ns string, fieldSpecs []config.FieldSpec) (Transformer, error) { + if len(np) == 0 && len(ns) == 0 { + return NewNoOpTransformer(), nil + } + if fieldSpecs == nil { + return nil, errors.New("fieldSpecs is not expected to be nil") + } + return &namePrefixSuffixTransformer{ + prefix: np, + suffix: ns, + fieldSpecsToUse: fieldSpecs, + fieldSpecsToSkip: prefixSuffixFieldSpecsToSkip}, nil +} + +// Transform prepends the name prefix and appends the name suffix. +func (o *namePrefixSuffixTransformer) Transform(m resmap.ResMap) error { + // Fill map "mf" with entries subject to name modification, and + // delete these entries from "m", so that for now m retains only + // the entries whose names will not be modified. + mf := resmap.ResMap{} + for id := range m { + found := false + for _, path := range o.fieldSpecsToSkip { + if id.Gvk().IsSelected(&path.Gvk) { + found = true + break + } + } + if !found { + mf[id] = m[id] + delete(m, id) + } + } + + for id := range mf { + objMap := mf[id].Map() + for _, path := range o.fieldSpecsToUse { + if !id.Gvk().IsSelected(&path.Gvk) { + continue + } + err := mutateField( + objMap, + path.PathSlice(), + path.CreateIfNotPresent, + o.addPrefixSuffix) + if err != nil { + return err + } + newId := id.CopyWithNewPrefixSuffix(o.prefix, o.suffix) + m[newId] = mf[id] + } + } + return nil +} + +func (o *namePrefixSuffixTransformer) addPrefixSuffix( + in interface{}) (interface{}, error) { + s, ok := in.(string) + if !ok { + return nil, fmt.Errorf("%#v is expected to be %T", in, s) + } + return fmt.Sprintf("%s%s%s", o.prefix, s, o.suffix), nil +} diff --git a/vendor/sigs.k8s.io/kustomize/pkg/transformers/refvars.go b/vendor/sigs.k8s.io/kustomize/pkg/transformers/refvars.go new file mode 100644 index 0000000000..b31ec6e7a2 --- /dev/null +++ b/vendor/sigs.k8s.io/kustomize/pkg/transformers/refvars.go @@ -0,0 +1,94 @@ +package transformers + +import ( + "fmt" + "sigs.k8s.io/kustomize/pkg/expansion" + "sigs.k8s.io/kustomize/pkg/resmap" + "sigs.k8s.io/kustomize/pkg/transformers/config" +) + +type RefVarTransformer struct { + varMap map[string]string + replacementCounts map[string]int + fieldSpecs []config.FieldSpec + mappingFunc func(string) string +} + +// NewRefVarTransformer returns a new RefVarTransformer +// that replaces $(VAR) style variables with values. +// The fieldSpecs are the places to look for occurrences of $(VAR). +func NewRefVarTransformer( + varMap map[string]string, fs []config.FieldSpec) *RefVarTransformer { + return &RefVarTransformer{ + varMap: varMap, + fieldSpecs: fs, + } +} + +// replaceVars accepts as 'in' a string, or string array, which can have +// embedded instances of $VAR style variables, e.g. a container command string. +// The function returns the string with the variables expanded to their final +// values. +func (rv *RefVarTransformer) replaceVars(in interface{}) (interface{}, error) { + switch vt := in.(type) { + case []interface{}: + var xs []string + for _, a := range in.([]interface{}) { + xs = append(xs, expansion.Expand(a.(string), rv.mappingFunc)) + } + return xs, nil + case map[string]interface{}: + inMap := in.(map[string]interface{}) + xs := make(map[string]interface{}, len(inMap)) + for k, v := range inMap { + s, ok := v.(string) + if !ok { + return nil, fmt.Errorf("%#v is expected to be %T", v, s) + } + xs[k] = expansion.Expand(s, rv.mappingFunc) + } + return xs, nil + case interface{}: + s, ok := in.(string) + if !ok { + return nil, fmt.Errorf("%#v is expected to be %T", in, s) + } + return expansion.Expand(s, rv.mappingFunc), nil + case nil: + return nil, nil + default: + return "", fmt.Errorf("invalid type encountered %T", vt) + } +} + +// UnusedVars returns slice of Var names that were unused +// after a Transform run. +func (rv *RefVarTransformer) UnusedVars() []string { + var unused []string + for k := range rv.varMap { + _, ok := rv.replacementCounts[k] + if !ok { + unused = append(unused, k) + } + } + return unused +} + +// Transform replaces $(VAR) style variables with values. +func (rv *RefVarTransformer) Transform(m resmap.ResMap) error { + rv.replacementCounts = make(map[string]int) + rv.mappingFunc = expansion.MappingFuncFor( + rv.replacementCounts, rv.varMap) + for id, res := range m { + for _, fieldSpec := range rv.fieldSpecs { + if id.Gvk().IsSelected(&fieldSpec.Gvk) { + if err := mutateField( + res.Map(), fieldSpec.PathSlice(), + false, rv.replaceVars); err != nil { + return err + } + } + } + } + return nil +} diff --git a/vendor/sigs.k8s.io/kustomize/pkg/transformers/transformer.go b/vendor/sigs.k8s.io/kustomize/pkg/transformers/transformer.go new file mode 100644 index 0000000000..dc6f8807c3 --- /dev/null +++ b/vendor/sigs.k8s.io/kustomize/pkg/transformers/transformer.go @@ -0,0 +1,26 @@ +/* +Copyright 2018 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Package transformers has implementations of resmap.ResMap transformers. +package transformers + +import "sigs.k8s.io/kustomize/pkg/resmap" + +// A Transformer modifies an instance of resmap.ResMap. +type Transformer interface { + // Transform modifies data in the argument, e.g. adding labels to resources that can be labelled. + Transform(m resmap.ResMap) error +} diff --git a/vendor/sigs.k8s.io/kustomize/pkg/types/genargs.go b/vendor/sigs.k8s.io/kustomize/pkg/types/genargs.go new file mode 100644 index 0000000000..bef093d350 --- /dev/null +++ b/vendor/sigs.k8s.io/kustomize/pkg/types/genargs.go @@ -0,0 +1,64 @@ +/* +Copyright 2019 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package types + +import ( + "strconv" + "strings" +) + +// GenArgs contains both generator args and options +type GenArgs struct { + args *GeneratorArgs + opts *GeneratorOptions +} + +// NewGenArgs returns a new object of GenArgs +func NewGenArgs(args *GeneratorArgs, opts *GeneratorOptions) *GenArgs { + return &GenArgs{ + args: args, + opts: opts, + } +} + +func (g *GenArgs) String() string { + if g == nil { + return "{nilGenArgs}" + } + return "{" + + strings.Join([]string{ + "nsfx:" + strconv.FormatBool(g.NeedsHashSuffix()), + "beh:" + g.Behavior().String()}, + ",") + + "}" +} + +// NeedHashSuffix returns true if the hash suffix is needed. +// It is needed when the two conditions are both met +// 1) GenArgs is not nil +// 2) DisableNameSuffixHash in GeneratorOptions is not set to true +func (g *GenArgs) NeedsHashSuffix() bool { + return g.args != nil && (g.opts == nil || g.opts.DisableNameSuffixHash == false) +} + +// Behavior returns Behavior field of GeneratorArgs +func (g *GenArgs) Behavior() GenerationBehavior { + if g.args == nil { + return BehaviorUnspecified + } + return NewGenerationBehavior(g.args.Behavior) +} diff --git a/vendor/sigs.k8s.io/kustomize/pkg/types/generationbehavior.go b/vendor/sigs.k8s.io/kustomize/pkg/types/generationbehavior.go new file mode 100644 index 0000000000..67ba8a0b56 --- /dev/null +++ b/vendor/sigs.k8s.io/kustomize/pkg/types/generationbehavior.go @@ -0,0 +1,59 @@ +/* +Copyright 2018 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package types + +// GenerationBehavior specifies generation behavior of configmaps, secrets and maybe other resources. +type GenerationBehavior int + +const ( + // BehaviorUnspecified is an Unspecified behavior; typically treated as a Create. + BehaviorUnspecified GenerationBehavior = iota + // BehaviorCreate makes a new resource. + BehaviorCreate + // BehaviorReplace replaces a resource. + BehaviorReplace + // BehaviorMerge attempts to merge a new resource with an existing resource. + BehaviorMerge +) + +// String converts a GenerationBehavior to a string. +func (b GenerationBehavior) String() string { + switch b { + case BehaviorReplace: + return "replace" + case BehaviorMerge: + return "merge" + case BehaviorCreate: + return "create" + default: + return "unspecified" + } +} + +// NewGenerationBehavior converts a string to a GenerationBehavior. +func NewGenerationBehavior(s string) GenerationBehavior { + switch s { + case "replace": + return BehaviorReplace + case "merge": + return BehaviorMerge + case "create": + return BehaviorCreate + default: + return BehaviorUnspecified + } +} diff --git a/vendor/sigs.k8s.io/kustomize/pkg/types/kustomization.go b/vendor/sigs.k8s.io/kustomize/pkg/types/kustomization.go new file mode 100644 index 0000000000..12d09820f0 --- /dev/null +++ b/vendor/sigs.k8s.io/kustomize/pkg/types/kustomization.go @@ -0,0 +1,250 @@ +/* +Copyright 2017 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Package types holds struct definitions that should find a better home. +package types + +import ( + "regexp" + + "sigs.k8s.io/kustomize/pkg/image" + "sigs.k8s.io/kustomize/pkg/patch" +) + +const ( + KustomizationVersion = "kustomize.config.k8s.io/v1beta1" + KustomizationKind = "Kustomization" +) + +// TypeMeta copies apimachinery/pkg/apis/meta/v1.TypeMeta +type TypeMeta struct { + // Kind copies apimachinery/pkg/apis/meta/v1.Typemeta.Kind + Kind string `json:"kind,omitempty" protobuf:"bytes,1,opt,name=kind"` + + // APIVersion copies apimachinery/pkg/apis/meta/v1.Typemeta.APIVersion + APIVersion string `json:"apiVersion,omitempty" protobuf:"bytes,2,opt,name=apiVersion"` +} + +// Kustomization holds the information needed to generate customized k8s api resources. +type Kustomization struct { + TypeMeta `json:",inline" yaml:",inline"` + + // + // Operators - what kustomize can do. + // + + // NamePrefix will prefix the names of all resources mentioned in the kustomization + // file including generated configmaps and secrets. + NamePrefix string `json:"namePrefix,omitempty" yaml:"namePrefix,omitempty"` + + // NameSuffix will suffix the names of all resources mentioned in the kustomization + // file including generated configmaps and secrets. + NameSuffix string `json:"nameSuffix,omitempty" yaml:"nameSuffix,omitempty"` + + // Namespace to add to all objects. + Namespace string `json:"namespace,omitempty" yaml:"namespace,omitempty"` + + // CommonLabels to add to all objects and selectors. + CommonLabels map[string]string `json:"commonLabels,omitempty" yaml:"commonLabels,omitempty"` + + // CommonAnnotations to add to all objects. + CommonAnnotations map[string]string `json:"commonAnnotations,omitempty" yaml:"commonAnnotations,omitempty"` + + // PatchesStrategicMerge specifies the relative path to a file + // containing a strategic merge patch. Format documented at + // https://github.com/kubernetes/community/blob/master/contributors/devel/strategic-merge-patch.md + // URLs and globs are not supported. + PatchesStrategicMerge []patch.StrategicMerge `json:"patchesStrategicMerge,omitempty" yaml:"patchesStrategicMerge,omitempty"` + + // JSONPatches is a list of JSONPatch for applying JSON patch. + // Format documented at https://tools.ietf.org/html/rfc6902 + // and http://jsonpatch.com + PatchesJson6902 []patch.Json6902 `json:"patchesJson6902,omitempty" yaml:"patchesJson6902,omitempty"` + + // Images is a list of (image name, new name, new tag or digest) + // for changing image names, tags or digests. This can also be achieved with a + // patch, but this operator is simpler to specify. + Images []image.Image `json:"images,omitempty" yaml:"images,omitempty"` + + // Vars allow things modified by kustomize to be injected into a + // container specification. A var is a name (e.g. FOO) associated + // with a field in a specific resource instance. The field must + // contain a value of type string, and defaults to the name field + // of the instance. Any appearance of "$(FOO)" in the container + // spec will be replaced at kustomize build time, after the final + // value of the specified field has been determined. + Vars []Var `json:"vars,omitempty" yaml:"vars,omitempty"` + + // + // Operands - what kustomize operates on. + // + + // Resources specifies relative paths to files holding YAML representations + // of kubernetes API objects. URLs and globs not supported. + Resources []string `json:"resources,omitempty" yaml:"resources,omitempty"` + + // Crds specifies relative paths to Custom Resource Definition files. + // This allows custom resources to be recognized as operands, making + // it possible to add them to the Resources list. + // CRDs themselves are not modified. + Crds []string `json:"crds,omitempty" yaml:"crds,omitempty"` + + // Bases are relative paths or github repository URLs specifying a + // directory containing a kustomization.yaml file. + // URL format: https://github.com/hashicorp/go-getter#url-format + Bases []string `json:"bases,omitempty" yaml:"bases,omitempty"` + + // + // Generators (operators that create operands) + // + + // ConfigMapGenerator is a list of configmaps to generate from + // local data (one configMap per list item). + // The resulting resource is a normal operand, subject to + // name prefixing, patching, etc. By default, the name of + // the map will have a suffix hash generated from its contents. + ConfigMapGenerator []ConfigMapArgs `json:"configMapGenerator,omitempty" yaml:"configMapGenerator,omitempty"` + + // SecretGenerator is a list of secrets to generate from + // local data (one secret per list item). + // The resulting resource is a normal operand, subject to + // name prefixing, patching, etc. By default, the name of + // the map will have a suffix hash generated from its contents. + SecretGenerator []SecretArgs `json:"secretGenerator,omitempty" yaml:"secretGenerator,omitempty"` + + // GeneratorOptions modify behavior of all ConfigMap and Secret generators. + GeneratorOptions *GeneratorOptions `json:"generatorOptions,omitempty" yaml:"generatorOptions,omitempty"` + + // Configurations is a list of transformer configuration files + Configurations []string `json:"configurations,omitempty" yaml:"configurations,omitempty"` +} + +// DealWithMissingFields fills the missing fields +func (k *Kustomization) DealWithMissingFields() []string { + var msgs []string + if k.APIVersion == "" { + k.APIVersion = KustomizationVersion + msgs = append(msgs, "Fixed the missing field by adding apiVersion: "+KustomizationVersion) + } + if k.Kind == "" { + k.Kind = KustomizationKind + msgs = append(msgs, "Fixed the missing field by adding kind: "+KustomizationKind) + } + return msgs +} + +func (k *Kustomization) EnforceFields() []string { + var errs []string + if k.APIVersion != "" && k.APIVersion != KustomizationVersion { + errs = append(errs, "apiVersion should be "+KustomizationVersion) + } + if k.Kind != "" && k.Kind != KustomizationKind { + errs = append(errs, "kind should be "+KustomizationKind) + } + return errs +} + +// DealWithDeprecatedFields should be called immediately after +// loading from storage. +func DealWithDeprecatedFields(data []byte) []byte { + deprecateFieldsMap := map[string]string{ + "patches:": "patchesStrategicMerge:", + "imageTags:": "images:", + } + for oldname, newname := range deprecateFieldsMap { + pattern := regexp.MustCompile(oldname) + data = pattern.ReplaceAll(data, []byte(newname)) + } + return data +} + +// GeneratorArgs contains arguments common to generators. +type GeneratorArgs struct { + // Namespace for the configmap, optional + Namespace string `json:"namespace,omitempty" yaml:"namespace,omitempty"` + + // Name - actually the partial name - of the generated resource. + // The full name ends up being something like + // NamePrefix + this.Name + hash(content of generated resource). + Name string `json:"name,omitempty" yaml:"name,omitempty"` + + // Behavior of generated resource, must be one of: + // 'create': create a new one + // 'replace': replace the existing one + // 'merge': merge with the existing one + Behavior string `json:"behavior,omitempty" yaml:"behavior,omitempty"` + + // DataSources for the generator. + DataSources `json:",inline,omitempty" yaml:",inline,omitempty"` +} + +// ConfigMapArgs contains the metadata of how to generate a configmap. +type ConfigMapArgs struct { + // GeneratorArgs for the configmap. + GeneratorArgs `json:",inline,omitempty" yaml:",inline,omitempty"` +} + +// SecretArgs contains the metadata of how to generate a secret. +type SecretArgs struct { + // GeneratorArgs for the secret. + GeneratorArgs `json:",inline,omitempty" yaml:",inline,omitempty"` + + // Type of the secret. + // + // This is the same field as the secret type field in v1/Secret: + // It can be "Opaque" (default), or "kubernetes.io/tls". + // + // If type is "kubernetes.io/tls", then "literals" or "files" must have exactly two + // keys: "tls.key" and "tls.crt" + Type string `json:"type,omitempty" yaml:"type,omitempty"` +} + +// DataSources contains some generic sources for configmaps. +type DataSources struct { + // LiteralSources is a list of literal sources. + // Each literal source should be a key and literal value, + // e.g. `somekey=somevalue` + // It will be similar to kubectl create configmap|secret --from-literal + LiteralSources []string `json:"literals,omitempty" yaml:"literals,omitempty"` + + // FileSources is a list of file sources. + // Each file source can be specified using its file path, in which case file + // basename will be used as configmap key, or optionally with a key and file + // path, in which case the given key will be used. + // Specifying a directory will iterate each named file in the directory + // whose basename is a valid configmap key. + // It will be similar to kubectl create configmap|secret --from-file + FileSources []string `json:"files,omitempty" yaml:"files,omitempty"` + + // EnvSource format should be a path to a file to read lines of key=val + // pairs to create a configmap. + // i.e. a Docker .env file or a .ini file. + EnvSource string `json:"env,omitempty" yaml:"env,omitempty"` +} + +// GeneratorOptions modify behavior of all ConfigMap and Secret generators. +type GeneratorOptions struct { + // Labels to add to all generated resources. + Labels map[string]string `json:"labels,omitempty" yaml:"labels,omitempty"` + + // Annotations to add to all generated resources. + Annotations map[string]string `json:"annotations,omitempty" yaml:"annotations,omitempty"` + + // DisableNameSuffixHash if true disables the default behavior of adding a + // suffix to the names of generated resources that is a hash of the + // resource contents. + DisableNameSuffixHash bool `json:"disableNameSuffixHash,omitempty" yaml:"disableNameSuffixHash,omitempty"` +} diff --git a/vendor/sigs.k8s.io/kustomize/pkg/types/var.go b/vendor/sigs.k8s.io/kustomize/pkg/types/var.go new file mode 100644 index 0000000000..6a48032a08 --- /dev/null +++ b/vendor/sigs.k8s.io/kustomize/pkg/types/var.go @@ -0,0 +1,145 @@ +/* +Copyright 2017 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package types + +import ( + "fmt" + "sort" + "strings" + + "sigs.k8s.io/kustomize/pkg/gvk" +) + +const defaultFieldPath = "metadata.name" + +// Var represents a variable whose value will be sourced +// from a field in a Kubernetes object. +type Var struct { + // Value of identifier name e.g. FOO used in container args, annotations + // Appears in pod template as $(FOO) + Name string `json:"name" yaml:"name"` + + // ObjRef must refer to a Kubernetes resource under the + // purview of this kustomization. ObjRef should use the + // raw name of the object (the name specified in its YAML, + // before addition of a namePrefix and a nameSuffix). + ObjRef Target `json:"objref" yaml:"objref"` + + // FieldRef refers to the field of the object referred to by + // ObjRef whose value will be extracted for use in + // replacing $(FOO). + // If unspecified, this defaults to fieldPath: $defaultFieldPath + FieldRef FieldSelector `json:"fieldref,omitempty" yaml:"fieldref,omitempty"` +} + +// Target refers to a kubernetes object by Group, Version, Kind and Name +// gvk.Gvk contains Group, Version and Kind +// APIVersion is added to keep the backward compatibility of using ObjectReference +// for Var.ObjRef +type Target struct { + APIVersion string `json:"apiVersion,omitempty" yaml:"apiVersion,omitempty"` + gvk.Gvk `json:",inline,omitempty" yaml:",inline,omitempty"` + Name string `json:"name" yaml:"name"` +} + +// FieldSelector contains the fieldPath to an object field. +// This struct is added to keep the backward compatibility of using ObjectFieldSelector +// for Var.FieldRef +type FieldSelector struct { + FieldPath string `json:"fieldPath,omitempty" yaml:"fieldPath,omitempty"` +} + +// defaulting sets reference to field used by default. +func (v *Var) defaulting() { + if v.FieldRef.FieldPath == "" { + v.FieldRef.FieldPath = defaultFieldPath + } +} + +// VarSet is a slice of Vars where no var.Name is repeated. +type VarSet struct { + set []Var +} + +// Set returns a copy of the var set. +func (vs *VarSet) Set() []Var { + s := make([]Var, len(vs.set)) + copy(s, vs.set) + return s +} + +// MergeSet absorbs other vars with error on name collision. +func (vs *VarSet) MergeSet(incoming *VarSet) error { + return vs.MergeSlice(incoming.set) +} + +// MergeSlice absorbs other vars with error on name collision. +// Empty fields in incoming vars are defaulted. +func (vs *VarSet) MergeSlice(incoming []Var) error { + for _, v := range incoming { + if vs.Contains(v) { + return fmt.Errorf( + "var %s already encountered", v.Name) + } + v.defaulting() + vs.insert(v) + } + return nil +} + +func (vs *VarSet) insert(v Var) { + index := sort.Search( + len(vs.set), + func(i int) bool { return vs.set[i].Name > v.Name }) + // make room + vs.set = append(vs.set, Var{}) + // shift right at index. + // copy will not increase size of destination. + copy(vs.set[index+1:], vs.set[index:]) + vs.set[index] = v +} + +// Contains is true if the set has the other var. +func (vs *VarSet) Contains(other Var) bool { + return vs.Get(other.Name) != nil +} + +// Get returns the var with the given name, else nil. +func (vs *VarSet) Get(name string) *Var { + for _, v := range vs.set { + if v.Name == name { + return &v + } + } + return nil +} + +// GVK returns the Gvk object in Target +func (t *Target) GVK() gvk.Gvk { + if t.APIVersion == "" { + return t.Gvk + } + versions := strings.Split(t.APIVersion, "/") + if len(versions) == 2 { + t.Group = versions[0] + t.Version = versions[1] + } + if len(versions) == 1 { + t.Version = versions[0] + } + return t.Gvk +} From a8b9211416776ea0458281377a778da884ba8959 Mon Sep 17 00:00:00 2001 From: junotx Date: Tue, 16 Mar 2021 10:21:26 +0800 Subject: [PATCH 3/3] updating dashboard dependency version and resolve conflicts Signed-off-by: junotx --- go.mod | 2 +- go.sum | 4 +- .../resources/v1alpha3/resource/resource.go | 5 +- vendor/github.com/fatih/camelcase/LICENSE.md | 20 - vendor/github.com/fatih/camelcase/README.md | 58 - .../github.com/fatih/camelcase/camelcase.go | 90 - vendor/github.com/golang/mock/AUTHORS | 12 - vendor/github.com/golang/mock/CONTRIBUTORS | 37 - vendor/github.com/golang/mock/gomock/call.go | 427 ----- .../github.com/golang/mock/gomock/callset.go | 108 -- .../golang/mock/gomock/controller.go | 264 --- .../github.com/golang/mock/gomock/matchers.go | 255 --- .../golang/protobuf/descriptor/descriptor.go | 185 -- .../golang/protobuf/jsonpb/decode.go | 514 ------ .../golang/protobuf/jsonpb/encode.go | 554 ------ .../github.com/golang/protobuf/jsonpb/json.go | 69 - .../golang/protobuf/ptypes/empty/empty.pb.go | 62 - .../protobuf/ptypes/struct/struct.pb.go | 78 - .../go-grpc-middleware/.gitignore | 204 -- .../go-grpc-middleware/.travis.yml | 15 - .../go-grpc-middleware/CHANGELOG.md | 31 - .../go-grpc-middleware/CONTRIBUTING.md | 20 - .../go-grpc-middleware/README.md | 85 - .../go-grpc-middleware/chain.go | 120 -- .../grpc-ecosystem/go-grpc-middleware/doc.go | 69 - .../grpc-ecosystem/go-grpc-middleware/go.mod | 17 - .../grpc-ecosystem/go-grpc-middleware/go.sum | 78 - .../go-grpc-middleware/makefile | 17 - .../go-grpc-middleware/recovery/doc.go | 15 - .../recovery/interceptors.go | 53 - .../go-grpc-middleware/recovery/options.go | 43 - .../go-grpc-middleware/slack.png | Bin 5088 -> 0 bytes .../go-grpc-middleware/validator/doc.go | 45 - .../go-grpc-middleware/validator/validator.go | 58 - .../go-grpc-middleware/wrappers.go | 30 - .../grpc-ecosystem/grpc-gateway/LICENSE.txt | 27 - .../grpc-gateway/internal/BUILD.bazel | 23 - .../grpc-gateway/internal/errors.pb.go | 189 -- .../grpc-gateway/internal/errors.proto | 26 - .../protoc-gen-swagger/options/BUILD.bazel | 39 - .../options/annotations.pb.go | 105 -- .../options/annotations.proto | 44 - .../options/openapiv2.pb.go | 1638 ----------------- .../options/openapiv2.proto | 380 ---- .../grpc-gateway/runtime/BUILD.bazel | 86 - .../grpc-gateway/runtime/context.go | 236 --- .../grpc-gateway/runtime/convert.go | 318 ---- .../grpc-gateway/runtime/doc.go | 5 - .../grpc-gateway/runtime/errors.go | 169 -- .../grpc-gateway/runtime/fieldmask.go | 82 - .../grpc-gateway/runtime/handler.go | 212 --- .../runtime/marshal_httpbodyproto.go | 43 - .../grpc-gateway/runtime/marshal_json.go | 45 - .../grpc-gateway/runtime/marshal_jsonpb.go | 262 --- .../grpc-gateway/runtime/marshal_proto.go | 62 - .../grpc-gateway/runtime/marshaler.go | 55 - .../runtime/marshaler_registry.go | 91 - .../grpc-gateway/runtime/mux.go | 300 --- .../grpc-gateway/runtime/pattern.go | 262 --- .../grpc-gateway/runtime/proto2_convert.go | 80 - .../grpc-gateway/runtime/proto_errors.go | 106 -- .../grpc-gateway/runtime/query.go | 406 ---- .../grpc-gateway/utilities/BUILD.bazel | 21 - .../grpc-gateway/utilities/doc.go | 2 - .../grpc-gateway/utilities/pattern.go | 22 - .../grpc-gateway/utilities/readerfactory.go | 20 - .../grpc-gateway/utilities/trie.go | 177 -- .../github.com/koding/multiconfig/.travis.yml | 4 - .../github.com/koding/multiconfig/README.md | 92 - vendor/github.com/koding/multiconfig/doc.go | 5 - vendor/github.com/koding/multiconfig/env.go | 129 -- vendor/github.com/koding/multiconfig/file.go | 139 -- vendor/github.com/koding/multiconfig/flag.go | 207 --- .../koding/multiconfig/multiconfig.go | 227 --- .../koding/multiconfig/multiloader.go | 27 - .../koding/multiconfig/multivalidator.go | 28 - vendor/github.com/koding/multiconfig/tag.go | 60 - .../koding/multiconfig/validator.go | 73 - .../x/crypto/curve25519/const_amd64.h | 8 - .../x/crypto/curve25519/const_amd64.s | 20 - .../x/crypto/curve25519/cswap_amd64.s | 65 - vendor/golang.org/x/crypto/curve25519/doc.go | 23 - .../x/crypto/curve25519/freeze_amd64.s | 73 - .../x/crypto/curve25519/mul_amd64.s | 169 -- .../x/crypto/curve25519/square_amd64.s | 132 -- .../crypto/internal/chacha20/chacha_arm64.go | 31 - .../internal/chacha20/chacha_generic.go | 264 --- .../crypto/internal/chacha20/chacha_s390x.go | 29 - .../golang.org/x/crypto/poly1305/sum_arm.go | 22 - vendor/golang.org/x/crypto/poly1305/sum_arm.s | 427 ----- .../golang.org/x/crypto/poly1305/sum_noasm.go | 16 - .../x/crypto/poly1305/sum_vmsl_s390x.s | 909 --------- .../api/annotations/annotations.pb.go | 57 - .../googleapis/api/annotations/client.pb.go | 81 - .../api/annotations/field_behavior.pb.go | 124 -- .../googleapis/api/annotations/http.pb.go | 635 ------- .../googleapis/api/annotations/resource.pb.go | 443 ----- .../googleapis/api/httpbody/httpbody.pb.go | 148 -- .../protobuf/field_mask/field_mask.pb.go | 284 --- .../grpc/reflection/README.md | 18 - .../grpc_reflection_v1alpha/reflection.pb.go | 750 -------- .../grpc_reflection_v1alpha/reflection.proto | 136 -- .../grpc/reflection/serverreflection.go | 454 ----- .../protobuf/encoding/protojson/decode.go | 683 ------- .../protobuf/encoding/protojson/doc.go | 11 - .../protobuf/encoding/protojson/encode.go | 394 ---- .../encoding/protojson/well_known_types.go | 903 --------- .../protobuf/internal/detectknown/detect.go | 47 - .../protobuf/internal/encoding/json/decode.go | 340 ---- .../internal/encoding/json/decode_number.go | 254 --- .../internal/encoding/json/decode_string.go | 91 - .../internal/encoding/json/decode_token.go | 193 -- .../protobuf/internal/encoding/json/encode.go | 276 --- .../protobuf/reflect/protodesc/desc.go | 275 --- .../protobuf/reflect/protodesc/desc_init.go | 248 --- .../reflect/protodesc/desc_resolve.go | 286 --- .../reflect/protodesc/desc_validate.go | 370 ---- .../protobuf/reflect/protodesc/proto.go | 242 --- .../protobuf/types/known/emptypb/empty.pb.go | 168 -- .../types/known/structpb/struct.pb.go | 505 ----- .../api/v1alpha1/dashboard_types.go | 55 +- .../api/v1alpha1/zz_generated.deepcopy.go | 19 +- vendor/modules.txt | 2 +- .../pkg/cache/informertest/fake_cache.go | 141 -- .../pkg/client/fake/client.go | 409 ---- .../controller-runtime/pkg/client/fake/doc.go | 33 - .../pkg/controller/controllertest/doc.go | 20 - .../pkg/controller/controllertest/testing.go | 62 - .../unconventionallisttypecrd.go | 60 - .../pkg/controller/controllertest/util.go | 108 -- .../pkg/internal/objectutil/filter.go | 42 - 131 files changed, 75 insertions(+), 21648 deletions(-) delete mode 100644 vendor/github.com/fatih/camelcase/LICENSE.md delete mode 100644 vendor/github.com/fatih/camelcase/README.md delete mode 100644 vendor/github.com/fatih/camelcase/camelcase.go delete mode 100644 vendor/github.com/golang/mock/AUTHORS delete mode 100644 vendor/github.com/golang/mock/CONTRIBUTORS delete mode 100644 vendor/github.com/golang/mock/gomock/call.go delete mode 100644 vendor/github.com/golang/mock/gomock/callset.go delete mode 100644 vendor/github.com/golang/mock/gomock/controller.go delete mode 100644 vendor/github.com/golang/mock/gomock/matchers.go delete mode 100644 vendor/github.com/golang/protobuf/descriptor/descriptor.go delete mode 100644 vendor/github.com/golang/protobuf/jsonpb/decode.go delete mode 100644 vendor/github.com/golang/protobuf/jsonpb/encode.go delete mode 100644 vendor/github.com/golang/protobuf/jsonpb/json.go delete mode 100644 vendor/github.com/golang/protobuf/ptypes/empty/empty.pb.go delete mode 100644 vendor/github.com/golang/protobuf/ptypes/struct/struct.pb.go delete mode 100644 vendor/github.com/grpc-ecosystem/go-grpc-middleware/.gitignore delete mode 100644 vendor/github.com/grpc-ecosystem/go-grpc-middleware/.travis.yml delete mode 100644 vendor/github.com/grpc-ecosystem/go-grpc-middleware/CHANGELOG.md delete mode 100644 vendor/github.com/grpc-ecosystem/go-grpc-middleware/CONTRIBUTING.md delete mode 100644 vendor/github.com/grpc-ecosystem/go-grpc-middleware/README.md delete mode 100644 vendor/github.com/grpc-ecosystem/go-grpc-middleware/chain.go delete mode 100644 vendor/github.com/grpc-ecosystem/go-grpc-middleware/doc.go delete mode 100644 vendor/github.com/grpc-ecosystem/go-grpc-middleware/go.mod delete mode 100644 vendor/github.com/grpc-ecosystem/go-grpc-middleware/go.sum delete mode 100644 vendor/github.com/grpc-ecosystem/go-grpc-middleware/makefile delete mode 100644 vendor/github.com/grpc-ecosystem/go-grpc-middleware/recovery/doc.go delete mode 100644 vendor/github.com/grpc-ecosystem/go-grpc-middleware/recovery/interceptors.go delete mode 100644 vendor/github.com/grpc-ecosystem/go-grpc-middleware/recovery/options.go delete mode 100644 vendor/github.com/grpc-ecosystem/go-grpc-middleware/slack.png delete mode 100644 vendor/github.com/grpc-ecosystem/go-grpc-middleware/validator/doc.go delete mode 100644 vendor/github.com/grpc-ecosystem/go-grpc-middleware/validator/validator.go delete mode 100644 vendor/github.com/grpc-ecosystem/go-grpc-middleware/wrappers.go delete mode 100644 vendor/github.com/grpc-ecosystem/grpc-gateway/LICENSE.txt delete mode 100644 vendor/github.com/grpc-ecosystem/grpc-gateway/internal/BUILD.bazel delete mode 100644 vendor/github.com/grpc-ecosystem/grpc-gateway/internal/errors.pb.go delete mode 100644 vendor/github.com/grpc-ecosystem/grpc-gateway/internal/errors.proto delete mode 100644 vendor/github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger/options/BUILD.bazel delete mode 100644 vendor/github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger/options/annotations.pb.go delete mode 100644 vendor/github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger/options/annotations.proto delete mode 100644 vendor/github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger/options/openapiv2.pb.go delete mode 100644 vendor/github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger/options/openapiv2.proto delete mode 100644 vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/BUILD.bazel delete mode 100644 vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/context.go delete mode 100644 vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/convert.go delete mode 100644 vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/doc.go delete mode 100644 vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/errors.go delete mode 100644 vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/fieldmask.go delete mode 100644 vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/handler.go delete mode 100644 vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/marshal_httpbodyproto.go delete mode 100644 vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/marshal_json.go delete mode 100644 vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/marshal_jsonpb.go delete mode 100644 vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/marshal_proto.go delete mode 100644 vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/marshaler.go delete mode 100644 vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/marshaler_registry.go delete mode 100644 vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/mux.go delete mode 100644 vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/pattern.go delete mode 100644 vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/proto2_convert.go delete mode 100644 vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/proto_errors.go delete mode 100644 vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/query.go delete mode 100644 vendor/github.com/grpc-ecosystem/grpc-gateway/utilities/BUILD.bazel delete mode 100644 vendor/github.com/grpc-ecosystem/grpc-gateway/utilities/doc.go delete mode 100644 vendor/github.com/grpc-ecosystem/grpc-gateway/utilities/pattern.go delete mode 100644 vendor/github.com/grpc-ecosystem/grpc-gateway/utilities/readerfactory.go delete mode 100644 vendor/github.com/grpc-ecosystem/grpc-gateway/utilities/trie.go delete mode 100644 vendor/github.com/koding/multiconfig/.travis.yml delete mode 100644 vendor/github.com/koding/multiconfig/README.md delete mode 100644 vendor/github.com/koding/multiconfig/doc.go delete mode 100644 vendor/github.com/koding/multiconfig/env.go delete mode 100644 vendor/github.com/koding/multiconfig/file.go delete mode 100644 vendor/github.com/koding/multiconfig/flag.go delete mode 100644 vendor/github.com/koding/multiconfig/multiconfig.go delete mode 100644 vendor/github.com/koding/multiconfig/multiloader.go delete mode 100644 vendor/github.com/koding/multiconfig/multivalidator.go delete mode 100644 vendor/github.com/koding/multiconfig/tag.go delete mode 100644 vendor/github.com/koding/multiconfig/validator.go delete mode 100644 vendor/golang.org/x/crypto/curve25519/const_amd64.h delete mode 100644 vendor/golang.org/x/crypto/curve25519/const_amd64.s delete mode 100644 vendor/golang.org/x/crypto/curve25519/cswap_amd64.s delete mode 100644 vendor/golang.org/x/crypto/curve25519/doc.go delete mode 100644 vendor/golang.org/x/crypto/curve25519/freeze_amd64.s delete mode 100644 vendor/golang.org/x/crypto/curve25519/mul_amd64.s delete mode 100644 vendor/golang.org/x/crypto/curve25519/square_amd64.s delete mode 100644 vendor/golang.org/x/crypto/internal/chacha20/chacha_arm64.go delete mode 100644 vendor/golang.org/x/crypto/internal/chacha20/chacha_generic.go delete mode 100644 vendor/golang.org/x/crypto/internal/chacha20/chacha_s390x.go delete mode 100644 vendor/golang.org/x/crypto/poly1305/sum_arm.go delete mode 100644 vendor/golang.org/x/crypto/poly1305/sum_arm.s delete mode 100644 vendor/golang.org/x/crypto/poly1305/sum_noasm.go delete mode 100644 vendor/golang.org/x/crypto/poly1305/sum_vmsl_s390x.s delete mode 100644 vendor/google.golang.org/genproto/googleapis/api/annotations/annotations.pb.go delete mode 100644 vendor/google.golang.org/genproto/googleapis/api/annotations/client.pb.go delete mode 100644 vendor/google.golang.org/genproto/googleapis/api/annotations/field_behavior.pb.go delete mode 100644 vendor/google.golang.org/genproto/googleapis/api/annotations/http.pb.go delete mode 100644 vendor/google.golang.org/genproto/googleapis/api/annotations/resource.pb.go delete mode 100644 vendor/google.golang.org/genproto/googleapis/api/httpbody/httpbody.pb.go delete mode 100644 vendor/google.golang.org/genproto/protobuf/field_mask/field_mask.pb.go delete mode 100644 vendor/google.golang.org/grpc/reflection/README.md delete mode 100644 vendor/google.golang.org/grpc/reflection/grpc_reflection_v1alpha/reflection.pb.go delete mode 100644 vendor/google.golang.org/grpc/reflection/grpc_reflection_v1alpha/reflection.proto delete mode 100644 vendor/google.golang.org/grpc/reflection/serverreflection.go delete mode 100644 vendor/google.golang.org/protobuf/encoding/protojson/decode.go delete mode 100644 vendor/google.golang.org/protobuf/encoding/protojson/doc.go delete mode 100644 vendor/google.golang.org/protobuf/encoding/protojson/encode.go delete mode 100644 vendor/google.golang.org/protobuf/encoding/protojson/well_known_types.go delete mode 100644 vendor/google.golang.org/protobuf/internal/detectknown/detect.go delete mode 100644 vendor/google.golang.org/protobuf/internal/encoding/json/decode.go delete mode 100644 vendor/google.golang.org/protobuf/internal/encoding/json/decode_number.go delete mode 100644 vendor/google.golang.org/protobuf/internal/encoding/json/decode_string.go delete mode 100644 vendor/google.golang.org/protobuf/internal/encoding/json/decode_token.go delete mode 100644 vendor/google.golang.org/protobuf/internal/encoding/json/encode.go delete mode 100644 vendor/google.golang.org/protobuf/reflect/protodesc/desc.go delete mode 100644 vendor/google.golang.org/protobuf/reflect/protodesc/desc_init.go delete mode 100644 vendor/google.golang.org/protobuf/reflect/protodesc/desc_resolve.go delete mode 100644 vendor/google.golang.org/protobuf/reflect/protodesc/desc_validate.go delete mode 100644 vendor/google.golang.org/protobuf/reflect/protodesc/proto.go delete mode 100644 vendor/google.golang.org/protobuf/types/known/emptypb/empty.pb.go delete mode 100644 vendor/google.golang.org/protobuf/types/known/structpb/struct.pb.go delete mode 100644 vendor/sigs.k8s.io/controller-runtime/pkg/cache/informertest/fake_cache.go delete mode 100644 vendor/sigs.k8s.io/controller-runtime/pkg/client/fake/client.go delete mode 100644 vendor/sigs.k8s.io/controller-runtime/pkg/client/fake/doc.go delete mode 100644 vendor/sigs.k8s.io/controller-runtime/pkg/controller/controllertest/doc.go delete mode 100644 vendor/sigs.k8s.io/controller-runtime/pkg/controller/controllertest/testing.go delete mode 100644 vendor/sigs.k8s.io/controller-runtime/pkg/controller/controllertest/unconventionallisttypecrd.go delete mode 100644 vendor/sigs.k8s.io/controller-runtime/pkg/controller/controllertest/util.go delete mode 100644 vendor/sigs.k8s.io/controller-runtime/pkg/internal/objectutil/filter.go diff --git a/go.mod b/go.mod index 9e48e27909..356b09bac6 100644 --- a/go.mod +++ b/go.mod @@ -104,7 +104,7 @@ require ( k8s.io/metrics v0.18.6 k8s.io/utils v0.0.0-20200603063816-c1c6865ac451 kubesphere.io/client-go v0.0.0 - kubesphere.io/monitoring-dashboard v0.1.1 + kubesphere.io/monitoring-dashboard v0.1.2 sigs.k8s.io/application v0.8.4-0.20201016185654-c8e2959e57a0 sigs.k8s.io/controller-runtime v0.6.4 sigs.k8s.io/controller-tools v0.4.0 diff --git a/go.sum b/go.sum index 75626a1b6c..b4ec412a80 100644 --- a/go.sum +++ b/go.sum @@ -857,8 +857,8 @@ k8s.io/metrics v0.18.6 h1:IRMCn0KKNhbOSnxNZ+MhooRi8c67iIMjpGkKpm6oqOM= k8s.io/metrics v0.18.6/go.mod h1:iAwGeabusQNO3duHDM7BBExTUB8L+iq8PM7N9EtQw6g= k8s.io/utils v0.0.0-20200603063816-c1c6865ac451 h1:v8ud2Up6QK1lNOKFgiIVrZdMg7MpmSnvtrOieolJKoE= k8s.io/utils v0.0.0-20200603063816-c1c6865ac451/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= -kubesphere.io/monitoring-dashboard v0.1.1 h1:bqH9B3Yw4yRO0GjyUzx0NPvwdjq/K59eNBuRoLCviic= -kubesphere.io/monitoring-dashboard v0.1.1/go.mod h1:4mRqyjT3w8RRXaRJR3wjwfsufXRl6IrkF2tXJXuC6LQ= +kubesphere.io/monitoring-dashboard v0.1.2 h1:KRAQbjpconHYwOYBmbpKWzE6k2DHpqQAPyZnxB5FKso= +kubesphere.io/monitoring-dashboard v0.1.2/go.mod h1:VSP7rZv0dG4lq6aVaFB1khdjma4SPtWNAOCzgdnYvXQ= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= rsc.io/letsencrypt v0.0.1/go.mod h1:buyQKZ6IXrRnB7TdkHP0RyEybLx18HHyOSoTyoOLqNY= rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= diff --git a/pkg/models/resources/v1alpha3/resource/resource.go b/pkg/models/resources/v1alpha3/resource/resource.go index 1f34ceaa1e..0a4f7a685e 100644 --- a/pkg/models/resources/v1alpha3/resource/resource.go +++ b/pkg/models/resources/v1alpha3/resource/resource.go @@ -80,6 +80,7 @@ import ( "kubesphere.io/kubesphere/pkg/models/resources/v1alpha3/workspacerole" "kubesphere.io/kubesphere/pkg/models/resources/v1alpha3/workspacerolebinding" "kubesphere.io/kubesphere/pkg/models/resources/v1alpha3/workspacetemplate" + monitoringdashboardv1alpha1 "kubesphere.io/monitoring-dashboard/api/v1alpha1" "sigs.k8s.io/controller-runtime/pkg/cache" ) @@ -132,7 +133,7 @@ func NewResourceGetter(factory informers.InformerFactory, cache cache.Cache) *Re clusterResourceGetters[clusterv1alpha1.SchemeGroupVersion.WithResource(clusterv1alpha1.ResourcesPluralCluster)] = cluster.New(factory.KubeSphereSharedInformerFactory()) clusterResourceGetters[notificationv2beta1.SchemeGroupVersion.WithResource(notificationv2beta1.ResourcesPluralConfig)] = notification.NewNotificationConfigGetter(factory.KubeSphereSharedInformerFactory()) clusterResourceGetters[notificationv2beta1.SchemeGroupVersion.WithResource(notificationv2beta1.ResourcesPluralReceiver)] = notification.NewNotificationReceiverGetter(factory.KubeSphereSharedInformerFactory()) - clusterResourceGetters[schema.GroupVersionResource{Group: "monitoring.kubesphere.io", Version: "v1alpha1", Resource: "clusterdashboards"}] = clusterdashboard.New(cache) + clusterResourceGetters[monitoringdashboardv1alpha1.GroupVersion.WithResource("clusterdashboards")] = clusterdashboard.New(cache) // federated resources namespacedResourceGetters[typesv1beta1.SchemeGroupVersion.WithResource(typesv1beta1.ResourcePluralFederatedNamespace)] = federatednamespace.New(factory.KubeSphereSharedInformerFactory()) @@ -144,7 +145,7 @@ func NewResourceGetter(factory informers.InformerFactory, cache cache.Cache) *Re namespacedResourceGetters[typesv1beta1.SchemeGroupVersion.WithResource(typesv1beta1.ResourcePluralFederatedPersistentVolumeClaim)] = federatedpersistentvolumeclaim.New(factory.KubeSphereSharedInformerFactory()) namespacedResourceGetters[typesv1beta1.SchemeGroupVersion.WithResource(typesv1beta1.ResourcePluralFederatedStatefulSet)] = federatedstatefulset.New(factory.KubeSphereSharedInformerFactory()) namespacedResourceGetters[typesv1beta1.SchemeGroupVersion.WithResource(typesv1beta1.ResourcePluralFederatedIngress)] = federatedingress.New(factory.KubeSphereSharedInformerFactory()) - namespacedResourceGetters[schema.GroupVersionResource{Group: "monitoring.kubesphere.io", Version: "v1alpha1", Resource: "dashboards"}] = dashboard.New(cache) + namespacedResourceGetters[monitoringdashboardv1alpha1.GroupVersion.WithResource("dashboards")] = dashboard.New(cache) return &ResourceGetter{ namespacedResourceGetters: namespacedResourceGetters, diff --git a/vendor/github.com/fatih/camelcase/LICENSE.md b/vendor/github.com/fatih/camelcase/LICENSE.md deleted file mode 100644 index aa4a536caf..0000000000 --- a/vendor/github.com/fatih/camelcase/LICENSE.md +++ /dev/null @@ -1,20 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2015 Fatih Arslan - -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/fatih/camelcase/README.md b/vendor/github.com/fatih/camelcase/README.md deleted file mode 100644 index 105a6ae33d..0000000000 --- a/vendor/github.com/fatih/camelcase/README.md +++ /dev/null @@ -1,58 +0,0 @@ -# CamelCase [![GoDoc](http://img.shields.io/badge/go-documentation-blue.svg?style=flat-square)](http://godoc.org/github.com/fatih/camelcase) [![Build Status](http://img.shields.io/travis/fatih/camelcase.svg?style=flat-square)](https://travis-ci.org/fatih/camelcase) - -CamelCase is a Golang (Go) package to split the words of a camelcase type -string into a slice of words. It can be used to convert a camelcase word (lower -or upper case) into any type of word. - -## Splitting rules: - -1. If string is not valid UTF-8, return it without splitting as - single item array. -2. Assign all unicode characters into one of 4 sets: lower case - letters, upper case letters, numbers, and all other characters. -3. Iterate through characters of string, introducing splits - between adjacent characters that belong to different sets. -4. Iterate through array of split strings, and if a given string - is upper case: - * if subsequent string is lower case: - * move last character of upper case string to beginning of - lower case string - -## Install - -```bash -go get github.com/fatih/camelcase -``` - -## Usage and examples - -```go -splitted := camelcase.Split("GolangPackage") - -fmt.Println(splitted[0], splitted[1]) // prints: "Golang", "Package" -``` - -Both lower camel case and upper camel case are supported. For more info please -check: [http://en.wikipedia.org/wiki/CamelCase](http://en.wikipedia.org/wiki/CamelCase) - -Below are some example cases: - -``` -"" => [] -"lowercase" => ["lowercase"] -"Class" => ["Class"] -"MyClass" => ["My", "Class"] -"MyC" => ["My", "C"] -"HTML" => ["HTML"] -"PDFLoader" => ["PDF", "Loader"] -"AString" => ["A", "String"] -"SimpleXMLParser" => ["Simple", "XML", "Parser"] -"vimRPCPlugin" => ["vim", "RPC", "Plugin"] -"GL11Version" => ["GL", "11", "Version"] -"99Bottles" => ["99", "Bottles"] -"May5" => ["May", "5"] -"BFG9000" => ["BFG", "9000"] -"BöseÜberraschung" => ["Böse", "Überraschung"] -"Two spaces" => ["Two", " ", "spaces"] -"BadUTF8\xe2\xe2\xa1" => ["BadUTF8\xe2\xe2\xa1"] -``` diff --git a/vendor/github.com/fatih/camelcase/camelcase.go b/vendor/github.com/fatih/camelcase/camelcase.go deleted file mode 100644 index 02160c9a43..0000000000 --- a/vendor/github.com/fatih/camelcase/camelcase.go +++ /dev/null @@ -1,90 +0,0 @@ -// Package camelcase is a micro package to split the words of a camelcase type -// string into a slice of words. -package camelcase - -import ( - "unicode" - "unicode/utf8" -) - -// Split splits the camelcase word and returns a list of words. It also -// supports digits. Both lower camel case and upper camel case are supported. -// For more info please check: http://en.wikipedia.org/wiki/CamelCase -// -// Examples -// -// "" => [""] -// "lowercase" => ["lowercase"] -// "Class" => ["Class"] -// "MyClass" => ["My", "Class"] -// "MyC" => ["My", "C"] -// "HTML" => ["HTML"] -// "PDFLoader" => ["PDF", "Loader"] -// "AString" => ["A", "String"] -// "SimpleXMLParser" => ["Simple", "XML", "Parser"] -// "vimRPCPlugin" => ["vim", "RPC", "Plugin"] -// "GL11Version" => ["GL", "11", "Version"] -// "99Bottles" => ["99", "Bottles"] -// "May5" => ["May", "5"] -// "BFG9000" => ["BFG", "9000"] -// "BöseÜberraschung" => ["Böse", "Überraschung"] -// "Two spaces" => ["Two", " ", "spaces"] -// "BadUTF8\xe2\xe2\xa1" => ["BadUTF8\xe2\xe2\xa1"] -// -// Splitting rules -// -// 1) If string is not valid UTF-8, return it without splitting as -// single item array. -// 2) Assign all unicode characters into one of 4 sets: lower case -// letters, upper case letters, numbers, and all other characters. -// 3) Iterate through characters of string, introducing splits -// between adjacent characters that belong to different sets. -// 4) Iterate through array of split strings, and if a given string -// is upper case: -// if subsequent string is lower case: -// move last character of upper case string to beginning of -// lower case string -func Split(src string) (entries []string) { - // don't split invalid utf8 - if !utf8.ValidString(src) { - return []string{src} - } - entries = []string{} - var runes [][]rune - lastClass := 0 - class := 0 - // split into fields based on class of unicode character - for _, r := range src { - switch true { - case unicode.IsLower(r): - class = 1 - case unicode.IsUpper(r): - class = 2 - case unicode.IsDigit(r): - class = 3 - default: - class = 4 - } - if class == lastClass { - runes[len(runes)-1] = append(runes[len(runes)-1], r) - } else { - runes = append(runes, []rune{r}) - } - lastClass = class - } - // handle upper case -> lower case sequences, e.g. - // "PDFL", "oader" -> "PDF", "Loader" - for i := 0; i < len(runes)-1; i++ { - if unicode.IsUpper(runes[i][0]) && unicode.IsLower(runes[i+1][0]) { - runes[i+1] = append([]rune{runes[i][len(runes[i])-1]}, runes[i+1]...) - runes[i] = runes[i][:len(runes[i])-1] - } - } - // construct []string from results - for _, s := range runes { - if len(s) > 0 { - entries = append(entries, string(s)) - } - } - return -} diff --git a/vendor/github.com/golang/mock/AUTHORS b/vendor/github.com/golang/mock/AUTHORS deleted file mode 100644 index 660b8ccc8a..0000000000 --- a/vendor/github.com/golang/mock/AUTHORS +++ /dev/null @@ -1,12 +0,0 @@ -# This is the official list of GoMock authors for copyright purposes. -# This file is distinct from the CONTRIBUTORS files. -# See the latter for an explanation. - -# Names should be added to this file as -# Name or Organization -# The email address is not required for organizations. - -# Please keep the list sorted. - -Alex Reece -Google Inc. diff --git a/vendor/github.com/golang/mock/CONTRIBUTORS b/vendor/github.com/golang/mock/CONTRIBUTORS deleted file mode 100644 index def849cab1..0000000000 --- a/vendor/github.com/golang/mock/CONTRIBUTORS +++ /dev/null @@ -1,37 +0,0 @@ -# This is the official list of people who can contribute (and typically -# have contributed) code to the gomock repository. -# The AUTHORS file lists the copyright holders; this file -# lists people. For example, Google employees are listed here -# but not in AUTHORS, because Google holds the copyright. -# -# The submission process automatically checks to make sure -# that people submitting code are listed in this file (by email address). -# -# Names should be added to this file only after verifying that -# the individual or the individual's organization has agreed to -# the appropriate Contributor License Agreement, found here: -# -# http://code.google.com/legal/individual-cla-v1.0.html -# http://code.google.com/legal/corporate-cla-v1.0.html -# -# The agreement for individuals can be filled out on the web. -# -# When adding J Random Contributor's name to this file, -# either J's name or J's organization's name should be -# added to the AUTHORS file, depending on whether the -# individual or corporate CLA was used. - -# Names should be added to this file like so: -# Name -# -# An entry with two email addresses specifies that the -# first address should be used in the submit logs and -# that the second address should be recognized as the -# same person when interacting with Rietveld. - -# Please keep the list sorted. - -Aaron Jacobs -Alex Reece -David Symonds -Ryan Barrett diff --git a/vendor/github.com/golang/mock/gomock/call.go b/vendor/github.com/golang/mock/gomock/call.go deleted file mode 100644 index 7345f6540f..0000000000 --- a/vendor/github.com/golang/mock/gomock/call.go +++ /dev/null @@ -1,427 +0,0 @@ -// Copyright 2010 Google Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package gomock - -import ( - "fmt" - "reflect" - "strconv" - "strings" -) - -// Call represents an expected call to a mock. -type Call struct { - t TestHelper // for triggering test failures on invalid call setup - - receiver interface{} // the receiver of the method call - method string // the name of the method - methodType reflect.Type // the type of the method - args []Matcher // the args - origin string // file and line number of call setup - - preReqs []*Call // prerequisite calls - - // Expectations - minCalls, maxCalls int - - numCalls int // actual number made - - // actions are called when this Call is called. Each action gets the args and - // can set the return values by returning a non-nil slice. Actions run in the - // order they are created. - actions []func([]interface{}) []interface{} -} - -// newCall creates a *Call. It requires the method type in order to support -// unexported methods. -func newCall(t TestHelper, receiver interface{}, method string, methodType reflect.Type, args ...interface{}) *Call { - t.Helper() - - // TODO: check arity, types. - margs := make([]Matcher, len(args)) - for i, arg := range args { - if m, ok := arg.(Matcher); ok { - margs[i] = m - } else if arg == nil { - // Handle nil specially so that passing a nil interface value - // will match the typed nils of concrete args. - margs[i] = Nil() - } else { - margs[i] = Eq(arg) - } - } - - origin := callerInfo(3) - actions := []func([]interface{}) []interface{}{func([]interface{}) []interface{} { - // Synthesize the zero value for each of the return args' types. - rets := make([]interface{}, methodType.NumOut()) - for i := 0; i < methodType.NumOut(); i++ { - rets[i] = reflect.Zero(methodType.Out(i)).Interface() - } - return rets - }} - return &Call{t: t, receiver: receiver, method: method, methodType: methodType, - args: margs, origin: origin, minCalls: 1, maxCalls: 1, actions: actions} -} - -// AnyTimes allows the expectation to be called 0 or more times -func (c *Call) AnyTimes() *Call { - c.minCalls, c.maxCalls = 0, 1e8 // close enough to infinity - return c -} - -// MinTimes requires the call to occur at least n times. If AnyTimes or MaxTimes have not been called or if MaxTimes -// was previously called with 1, MinTimes also sets the maximum number of calls to infinity. -func (c *Call) MinTimes(n int) *Call { - c.minCalls = n - if c.maxCalls == 1 { - c.maxCalls = 1e8 - } - return c -} - -// MaxTimes limits the number of calls to n times. If AnyTimes or MinTimes have not been called or if MinTimes was -// previously called with 1, MaxTimes also sets the minimum number of calls to 0. -func (c *Call) MaxTimes(n int) *Call { - c.maxCalls = n - if c.minCalls == 1 { - c.minCalls = 0 - } - return c -} - -// DoAndReturn declares the action to run when the call is matched. -// The return values from this function are returned by the mocked function. -// It takes an interface{} argument to support n-arity functions. -func (c *Call) DoAndReturn(f interface{}) *Call { - // TODO: Check arity and types here, rather than dying badly elsewhere. - v := reflect.ValueOf(f) - - c.addAction(func(args []interface{}) []interface{} { - vargs := make([]reflect.Value, len(args)) - ft := v.Type() - for i := 0; i < len(args); i++ { - if args[i] != nil { - vargs[i] = reflect.ValueOf(args[i]) - } else { - // Use the zero value for the arg. - vargs[i] = reflect.Zero(ft.In(i)) - } - } - vrets := v.Call(vargs) - rets := make([]interface{}, len(vrets)) - for i, ret := range vrets { - rets[i] = ret.Interface() - } - return rets - }) - return c -} - -// Do declares the action to run when the call is matched. The function's -// return values are ignored to retain backward compatibility. To use the -// return values call DoAndReturn. -// It takes an interface{} argument to support n-arity functions. -func (c *Call) Do(f interface{}) *Call { - // TODO: Check arity and types here, rather than dying badly elsewhere. - v := reflect.ValueOf(f) - - c.addAction(func(args []interface{}) []interface{} { - vargs := make([]reflect.Value, len(args)) - ft := v.Type() - for i := 0; i < len(args); i++ { - if args[i] != nil { - vargs[i] = reflect.ValueOf(args[i]) - } else { - // Use the zero value for the arg. - vargs[i] = reflect.Zero(ft.In(i)) - } - } - v.Call(vargs) - return nil - }) - return c -} - -// Return declares the values to be returned by the mocked function call. -func (c *Call) Return(rets ...interface{}) *Call { - c.t.Helper() - - mt := c.methodType - if len(rets) != mt.NumOut() { - c.t.Fatalf("wrong number of arguments to Return for %T.%v: got %d, want %d [%s]", - c.receiver, c.method, len(rets), mt.NumOut(), c.origin) - } - for i, ret := range rets { - if got, want := reflect.TypeOf(ret), mt.Out(i); got == want { - // Identical types; nothing to do. - } else if got == nil { - // Nil needs special handling. - switch want.Kind() { - case reflect.Chan, reflect.Func, reflect.Interface, reflect.Map, reflect.Ptr, reflect.Slice: - // ok - default: - c.t.Fatalf("argument %d to Return for %T.%v is nil, but %v is not nillable [%s]", - i, c.receiver, c.method, want, c.origin) - } - } else if got.AssignableTo(want) { - // Assignable type relation. Make the assignment now so that the generated code - // can return the values with a type assertion. - v := reflect.New(want).Elem() - v.Set(reflect.ValueOf(ret)) - rets[i] = v.Interface() - } else { - c.t.Fatalf("wrong type of argument %d to Return for %T.%v: %v is not assignable to %v [%s]", - i, c.receiver, c.method, got, want, c.origin) - } - } - - c.addAction(func([]interface{}) []interface{} { - return rets - }) - - return c -} - -// Times declares the exact number of times a function call is expected to be executed. -func (c *Call) Times(n int) *Call { - c.minCalls, c.maxCalls = n, n - return c -} - -// SetArg declares an action that will set the nth argument's value, -// indirected through a pointer. Or, in the case of a slice, SetArg -// will copy value's elements into the nth argument. -func (c *Call) SetArg(n int, value interface{}) *Call { - c.t.Helper() - - mt := c.methodType - // TODO: This will break on variadic methods. - // We will need to check those at invocation time. - if n < 0 || n >= mt.NumIn() { - c.t.Fatalf("SetArg(%d, ...) called for a method with %d args [%s]", - n, mt.NumIn(), c.origin) - } - // Permit setting argument through an interface. - // In the interface case, we don't (nay, can't) check the type here. - at := mt.In(n) - switch at.Kind() { - case reflect.Ptr: - dt := at.Elem() - if vt := reflect.TypeOf(value); !vt.AssignableTo(dt) { - c.t.Fatalf("SetArg(%d, ...) argument is a %v, not assignable to %v [%s]", - n, vt, dt, c.origin) - } - case reflect.Interface: - // nothing to do - case reflect.Slice: - // nothing to do - default: - c.t.Fatalf("SetArg(%d, ...) referring to argument of non-pointer non-interface non-slice type %v [%s]", - n, at, c.origin) - } - - c.addAction(func(args []interface{}) []interface{} { - v := reflect.ValueOf(value) - switch reflect.TypeOf(args[n]).Kind() { - case reflect.Slice: - setSlice(args[n], v) - default: - reflect.ValueOf(args[n]).Elem().Set(v) - } - return nil - }) - return c -} - -// isPreReq returns true if other is a direct or indirect prerequisite to c. -func (c *Call) isPreReq(other *Call) bool { - for _, preReq := range c.preReqs { - if other == preReq || preReq.isPreReq(other) { - return true - } - } - return false -} - -// After declares that the call may only match after preReq has been exhausted. -func (c *Call) After(preReq *Call) *Call { - c.t.Helper() - - if c == preReq { - c.t.Fatalf("A call isn't allowed to be its own prerequisite") - } - if preReq.isPreReq(c) { - c.t.Fatalf("Loop in call order: %v is a prerequisite to %v (possibly indirectly).", c, preReq) - } - - c.preReqs = append(c.preReqs, preReq) - return c -} - -// Returns true if the minimum number of calls have been made. -func (c *Call) satisfied() bool { - return c.numCalls >= c.minCalls -} - -// Returns true if the maximum number of calls have been made. -func (c *Call) exhausted() bool { - return c.numCalls >= c.maxCalls -} - -func (c *Call) String() string { - args := make([]string, len(c.args)) - for i, arg := range c.args { - args[i] = arg.String() - } - arguments := strings.Join(args, ", ") - return fmt.Sprintf("%T.%v(%s) %s", c.receiver, c.method, arguments, c.origin) -} - -// Tests if the given call matches the expected call. -// If yes, returns nil. If no, returns error with message explaining why it does not match. -func (c *Call) matches(args []interface{}) error { - if !c.methodType.IsVariadic() { - if len(args) != len(c.args) { - return fmt.Errorf("expected call at %s has the wrong number of arguments. Got: %d, want: %d", - c.origin, len(args), len(c.args)) - } - - for i, m := range c.args { - if !m.Matches(args[i]) { - got := fmt.Sprintf("%v", args[i]) - if gs, ok := m.(GotFormatter); ok { - got = gs.Got(args[i]) - } - - return fmt.Errorf( - "expected call at %s doesn't match the argument at index %d.\nGot: %v\nWant: %v", - c.origin, i, got, m, - ) - } - } - } else { - if len(c.args) < c.methodType.NumIn()-1 { - return fmt.Errorf("expected call at %s has the wrong number of matchers. Got: %d, want: %d", - c.origin, len(c.args), c.methodType.NumIn()-1) - } - if len(c.args) != c.methodType.NumIn() && len(args) != len(c.args) { - return fmt.Errorf("expected call at %s has the wrong number of arguments. Got: %d, want: %d", - c.origin, len(args), len(c.args)) - } - if len(args) < len(c.args)-1 { - return fmt.Errorf("expected call at %s has the wrong number of arguments. Got: %d, want: greater than or equal to %d", - c.origin, len(args), len(c.args)-1) - } - - for i, m := range c.args { - if i < c.methodType.NumIn()-1 { - // Non-variadic args - if !m.Matches(args[i]) { - return fmt.Errorf("expected call at %s doesn't match the argument at index %s.\nGot: %v\nWant: %v", - c.origin, strconv.Itoa(i), args[i], m) - } - continue - } - // The last arg has a possibility of a variadic argument, so let it branch - - // sample: Foo(a int, b int, c ...int) - if i < len(c.args) && i < len(args) { - if m.Matches(args[i]) { - // Got Foo(a, b, c) want Foo(matcherA, matcherB, gomock.Any()) - // Got Foo(a, b, c) want Foo(matcherA, matcherB, someSliceMatcher) - // Got Foo(a, b, c) want Foo(matcherA, matcherB, matcherC) - // Got Foo(a, b) want Foo(matcherA, matcherB) - // Got Foo(a, b, c, d) want Foo(matcherA, matcherB, matcherC, matcherD) - continue - } - } - - // The number of actual args don't match the number of matchers, - // or the last matcher is a slice and the last arg is not. - // If this function still matches it is because the last matcher - // matches all the remaining arguments or the lack of any. - // Convert the remaining arguments, if any, into a slice of the - // expected type. - vargsType := c.methodType.In(c.methodType.NumIn() - 1) - vargs := reflect.MakeSlice(vargsType, 0, len(args)-i) - for _, arg := range args[i:] { - vargs = reflect.Append(vargs, reflect.ValueOf(arg)) - } - if m.Matches(vargs.Interface()) { - // Got Foo(a, b, c, d, e) want Foo(matcherA, matcherB, gomock.Any()) - // Got Foo(a, b, c, d, e) want Foo(matcherA, matcherB, someSliceMatcher) - // Got Foo(a, b) want Foo(matcherA, matcherB, gomock.Any()) - // Got Foo(a, b) want Foo(matcherA, matcherB, someEmptySliceMatcher) - break - } - // Wrong number of matchers or not match. Fail. - // Got Foo(a, b) want Foo(matcherA, matcherB, matcherC, matcherD) - // Got Foo(a, b, c) want Foo(matcherA, matcherB, matcherC, matcherD) - // Got Foo(a, b, c, d) want Foo(matcherA, matcherB, matcherC, matcherD, matcherE) - // Got Foo(a, b, c, d, e) want Foo(matcherA, matcherB, matcherC, matcherD) - // Got Foo(a, b, c) want Foo(matcherA, matcherB) - return fmt.Errorf("Expected call at %s doesn't match the argument at index %s.\nGot: %v\nWant: %v", - c.origin, strconv.Itoa(i), args[i:], c.args[i]) - - } - } - - // Check that all prerequisite calls have been satisfied. - for _, preReqCall := range c.preReqs { - if !preReqCall.satisfied() { - return fmt.Errorf("Expected call at %s doesn't have a prerequisite call satisfied:\n%v\nshould be called before:\n%v", - c.origin, preReqCall, c) - } - } - - // Check that the call is not exhausted. - if c.exhausted() { - return fmt.Errorf("expected call at %s has already been called the max number of times", c.origin) - } - - return nil -} - -// dropPrereqs tells the expected Call to not re-check prerequisite calls any -// longer, and to return its current set. -func (c *Call) dropPrereqs() (preReqs []*Call) { - preReqs = c.preReqs - c.preReqs = nil - return -} - -func (c *Call) call() []func([]interface{}) []interface{} { - c.numCalls++ - return c.actions -} - -// InOrder declares that the given calls should occur in order. -func InOrder(calls ...*Call) { - for i := 1; i < len(calls); i++ { - calls[i].After(calls[i-1]) - } -} - -func setSlice(arg interface{}, v reflect.Value) { - va := reflect.ValueOf(arg) - for i := 0; i < v.Len(); i++ { - va.Index(i).Set(v.Index(i)) - } -} - -func (c *Call) addAction(action func([]interface{}) []interface{}) { - c.actions = append(c.actions, action) -} diff --git a/vendor/github.com/golang/mock/gomock/callset.go b/vendor/github.com/golang/mock/gomock/callset.go deleted file mode 100644 index b046b525e9..0000000000 --- a/vendor/github.com/golang/mock/gomock/callset.go +++ /dev/null @@ -1,108 +0,0 @@ -// Copyright 2011 Google Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package gomock - -import ( - "bytes" - "fmt" -) - -// callSet represents a set of expected calls, indexed by receiver and method -// name. -type callSet struct { - // Calls that are still expected. - expected map[callSetKey][]*Call - // Calls that have been exhausted. - exhausted map[callSetKey][]*Call -} - -// callSetKey is the key in the maps in callSet -type callSetKey struct { - receiver interface{} - fname string -} - -func newCallSet() *callSet { - return &callSet{make(map[callSetKey][]*Call), make(map[callSetKey][]*Call)} -} - -// Add adds a new expected call. -func (cs callSet) Add(call *Call) { - key := callSetKey{call.receiver, call.method} - m := cs.expected - if call.exhausted() { - m = cs.exhausted - } - m[key] = append(m[key], call) -} - -// Remove removes an expected call. -func (cs callSet) Remove(call *Call) { - key := callSetKey{call.receiver, call.method} - calls := cs.expected[key] - for i, c := range calls { - if c == call { - // maintain order for remaining calls - cs.expected[key] = append(calls[:i], calls[i+1:]...) - cs.exhausted[key] = append(cs.exhausted[key], call) - break - } - } -} - -// FindMatch searches for a matching call. Returns error with explanation message if no call matched. -func (cs callSet) FindMatch(receiver interface{}, method string, args []interface{}) (*Call, error) { - key := callSetKey{receiver, method} - - // Search through the expected calls. - expected := cs.expected[key] - var callsErrors bytes.Buffer - for _, call := range expected { - err := call.matches(args) - if err != nil { - _, _ = fmt.Fprintf(&callsErrors, "\n%v", err) - } else { - return call, nil - } - } - - // If we haven't found a match then search through the exhausted calls so we - // get useful error messages. - exhausted := cs.exhausted[key] - for _, call := range exhausted { - if err := call.matches(args); err != nil { - _, _ = fmt.Fprintf(&callsErrors, "\n%v", err) - } - } - - if len(expected)+len(exhausted) == 0 { - _, _ = fmt.Fprintf(&callsErrors, "there are no expected calls of the method %q for that receiver", method) - } - - return nil, fmt.Errorf(callsErrors.String()) -} - -// Failures returns the calls that are not satisfied. -func (cs callSet) Failures() []*Call { - failures := make([]*Call, 0, len(cs.expected)) - for _, calls := range cs.expected { - for _, call := range calls { - if !call.satisfied() { - failures = append(failures, call) - } - } - } - return failures -} diff --git a/vendor/github.com/golang/mock/gomock/controller.go b/vendor/github.com/golang/mock/gomock/controller.go deleted file mode 100644 index d7c3c656ae..0000000000 --- a/vendor/github.com/golang/mock/gomock/controller.go +++ /dev/null @@ -1,264 +0,0 @@ -// Copyright 2010 Google Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Package gomock is a mock framework for Go. -// -// Standard usage: -// (1) Define an interface that you wish to mock. -// type MyInterface interface { -// SomeMethod(x int64, y string) -// } -// (2) Use mockgen to generate a mock from the interface. -// (3) Use the mock in a test: -// func TestMyThing(t *testing.T) { -// mockCtrl := gomock.NewController(t) -// defer mockCtrl.Finish() -// -// mockObj := something.NewMockMyInterface(mockCtrl) -// mockObj.EXPECT().SomeMethod(4, "blah") -// // pass mockObj to a real object and play with it. -// } -// -// By default, expected calls are not enforced to run in any particular order. -// Call order dependency can be enforced by use of InOrder and/or Call.After. -// Call.After can create more varied call order dependencies, but InOrder is -// often more convenient. -// -// The following examples create equivalent call order dependencies. -// -// Example of using Call.After to chain expected call order: -// -// firstCall := mockObj.EXPECT().SomeMethod(1, "first") -// secondCall := mockObj.EXPECT().SomeMethod(2, "second").After(firstCall) -// mockObj.EXPECT().SomeMethod(3, "third").After(secondCall) -// -// Example of using InOrder to declare expected call order: -// -// gomock.InOrder( -// mockObj.EXPECT().SomeMethod(1, "first"), -// mockObj.EXPECT().SomeMethod(2, "second"), -// mockObj.EXPECT().SomeMethod(3, "third"), -// ) -// -// TODO: -// - Handle different argument/return types (e.g. ..., chan, map, interface). -package gomock - -import ( - "context" - "fmt" - "reflect" - "runtime" - "sync" -) - -// A TestReporter is something that can be used to report test failures. It -// is satisfied by the standard library's *testing.T. -type TestReporter interface { - Errorf(format string, args ...interface{}) - Fatalf(format string, args ...interface{}) -} - -// TestHelper is a TestReporter that has the Helper method. It is satisfied -// by the standard library's *testing.T. -type TestHelper interface { - TestReporter - Helper() -} - -// A Controller represents the top-level control of a mock ecosystem. It -// defines the scope and lifetime of mock objects, as well as their -// expectations. It is safe to call Controller's methods from multiple -// goroutines. Each test should create a new Controller and invoke Finish via -// defer. -// -// func TestFoo(t *testing.T) { -// ctrl := gomock.NewController(t) -// defer ctrl.Finish() -// // .. -// } -// -// func TestBar(t *testing.T) { -// t.Run("Sub-Test-1", st) { -// ctrl := gomock.NewController(st) -// defer ctrl.Finish() -// // .. -// }) -// t.Run("Sub-Test-2", st) { -// ctrl := gomock.NewController(st) -// defer ctrl.Finish() -// // .. -// }) -// }) -type Controller struct { - // T should only be called within a generated mock. It is not intended to - // be used in user code and may be changed in future versions. T is the - // TestReporter passed in when creating the Controller via NewController. - // If the TestReporter does not implement a TestHelper it will be wrapped - // with a nopTestHelper. - T TestHelper - mu sync.Mutex - expectedCalls *callSet - finished bool -} - -// NewController returns a new Controller. It is the preferred way to create a -// Controller. -func NewController(t TestReporter) *Controller { - h, ok := t.(TestHelper) - if !ok { - h = nopTestHelper{t} - } - - return &Controller{ - T: h, - expectedCalls: newCallSet(), - } -} - -type cancelReporter struct { - TestHelper - cancel func() -} - -func (r *cancelReporter) Errorf(format string, args ...interface{}) { - r.TestHelper.Errorf(format, args...) -} -func (r *cancelReporter) Fatalf(format string, args ...interface{}) { - defer r.cancel() - r.TestHelper.Fatalf(format, args...) -} - -// WithContext returns a new Controller and a Context, which is cancelled on any -// fatal failure. -func WithContext(ctx context.Context, t TestReporter) (*Controller, context.Context) { - h, ok := t.(TestHelper) - if !ok { - h = nopTestHelper{t} - } - - ctx, cancel := context.WithCancel(ctx) - return NewController(&cancelReporter{h, cancel}), ctx -} - -type nopTestHelper struct { - TestReporter -} - -func (h nopTestHelper) Helper() {} - -// RecordCall is called by a mock. It should not be called by user code. -func (ctrl *Controller) RecordCall(receiver interface{}, method string, args ...interface{}) *Call { - ctrl.T.Helper() - - recv := reflect.ValueOf(receiver) - for i := 0; i < recv.Type().NumMethod(); i++ { - if recv.Type().Method(i).Name == method { - return ctrl.RecordCallWithMethodType(receiver, method, recv.Method(i).Type(), args...) - } - } - ctrl.T.Fatalf("gomock: failed finding method %s on %T", method, receiver) - panic("unreachable") -} - -// RecordCallWithMethodType is called by a mock. It should not be called by user code. -func (ctrl *Controller) RecordCallWithMethodType(receiver interface{}, method string, methodType reflect.Type, args ...interface{}) *Call { - ctrl.T.Helper() - - call := newCall(ctrl.T, receiver, method, methodType, args...) - - ctrl.mu.Lock() - defer ctrl.mu.Unlock() - ctrl.expectedCalls.Add(call) - - return call -} - -// Call is called by a mock. It should not be called by user code. -func (ctrl *Controller) Call(receiver interface{}, method string, args ...interface{}) []interface{} { - ctrl.T.Helper() - - // Nest this code so we can use defer to make sure the lock is released. - actions := func() []func([]interface{}) []interface{} { - ctrl.T.Helper() - ctrl.mu.Lock() - defer ctrl.mu.Unlock() - - expected, err := ctrl.expectedCalls.FindMatch(receiver, method, args) - if err != nil { - origin := callerInfo(2) - ctrl.T.Fatalf("Unexpected call to %T.%v(%v) at %s because: %s", receiver, method, args, origin, err) - } - - // Two things happen here: - // * the matching call no longer needs to check prerequite calls, - // * and the prerequite calls are no longer expected, so remove them. - preReqCalls := expected.dropPrereqs() - for _, preReqCall := range preReqCalls { - ctrl.expectedCalls.Remove(preReqCall) - } - - actions := expected.call() - if expected.exhausted() { - ctrl.expectedCalls.Remove(expected) - } - return actions - }() - - var rets []interface{} - for _, action := range actions { - if r := action(args); r != nil { - rets = r - } - } - - return rets -} - -// Finish checks to see if all the methods that were expected to be called -// were called. It should be invoked for each Controller. It is not idempotent -// and therefore can only be invoked once. -func (ctrl *Controller) Finish() { - ctrl.T.Helper() - - ctrl.mu.Lock() - defer ctrl.mu.Unlock() - - if ctrl.finished { - ctrl.T.Fatalf("Controller.Finish was called more than once. It has to be called exactly once.") - } - ctrl.finished = true - - // If we're currently panicking, probably because this is a deferred call, - // pass through the panic. - if err := recover(); err != nil { - panic(err) - } - - // Check that all remaining expected calls are satisfied. - failures := ctrl.expectedCalls.Failures() - for _, call := range failures { - ctrl.T.Errorf("missing call(s) to %v", call) - } - if len(failures) != 0 { - ctrl.T.Fatalf("aborting test due to missing call(s)") - } -} - -func callerInfo(skip int) string { - if _, file, line, ok := runtime.Caller(skip + 1); ok { - return fmt.Sprintf("%s:%d", file, line) - } - return "unknown file" -} diff --git a/vendor/github.com/golang/mock/gomock/matchers.go b/vendor/github.com/golang/mock/gomock/matchers.go deleted file mode 100644 index 7bfc07be43..0000000000 --- a/vendor/github.com/golang/mock/gomock/matchers.go +++ /dev/null @@ -1,255 +0,0 @@ -// Copyright 2010 Google Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package gomock - -import ( - "fmt" - "reflect" - "strings" -) - -// A Matcher is a representation of a class of values. -// It is used to represent the valid or expected arguments to a mocked method. -type Matcher interface { - // Matches returns whether x is a match. - Matches(x interface{}) bool - - // String describes what the matcher matches. - String() string -} - -// WantFormatter modifies the given Matcher's String() method to the given -// Stringer. This allows for control on how the "Want" is formatted when -// printing . -func WantFormatter(s fmt.Stringer, m Matcher) Matcher { - type matcher interface { - Matches(x interface{}) bool - } - - return struct { - matcher - fmt.Stringer - }{ - matcher: m, - Stringer: s, - } -} - -// StringerFunc type is an adapter to allow the use of ordinary functions as -// a Stringer. If f is a function with the appropriate signature, -// StringerFunc(f) is a Stringer that calls f. -type StringerFunc func() string - -// String implements fmt.Stringer. -func (f StringerFunc) String() string { - return f() -} - -// GotFormatter is used to better print failure messages. If a matcher -// implements GotFormatter, it will use the result from Got when printing -// the failure message. -type GotFormatter interface { - // Got is invoked with the received value. The result is used when - // printing the failure message. - Got(got interface{}) string -} - -// GotFormatterFunc type is an adapter to allow the use of ordinary -// functions as a GotFormatter. If f is a function with the appropriate -// signature, GotFormatterFunc(f) is a GotFormatter that calls f. -type GotFormatterFunc func(got interface{}) string - -// Got implements GotFormatter. -func (f GotFormatterFunc) Got(got interface{}) string { - return f(got) -} - -// GotFormatterAdapter attaches a GotFormatter to a Matcher. -func GotFormatterAdapter(s GotFormatter, m Matcher) Matcher { - return struct { - GotFormatter - Matcher - }{ - GotFormatter: s, - Matcher: m, - } -} - -type anyMatcher struct{} - -func (anyMatcher) Matches(interface{}) bool { - return true -} - -func (anyMatcher) String() string { - return "is anything" -} - -type eqMatcher struct { - x interface{} -} - -func (e eqMatcher) Matches(x interface{}) bool { - return reflect.DeepEqual(e.x, x) -} - -func (e eqMatcher) String() string { - return fmt.Sprintf("is equal to %v", e.x) -} - -type nilMatcher struct{} - -func (nilMatcher) Matches(x interface{}) bool { - if x == nil { - return true - } - - v := reflect.ValueOf(x) - switch v.Kind() { - case reflect.Chan, reflect.Func, reflect.Interface, reflect.Map, - reflect.Ptr, reflect.Slice: - return v.IsNil() - } - - return false -} - -func (nilMatcher) String() string { - return "is nil" -} - -type notMatcher struct { - m Matcher -} - -func (n notMatcher) Matches(x interface{}) bool { - return !n.m.Matches(x) -} - -func (n notMatcher) String() string { - // TODO: Improve this if we add a NotString method to the Matcher interface. - return "not(" + n.m.String() + ")" -} - -type assignableToTypeOfMatcher struct { - targetType reflect.Type -} - -func (m assignableToTypeOfMatcher) Matches(x interface{}) bool { - return reflect.TypeOf(x).AssignableTo(m.targetType) -} - -func (m assignableToTypeOfMatcher) String() string { - return "is assignable to " + m.targetType.Name() -} - -type allMatcher struct { - matchers []Matcher -} - -func (am allMatcher) Matches(x interface{}) bool { - for _, m := range am.matchers { - if !m.Matches(x) { - return false - } - } - return true -} - -func (am allMatcher) String() string { - ss := make([]string, 0, len(am.matchers)) - for _, matcher := range am.matchers { - ss = append(ss, matcher.String()) - } - return strings.Join(ss, "; ") -} - -type lenMatcher struct { - i int -} - -func (m lenMatcher) Matches(x interface{}) bool { - v := reflect.ValueOf(x) - switch v.Kind() { - case reflect.Array, reflect.Chan, reflect.Map, reflect.Slice, reflect.String: - return v.Len() == m.i - default: - return false - } -} - -func (m lenMatcher) String() string { - return fmt.Sprintf("has length %d", m.i) -} - -// Constructors - -// All returns a composite Matcher that returns true if and only all of the -// matchers return true. -func All(ms ...Matcher) Matcher { return allMatcher{ms} } - -// Any returns a matcher that always matches. -func Any() Matcher { return anyMatcher{} } - -// Eq returns a matcher that matches on equality. -// -// Example usage: -// Eq(5).Matches(5) // returns true -// Eq(5).Matches(4) // returns false -func Eq(x interface{}) Matcher { return eqMatcher{x} } - -// Len returns a matcher that matches on length. This matcher returns false if -// is compared to a type that is not an array, chan, map, slice, or string. -func Len(i int) Matcher { - return lenMatcher{i} -} - -// Nil returns a matcher that matches if the received value is nil. -// -// Example usage: -// var x *bytes.Buffer -// Nil().Matches(x) // returns true -// x = &bytes.Buffer{} -// Nil().Matches(x) // returns false -func Nil() Matcher { return nilMatcher{} } - -// Not reverses the results of its given child matcher. -// -// Example usage: -// Not(Eq(5)).Matches(4) // returns true -// Not(Eq(5)).Matches(5) // returns false -func Not(x interface{}) Matcher { - if m, ok := x.(Matcher); ok { - return notMatcher{m} - } - return notMatcher{Eq(x)} -} - -// AssignableToTypeOf is a Matcher that matches if the parameter to the mock -// function is assignable to the type of the parameter to this function. -// -// Example usage: -// var s fmt.Stringer = &bytes.Buffer{} -// AssignableToTypeOf(s).Matches(time.Second) // returns true -// AssignableToTypeOf(s).Matches(99) // returns false -// -// var ctx = reflect.TypeOf((*context.Context)).Elem() -// AssignableToTypeOf(ctx).Matches(context.Background()) // returns true -func AssignableToTypeOf(x interface{}) Matcher { - if xt, ok := x.(reflect.Type); ok { - return assignableToTypeOfMatcher{xt} - } - return assignableToTypeOfMatcher{reflect.TypeOf(x)} -} diff --git a/vendor/github.com/golang/protobuf/descriptor/descriptor.go b/vendor/github.com/golang/protobuf/descriptor/descriptor.go deleted file mode 100644 index c3c4a2b87e..0000000000 --- a/vendor/github.com/golang/protobuf/descriptor/descriptor.go +++ /dev/null @@ -1,185 +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 descriptor provides functions for obtaining the protocol buffer -// descriptors of generated Go types. -// -// Deprecated: See the "google.golang.org/protobuf/reflect/protoreflect" package -// for how to obtain an EnumDescriptor or MessageDescriptor in order to -// programatically interact with the protobuf type system. -package descriptor - -import ( - "bytes" - "compress/gzip" - "io/ioutil" - "sync" - - "github.com/golang/protobuf/proto" - "google.golang.org/protobuf/reflect/protodesc" - "google.golang.org/protobuf/reflect/protoreflect" - "google.golang.org/protobuf/runtime/protoimpl" - - descriptorpb "github.com/golang/protobuf/protoc-gen-go/descriptor" -) - -// Message is proto.Message with a method to return its descriptor. -// -// Deprecated: The Descriptor method may not be generated by future -// versions of protoc-gen-go, meaning that this interface may not -// be implemented by many concrete message types. -type Message interface { - proto.Message - Descriptor() ([]byte, []int) -} - -// ForMessage returns the file descriptor proto containing -// the message and the message descriptor proto for the message itself. -// The returned proto messages must not be mutated. -// -// Deprecated: Not all concrete message types satisfy the Message interface. -// Use MessageDescriptorProto instead. If possible, the calling code should -// be rewritten to use protobuf reflection instead. -// See package "google.golang.org/protobuf/reflect/protoreflect" for details. -func ForMessage(m Message) (*descriptorpb.FileDescriptorProto, *descriptorpb.DescriptorProto) { - return MessageDescriptorProto(m) -} - -type rawDesc struct { - fileDesc []byte - indexes []int -} - -var rawDescCache sync.Map // map[protoreflect.Descriptor]*rawDesc - -func deriveRawDescriptor(d protoreflect.Descriptor) ([]byte, []int) { - // Fast-path: check whether raw descriptors are already cached. - origDesc := d - if v, ok := rawDescCache.Load(origDesc); ok { - return v.(*rawDesc).fileDesc, v.(*rawDesc).indexes - } - - // Slow-path: derive the raw descriptor from the v2 descriptor. - - // Start with the leaf (a given enum or message declaration) and - // ascend upwards until we hit the parent file descriptor. - var idxs []int - for { - idxs = append(idxs, d.Index()) - d = d.Parent() - if d == nil { - // TODO: We could construct a FileDescriptor stub for standalone - // descriptors to satisfy the API. - return nil, nil - } - if _, ok := d.(protoreflect.FileDescriptor); ok { - break - } - } - - // Obtain the raw file descriptor. - var raw []byte - switch fd := d.(type) { - case interface{ ProtoLegacyRawDesc() []byte }: - raw = fd.ProtoLegacyRawDesc() - case protoreflect.FileDescriptor: - raw, _ = proto.Marshal(protodesc.ToFileDescriptorProto(fd)) - } - file := protoimpl.X.CompressGZIP(raw) - - // Reverse the indexes, since we populated it in reverse. - for i, j := 0, len(idxs)-1; i < j; i, j = i+1, j-1 { - idxs[i], idxs[j] = idxs[j], idxs[i] - } - - if v, ok := rawDescCache.LoadOrStore(origDesc, &rawDesc{file, idxs}); ok { - return v.(*rawDesc).fileDesc, v.(*rawDesc).indexes - } - return file, idxs -} - -// EnumRawDescriptor returns the GZIP'd raw file descriptor representing -// the enum and the index path to reach the enum declaration. -// The returned slices must not be mutated. -func EnumRawDescriptor(e proto.GeneratedEnum) ([]byte, []int) { - if ev, ok := e.(interface{ EnumDescriptor() ([]byte, []int) }); ok { - return ev.EnumDescriptor() - } - ed := protoimpl.X.EnumTypeOf(e) - return deriveRawDescriptor(ed.Descriptor()) -} - -// MessageRawDescriptor returns the GZIP'd raw file descriptor representing -// the message and the index path to reach the message declaration. -// The returned slices must not be mutated. -func MessageRawDescriptor(m proto.GeneratedMessage) ([]byte, []int) { - if mv, ok := m.(interface{ Descriptor() ([]byte, []int) }); ok { - return mv.Descriptor() - } - md := protoimpl.X.MessageTypeOf(m) - return deriveRawDescriptor(md.Descriptor()) -} - -var fileDescCache sync.Map // map[*byte]*descriptorpb.FileDescriptorProto - -func deriveFileDescriptor(rawDesc []byte) *descriptorpb.FileDescriptorProto { - // Fast-path: check whether descriptor protos are already cached. - if v, ok := fileDescCache.Load(&rawDesc[0]); ok { - return v.(*descriptorpb.FileDescriptorProto) - } - - // Slow-path: derive the descriptor proto from the GZIP'd message. - zr, err := gzip.NewReader(bytes.NewReader(rawDesc)) - if err != nil { - panic(err) - } - b, err := ioutil.ReadAll(zr) - if err != nil { - panic(err) - } - fd := new(descriptorpb.FileDescriptorProto) - if err := proto.Unmarshal(b, fd); err != nil { - panic(err) - } - if v, ok := fileDescCache.LoadOrStore(&rawDesc[0], fd); ok { - return v.(*descriptorpb.FileDescriptorProto) - } - return fd -} - -// EnumDescriptorProto returns the file descriptor proto representing -// the enum and the enum descriptor proto for the enum itself. -// The returned proto messages must not be mutated. -func EnumDescriptorProto(e proto.GeneratedEnum) (*descriptorpb.FileDescriptorProto, *descriptorpb.EnumDescriptorProto) { - rawDesc, idxs := EnumRawDescriptor(e) - if rawDesc == nil || idxs == nil { - return nil, nil - } - fd := deriveFileDescriptor(rawDesc) - if len(idxs) == 1 { - return fd, fd.EnumType[idxs[0]] - } - md := fd.MessageType[idxs[0]] - for _, i := range idxs[1 : len(idxs)-1] { - md = md.NestedType[i] - } - ed := md.EnumType[idxs[len(idxs)-1]] - return fd, ed -} - -// MessageDescriptorProto returns the file descriptor proto representing -// the message and the message descriptor proto for the message itself. -// The returned proto messages must not be mutated. -func MessageDescriptorProto(m proto.GeneratedMessage) (*descriptorpb.FileDescriptorProto, *descriptorpb.DescriptorProto) { - rawDesc, idxs := MessageRawDescriptor(m) - if rawDesc == nil || idxs == nil { - return nil, nil - } - fd := deriveFileDescriptor(rawDesc) - md := fd.MessageType[idxs[0]] - for _, i := range idxs[1:] { - md = md.NestedType[i] - } - return fd, md -} diff --git a/vendor/github.com/golang/protobuf/jsonpb/decode.go b/vendor/github.com/golang/protobuf/jsonpb/decode.go deleted file mode 100644 index 7c6c5a5244..0000000000 --- a/vendor/github.com/golang/protobuf/jsonpb/decode.go +++ /dev/null @@ -1,514 +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 jsonpb - -import ( - "encoding/json" - "errors" - "fmt" - "io" - "math" - "reflect" - "strconv" - "strings" - "time" - - "github.com/golang/protobuf/proto" - "google.golang.org/protobuf/encoding/protojson" - protoV2 "google.golang.org/protobuf/proto" - "google.golang.org/protobuf/reflect/protoreflect" - "google.golang.org/protobuf/reflect/protoregistry" -) - -const wrapJSONUnmarshalV2 = false - -// UnmarshalNext unmarshals the next JSON object from d into m. -func UnmarshalNext(d *json.Decoder, m proto.Message) error { - return new(Unmarshaler).UnmarshalNext(d, m) -} - -// Unmarshal unmarshals a JSON object from r into m. -func Unmarshal(r io.Reader, m proto.Message) error { - return new(Unmarshaler).Unmarshal(r, m) -} - -// UnmarshalString unmarshals a JSON object from s into m. -func UnmarshalString(s string, m proto.Message) error { - return new(Unmarshaler).Unmarshal(strings.NewReader(s), m) -} - -// Unmarshaler is a configurable object for converting from a JSON -// representation to a protocol buffer object. -type Unmarshaler struct { - // AllowUnknownFields specifies whether to allow messages to contain - // unknown JSON fields, as opposed to failing to unmarshal. - AllowUnknownFields bool - - // AnyResolver is used to resolve the google.protobuf.Any well-known type. - // If unset, the global registry is used by default. - AnyResolver AnyResolver -} - -// JSONPBUnmarshaler is implemented by protobuf messages that customize the way -// they are unmarshaled from JSON. Messages that implement this should also -// implement JSONPBMarshaler so that the custom format can be produced. -// -// The JSON unmarshaling must follow the JSON to proto specification: -// https://developers.google.com/protocol-buffers/docs/proto3#json -// -// Deprecated: Custom types should implement protobuf reflection instead. -type JSONPBUnmarshaler interface { - UnmarshalJSONPB(*Unmarshaler, []byte) error -} - -// Unmarshal unmarshals a JSON object from r into m. -func (u *Unmarshaler) Unmarshal(r io.Reader, m proto.Message) error { - return u.UnmarshalNext(json.NewDecoder(r), m) -} - -// UnmarshalNext unmarshals the next JSON object from d into m. -func (u *Unmarshaler) UnmarshalNext(d *json.Decoder, m proto.Message) error { - if m == nil { - return errors.New("invalid nil message") - } - - // Parse the next JSON object from the stream. - raw := json.RawMessage{} - if err := d.Decode(&raw); err != nil { - return err - } - - // Check for custom unmarshalers first since they may not properly - // implement protobuf reflection that the logic below relies on. - if jsu, ok := m.(JSONPBUnmarshaler); ok { - return jsu.UnmarshalJSONPB(u, raw) - } - - mr := proto.MessageReflect(m) - - // NOTE: For historical reasons, a top-level null is treated as a noop. - // This is incorrect, but kept for compatibility. - if string(raw) == "null" && mr.Descriptor().FullName() != "google.protobuf.Value" { - return nil - } - - if wrapJSONUnmarshalV2 { - // NOTE: If input message is non-empty, we need to preserve merge semantics - // of the old jsonpb implementation. These semantics are not supported by - // the protobuf JSON specification. - isEmpty := true - mr.Range(func(protoreflect.FieldDescriptor, protoreflect.Value) bool { - isEmpty = false // at least one iteration implies non-empty - return false - }) - if !isEmpty { - // Perform unmarshaling into a newly allocated, empty message. - mr = mr.New() - - // Use a defer to copy all unmarshaled fields into the original message. - dst := proto.MessageReflect(m) - defer mr.Range(func(fd protoreflect.FieldDescriptor, v protoreflect.Value) bool { - dst.Set(fd, v) - return true - }) - } - - // Unmarshal using the v2 JSON unmarshaler. - opts := protojson.UnmarshalOptions{ - DiscardUnknown: u.AllowUnknownFields, - } - if u.AnyResolver != nil { - opts.Resolver = anyResolver{u.AnyResolver} - } - return opts.Unmarshal(raw, mr.Interface()) - } else { - if err := u.unmarshalMessage(mr, raw); err != nil { - return err - } - return protoV2.CheckInitialized(mr.Interface()) - } -} - -func (u *Unmarshaler) unmarshalMessage(m protoreflect.Message, in []byte) error { - md := m.Descriptor() - fds := md.Fields() - - if string(in) == "null" && md.FullName() != "google.protobuf.Value" { - return nil - } - - if jsu, ok := proto.MessageV1(m.Interface()).(JSONPBUnmarshaler); ok { - return jsu.UnmarshalJSONPB(u, in) - } - - switch wellKnownType(md.FullName()) { - case "Any": - var jsonObject map[string]json.RawMessage - if err := json.Unmarshal(in, &jsonObject); err != nil { - return err - } - - rawTypeURL, ok := jsonObject["@type"] - if !ok { - return errors.New("Any JSON doesn't have '@type'") - } - typeURL, err := unquoteString(string(rawTypeURL)) - if err != nil { - return fmt.Errorf("can't unmarshal Any's '@type': %q", rawTypeURL) - } - m.Set(fds.ByNumber(1), protoreflect.ValueOfString(typeURL)) - - var m2 protoreflect.Message - if u.AnyResolver != nil { - mi, err := u.AnyResolver.Resolve(typeURL) - if err != nil { - return err - } - m2 = proto.MessageReflect(mi) - } else { - mt, err := protoregistry.GlobalTypes.FindMessageByURL(typeURL) - if err != nil { - if err == protoregistry.NotFound { - return fmt.Errorf("could not resolve Any message type: %v", typeURL) - } - return err - } - m2 = mt.New() - } - - if wellKnownType(m2.Descriptor().FullName()) != "" { - rawValue, ok := jsonObject["value"] - if !ok { - return errors.New("Any JSON doesn't have 'value'") - } - if err := u.unmarshalMessage(m2, rawValue); err != nil { - return fmt.Errorf("can't unmarshal Any nested proto %v: %v", typeURL, err) - } - } else { - delete(jsonObject, "@type") - rawJSON, err := json.Marshal(jsonObject) - if err != nil { - return fmt.Errorf("can't generate JSON for Any's nested proto to be unmarshaled: %v", err) - } - if err = u.unmarshalMessage(m2, rawJSON); err != nil { - return fmt.Errorf("can't unmarshal Any nested proto %v: %v", typeURL, err) - } - } - - rawWire, err := protoV2.Marshal(m2.Interface()) - if err != nil { - return fmt.Errorf("can't marshal proto %v into Any.Value: %v", typeURL, err) - } - m.Set(fds.ByNumber(2), protoreflect.ValueOfBytes(rawWire)) - return nil - case "BoolValue", "BytesValue", "StringValue", - "Int32Value", "UInt32Value", "FloatValue", - "Int64Value", "UInt64Value", "DoubleValue": - fd := fds.ByNumber(1) - v, err := u.unmarshalValue(m.NewField(fd), in, fd) - if err != nil { - return err - } - m.Set(fd, v) - return nil - case "Duration": - v, err := unquoteString(string(in)) - if err != nil { - return err - } - d, err := time.ParseDuration(v) - if err != nil { - return fmt.Errorf("bad Duration: %v", err) - } - - sec := d.Nanoseconds() / 1e9 - nsec := d.Nanoseconds() % 1e9 - m.Set(fds.ByNumber(1), protoreflect.ValueOfInt64(int64(sec))) - m.Set(fds.ByNumber(2), protoreflect.ValueOfInt32(int32(nsec))) - return nil - case "Timestamp": - v, err := unquoteString(string(in)) - if err != nil { - return err - } - t, err := time.Parse(time.RFC3339Nano, v) - if err != nil { - return fmt.Errorf("bad Timestamp: %v", err) - } - - sec := t.Unix() - nsec := t.Nanosecond() - m.Set(fds.ByNumber(1), protoreflect.ValueOfInt64(int64(sec))) - m.Set(fds.ByNumber(2), protoreflect.ValueOfInt32(int32(nsec))) - return nil - case "Value": - switch { - case string(in) == "null": - m.Set(fds.ByNumber(1), protoreflect.ValueOfEnum(0)) - case string(in) == "true": - m.Set(fds.ByNumber(4), protoreflect.ValueOfBool(true)) - case string(in) == "false": - m.Set(fds.ByNumber(4), protoreflect.ValueOfBool(false)) - case hasPrefixAndSuffix('"', in, '"'): - s, err := unquoteString(string(in)) - if err != nil { - return fmt.Errorf("unrecognized type for Value %q", in) - } - m.Set(fds.ByNumber(3), protoreflect.ValueOfString(s)) - case hasPrefixAndSuffix('[', in, ']'): - v := m.Mutable(fds.ByNumber(6)) - return u.unmarshalMessage(v.Message(), in) - case hasPrefixAndSuffix('{', in, '}'): - v := m.Mutable(fds.ByNumber(5)) - return u.unmarshalMessage(v.Message(), in) - default: - f, err := strconv.ParseFloat(string(in), 0) - if err != nil { - return fmt.Errorf("unrecognized type for Value %q", in) - } - m.Set(fds.ByNumber(2), protoreflect.ValueOfFloat64(f)) - } - return nil - case "ListValue": - var jsonArray []json.RawMessage - if err := json.Unmarshal(in, &jsonArray); err != nil { - return fmt.Errorf("bad ListValue: %v", err) - } - - lv := m.Mutable(fds.ByNumber(1)).List() - for _, raw := range jsonArray { - ve := lv.NewElement() - if err := u.unmarshalMessage(ve.Message(), raw); err != nil { - return err - } - lv.Append(ve) - } - return nil - case "Struct": - var jsonObject map[string]json.RawMessage - if err := json.Unmarshal(in, &jsonObject); err != nil { - return fmt.Errorf("bad StructValue: %v", err) - } - - mv := m.Mutable(fds.ByNumber(1)).Map() - for key, raw := range jsonObject { - kv := protoreflect.ValueOf(key).MapKey() - vv := mv.NewValue() - if err := u.unmarshalMessage(vv.Message(), raw); err != nil { - return fmt.Errorf("bad value in StructValue for key %q: %v", key, err) - } - mv.Set(kv, vv) - } - return nil - } - - var jsonObject map[string]json.RawMessage - if err := json.Unmarshal(in, &jsonObject); err != nil { - return err - } - - // Handle known fields. - for i := 0; i < fds.Len(); i++ { - fd := fds.Get(i) - if fd.IsWeak() && fd.Message().IsPlaceholder() { - continue // weak reference is not linked in - } - - // Search for any raw JSON value associated with this field. - var raw json.RawMessage - name := string(fd.Name()) - if fd.Kind() == protoreflect.GroupKind { - name = string(fd.Message().Name()) - } - if v, ok := jsonObject[name]; ok { - delete(jsonObject, name) - raw = v - } - name = string(fd.JSONName()) - if v, ok := jsonObject[name]; ok { - delete(jsonObject, name) - raw = v - } - - // Unmarshal the field value. - if raw == nil || (string(raw) == "null" && !isSingularWellKnownValue(fd)) { - continue - } - v, err := u.unmarshalValue(m.NewField(fd), raw, fd) - if err != nil { - return err - } - m.Set(fd, v) - } - - // Handle extension fields. - for name, raw := range jsonObject { - if !strings.HasPrefix(name, "[") || !strings.HasSuffix(name, "]") { - continue - } - - // Resolve the extension field by name. - xname := protoreflect.FullName(name[len("[") : len(name)-len("]")]) - xt, _ := protoregistry.GlobalTypes.FindExtensionByName(xname) - if xt == nil && isMessageSet(md) { - xt, _ = protoregistry.GlobalTypes.FindExtensionByName(xname.Append("message_set_extension")) - } - if xt == nil { - continue - } - delete(jsonObject, name) - fd := xt.TypeDescriptor() - if fd.ContainingMessage().FullName() != m.Descriptor().FullName() { - return fmt.Errorf("extension field %q does not extend message %q", xname, m.Descriptor().FullName()) - } - - // Unmarshal the field value. - if raw == nil || (string(raw) == "null" && !isSingularWellKnownValue(fd)) { - continue - } - v, err := u.unmarshalValue(m.NewField(fd), raw, fd) - if err != nil { - return err - } - m.Set(fd, v) - } - - if !u.AllowUnknownFields && len(jsonObject) > 0 { - for name := range jsonObject { - return fmt.Errorf("unknown field %q in %v", name, md.FullName()) - } - } - return nil -} - -func isSingularWellKnownValue(fd protoreflect.FieldDescriptor) bool { - if md := fd.Message(); md != nil { - return md.FullName() == "google.protobuf.Value" && fd.Cardinality() != protoreflect.Repeated - } - return false -} - -func (u *Unmarshaler) unmarshalValue(v protoreflect.Value, in []byte, fd protoreflect.FieldDescriptor) (protoreflect.Value, error) { - switch { - case fd.IsList(): - var jsonArray []json.RawMessage - if err := json.Unmarshal(in, &jsonArray); err != nil { - return v, err - } - lv := v.List() - for _, raw := range jsonArray { - ve, err := u.unmarshalSingularValue(lv.NewElement(), raw, fd) - if err != nil { - return v, err - } - lv.Append(ve) - } - return v, nil - case fd.IsMap(): - var jsonObject map[string]json.RawMessage - if err := json.Unmarshal(in, &jsonObject); err != nil { - return v, err - } - kfd := fd.MapKey() - vfd := fd.MapValue() - mv := v.Map() - for key, raw := range jsonObject { - var kv protoreflect.MapKey - if kfd.Kind() == protoreflect.StringKind { - kv = protoreflect.ValueOf(key).MapKey() - } else { - v, err := u.unmarshalSingularValue(kfd.Default(), []byte(key), kfd) - if err != nil { - return v, err - } - kv = v.MapKey() - } - - vv, err := u.unmarshalSingularValue(mv.NewValue(), raw, vfd) - if err != nil { - return v, err - } - mv.Set(kv, vv) - } - return v, nil - default: - return u.unmarshalSingularValue(v, in, fd) - } -} - -var nonFinite = map[string]float64{ - `"NaN"`: math.NaN(), - `"Infinity"`: math.Inf(+1), - `"-Infinity"`: math.Inf(-1), -} - -func (u *Unmarshaler) unmarshalSingularValue(v protoreflect.Value, in []byte, fd protoreflect.FieldDescriptor) (protoreflect.Value, error) { - switch fd.Kind() { - case protoreflect.BoolKind: - return unmarshalValue(in, new(bool)) - case protoreflect.Int32Kind, protoreflect.Sint32Kind, protoreflect.Sfixed32Kind: - return unmarshalValue(trimQuote(in), new(int32)) - case protoreflect.Int64Kind, protoreflect.Sint64Kind, protoreflect.Sfixed64Kind: - return unmarshalValue(trimQuote(in), new(int64)) - case protoreflect.Uint32Kind, protoreflect.Fixed32Kind: - return unmarshalValue(trimQuote(in), new(uint32)) - case protoreflect.Uint64Kind, protoreflect.Fixed64Kind: - return unmarshalValue(trimQuote(in), new(uint64)) - case protoreflect.FloatKind: - if f, ok := nonFinite[string(in)]; ok { - return protoreflect.ValueOfFloat32(float32(f)), nil - } - return unmarshalValue(trimQuote(in), new(float32)) - case protoreflect.DoubleKind: - if f, ok := nonFinite[string(in)]; ok { - return protoreflect.ValueOfFloat64(float64(f)), nil - } - return unmarshalValue(trimQuote(in), new(float64)) - case protoreflect.StringKind: - return unmarshalValue(in, new(string)) - case protoreflect.BytesKind: - return unmarshalValue(in, new([]byte)) - case protoreflect.EnumKind: - if hasPrefixAndSuffix('"', in, '"') { - vd := fd.Enum().Values().ByName(protoreflect.Name(trimQuote(in))) - if vd == nil { - return v, fmt.Errorf("unknown value %q for enum %s", in, fd.Enum().FullName()) - } - return protoreflect.ValueOfEnum(vd.Number()), nil - } - return unmarshalValue(in, new(protoreflect.EnumNumber)) - case protoreflect.MessageKind, protoreflect.GroupKind: - err := u.unmarshalMessage(v.Message(), in) - return v, err - default: - panic(fmt.Sprintf("invalid kind %v", fd.Kind())) - } -} - -func unmarshalValue(in []byte, v interface{}) (protoreflect.Value, error) { - err := json.Unmarshal(in, v) - return protoreflect.ValueOf(reflect.ValueOf(v).Elem().Interface()), err -} - -func unquoteString(in string) (out string, err error) { - err = json.Unmarshal([]byte(in), &out) - return out, err -} - -func hasPrefixAndSuffix(prefix byte, in []byte, suffix byte) bool { - if len(in) >= 2 && in[0] == prefix && in[len(in)-1] == suffix { - return true - } - return false -} - -// trimQuote is like unquoteString but simply strips surrounding quotes. -// This is incorrect, but is behavior done by the legacy implementation. -func trimQuote(in []byte) []byte { - if len(in) >= 2 && in[0] == '"' && in[len(in)-1] == '"' { - in = in[1 : len(in)-1] - } - return in -} diff --git a/vendor/github.com/golang/protobuf/jsonpb/encode.go b/vendor/github.com/golang/protobuf/jsonpb/encode.go deleted file mode 100644 index 7633019f72..0000000000 --- a/vendor/github.com/golang/protobuf/jsonpb/encode.go +++ /dev/null @@ -1,554 +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 jsonpb - -import ( - "encoding/json" - "errors" - "fmt" - "io" - "math" - "reflect" - "sort" - "strconv" - "strings" - "time" - - "github.com/golang/protobuf/proto" - "google.golang.org/protobuf/encoding/protojson" - protoV2 "google.golang.org/protobuf/proto" - "google.golang.org/protobuf/reflect/protoreflect" - "google.golang.org/protobuf/reflect/protoregistry" -) - -const wrapJSONMarshalV2 = false - -// Marshaler is a configurable object for marshaling protocol buffer messages -// to the specified JSON representation. -type Marshaler struct { - // OrigName specifies whether to use the original protobuf name for fields. - OrigName bool - - // EnumsAsInts specifies whether to render enum values as integers, - // as opposed to string values. - EnumsAsInts bool - - // EmitDefaults specifies whether to render fields with zero values. - EmitDefaults bool - - // Indent controls whether the output is compact or not. - // If empty, the output is compact JSON. Otherwise, every JSON object - // entry and JSON array value will be on its own line. - // Each line will be preceded by repeated copies of Indent, where the - // number of copies is the current indentation depth. - Indent string - - // AnyResolver is used to resolve the google.protobuf.Any well-known type. - // If unset, the global registry is used by default. - AnyResolver AnyResolver -} - -// JSONPBMarshaler is implemented by protobuf messages that customize the -// way they are marshaled to JSON. Messages that implement this should also -// implement JSONPBUnmarshaler so that the custom format can be parsed. -// -// The JSON marshaling must follow the proto to JSON specification: -// https://developers.google.com/protocol-buffers/docs/proto3#json -// -// Deprecated: Custom types should implement protobuf reflection instead. -type JSONPBMarshaler interface { - MarshalJSONPB(*Marshaler) ([]byte, error) -} - -// Marshal serializes a protobuf message as JSON into w. -func (jm *Marshaler) Marshal(w io.Writer, m proto.Message) error { - b, err := jm.marshal(m) - if len(b) > 0 { - if _, err := w.Write(b); err != nil { - return err - } - } - return err -} - -// MarshalToString serializes a protobuf message as JSON in string form. -func (jm *Marshaler) MarshalToString(m proto.Message) (string, error) { - b, err := jm.marshal(m) - if err != nil { - return "", err - } - return string(b), nil -} - -func (jm *Marshaler) marshal(m proto.Message) ([]byte, error) { - v := reflect.ValueOf(m) - if m == nil || (v.Kind() == reflect.Ptr && v.IsNil()) { - return nil, errors.New("Marshal called with nil") - } - - // Check for custom marshalers first since they may not properly - // implement protobuf reflection that the logic below relies on. - if jsm, ok := m.(JSONPBMarshaler); ok { - return jsm.MarshalJSONPB(jm) - } - - if wrapJSONMarshalV2 { - opts := protojson.MarshalOptions{ - UseProtoNames: jm.OrigName, - UseEnumNumbers: jm.EnumsAsInts, - EmitUnpopulated: jm.EmitDefaults, - Indent: jm.Indent, - } - if jm.AnyResolver != nil { - opts.Resolver = anyResolver{jm.AnyResolver} - } - return opts.Marshal(proto.MessageReflect(m).Interface()) - } else { - // Check for unpopulated required fields first. - m2 := proto.MessageReflect(m) - if err := protoV2.CheckInitialized(m2.Interface()); err != nil { - return nil, err - } - - w := jsonWriter{Marshaler: jm} - err := w.marshalMessage(m2, "", "") - return w.buf, err - } -} - -type jsonWriter struct { - *Marshaler - buf []byte -} - -func (w *jsonWriter) write(s string) { - w.buf = append(w.buf, s...) -} - -func (w *jsonWriter) marshalMessage(m protoreflect.Message, indent, typeURL string) error { - if jsm, ok := proto.MessageV1(m.Interface()).(JSONPBMarshaler); ok { - b, err := jsm.MarshalJSONPB(w.Marshaler) - if err != nil { - return err - } - if typeURL != "" { - // we are marshaling this object to an Any type - var js map[string]*json.RawMessage - if err = json.Unmarshal(b, &js); err != nil { - return fmt.Errorf("type %T produced invalid JSON: %v", m.Interface(), err) - } - turl, err := json.Marshal(typeURL) - if err != nil { - return fmt.Errorf("failed to marshal type URL %q to JSON: %v", typeURL, err) - } - js["@type"] = (*json.RawMessage)(&turl) - if b, err = json.Marshal(js); err != nil { - return err - } - } - w.write(string(b)) - return nil - } - - md := m.Descriptor() - fds := md.Fields() - - // Handle well-known types. - const secondInNanos = int64(time.Second / time.Nanosecond) - switch wellKnownType(md.FullName()) { - case "Any": - return w.marshalAny(m, indent) - case "BoolValue", "BytesValue", "StringValue", - "Int32Value", "UInt32Value", "FloatValue", - "Int64Value", "UInt64Value", "DoubleValue": - fd := fds.ByNumber(1) - return w.marshalValue(fd, m.Get(fd), indent) - case "Duration": - // "Generated output always contains 0, 3, 6, or 9 fractional digits, - // depending on required precision." - s := m.Get(fds.ByNumber(1)).Int() - ns := m.Get(fds.ByNumber(2)).Int() - if ns <= -secondInNanos || ns >= secondInNanos { - return fmt.Errorf("ns out of range (%v, %v)", -secondInNanos, secondInNanos) - } - if (s > 0 && ns < 0) || (s < 0 && ns > 0) { - return errors.New("signs of seconds and nanos do not match") - } - if s < 0 { - ns = -ns - } - x := fmt.Sprintf("%d.%09d", s, ns) - x = strings.TrimSuffix(x, "000") - x = strings.TrimSuffix(x, "000") - x = strings.TrimSuffix(x, ".000") - w.write(fmt.Sprintf(`"%vs"`, x)) - return nil - case "Timestamp": - // "RFC 3339, where generated output will always be Z-normalized - // and uses 0, 3, 6 or 9 fractional digits." - s := m.Get(fds.ByNumber(1)).Int() - ns := m.Get(fds.ByNumber(2)).Int() - if ns < 0 || ns >= secondInNanos { - return fmt.Errorf("ns out of range [0, %v)", secondInNanos) - } - t := time.Unix(s, ns).UTC() - // time.RFC3339Nano isn't exactly right (we need to get 3/6/9 fractional digits). - x := t.Format("2006-01-02T15:04:05.000000000") - x = strings.TrimSuffix(x, "000") - x = strings.TrimSuffix(x, "000") - x = strings.TrimSuffix(x, ".000") - w.write(fmt.Sprintf(`"%vZ"`, x)) - return nil - case "Value": - // JSON value; which is a null, number, string, bool, object, or array. - od := md.Oneofs().Get(0) - fd := m.WhichOneof(od) - if fd == nil { - return errors.New("nil Value") - } - return w.marshalValue(fd, m.Get(fd), indent) - case "Struct", "ListValue": - // JSON object or array. - fd := fds.ByNumber(1) - return w.marshalValue(fd, m.Get(fd), indent) - } - - w.write("{") - if w.Indent != "" { - w.write("\n") - } - - firstField := true - if typeURL != "" { - if err := w.marshalTypeURL(indent, typeURL); err != nil { - return err - } - firstField = false - } - - for i := 0; i < fds.Len(); { - fd := fds.Get(i) - if od := fd.ContainingOneof(); od != nil { - fd = m.WhichOneof(od) - i += od.Fields().Len() - if fd == nil { - continue - } - } else { - i++ - } - - v := m.Get(fd) - - if !m.Has(fd) { - if !w.EmitDefaults || fd.ContainingOneof() != nil { - continue - } - if fd.Cardinality() != protoreflect.Repeated && (fd.Message() != nil || fd.Syntax() == protoreflect.Proto2) { - v = protoreflect.Value{} // use "null" for singular messages or proto2 scalars - } - } - - if !firstField { - w.writeComma() - } - if err := w.marshalField(fd, v, indent); err != nil { - return err - } - firstField = false - } - - // Handle proto2 extensions. - if md.ExtensionRanges().Len() > 0 { - // Collect a sorted list of all extension descriptor and values. - type ext struct { - desc protoreflect.FieldDescriptor - val protoreflect.Value - } - var exts []ext - m.Range(func(fd protoreflect.FieldDescriptor, v protoreflect.Value) bool { - if fd.IsExtension() { - exts = append(exts, ext{fd, v}) - } - return true - }) - sort.Slice(exts, func(i, j int) bool { - return exts[i].desc.Number() < exts[j].desc.Number() - }) - - for _, ext := range exts { - if !firstField { - w.writeComma() - } - if err := w.marshalField(ext.desc, ext.val, indent); err != nil { - return err - } - firstField = false - } - } - - if w.Indent != "" { - w.write("\n") - w.write(indent) - } - w.write("}") - return nil -} - -func (w *jsonWriter) writeComma() { - if w.Indent != "" { - w.write(",\n") - } else { - w.write(",") - } -} - -func (w *jsonWriter) marshalAny(m protoreflect.Message, indent string) error { - // "If the Any contains a value that has a special JSON mapping, - // it will be converted as follows: {"@type": xxx, "value": yyy}. - // Otherwise, the value will be converted into a JSON object, - // and the "@type" field will be inserted to indicate the actual data type." - md := m.Descriptor() - typeURL := m.Get(md.Fields().ByNumber(1)).String() - rawVal := m.Get(md.Fields().ByNumber(2)).Bytes() - - var m2 protoreflect.Message - if w.AnyResolver != nil { - mi, err := w.AnyResolver.Resolve(typeURL) - if err != nil { - return err - } - m2 = proto.MessageReflect(mi) - } else { - mt, err := protoregistry.GlobalTypes.FindMessageByURL(typeURL) - if err != nil { - return err - } - m2 = mt.New() - } - - if err := protoV2.Unmarshal(rawVal, m2.Interface()); err != nil { - return err - } - - if wellKnownType(m2.Descriptor().FullName()) == "" { - return w.marshalMessage(m2, indent, typeURL) - } - - w.write("{") - if w.Indent != "" { - w.write("\n") - } - if err := w.marshalTypeURL(indent, typeURL); err != nil { - return err - } - w.writeComma() - if w.Indent != "" { - w.write(indent) - w.write(w.Indent) - w.write(`"value": `) - } else { - w.write(`"value":`) - } - if err := w.marshalMessage(m2, indent+w.Indent, ""); err != nil { - return err - } - if w.Indent != "" { - w.write("\n") - w.write(indent) - } - w.write("}") - return nil -} - -func (w *jsonWriter) marshalTypeURL(indent, typeURL string) error { - if w.Indent != "" { - w.write(indent) - w.write(w.Indent) - } - w.write(`"@type":`) - if w.Indent != "" { - w.write(" ") - } - b, err := json.Marshal(typeURL) - if err != nil { - return err - } - w.write(string(b)) - return nil -} - -// marshalField writes field description and value to the Writer. -func (w *jsonWriter) marshalField(fd protoreflect.FieldDescriptor, v protoreflect.Value, indent string) error { - if w.Indent != "" { - w.write(indent) - w.write(w.Indent) - } - w.write(`"`) - switch { - case fd.IsExtension(): - // For message set, use the fname of the message as the extension name. - name := string(fd.FullName()) - if isMessageSet(fd.ContainingMessage()) { - name = strings.TrimSuffix(name, ".message_set_extension") - } - - w.write("[" + name + "]") - case w.OrigName: - name := string(fd.Name()) - if fd.Kind() == protoreflect.GroupKind { - name = string(fd.Message().Name()) - } - w.write(name) - default: - w.write(string(fd.JSONName())) - } - w.write(`":`) - if w.Indent != "" { - w.write(" ") - } - return w.marshalValue(fd, v, indent) -} - -func (w *jsonWriter) marshalValue(fd protoreflect.FieldDescriptor, v protoreflect.Value, indent string) error { - switch { - case fd.IsList(): - w.write("[") - comma := "" - lv := v.List() - for i := 0; i < lv.Len(); i++ { - w.write(comma) - if w.Indent != "" { - w.write("\n") - w.write(indent) - w.write(w.Indent) - w.write(w.Indent) - } - if err := w.marshalSingularValue(fd, lv.Get(i), indent+w.Indent); err != nil { - return err - } - comma = "," - } - if w.Indent != "" { - w.write("\n") - w.write(indent) - w.write(w.Indent) - } - w.write("]") - return nil - case fd.IsMap(): - kfd := fd.MapKey() - vfd := fd.MapValue() - mv := v.Map() - - // Collect a sorted list of all map keys and values. - type entry struct{ key, val protoreflect.Value } - var entries []entry - mv.Range(func(k protoreflect.MapKey, v protoreflect.Value) bool { - entries = append(entries, entry{k.Value(), v}) - return true - }) - sort.Slice(entries, func(i, j int) bool { - switch kfd.Kind() { - case protoreflect.BoolKind: - return !entries[i].key.Bool() && entries[j].key.Bool() - case protoreflect.Int32Kind, protoreflect.Sint32Kind, protoreflect.Sfixed32Kind, protoreflect.Int64Kind, protoreflect.Sint64Kind, protoreflect.Sfixed64Kind: - return entries[i].key.Int() < entries[j].key.Int() - case protoreflect.Uint32Kind, protoreflect.Fixed32Kind, protoreflect.Uint64Kind, protoreflect.Fixed64Kind: - return entries[i].key.Uint() < entries[j].key.Uint() - case protoreflect.StringKind: - return entries[i].key.String() < entries[j].key.String() - default: - panic("invalid kind") - } - }) - - w.write(`{`) - comma := "" - for _, entry := range entries { - w.write(comma) - if w.Indent != "" { - w.write("\n") - w.write(indent) - w.write(w.Indent) - w.write(w.Indent) - } - - s := fmt.Sprint(entry.key.Interface()) - b, err := json.Marshal(s) - if err != nil { - return err - } - w.write(string(b)) - - w.write(`:`) - if w.Indent != "" { - w.write(` `) - } - - if err := w.marshalSingularValue(vfd, entry.val, indent+w.Indent); err != nil { - return err - } - comma = "," - } - if w.Indent != "" { - w.write("\n") - w.write(indent) - w.write(w.Indent) - } - w.write(`}`) - return nil - default: - return w.marshalSingularValue(fd, v, indent) - } -} - -func (w *jsonWriter) marshalSingularValue(fd protoreflect.FieldDescriptor, v protoreflect.Value, indent string) error { - switch { - case !v.IsValid(): - w.write("null") - return nil - case fd.Message() != nil: - return w.marshalMessage(v.Message(), indent+w.Indent, "") - case fd.Enum() != nil: - if fd.Enum().FullName() == "google.protobuf.NullValue" { - w.write("null") - return nil - } - - vd := fd.Enum().Values().ByNumber(v.Enum()) - if vd == nil || w.EnumsAsInts { - w.write(strconv.Itoa(int(v.Enum()))) - } else { - w.write(`"` + string(vd.Name()) + `"`) - } - return nil - default: - switch v.Interface().(type) { - case float32, float64: - switch { - case math.IsInf(v.Float(), +1): - w.write(`"Infinity"`) - return nil - case math.IsInf(v.Float(), -1): - w.write(`"-Infinity"`) - return nil - case math.IsNaN(v.Float()): - w.write(`"NaN"`) - return nil - } - case int64, uint64: - w.write(fmt.Sprintf(`"%d"`, v.Interface())) - return nil - } - - b, err := json.Marshal(v.Interface()) - if err != nil { - return err - } - w.write(string(b)) - return nil - } -} diff --git a/vendor/github.com/golang/protobuf/jsonpb/json.go b/vendor/github.com/golang/protobuf/jsonpb/json.go deleted file mode 100644 index 480e2448de..0000000000 --- a/vendor/github.com/golang/protobuf/jsonpb/json.go +++ /dev/null @@ -1,69 +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 jsonpb provides functionality to marshal and unmarshal between a -// protocol buffer message and JSON. It follows the specification at -// https://developers.google.com/protocol-buffers/docs/proto3#json. -// -// Do not rely on the default behavior of the standard encoding/json package -// when called on generated message types as it does not operate correctly. -// -// Deprecated: Use the "google.golang.org/protobuf/encoding/protojson" -// package instead. -package jsonpb - -import ( - "github.com/golang/protobuf/proto" - "google.golang.org/protobuf/reflect/protoreflect" - "google.golang.org/protobuf/reflect/protoregistry" - "google.golang.org/protobuf/runtime/protoimpl" -) - -// AnyResolver takes a type URL, present in an Any message, -// and resolves it into an instance of the associated message. -type AnyResolver interface { - Resolve(typeURL string) (proto.Message, error) -} - -type anyResolver struct{ AnyResolver } - -func (r anyResolver) FindMessageByName(message protoreflect.FullName) (protoreflect.MessageType, error) { - return r.FindMessageByURL(string(message)) -} - -func (r anyResolver) FindMessageByURL(url string) (protoreflect.MessageType, error) { - m, err := r.Resolve(url) - if err != nil { - return nil, err - } - return protoimpl.X.MessageTypeOf(m), nil -} - -func (r anyResolver) FindExtensionByName(field protoreflect.FullName) (protoreflect.ExtensionType, error) { - return protoregistry.GlobalTypes.FindExtensionByName(field) -} - -func (r anyResolver) FindExtensionByNumber(message protoreflect.FullName, field protoreflect.FieldNumber) (protoreflect.ExtensionType, error) { - return protoregistry.GlobalTypes.FindExtensionByNumber(message, field) -} - -func wellKnownType(s protoreflect.FullName) string { - if s.Parent() == "google.protobuf" { - switch s.Name() { - case "Empty", "Any", - "BoolValue", "BytesValue", "StringValue", - "Int32Value", "UInt32Value", "FloatValue", - "Int64Value", "UInt64Value", "DoubleValue", - "Duration", "Timestamp", - "NullValue", "Struct", "Value", "ListValue": - return string(s.Name()) - } - } - return "" -} - -func isMessageSet(md protoreflect.MessageDescriptor) bool { - ms, ok := md.(interface{ IsMessageSet() bool }) - return ok && ms.IsMessageSet() -} diff --git a/vendor/github.com/golang/protobuf/ptypes/empty/empty.pb.go b/vendor/github.com/golang/protobuf/ptypes/empty/empty.pb.go deleted file mode 100644 index 16686a6552..0000000000 --- a/vendor/github.com/golang/protobuf/ptypes/empty/empty.pb.go +++ /dev/null @@ -1,62 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// source: github.com/golang/protobuf/ptypes/empty/empty.proto - -package empty - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - emptypb "google.golang.org/protobuf/types/known/emptypb" - reflect "reflect" -) - -// Symbols defined in public import of google/protobuf/empty.proto. - -type Empty = emptypb.Empty - -var File_github_com_golang_protobuf_ptypes_empty_empty_proto protoreflect.FileDescriptor - -var file_github_com_golang_protobuf_ptypes_empty_empty_proto_rawDesc = []byte{ - 0x0a, 0x33, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x6f, 0x6c, - 0x61, 0x6e, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x70, 0x74, 0x79, - 0x70, 0x65, 0x73, 0x2f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x42, 0x2f, 0x5a, 0x2d, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, - 0x2f, 0x67, 0x6f, 0x6c, 0x61, 0x6e, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, - 0x2f, 0x70, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x3b, 0x65, 0x6d, - 0x70, 0x74, 0x79, 0x50, 0x00, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var file_github_com_golang_protobuf_ptypes_empty_empty_proto_goTypes = []interface{}{} -var file_github_com_golang_protobuf_ptypes_empty_empty_proto_depIdxs = []int32{ - 0, // [0:0] is the sub-list for method output_type - 0, // [0:0] is the sub-list for method input_type - 0, // [0:0] is the sub-list for extension type_name - 0, // [0:0] is the sub-list for extension extendee - 0, // [0:0] is the sub-list for field type_name -} - -func init() { file_github_com_golang_protobuf_ptypes_empty_empty_proto_init() } -func file_github_com_golang_protobuf_ptypes_empty_empty_proto_init() { - if File_github_com_golang_protobuf_ptypes_empty_empty_proto != nil { - return - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_github_com_golang_protobuf_ptypes_empty_empty_proto_rawDesc, - NumEnums: 0, - NumMessages: 0, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_github_com_golang_protobuf_ptypes_empty_empty_proto_goTypes, - DependencyIndexes: file_github_com_golang_protobuf_ptypes_empty_empty_proto_depIdxs, - }.Build() - File_github_com_golang_protobuf_ptypes_empty_empty_proto = out.File - file_github_com_golang_protobuf_ptypes_empty_empty_proto_rawDesc = nil - file_github_com_golang_protobuf_ptypes_empty_empty_proto_goTypes = nil - file_github_com_golang_protobuf_ptypes_empty_empty_proto_depIdxs = nil -} diff --git a/vendor/github.com/golang/protobuf/ptypes/struct/struct.pb.go b/vendor/github.com/golang/protobuf/ptypes/struct/struct.pb.go deleted file mode 100644 index 8d82abe213..0000000000 --- a/vendor/github.com/golang/protobuf/ptypes/struct/struct.pb.go +++ /dev/null @@ -1,78 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// source: github.com/golang/protobuf/ptypes/struct/struct.proto - -package structpb - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - structpb "google.golang.org/protobuf/types/known/structpb" - reflect "reflect" -) - -// Symbols defined in public import of google/protobuf/struct.proto. - -type NullValue = structpb.NullValue - -const NullValue_NULL_VALUE = structpb.NullValue_NULL_VALUE - -var NullValue_name = structpb.NullValue_name -var NullValue_value = structpb.NullValue_value - -type Struct = structpb.Struct -type Value = structpb.Value -type Value_NullValue = structpb.Value_NullValue -type Value_NumberValue = structpb.Value_NumberValue -type Value_StringValue = structpb.Value_StringValue -type Value_BoolValue = structpb.Value_BoolValue -type Value_StructValue = structpb.Value_StructValue -type Value_ListValue = structpb.Value_ListValue -type ListValue = structpb.ListValue - -var File_github_com_golang_protobuf_ptypes_struct_struct_proto protoreflect.FileDescriptor - -var file_github_com_golang_protobuf_ptypes_struct_struct_proto_rawDesc = []byte{ - 0x0a, 0x35, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x6f, 0x6c, - 0x61, 0x6e, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x70, 0x74, 0x79, - 0x70, 0x65, 0x73, 0x2f, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x2f, 0x73, 0x74, 0x72, 0x75, 0x63, - 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x42, 0x33, 0x5a, 0x31, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, - 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x6f, 0x6c, 0x61, 0x6e, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x62, 0x75, 0x66, 0x2f, 0x70, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x73, 0x74, 0x72, 0x75, 0x63, - 0x74, 0x3b, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x70, 0x62, 0x50, 0x00, 0x62, 0x06, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x33, -} - -var file_github_com_golang_protobuf_ptypes_struct_struct_proto_goTypes = []interface{}{} -var file_github_com_golang_protobuf_ptypes_struct_struct_proto_depIdxs = []int32{ - 0, // [0:0] is the sub-list for method output_type - 0, // [0:0] is the sub-list for method input_type - 0, // [0:0] is the sub-list for extension type_name - 0, // [0:0] is the sub-list for extension extendee - 0, // [0:0] is the sub-list for field type_name -} - -func init() { file_github_com_golang_protobuf_ptypes_struct_struct_proto_init() } -func file_github_com_golang_protobuf_ptypes_struct_struct_proto_init() { - if File_github_com_golang_protobuf_ptypes_struct_struct_proto != nil { - return - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_github_com_golang_protobuf_ptypes_struct_struct_proto_rawDesc, - NumEnums: 0, - NumMessages: 0, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_github_com_golang_protobuf_ptypes_struct_struct_proto_goTypes, - DependencyIndexes: file_github_com_golang_protobuf_ptypes_struct_struct_proto_depIdxs, - }.Build() - File_github_com_golang_protobuf_ptypes_struct_struct_proto = out.File - file_github_com_golang_protobuf_ptypes_struct_struct_proto_rawDesc = nil - file_github_com_golang_protobuf_ptypes_struct_struct_proto_goTypes = nil - file_github_com_golang_protobuf_ptypes_struct_struct_proto_depIdxs = nil -} diff --git a/vendor/github.com/grpc-ecosystem/go-grpc-middleware/.gitignore b/vendor/github.com/grpc-ecosystem/go-grpc-middleware/.gitignore deleted file mode 100644 index 826caa3902..0000000000 --- a/vendor/github.com/grpc-ecosystem/go-grpc-middleware/.gitignore +++ /dev/null @@ -1,204 +0,0 @@ -# Created by .ignore support plugin (hsz.mobi) -### Go template -# 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 -### Windows template -# Windows image file caches -Thumbs.db -ehthumbs.db - -# Folder config file -Desktop.ini - -# Recycle Bin used on file shares -$RECYCLE.BIN/ - -# Windows Installer files -*.cab -*.msi -*.msm -*.msp - -# Windows shortcuts -*.lnk -### Kate template -# Swap Files # -.*.kate-swp -.swp.* -### SublimeText template -# cache files for sublime text -*.tmlanguage.cache -*.tmPreferences.cache -*.stTheme.cache - -# workspace files are user-specific -*.sublime-workspace - -# project files should be checked into the repository, unless a significant -# proportion of contributors will probably not be using SublimeText -# *.sublime-project - -# sftp configuration file -sftp-config.json -### Linux template -*~ - -# temporary files which can be created if a process still has a handle open of a deleted file -.fuse_hidden* - -# KDE directory preferences -.directory - -# Linux trash folder which might appear on any partition or disk -.Trash-* -### JetBrains template -# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm -# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 - -# User-specific stuff: -.idea -.idea/tasks.xml -.idea/dictionaries -.idea/vcs.xml -.idea/jsLibraryMappings.xml - -# Sensitive or high-churn files: -.idea/dataSources.ids -.idea/dataSources.xml -.idea/dataSources.local.xml -.idea/sqlDataSources.xml -.idea/dynamic.xml -.idea/uiDesigner.xml - -# Gradle: -.idea/gradle.xml -.idea/libraries - -# Mongo Explorer plugin: -.idea/mongoSettings.xml - -## File-based project format: -*.iws - -## Plugin-specific files: - -# IntelliJ -/out/ - -# mpeltonen/sbt-idea plugin -.idea_modules/ - -# JIRA plugin -atlassian-ide-plugin.xml - -# Crashlytics plugin (for Android Studio and IntelliJ) -com_crashlytics_export_strings.xml -crashlytics.properties -crashlytics-build.properties -fabric.properties -### Xcode template -# Xcode -# -# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore - -## Build generated -build/ -DerivedData/ - -## Various settings -*.pbxuser -!default.pbxuser -*.mode1v3 -!default.mode1v3 -*.mode2v3 -!default.mode2v3 -*.perspectivev3 -!default.perspectivev3 -xcuserdata/ - -## Other -*.moved-aside -*.xccheckout -*.xcscmblueprint -### Eclipse template - -.metadata -bin/ -tmp/ -*.tmp -*.bak -*.swp -*~.nib -local.properties -.settings/ -.loadpath -.recommenders - -# Eclipse Core -.project - -# External tool builders -.externalToolBuilders/ - -# Locally stored "Eclipse launch configurations" -*.launch - -# PyDev specific (Python IDE for Eclipse) -*.pydevproject - -# CDT-specific (C/C++ Development Tooling) -.cproject - -# JDT-specific (Eclipse Java Development Tools) -.classpath - -# Java annotation processor (APT) -.factorypath - -# PDT-specific (PHP Development Tools) -.buildpath - -# sbteclipse plugin -.target - -# Tern plugin -.tern-project - -# TeXlipse plugin -.texlipse - -# STS (Spring Tool Suite) -.springBeans - -# Code Recommenders -.recommenders/ - - -coverage.txt - -#vendor -vendor/ - -.envrc \ No newline at end of file diff --git a/vendor/github.com/grpc-ecosystem/go-grpc-middleware/.travis.yml b/vendor/github.com/grpc-ecosystem/go-grpc-middleware/.travis.yml deleted file mode 100644 index 50730b83a7..0000000000 --- a/vendor/github.com/grpc-ecosystem/go-grpc-middleware/.travis.yml +++ /dev/null @@ -1,15 +0,0 @@ -sudo: false -language: go -go: - - 1.11.x - - 1.12.x - -env: - global: - - GO111MODULE=on - -script: - - make test - -after_success: - - bash <(curl -s https://codecov.io/bash) diff --git a/vendor/github.com/grpc-ecosystem/go-grpc-middleware/CHANGELOG.md b/vendor/github.com/grpc-ecosystem/go-grpc-middleware/CHANGELOG.md deleted file mode 100644 index 45644234df..0000000000 --- a/vendor/github.com/grpc-ecosystem/go-grpc-middleware/CHANGELOG.md +++ /dev/null @@ -1,31 +0,0 @@ -# Changelog -All notable changes to this project will be documented in this file. - -The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) -and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). - -Types of changes: -- `Added` for new features. -- `Changed` for changes in existing functionality. -- `Deprecated` for soon-to-be removed features. -- `Removed` for now removed features. -- `Fixed` for any bug fixes. -- `Security` in case of vulnerabilities. - -## [Unreleased] -### Added -- This CHANGELOG file to keep track of changes. -- Support for go modules. - -## 1.0.0 - 2018-05-08 -### Added -- grpc_auth -- grpc_ctxtags -- grpc_zap -- grpc_logrus -- grpc_opentracing -- grpc_retry -- grpc_validator -- grpc_recovery - -[Unreleased]: https://github.com/grpc-ecosystem/go-grpc-middleware/compare/v1.0.0...HEAD diff --git a/vendor/github.com/grpc-ecosystem/go-grpc-middleware/CONTRIBUTING.md b/vendor/github.com/grpc-ecosystem/go-grpc-middleware/CONTRIBUTING.md deleted file mode 100644 index dd52ab8938..0000000000 --- a/vendor/github.com/grpc-ecosystem/go-grpc-middleware/CONTRIBUTING.md +++ /dev/null @@ -1,20 +0,0 @@ -# Contributing - -We would love to have people submit pull requests and help make `grpc-ecosystem/go-grpc-middleware` even better 👍. - -Fork, then clone the repo: - -```bash -git clone git@github.com:your-username/go-grpc-middleware.git -``` - -Before checking in please run the following: - -```bash -make all -``` - -This will `vet`, `fmt`, regenerate documentation and run all tests. - - -Push to your fork and open a pull request. \ No newline at end of file diff --git a/vendor/github.com/grpc-ecosystem/go-grpc-middleware/README.md b/vendor/github.com/grpc-ecosystem/go-grpc-middleware/README.md deleted file mode 100644 index 0008e800bf..0000000000 --- a/vendor/github.com/grpc-ecosystem/go-grpc-middleware/README.md +++ /dev/null @@ -1,85 +0,0 @@ -# Go gRPC Middleware - -[![Travis Build](https://travis-ci.org/grpc-ecosystem/go-grpc-middleware.svg?branch=master)](https://travis-ci.org/grpc-ecosystem/go-grpc-middleware) -[![Go Report Card](https://goreportcard.com/badge/github.com/grpc-ecosystem/go-grpc-middleware)](https://goreportcard.com/report/github.com/grpc-ecosystem/go-grpc-middleware) -[![GoDoc](http://img.shields.io/badge/GoDoc-Reference-blue.svg)](https://godoc.org/github.com/grpc-ecosystem/go-grpc-middleware) -[![SourceGraph](https://sourcegraph.com/github.com/grpc-ecosystem/go-grpc-middleware/-/badge.svg)](https://sourcegraph.com/github.com/grpc-ecosystem/go-grpc-middleware/?badge) -[![codecov](https://codecov.io/gh/grpc-ecosystem/go-grpc-middleware/branch/master/graph/badge.svg)](https://codecov.io/gh/grpc-ecosystem/go-grpc-middleware) -[![Apache 2.0 License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](LICENSE) -[![quality: production](https://img.shields.io/badge/quality-production-orange.svg)](#status) -[![Slack](slack.png)](https://join.slack.com/t/improbable-eng/shared_invite/enQtMzQ1ODcyMzQ5MjM4LWY5ZWZmNGM2ODc5MmViNmQ3ZTA3ZTY3NzQwOTBlMTkzZmIxZTIxODk0OWU3YjZhNWVlNDU3MDlkZGViZjhkMjc) - -[gRPC Go](https://github.com/grpc/grpc-go) Middleware: interceptors, helpers, utilities. - -## Middleware - -[gRPC Go](https://github.com/grpc/grpc-go) recently acquired support for -Interceptors, i.e. [middleware](https://medium.com/@matryer/writing-middleware-in-golang-and-how-go-makes-it-so-much-fun-4375c1246e81#.gv7tdlghs) -that is executed either on the gRPC Server before the request is passed onto the user's application logic, or on the gRPC client either around the user call. It is a perfect way to implement -common patterns: auth, logging, message, validation, retries or monitoring. - -These are generic building blocks that make it easy to build multiple microservices easily. -The purpose of this repository is to act as a go-to point for such reusable functionality. It contains -some of them itself, but also will link to useful external repos. - -`grpc_middleware` itself provides support for chaining interceptors, here's an example: - -```go -import "github.com/grpc-ecosystem/go-grpc-middleware" - -myServer := grpc.NewServer( - grpc.StreamInterceptor(grpc_middleware.ChainStreamServer( - grpc_ctxtags.StreamServerInterceptor(), - grpc_opentracing.StreamServerInterceptor(), - grpc_prometheus.StreamServerInterceptor, - grpc_zap.StreamServerInterceptor(zapLogger), - grpc_auth.StreamServerInterceptor(myAuthFunction), - grpc_recovery.StreamServerInterceptor(), - )), - grpc.UnaryInterceptor(grpc_middleware.ChainUnaryServer( - grpc_ctxtags.UnaryServerInterceptor(), - grpc_opentracing.UnaryServerInterceptor(), - grpc_prometheus.UnaryServerInterceptor, - grpc_zap.UnaryServerInterceptor(zapLogger), - grpc_auth.UnaryServerInterceptor(myAuthFunction), - grpc_recovery.UnaryServerInterceptor(), - )), -) -``` - -## Interceptors - -*Please send a PR to add new interceptors or middleware to this list* - -#### Auth - * [`grpc_auth`](auth) - a customizable (via `AuthFunc`) piece of auth middleware - -#### Logging - * [`grpc_ctxtags`](tags/) - a library that adds a `Tag` map to context, with data populated from request body - * [`grpc_zap`](logging/zap/) - integration of [zap](https://github.com/uber-go/zap) logging library into gRPC handlers. - * [`grpc_logrus`](logging/logrus/) - integration of [logrus](https://github.com/sirupsen/logrus) logging library into gRPC handlers. - - -#### Monitoring - * [`grpc_prometheus`⚡](https://github.com/grpc-ecosystem/go-grpc-prometheus) - Prometheus client-side and server-side monitoring middleware - * [`otgrpc`⚡](https://github.com/grpc-ecosystem/grpc-opentracing/tree/master/go/otgrpc) - [OpenTracing](http://opentracing.io/) client-side and server-side interceptors - * [`grpc_opentracing`](tracing/opentracing) - [OpenTracing](http://opentracing.io/) client-side and server-side interceptors with support for streaming and handler-returned tags - -#### Client - * [`grpc_retry`](retry/) - a generic gRPC response code retry mechanism, client-side middleware - -#### Server - * [`grpc_validator`](validator/) - codegen inbound message validation from `.proto` options - * [`grpc_recovery`](recovery/) - turn panics into gRPC errors - * [`ratelimit`](ratelimit/) - grpc rate limiting by your own limiter - - -## Status - -This code has been running in *production* since May 2016 as the basis of the gRPC micro services stack at [Improbable](https://improbable.io). - -Additional tooling will be added, and contributions are welcome. - -## License - -`go-grpc-middleware` is released under the Apache 2.0 license. See the [LICENSE](LICENSE) file for details. diff --git a/vendor/github.com/grpc-ecosystem/go-grpc-middleware/chain.go b/vendor/github.com/grpc-ecosystem/go-grpc-middleware/chain.go deleted file mode 100644 index ea3738b896..0000000000 --- a/vendor/github.com/grpc-ecosystem/go-grpc-middleware/chain.go +++ /dev/null @@ -1,120 +0,0 @@ -// Copyright 2016 Michal Witkowski. All Rights Reserved. -// See LICENSE for licensing terms. - -// gRPC Server Interceptor chaining middleware. - -package grpc_middleware - -import ( - "context" - - "google.golang.org/grpc" -) - -// ChainUnaryServer creates a single interceptor out of a chain of many interceptors. -// -// Execution is done in left-to-right order, including passing of context. -// For example ChainUnaryServer(one, two, three) will execute one before two before three, and three -// will see context changes of one and two. -func ChainUnaryServer(interceptors ...grpc.UnaryServerInterceptor) grpc.UnaryServerInterceptor { - n := len(interceptors) - - return func(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error) { - chainer := func(currentInter grpc.UnaryServerInterceptor, currentHandler grpc.UnaryHandler) grpc.UnaryHandler { - return func(currentCtx context.Context, currentReq interface{}) (interface{}, error) { - return currentInter(currentCtx, currentReq, info, currentHandler) - } - } - - chainedHandler := handler - for i := n - 1; i >= 0; i-- { - chainedHandler = chainer(interceptors[i], chainedHandler) - } - - return chainedHandler(ctx, req) - } -} - -// ChainStreamServer creates a single interceptor out of a chain of many interceptors. -// -// Execution is done in left-to-right order, including passing of context. -// For example ChainUnaryServer(one, two, three) will execute one before two before three. -// If you want to pass context between interceptors, use WrapServerStream. -func ChainStreamServer(interceptors ...grpc.StreamServerInterceptor) grpc.StreamServerInterceptor { - n := len(interceptors) - - return func(srv interface{}, ss grpc.ServerStream, info *grpc.StreamServerInfo, handler grpc.StreamHandler) error { - chainer := func(currentInter grpc.StreamServerInterceptor, currentHandler grpc.StreamHandler) grpc.StreamHandler { - return func(currentSrv interface{}, currentStream grpc.ServerStream) error { - return currentInter(currentSrv, currentStream, info, currentHandler) - } - } - - chainedHandler := handler - for i := n - 1; i >= 0; i-- { - chainedHandler = chainer(interceptors[i], chainedHandler) - } - - return chainedHandler(srv, ss) - } -} - -// ChainUnaryClient creates a single interceptor out of a chain of many interceptors. -// -// Execution is done in left-to-right order, including passing of context. -// For example ChainUnaryClient(one, two, three) will execute one before two before three. -func ChainUnaryClient(interceptors ...grpc.UnaryClientInterceptor) grpc.UnaryClientInterceptor { - n := len(interceptors) - - return func(ctx context.Context, method string, req, reply interface{}, cc *grpc.ClientConn, invoker grpc.UnaryInvoker, opts ...grpc.CallOption) error { - chainer := func(currentInter grpc.UnaryClientInterceptor, currentInvoker grpc.UnaryInvoker) grpc.UnaryInvoker { - return func(currentCtx context.Context, currentMethod string, currentReq, currentRepl interface{}, currentConn *grpc.ClientConn, currentOpts ...grpc.CallOption) error { - return currentInter(currentCtx, currentMethod, currentReq, currentRepl, currentConn, currentInvoker, currentOpts...) - } - } - - chainedInvoker := invoker - for i := n - 1; i >= 0; i-- { - chainedInvoker = chainer(interceptors[i], chainedInvoker) - } - - return chainedInvoker(ctx, method, req, reply, cc, opts...) - } -} - -// ChainStreamClient creates a single interceptor out of a chain of many interceptors. -// -// Execution is done in left-to-right order, including passing of context. -// For example ChainStreamClient(one, two, three) will execute one before two before three. -func ChainStreamClient(interceptors ...grpc.StreamClientInterceptor) grpc.StreamClientInterceptor { - n := len(interceptors) - - return func(ctx context.Context, desc *grpc.StreamDesc, cc *grpc.ClientConn, method string, streamer grpc.Streamer, opts ...grpc.CallOption) (grpc.ClientStream, error) { - chainer := func(currentInter grpc.StreamClientInterceptor, currentStreamer grpc.Streamer) grpc.Streamer { - return func(currentCtx context.Context, currentDesc *grpc.StreamDesc, currentConn *grpc.ClientConn, currentMethod string, currentOpts ...grpc.CallOption) (grpc.ClientStream, error) { - return currentInter(currentCtx, currentDesc, currentConn, currentMethod, currentStreamer, currentOpts...) - } - } - - chainedStreamer := streamer - for i := n - 1; i >= 0; i-- { - chainedStreamer = chainer(interceptors[i], chainedStreamer) - } - - return chainedStreamer(ctx, desc, cc, method, opts...) - } -} - -// Chain creates a single interceptor out of a chain of many interceptors. -// -// WithUnaryServerChain is a grpc.Server config option that accepts multiple unary interceptors. -// Basically syntactic sugar. -func WithUnaryServerChain(interceptors ...grpc.UnaryServerInterceptor) grpc.ServerOption { - return grpc.UnaryInterceptor(ChainUnaryServer(interceptors...)) -} - -// WithStreamServerChain is a grpc.Server config option that accepts multiple stream interceptors. -// Basically syntactic sugar. -func WithStreamServerChain(interceptors ...grpc.StreamServerInterceptor) grpc.ServerOption { - return grpc.StreamInterceptor(ChainStreamServer(interceptors...)) -} diff --git a/vendor/github.com/grpc-ecosystem/go-grpc-middleware/doc.go b/vendor/github.com/grpc-ecosystem/go-grpc-middleware/doc.go deleted file mode 100644 index 7168950364..0000000000 --- a/vendor/github.com/grpc-ecosystem/go-grpc-middleware/doc.go +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright 2016 Michal Witkowski. All Rights Reserved. -// See LICENSE for licensing terms. - -/* -`grpc_middleware` is a collection of gRPC middleware packages: interceptors, helpers and tools. - -Middleware - -gRPC is a fantastic RPC middleware, which sees a lot of adoption in the Golang world. However, the -upstream gRPC codebase is relatively bare bones. - -This package, and most of its child packages provides commonly needed middleware for gRPC: -client-side interceptors for retires, server-side interceptors for input validation and auth, -functions for chaining said interceptors, metadata convenience methods and more. - -Chaining - -By default, gRPC doesn't allow one to have more than one interceptor either on the client nor on -the server side. `grpc_middleware` provides convenient chaining methods - -Simple way of turning a multiple interceptors into a single interceptor. Here's an example for -server chaining: - - myServer := grpc.NewServer( - grpc.StreamInterceptor(grpc_middleware.ChainStreamServer(loggingStream, monitoringStream, authStream)), - grpc.UnaryInterceptor(grpc_middleware.ChainUnaryServer(loggingUnary, monitoringUnary, authUnary), - ) - -These interceptors will be executed from left to right: logging, monitoring and auth. - -Here's an example for client side chaining: - - clientConn, err = grpc.Dial( - address, - grpc.WithUnaryInterceptor(grpc_middleware.ChainUnaryClient(monitoringClientUnary, retryUnary)), - grpc.WithStreamInterceptor(grpc_middleware.ChainStreamClient(monitoringClientStream, retryStream)), - ) - client = pb_testproto.NewTestServiceClient(clientConn) - resp, err := client.PingEmpty(s.ctx, &myservice.Request{Msg: "hello"}) - -These interceptors will be executed from left to right: monitoring and then retry logic. - -The retry interceptor will call every interceptor that follows it whenever when a retry happens. - -Writing Your Own - -Implementing your own interceptor is pretty trivial: there are interfaces for that. But the interesting -bit exposing common data to handlers (and other middleware), similarly to HTTP Middleware design. -For example, you may want to pass the identity of the caller from the auth interceptor all the way -to the handling function. - -For example, a client side interceptor example for auth looks like: - - func FakeAuthUnaryInterceptor(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error) { - newCtx := context.WithValue(ctx, "user_id", "john@example.com") - return handler(newCtx, req) - } - -Unfortunately, it's not as easy for streaming RPCs. These have the `context.Context` embedded within -the `grpc.ServerStream` object. To pass values through context, a wrapper (`WrappedServerStream`) is -needed. For example: - - func FakeAuthStreamingInterceptor(srv interface{}, stream grpc.ServerStream, info *grpc.StreamServerInfo, handler grpc.StreamHandler) error { - newStream := grpc_middleware.WrapServerStream(stream) - newStream.WrappedContext = context.WithValue(ctx, "user_id", "john@example.com") - return handler(srv, stream) - } -*/ -package grpc_middleware diff --git a/vendor/github.com/grpc-ecosystem/go-grpc-middleware/go.mod b/vendor/github.com/grpc-ecosystem/go-grpc-middleware/go.mod deleted file mode 100644 index 91fd6111e7..0000000000 --- a/vendor/github.com/grpc-ecosystem/go-grpc-middleware/go.mod +++ /dev/null @@ -1,17 +0,0 @@ -module github.com/grpc-ecosystem/go-grpc-middleware - -require ( - github.com/gogo/protobuf v1.2.1 - github.com/golang/protobuf v1.3.2 - github.com/opentracing/opentracing-go v1.1.0 - github.com/pkg/errors v0.8.1 // indirect - github.com/sirupsen/logrus v1.4.2 - github.com/stretchr/testify v1.4.0 - go.uber.org/atomic v1.4.0 // indirect - go.uber.org/multierr v1.1.0 // indirect - go.uber.org/zap v1.10.0 - golang.org/x/net v0.0.0-20190311183353-d8887717615a - golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be - google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55 // indirect - google.golang.org/grpc v1.19.0 -) diff --git a/vendor/github.com/grpc-ecosystem/go-grpc-middleware/go.sum b/vendor/github.com/grpc-ecosystem/go-grpc-middleware/go.sum deleted file mode 100644 index f142425f66..0000000000 --- a/vendor/github.com/grpc-ecosystem/go-grpc-middleware/go.sum +++ /dev/null @@ -1,78 +0,0 @@ -cloud.google.com/go v0.26.0 h1:e0WKqKTd5BnrG8aKH3J3h+QvEIQtSUcf2n5UZ5ZgLtQ= -cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= -github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= -github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/gogo/protobuf v1.2.1 h1:/s5zKNz0uPFCZ5hddgPdo2TK2TVrUNMn0OOX8/aZMTE= -github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= -github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58= -github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM= -github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.2 h1:6nsPYzhq5kReh6QImI3k5qWzO4PEbvbIW2cwSfR/6xs= -github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= -github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/konsorten/go-windows-terminal-sequences v1.0.1 h1:mweAR1A6xJ3oS2pRaGiHgQ4OO8tzTaLawm8vnODuwDk= -github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/opentracing/opentracing-go v1.1.0 h1:pWlfV3Bxv7k65HYwkikxat0+s3pV4bsqf19k25Ur8rU= -github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= -github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= -github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= -github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/sirupsen/logrus v1.4.2 h1:SPIRibHv4MatM3XXNO2BJeFLZwZ2LvZgfQ5+UNI2im4= -github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= -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/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= -github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk= -github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= -go.uber.org/atomic v1.4.0 h1:cxzIVoETapQEqDhQu3QfnvXAV4AlzcvUCxkVUFw3+EU= -go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= -go.uber.org/multierr v1.1.0 h1:HoEmRHQPVSqub6w2z2d2EOVs2fjyFRGyofhKuyDq0QI= -go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= -go.uber.org/zap v1.10.0 h1:ORx85nbTijNz8ljznvCMR1ZBIPKFn3jQrag10X2AsuM= -go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= -golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= -golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= -golang.org/x/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-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190311183353-d8887717615a h1:oWX7TPOiFAMXLq8o0ikBYfCJVlRHBcsciT5bXOrH628= -golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be h1:vEDujvNQGv4jgYKudGeI/+DAX4Jffq6hpD55MmoEvKs= -golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= -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/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a h1:1BGLXjeY4akVXGgbC9HugT3Jv3hCI0z56oJR5vAMgBU= -golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190422165155-953cdadca894 h1:Cz4ceDQGXuKRnVBDTS23GTn/pU5OE2C0WrNTOYK1Uuc= -golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= -golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/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-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= -google.golang.org/appengine v1.1.0 h1:igQkv0AAhEIvTEpD5LIpAfav2eeVO9HBTjvKHVJPRSs= -google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= -google.golang.org/appengine v1.4.0 h1:/wp5JvzpHIxhs/dumFmF7BXTf3Z+dd4uXta4kVyO508= -google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8 h1:Nw54tB0rB7hY/N0NQvRW8DG4Yk3Q6T9cu9RcFQDu1tc= -google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55 h1:gSJIx1SDwno+2ElGhA4+qG2zF97qiUzTM+rQ0klBOcE= -google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= -google.golang.org/grpc v1.19.0 h1:cfg4PD8YEdSFnm7qLV4++93WcmhH2nIUhMjhdCvl3j8= -google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw= -gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= diff --git a/vendor/github.com/grpc-ecosystem/go-grpc-middleware/makefile b/vendor/github.com/grpc-ecosystem/go-grpc-middleware/makefile deleted file mode 100644 index b18d2d2bb1..0000000000 --- a/vendor/github.com/grpc-ecosystem/go-grpc-middleware/makefile +++ /dev/null @@ -1,17 +0,0 @@ -SHELL=/bin/bash - -GOFILES_NOVENDOR = $(shell go list ./... | grep -v /vendor/) - -all: vet fmt test - -fmt: - go fmt $(GOFILES_NOVENDOR) - -vet: - # do not check lostcancel, they are intentional. - go vet -lostcancel=false $(GOFILES_NOVENDOR) - -test: vet - ./scripts/test_all.sh - -.PHONY: all test diff --git a/vendor/github.com/grpc-ecosystem/go-grpc-middleware/recovery/doc.go b/vendor/github.com/grpc-ecosystem/go-grpc-middleware/recovery/doc.go deleted file mode 100644 index da40190c54..0000000000 --- a/vendor/github.com/grpc-ecosystem/go-grpc-middleware/recovery/doc.go +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright 2017 David Ackroyd. All Rights Reserved. -// See LICENSE for licensing terms. - -/* -`grpc_recovery` are intereceptors that recover from gRPC handler panics. - -Server Side Recovery Middleware - -By default a panic will be converted into a gRPC error with `code.Internal`. - -Handling can be customised by providing an alternate recovery function. - -Please see examples for simple examples of use. -*/ -package grpc_recovery diff --git a/vendor/github.com/grpc-ecosystem/go-grpc-middleware/recovery/interceptors.go b/vendor/github.com/grpc-ecosystem/go-grpc-middleware/recovery/interceptors.go deleted file mode 100644 index d9794c3e78..0000000000 --- a/vendor/github.com/grpc-ecosystem/go-grpc-middleware/recovery/interceptors.go +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright 2017 David Ackroyd. All Rights Reserved. -// See LICENSE for licensing terms. - -package grpc_recovery - -import ( - "context" - - "google.golang.org/grpc" - "google.golang.org/grpc/codes" -) - -// RecoveryHandlerFunc is a function that recovers from the panic `p` by returning an `error`. -type RecoveryHandlerFunc func(p interface{}) (err error) - -// RecoveryHandlerFuncContext is a function that recovers from the panic `p` by returning an `error`. -// The context can be used to extract request scoped metadata and context values. -type RecoveryHandlerFuncContext func(ctx context.Context, p interface{}) (err error) - -// UnaryServerInterceptor returns a new unary server interceptor for panic recovery. -func UnaryServerInterceptor(opts ...Option) grpc.UnaryServerInterceptor { - o := evaluateOptions(opts) - return func(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (_ interface{}, err error) { - defer func() { - if r := recover(); r != nil { - err = recoverFrom(ctx, r, o.recoveryHandlerFunc) - } - }() - - return handler(ctx, req) - } -} - -// StreamServerInterceptor returns a new streaming server interceptor for panic recovery. -func StreamServerInterceptor(opts ...Option) grpc.StreamServerInterceptor { - o := evaluateOptions(opts) - return func(srv interface{}, stream grpc.ServerStream, info *grpc.StreamServerInfo, handler grpc.StreamHandler) (err error) { - defer func() { - if r := recover(); r != nil { - err = recoverFrom(stream.Context(), r, o.recoveryHandlerFunc) - } - }() - - return handler(srv, stream) - } -} - -func recoverFrom(ctx context.Context, p interface{}, r RecoveryHandlerFuncContext) error { - if r == nil { - return grpc.Errorf(codes.Internal, "%s", p) - } - return r(ctx, p) -} diff --git a/vendor/github.com/grpc-ecosystem/go-grpc-middleware/recovery/options.go b/vendor/github.com/grpc-ecosystem/go-grpc-middleware/recovery/options.go deleted file mode 100644 index ffe9c64c7d..0000000000 --- a/vendor/github.com/grpc-ecosystem/go-grpc-middleware/recovery/options.go +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright 2017 David Ackroyd. All Rights Reserved. -// See LICENSE for licensing terms. - -package grpc_recovery - -import "context" - -var ( - defaultOptions = &options{ - recoveryHandlerFunc: nil, - } -) - -type options struct { - recoveryHandlerFunc RecoveryHandlerFuncContext -} - -func evaluateOptions(opts []Option) *options { - optCopy := &options{} - *optCopy = *defaultOptions - for _, o := range opts { - o(optCopy) - } - return optCopy -} - -type Option func(*options) - -// WithRecoveryHandler customizes the function for recovering from a panic. -func WithRecoveryHandler(f RecoveryHandlerFunc) Option { - return func(o *options) { - o.recoveryHandlerFunc = RecoveryHandlerFuncContext(func(ctx context.Context, p interface{}) error { - return f(p) - }) - } -} - -// WithRecoveryHandlerContext customizes the function for recovering from a panic. -func WithRecoveryHandlerContext(f RecoveryHandlerFuncContext) Option { - return func(o *options) { - o.recoveryHandlerFunc = f - } -} diff --git a/vendor/github.com/grpc-ecosystem/go-grpc-middleware/slack.png b/vendor/github.com/grpc-ecosystem/go-grpc-middleware/slack.png deleted file mode 100644 index cc8f9a68a9368ca56dab09e6902ae41ecb8356b8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5088 zcmZ|Tc{Ei2`vCAe3x;e-vX2jlNl|9+lk+JWL6qTqDN!GHjk+C(5ghC|Q z89rp+TE@P8@A&Wc$M1E{ooDX7=b1U@eeXQaGxw31i7o>jCmjF)4ElOn=3p!VH&$k9 z@Kt}PY#$78cXeZR0C@NG+>s*{xXd;33>H00c<_z^VfPD82-M zOW4=V*OkE&)J}%FT3`h2YqrFIfflQ09RNm~vkfcI7zMte3Dh^%rkR6tA+FNiG=De_ z04%BcTIx4LCpPTDZn9dAoZbov8v4dCE&J634Y7Qp&X3^i)B1M(ADWDkSV*iN7kd)> zqd4~Y*H}BDdBJ$Wu0|IuL+0RbEjvkFo(wIsbO_aTEJU62)m;xvI%)0jP3x;w2nU<) z@2u*WC30Bt>TuK+>2UK948xvI_!&&wc(kmn$)(p4^0&uYvw!h_KvchE7vw+xNJ63p z3Va*cnVhjFDE_dqa(r-66Cwh$yDuYa9*+6AtDq3Cwa`yfL=H^(#{~0H2xDMeh>qp- z^0}j7#;SeYqT9-`^VAd*dw##F3SPruUt0PBV_h~NfP4F@M5ydvA!>`oqlOxml8Y8r zzfJG|=l*wk%qpd)pteM8&76R;qWwW9TCpcwP@;TaNh#IBX&G4&UHg$vw7J6|@A&?( zsfCrJb_kZ;Db(IIm_invBB-A-P@PNa5ztNMR`CDXx!apYBH{6GbYWa_$-D%2rihp| ziumC^e*@} z5o=w0)5UGOMz$zNTcdDaT%=!s;j^5_|Ht17GT%whqFOCH|R>^DXD zMAt}!?X}qW_^PT`uTGwxI&3RM$cnB1cIFcXO+WPqH??+8`FYhm@jsCz)QXkD-GBF8Qf68r3Zu%CeRqd`Zn=g=d52GkeC(9`Y}Fe(j(-f zIIZf6-pfd_l$3qrk^7gQy|S@j;}~za9XDL8R95EYEh-vYQPI=WXN2p%kf^|&j_&P6 zs)~ui`m@W+6oct&8ffAfV2nJElL&#djZrO?l{L?@_rQ9^QRmL|>*P?_w5tocu)x63 z*$E_QGTTYa&PjQtX+h1>DmTz`cKK#kSm_*o&!q}?e8m02-kDkU;FAs*spv?EP2xh? z8yP_HzSR|dpMmJ@aw0K})!{!4WbUnUoT(Zi1a+<6{YWx1SL@@Fk^-dM^6=o~KPI%( z+~6B&H-LeG)7VG+SsJ;E%XjyYFVTVXHO#B;RyQ&## z@L;7Qc6O3T9k8(m-`{i6?zlq3#Ke`0w}Q48deMR8w10au>Nc*5R%OW{)g;8;Ru>yV zHc3%`ej-l+AtPqGViPJxq=fkKswl4DzQ$wd$zC@yW~v5aR%&DW!a(+hi2)t0bqkwS z4RKmUf#Y+3Rpm6kax2t7c!wMq$lZ9GI&QpTbXUy;yd#Iti1`&2Q@}2sL0_jh?;y!e zPpvrsaqi)ecI$h26^1xR0Ylv5L)`m{%`{36i~jlfIoLtqWoK{)6ya#0RIm`@k(CzZ z!(P@Jt~FtQ7r$o7!J5vX?J0Qq*b+OP{AS?echqR%5)#~uv-8rCjnyc#J2N8|H(>N! zI}_f@ypq8c#Y^{TiKc2QVJTVX^aSU-|Awj@a;Qv<$VxI_5iKuo@q>NyQc=lz1w8uH z72gdr$&LOsyL_GRvg_QZuUX;?>+4Wh>|_HMr-31)exkDw&&Dp>H<{H9`}2qO@m4Er zr1HWe@Z!LsjJj9g&CNzdJ3FKe&I;9Ozl~SsVT<$*zG_~q`a2b$2pZ_m?Pe&u-psIvNqrE7IY+BJO(JCuY8Qd0kALDo~MNUruFUps0kp?Xp@ZQ>(NTrg)<2ilGn-s%qyqC*?ACXe<52jCC{+^x<` zudRfOGkjvmR+(W$qRFl}Vz1`ZPs#!6<4FNwIfMI>Dr}mg%z>bzfI6MQy+4x!Tb!qW zY3Wcv|2>1#c{AuCgZ7}fQsdBmkLny-jej`7zIwDyt9Sl)sIt9jg4Fi()+IKI+KoGH z(Z>hdYbuXg<;V-dmoCK;hc1jY`b{;eL;y52DQN}}-lqi^46Z`#(a$~(;^buiU9hnT zU3g??hg)6k@2{1bO+=NIeIFX%dD2xSQOCiDprN@3EQ`ljFmZ8Z_Whx1pOVW|RPt0% z%w5DT2LU%w%<>9;P3itR0@{#(#m1KIZrHg?t$*mU^}ox9zsK)@y&NxF|4OJJc4df1 zC^at5WK=1i7S2MO%M=)BcGL0_ddp*Q-Z%v}_<2m%6msvG0R$(gT~M5)MDSBbDP)MP zOt&IqFqos02t$R^9}W)E|1fs<_hYC76;t(#-$?WHo**>%Br`qC8lbq*)B@>@?%*0I@&nN;MQ%13cLLdrt8;La^(5zc-hS1AWflLodNPhs z$(YuJZm?fFIhpkLWr7!LsB{=@^|E2N!kXB!MNM60H$Id@np?5nSVd7s(hayoo()&Y zXg`XpHDCw3-4gtc<1M8gKTx4D=VL~|p?PQ3A#*x4jnV*FUn&GF_GL;(^jtLzx^sp& zK=HKFUCKm>q9rGp)E0Aka(p;WpZ?`FM-qV8wy}tu! z9i6+IwXSHl#g!rNQRrxuN+|X}C^ItVmqVz0P0-qS-P*`Drn*3*P(%bOWP}Z3perz4 zo1Pjwu&$e$c6JIsDE(kpC?W>$N)8HUMC9$piyg~E;InKoV%Q~<8$(~S(7FkOC4)eB z@{6>{L-AiblXqfN{P=B8erZ~dKNpA_Enb2bX%ZU3b<`GHTUyYPPH>-rPmj>r+J=UX z|6teB4T6ppCH>zTEpC}^5sY7Za4^XP(LJ!MvYKj$G8K4Lym4{I4Jm4zK^X70n`th* zNos7LxXkL`#K?$=(tDUXG_=_6un;~pzi3=on+N>*{rrp0Q|gZ$Goj91^k^|&xn#j{ z|J5IIGxQ7_`eU7)be+TH#JNs;`*KT|t1CDJQUUrClNaD-HV1ot>X4eycMZF%!{GG_ z_&Z!)@u9M^osSJhr)_KNEP!V2NN8w)IlXIB(}xBu!r@|8MDo~aXt+hofi0svEGUG6 zCgqIS%e@%d^}XNo-A|G3OmWRjR{9jQErB!dJ%@^nv&K63o9rYqdLa>KEUL;W5~mN1 zj451cQx%TJTSB%-goxN43Ilvh5h0F-iB~z4+3LN=V1afbj!Et4R|k_C9FG|X2XZ!i z?&fl@sgaHl+f$@z3h_QIFR!{faVdAEEjOL|!{6lG8Svh{e*MPKLhpJ2p}yK8peZSd zD4hFREjNcT^3NCYN_R3uktaLzHo@jbz$SOzphvxFPR$=5AHh;HAWJq|@x^O;%#?h< zqTCFi%$w0W4>53!XwiT~k_VdtL@lAXV&QCcMWq0F%s7u%y}cTH6!ogEgk||f1kSgW zmhRwiW_-X$^<=LvbC(2@;e1|F_#i5Jy7_|e+PwY~H49>Y@_;)dZJ!%hmqbM6 zFn|oF`;zx)ctf?^y_K!{%LLV^g46P;RAJ>D4am`o=_Qn#3y_&PRK%kQ|GYrX*T0=@ z;2PGrTLCtRK~n!x10K3X2w5L%*@Aj{*13cA{>zu>Xk<)Zj+don`S8L5TKj>`ZL81t z8x|v^=xveNRS{OOni)T{tO8iIFK`8@#GI5@3kgA8T{#(y^Z3teLmoWv-v_4^t@}5d zL$B8O*gDLH%s@Dk21_hp{$V##?HJ|d^$L@dk2z>K2fQp})cdmJd`Ta|j*HE*O^SzB z#x941NOBbE34$Xk+L=ON_H5++DDiICtKOy(ZwDRR&3uw(Z6lreFU;-V0rJdrY@g$W zRBNeY=>)@yxJi(8#LH-Qm1gI>)2<&AHa1?801GWaw`jO$LFfXSnM}Tju)8gu@twfP zoNsXsjyCM=NZ@2ZBa?u^!BnBnE~qbIVUw4K;pk-d+BHAF^k^@iYgw`V{mqK0w0SG= zS?pfqJwS^eiIfPLHB4_`eRFehX>A*4#KvjR=5=!MlEnQ4IXPHq+whseVvzZIEPd>n*c0HEB^=b!T)9QYs_=a=?8XoCa14=Hoi@)!d!C3hU}x zNiI;A+Gos$QPiTNS-ek9czB-jawL&S(&Fj^5-F^7v;|A{0`nQ^>2pqTv6T()`~rVs zfozjPsVqoRQCZJ-Un6d*4R4v<&B1xyn8;6V z_@5+XbLzAR)tTtNkV~=sx!;hur~c>cV>Wyz?6{lDo6_rS*%QgIK@+5n!#;|{wB)KyB4U|;DLJPP1C@@FzM@~ctV z`mHaSe&=SWiri9zfq#_FkUp?_PmRjf*3^_S zLE;YeaZZM+`O42Pr<>#nI#GKOILrA)zKm3Cy!7h;|7BwR5gE*}62^niPug*NjKT`} z3JP|)qN41kp6 zRe5nq8F4AOo02k$G75^43gE7yq@<=ga_s*k`1rbbx`qA!2~ym}E?|NrQ|-94SX#jjnJm)CTa(>D^oW*K(PRrb$m?jo2A=xdv3 JRcScf`yb{=X{rDK diff --git a/vendor/github.com/grpc-ecosystem/go-grpc-middleware/validator/doc.go b/vendor/github.com/grpc-ecosystem/go-grpc-middleware/validator/doc.go deleted file mode 100644 index 7205520a28..0000000000 --- a/vendor/github.com/grpc-ecosystem/go-grpc-middleware/validator/doc.go +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright 2016 Michal Witkowski. All Rights Reserved. -// See LICENSE for licensing terms. - -/* -`grpc_validator` is a generic request contents validator server-side middleware for gRPC. - -Request Validator Middleware - -Validating input is important, and hard. It also causes a lot of boilerplate code. This middleware -checks for the existence of a `Validate` method on each of the messages of a gRPC request. This -includes the single request of the `Unary` calls, as well as each message of the inbound Stream calls. -In case of a validation failure, an `InvalidArgument` gRPC status is returned, along with a -description of the validation failure. - -While it is generic, it was intended to be used with https://github.com/mwitkow/go-proto-validators, -a Go protocol buffers codegen plugin that creates the `Validate` methods (including nested messages) -based on declarative options in the `.proto` files themselves. For example: - - - syntax = "proto3"; - package validator.examples; - import "github.com/mwitkow/go-proto-validators/validator.proto"; - - message InnerMessage { - // some_integer can only be in range (1, 100). - int32 some_integer = 1 [(validator.field) = {int_gt: 0, int_lt: 100}]; - // some_float can only be in range (0;1). - double some_float = 2 [(validator.field) = {float_gte: 0, float_lte: 1}]; - } - - message OuterMessage { - // important_string must be a lowercase alpha-numeric of 5 to 30 characters (RE2 syntax). - string important_string = 1 [(validator.field) = {regex: "^[a-z]{2,5}$"}]; - // proto3 doesn't have `required`, the `msg_exist` enforces presence of InnerMessage. - InnerMessage inner = 2 [(validator.field) = {msg_exists : true}]; - } - -The `OuterMessage.Validate` would include validation of regexes, existence of the InnerMessage and -the range values within it. The `grpc_validator` middleware would then automatically use that to -check all messages processed by the server. - -Please consult https://github.com/mwitkow/go-proto-validators for details on `protoc` invocation and -other parameters of customization. -*/ -package grpc_validator diff --git a/vendor/github.com/grpc-ecosystem/go-grpc-middleware/validator/validator.go b/vendor/github.com/grpc-ecosystem/go-grpc-middleware/validator/validator.go deleted file mode 100644 index 24ca77d1e1..0000000000 --- a/vendor/github.com/grpc-ecosystem/go-grpc-middleware/validator/validator.go +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright 2016 Michal Witkowski. All Rights Reserved. -// See LICENSE for licensing terms. - -package grpc_validator - -import ( - "context" - - "google.golang.org/grpc" - "google.golang.org/grpc/codes" -) - -type validator interface { - Validate() error -} - -// UnaryServerInterceptor returns a new unary server interceptor that validates incoming messages. -// -// Invalid messages will be rejected with `InvalidArgument` before reaching any userspace handlers. -func UnaryServerInterceptor() grpc.UnaryServerInterceptor { - return func(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error) { - if v, ok := req.(validator); ok { - if err := v.Validate(); err != nil { - return nil, grpc.Errorf(codes.InvalidArgument, err.Error()) - } - } - return handler(ctx, req) - } -} - -// StreamServerInterceptor returns a new streaming server interceptor that validates incoming messages. -// -// The stage at which invalid messages will be rejected with `InvalidArgument` varies based on the -// type of the RPC. For `ServerStream` (1:m) requests, it will happen before reaching any userspace -// handlers. For `ClientStream` (n:1) or `BidiStream` (n:m) RPCs, the messages will be rejected on -// calls to `stream.Recv()`. -func StreamServerInterceptor() grpc.StreamServerInterceptor { - return func(srv interface{}, stream grpc.ServerStream, info *grpc.StreamServerInfo, handler grpc.StreamHandler) error { - wrapper := &recvWrapper{stream} - return handler(srv, wrapper) - } -} - -type recvWrapper struct { - grpc.ServerStream -} - -func (s *recvWrapper) RecvMsg(m interface{}) error { - if err := s.ServerStream.RecvMsg(m); err != nil { - return err - } - if v, ok := m.(validator); ok { - if err := v.Validate(); err != nil { - return grpc.Errorf(codes.InvalidArgument, err.Error()) - } - } - return nil -} diff --git a/vendor/github.com/grpc-ecosystem/go-grpc-middleware/wrappers.go b/vendor/github.com/grpc-ecosystem/go-grpc-middleware/wrappers.go deleted file mode 100644 index 05ccfb3f24..0000000000 --- a/vendor/github.com/grpc-ecosystem/go-grpc-middleware/wrappers.go +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright 2016 Michal Witkowski. All Rights Reserved. -// See LICENSE for licensing terms. - -package grpc_middleware - -import ( - "context" - - "google.golang.org/grpc" -) - -// WrappedServerStream is a thin wrapper around grpc.ServerStream that allows modifying context. -type WrappedServerStream struct { - grpc.ServerStream - // WrappedContext is the wrapper's own Context. You can assign it. - WrappedContext context.Context -} - -// Context returns the wrapper's WrappedContext, overwriting the nested grpc.ServerStream.Context() -func (w *WrappedServerStream) Context() context.Context { - return w.WrappedContext -} - -// WrapServerStream returns a ServerStream that has the ability to overwrite context. -func WrapServerStream(stream grpc.ServerStream) *WrappedServerStream { - if existing, ok := stream.(*WrappedServerStream); ok { - return existing - } - return &WrappedServerStream{ServerStream: stream, WrappedContext: stream.Context()} -} diff --git a/vendor/github.com/grpc-ecosystem/grpc-gateway/LICENSE.txt b/vendor/github.com/grpc-ecosystem/grpc-gateway/LICENSE.txt deleted file mode 100644 index 364516251b..0000000000 --- a/vendor/github.com/grpc-ecosystem/grpc-gateway/LICENSE.txt +++ /dev/null @@ -1,27 +0,0 @@ -Copyright (c) 2015, Gengo, Inc. -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - * Neither the name of Gengo, 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/grpc-ecosystem/grpc-gateway/internal/BUILD.bazel b/vendor/github.com/grpc-ecosystem/grpc-gateway/internal/BUILD.bazel deleted file mode 100644 index 5242751fb2..0000000000 --- a/vendor/github.com/grpc-ecosystem/grpc-gateway/internal/BUILD.bazel +++ /dev/null @@ -1,23 +0,0 @@ -load("@rules_proto//proto:defs.bzl", "proto_library") -load("@io_bazel_rules_go//go:def.bzl", "go_library") -load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library") - -package(default_visibility = ["//visibility:public"]) - -proto_library( - name = "internal_proto", - srcs = ["errors.proto"], - deps = ["@com_google_protobuf//:any_proto"], -) - -go_proto_library( - name = "internal_go_proto", - importpath = "github.com/grpc-ecosystem/grpc-gateway/internal", - proto = ":internal_proto", -) - -go_library( - name = "go_default_library", - embed = [":internal_go_proto"], - importpath = "github.com/grpc-ecosystem/grpc-gateway/internal", -) diff --git a/vendor/github.com/grpc-ecosystem/grpc-gateway/internal/errors.pb.go b/vendor/github.com/grpc-ecosystem/grpc-gateway/internal/errors.pb.go deleted file mode 100644 index 61101d7177..0000000000 --- a/vendor/github.com/grpc-ecosystem/grpc-gateway/internal/errors.pb.go +++ /dev/null @@ -1,189 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// source: internal/errors.proto - -package internal - -import ( - fmt "fmt" - proto "github.com/golang/protobuf/proto" - any "github.com/golang/protobuf/ptypes/any" - math "math" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package - -// Error is the generic error returned from unary RPCs. -type Error struct { - Error string `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"` - // This is to make the error more compatible with users that expect errors to be Status objects: - // https://github.com/grpc/grpc/blob/master/src/proto/grpc/status/status.proto - // It should be the exact same message as the Error field. - Code int32 `protobuf:"varint,2,opt,name=code,proto3" json:"code,omitempty"` - Message string `protobuf:"bytes,3,opt,name=message,proto3" json:"message,omitempty"` - Details []*any.Any `protobuf:"bytes,4,rep,name=details,proto3" json:"details,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Error) Reset() { *m = Error{} } -func (m *Error) String() string { return proto.CompactTextString(m) } -func (*Error) ProtoMessage() {} -func (*Error) Descriptor() ([]byte, []int) { - return fileDescriptor_9b093362ca6d1e03, []int{0} -} - -func (m *Error) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Error.Unmarshal(m, b) -} -func (m *Error) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Error.Marshal(b, m, deterministic) -} -func (m *Error) XXX_Merge(src proto.Message) { - xxx_messageInfo_Error.Merge(m, src) -} -func (m *Error) XXX_Size() int { - return xxx_messageInfo_Error.Size(m) -} -func (m *Error) XXX_DiscardUnknown() { - xxx_messageInfo_Error.DiscardUnknown(m) -} - -var xxx_messageInfo_Error proto.InternalMessageInfo - -func (m *Error) GetError() string { - if m != nil { - return m.Error - } - return "" -} - -func (m *Error) GetCode() int32 { - if m != nil { - return m.Code - } - return 0 -} - -func (m *Error) GetMessage() string { - if m != nil { - return m.Message - } - return "" -} - -func (m *Error) GetDetails() []*any.Any { - if m != nil { - return m.Details - } - return nil -} - -// StreamError is a response type which is returned when -// streaming rpc returns an error. -type StreamError struct { - GrpcCode int32 `protobuf:"varint,1,opt,name=grpc_code,json=grpcCode,proto3" json:"grpc_code,omitempty"` - HttpCode int32 `protobuf:"varint,2,opt,name=http_code,json=httpCode,proto3" json:"http_code,omitempty"` - Message string `protobuf:"bytes,3,opt,name=message,proto3" json:"message,omitempty"` - HttpStatus string `protobuf:"bytes,4,opt,name=http_status,json=httpStatus,proto3" json:"http_status,omitempty"` - Details []*any.Any `protobuf:"bytes,5,rep,name=details,proto3" json:"details,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *StreamError) Reset() { *m = StreamError{} } -func (m *StreamError) String() string { return proto.CompactTextString(m) } -func (*StreamError) ProtoMessage() {} -func (*StreamError) Descriptor() ([]byte, []int) { - return fileDescriptor_9b093362ca6d1e03, []int{1} -} - -func (m *StreamError) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_StreamError.Unmarshal(m, b) -} -func (m *StreamError) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_StreamError.Marshal(b, m, deterministic) -} -func (m *StreamError) XXX_Merge(src proto.Message) { - xxx_messageInfo_StreamError.Merge(m, src) -} -func (m *StreamError) XXX_Size() int { - return xxx_messageInfo_StreamError.Size(m) -} -func (m *StreamError) XXX_DiscardUnknown() { - xxx_messageInfo_StreamError.DiscardUnknown(m) -} - -var xxx_messageInfo_StreamError proto.InternalMessageInfo - -func (m *StreamError) GetGrpcCode() int32 { - if m != nil { - return m.GrpcCode - } - return 0 -} - -func (m *StreamError) GetHttpCode() int32 { - if m != nil { - return m.HttpCode - } - return 0 -} - -func (m *StreamError) GetMessage() string { - if m != nil { - return m.Message - } - return "" -} - -func (m *StreamError) GetHttpStatus() string { - if m != nil { - return m.HttpStatus - } - return "" -} - -func (m *StreamError) GetDetails() []*any.Any { - if m != nil { - return m.Details - } - return nil -} - -func init() { - proto.RegisterType((*Error)(nil), "grpc.gateway.runtime.Error") - proto.RegisterType((*StreamError)(nil), "grpc.gateway.runtime.StreamError") -} - -func init() { proto.RegisterFile("internal/errors.proto", fileDescriptor_9b093362ca6d1e03) } - -var fileDescriptor_9b093362ca6d1e03 = []byte{ - // 252 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x90, 0xc1, 0x4a, 0xc4, 0x30, - 0x10, 0x86, 0x89, 0xbb, 0x75, 0xdb, 0xe9, 0x2d, 0x54, 0x88, 0xee, 0xc1, 0xb2, 0xa7, 0x9e, 0x52, - 0xd0, 0x27, 0xd0, 0xc5, 0x17, 0xe8, 0xde, 0xbc, 0x2c, 0xd9, 0xdd, 0x31, 0x16, 0xda, 0xa4, 0x24, - 0x53, 0xa4, 0xf8, 0x56, 0x3e, 0xa1, 0x24, 0xa5, 0xb0, 0x27, 0xf1, 0xd6, 0xf9, 0xfb, 0xcf, 0x7c, - 0x1f, 0x81, 0xbb, 0xd6, 0x10, 0x3a, 0xa3, 0xba, 0x1a, 0x9d, 0xb3, 0xce, 0xcb, 0xc1, 0x59, 0xb2, - 0xbc, 0xd0, 0x6e, 0x38, 0x4b, 0xad, 0x08, 0xbf, 0xd4, 0x24, 0xdd, 0x68, 0xa8, 0xed, 0xf1, 0xe1, - 0x5e, 0x5b, 0xab, 0x3b, 0xac, 0x63, 0xe7, 0x34, 0x7e, 0xd4, 0xca, 0x4c, 0xf3, 0xc2, 0xee, 0x1b, - 0x92, 0xb7, 0x70, 0x80, 0x17, 0x90, 0xc4, 0x4b, 0x82, 0x95, 0xac, 0xca, 0x9a, 0x79, 0xe0, 0x1c, - 0xd6, 0x67, 0x7b, 0x41, 0x71, 0x53, 0xb2, 0x2a, 0x69, 0xe2, 0x37, 0x17, 0xb0, 0xe9, 0xd1, 0x7b, - 0xa5, 0x51, 0xac, 0x62, 0x77, 0x19, 0xb9, 0x84, 0xcd, 0x05, 0x49, 0xb5, 0x9d, 0x17, 0xeb, 0x72, - 0x55, 0xe5, 0x4f, 0x85, 0x9c, 0xc9, 0x72, 0x21, 0xcb, 0x17, 0x33, 0x35, 0x4b, 0x69, 0xf7, 0xc3, - 0x20, 0x3f, 0x90, 0x43, 0xd5, 0xcf, 0x0e, 0x5b, 0xc8, 0x82, 0xff, 0x31, 0x22, 0x59, 0x44, 0xa6, - 0x21, 0xd8, 0x07, 0xec, 0x16, 0xb2, 0x4f, 0xa2, 0xe1, 0x78, 0xe5, 0x93, 0x86, 0x60, 0xff, 0xb7, - 0xd3, 0x23, 0xe4, 0x71, 0xcd, 0x93, 0xa2, 0x31, 0x78, 0x85, 0xbf, 0x10, 0xa2, 0x43, 0x4c, 0xae, - 0xa5, 0x93, 0x7f, 0x48, 0xbf, 0xc2, 0x7b, 0xba, 0xbc, 0xfd, 0xe9, 0x36, 0x56, 0x9e, 0x7f, 0x03, - 0x00, 0x00, 0xff, 0xff, 0xde, 0x72, 0x6b, 0x83, 0x8e, 0x01, 0x00, 0x00, -} diff --git a/vendor/github.com/grpc-ecosystem/grpc-gateway/internal/errors.proto b/vendor/github.com/grpc-ecosystem/grpc-gateway/internal/errors.proto deleted file mode 100644 index 4fb212c6b6..0000000000 --- a/vendor/github.com/grpc-ecosystem/grpc-gateway/internal/errors.proto +++ /dev/null @@ -1,26 +0,0 @@ -syntax = "proto3"; -package grpc.gateway.runtime; -option go_package = "internal"; - -import "google/protobuf/any.proto"; - -// Error is the generic error returned from unary RPCs. -message Error { - string error = 1; - // This is to make the error more compatible with users that expect errors to be Status objects: - // https://github.com/grpc/grpc/blob/master/src/proto/grpc/status/status.proto - // It should be the exact same message as the Error field. - int32 code = 2; - string message = 3; - repeated google.protobuf.Any details = 4; -} - -// StreamError is a response type which is returned when -// streaming rpc returns an error. -message StreamError { - int32 grpc_code = 1; - int32 http_code = 2; - string message = 3; - string http_status = 4; - repeated google.protobuf.Any details = 5; -} diff --git a/vendor/github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger/options/BUILD.bazel b/vendor/github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger/options/BUILD.bazel deleted file mode 100644 index 464a56d453..0000000000 --- a/vendor/github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger/options/BUILD.bazel +++ /dev/null @@ -1,39 +0,0 @@ -load("@rules_proto//proto:defs.bzl", "proto_library") -load("@io_bazel_rules_go//go:def.bzl", "go_library") -load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library") - -package(default_visibility = ["//visibility:public"]) - -filegroup( - name = "options_proto_files", - srcs = [ - "annotations.proto", - "openapiv2.proto", - ], -) - -go_library( - name = "go_default_library", - embed = [":options_go_proto"], - importpath = "github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger/options", -) - -proto_library( - name = "options_proto", - srcs = [ - "annotations.proto", - "openapiv2.proto", - ], - deps = [ - "@com_google_protobuf//:any_proto", - "@com_google_protobuf//:descriptor_proto", - "@com_google_protobuf//:struct_proto", - ], -) - -go_proto_library( - name = "options_go_proto", - compilers = ["@io_bazel_rules_go//proto:go_grpc"], - importpath = "github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger/options", - proto = ":options_proto", -) diff --git a/vendor/github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger/options/annotations.pb.go b/vendor/github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger/options/annotations.pb.go deleted file mode 100644 index 651400277e..0000000000 --- a/vendor/github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger/options/annotations.pb.go +++ /dev/null @@ -1,105 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// source: protoc-gen-swagger/options/annotations.proto - -package options - -import ( - fmt "fmt" - proto "github.com/golang/protobuf/proto" - descriptor "github.com/golang/protobuf/protoc-gen-go/descriptor" - math "math" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package - -var E_Openapiv2Swagger = &proto.ExtensionDesc{ - ExtendedType: (*descriptor.FileOptions)(nil), - ExtensionType: (*Swagger)(nil), - Field: 1042, - Name: "grpc.gateway.protoc_gen_swagger.options.openapiv2_swagger", - Tag: "bytes,1042,opt,name=openapiv2_swagger", - Filename: "protoc-gen-swagger/options/annotations.proto", -} - -var E_Openapiv2Operation = &proto.ExtensionDesc{ - ExtendedType: (*descriptor.MethodOptions)(nil), - ExtensionType: (*Operation)(nil), - Field: 1042, - Name: "grpc.gateway.protoc_gen_swagger.options.openapiv2_operation", - Tag: "bytes,1042,opt,name=openapiv2_operation", - Filename: "protoc-gen-swagger/options/annotations.proto", -} - -var E_Openapiv2Schema = &proto.ExtensionDesc{ - ExtendedType: (*descriptor.MessageOptions)(nil), - ExtensionType: (*Schema)(nil), - Field: 1042, - Name: "grpc.gateway.protoc_gen_swagger.options.openapiv2_schema", - Tag: "bytes,1042,opt,name=openapiv2_schema", - Filename: "protoc-gen-swagger/options/annotations.proto", -} - -var E_Openapiv2Tag = &proto.ExtensionDesc{ - ExtendedType: (*descriptor.ServiceOptions)(nil), - ExtensionType: (*Tag)(nil), - Field: 1042, - Name: "grpc.gateway.protoc_gen_swagger.options.openapiv2_tag", - Tag: "bytes,1042,opt,name=openapiv2_tag", - Filename: "protoc-gen-swagger/options/annotations.proto", -} - -var E_Openapiv2Field = &proto.ExtensionDesc{ - ExtendedType: (*descriptor.FieldOptions)(nil), - ExtensionType: (*JSONSchema)(nil), - Field: 1042, - Name: "grpc.gateway.protoc_gen_swagger.options.openapiv2_field", - Tag: "bytes,1042,opt,name=openapiv2_field", - Filename: "protoc-gen-swagger/options/annotations.proto", -} - -func init() { - proto.RegisterExtension(E_Openapiv2Swagger) - proto.RegisterExtension(E_Openapiv2Operation) - proto.RegisterExtension(E_Openapiv2Schema) - proto.RegisterExtension(E_Openapiv2Tag) - proto.RegisterExtension(E_Openapiv2Field) -} - -func init() { - proto.RegisterFile("protoc-gen-swagger/options/annotations.proto", fileDescriptor_a6a34ca6badab664) -} - -var fileDescriptor_a6a34ca6badab664 = []byte{ - // 346 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x92, 0x4f, 0x4f, 0xea, 0x40, - 0x14, 0xc5, 0xc3, 0xe6, 0xe5, 0xa5, 0xef, 0xa9, 0x58, 0x37, 0x86, 0xf8, 0x87, 0x9d, 0xc6, 0xc0, - 0x8c, 0x81, 0x5d, 0x77, 0x6a, 0xe2, 0xc2, 0x44, 0x49, 0x0a, 0x2b, 0x37, 0x64, 0x18, 0x2e, 0x97, - 0x49, 0x4a, 0xef, 0x64, 0x66, 0x80, 0x90, 0xb0, 0xf4, 0x13, 0xf8, 0x89, 0x8d, 0xd3, 0xd2, 0x9a, - 0x8a, 0xa6, 0xbb, 0xce, 0xe9, 0xbd, 0xe7, 0x77, 0x7a, 0x3a, 0x41, 0x47, 0x1b, 0x72, 0x24, 0xbb, - 0x08, 0x69, 0xd7, 0xae, 0x05, 0x22, 0x18, 0x4e, 0xda, 0x29, 0x4a, 0x2d, 0x17, 0x69, 0x4a, 0x4e, - 0xf8, 0x67, 0xe6, 0xc7, 0xc2, 0x2b, 0x34, 0x5a, 0x32, 0x14, 0x0e, 0xd6, 0x62, 0x93, 0x69, 0x72, - 0x8c, 0x90, 0x8e, 0xf3, 0x55, 0x96, 0xaf, 0xb6, 0xda, 0x48, 0x84, 0x09, 0x70, 0x3f, 0x32, 0x59, - 0xce, 0xf8, 0x14, 0xac, 0x34, 0x4a, 0x3b, 0x32, 0xd9, 0x5a, 0xeb, 0xe6, 0x17, 0x30, 0x69, 0x48, - 0x85, 0x56, 0xab, 0x5e, 0x36, 0x1b, 0x6d, 0x83, 0xe3, 0x42, 0xda, 0xa1, 0xc2, 0x33, 0x96, 0x31, - 0xd8, 0x8e, 0xc1, 0x1e, 0x55, 0x02, 0x83, 0xcc, 0xe2, 0xf4, 0xfd, 0x6f, 0xbb, 0x71, 0xfd, 0xaf, - 0x77, 0xcb, 0x6a, 0x26, 0x66, 0xc3, 0xec, 0x1c, 0x37, 0x0b, 0x52, 0xae, 0x44, 0x6f, 0x8d, 0xe0, - 0xa4, 0xc4, 0x93, 0x06, 0xe3, 0x3b, 0x09, 0x2f, 0xbe, 0x05, 0x78, 0x06, 0x37, 0xa7, 0x69, 0x25, - 0x42, 0xaf, 0x76, 0x84, 0xc1, 0xce, 0x3a, 0x0e, 0x0b, 0x5e, 0xa1, 0x45, 0xdb, 0xa0, 0xf9, 0xa5, - 0x04, 0x39, 0x87, 0x85, 0x08, 0x2f, 0xf7, 0x44, 0xb0, 0x56, 0x60, 0xb5, 0x06, 0x5e, 0xbf, 0x06, - 0x6f, 0x1c, 0x1f, 0x95, 0x2d, 0x78, 0x21, 0xb2, 0xc1, 0x41, 0x49, 0x77, 0x02, 0xf7, 0xa0, 0x87, - 0x60, 0x56, 0x4a, 0x56, 0xd1, 0x9d, 0xda, 0xe8, 0x91, 0xc0, 0xf8, 0x7f, 0x01, 0x19, 0x09, 0x8c, - 0xb6, 0x41, 0x99, 0x63, 0x3c, 0x53, 0x90, 0x4c, 0xc3, 0xf3, 0x3d, 0x7f, 0x1d, 0x92, 0x6a, 0xe7, - 0xfd, 0xda, 0xd0, 0xa7, 0xe1, 0xe0, 0x25, 0xff, 0xe6, 0xc3, 0x82, 0xe5, 0x2d, 0xef, 0x1f, 0x5e, - 0xef, 0x50, 0xb9, 0xf9, 0x72, 0xc2, 0x24, 0x2d, 0xf8, 0xa7, 0x61, 0x17, 0x24, 0xd9, 0x8d, 0x75, - 0x90, 0x1f, 0x73, 0x7f, 0xfe, 0xf3, 0x55, 0x9e, 0xfc, 0xf1, 0xef, 0xfa, 0x1f, 0x01, 0x00, 0x00, - 0xff, 0xff, 0x59, 0x78, 0xb0, 0x03, 0x68, 0x03, 0x00, 0x00, -} diff --git a/vendor/github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger/options/annotations.proto b/vendor/github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger/options/annotations.proto deleted file mode 100644 index 5151fd5a65..0000000000 --- a/vendor/github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger/options/annotations.proto +++ /dev/null @@ -1,44 +0,0 @@ -syntax = "proto3"; - -package grpc.gateway.protoc_gen_swagger.options; - -option go_package = "github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger/options"; - -import "google/protobuf/descriptor.proto"; -import "protoc-gen-swagger/options/openapiv2.proto"; - -extend google.protobuf.FileOptions { - // ID assigned by protobuf-global-extension-registry@google.com for grpc-gateway project. - // - // All IDs are the same, as assigned. It is okay that they are the same, as they extend - // different descriptor messages. - Swagger openapiv2_swagger = 1042; -} -extend google.protobuf.MethodOptions { - // ID assigned by protobuf-global-extension-registry@google.com for grpc-gateway project. - // - // All IDs are the same, as assigned. It is okay that they are the same, as they extend - // different descriptor messages. - Operation openapiv2_operation = 1042; -} -extend google.protobuf.MessageOptions { - // ID assigned by protobuf-global-extension-registry@google.com for grpc-gateway project. - // - // All IDs are the same, as assigned. It is okay that they are the same, as they extend - // different descriptor messages. - Schema openapiv2_schema = 1042; -} -extend google.protobuf.ServiceOptions { - // ID assigned by protobuf-global-extension-registry@google.com for grpc-gateway project. - // - // All IDs are the same, as assigned. It is okay that they are the same, as they extend - // different descriptor messages. - Tag openapiv2_tag = 1042; -} -extend google.protobuf.FieldOptions { - // ID assigned by protobuf-global-extension-registry@google.com for grpc-gateway project. - // - // All IDs are the same, as assigned. It is okay that they are the same, as they extend - // different descriptor messages. - JSONSchema openapiv2_field = 1042; -} diff --git a/vendor/github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger/options/openapiv2.pb.go b/vendor/github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger/options/openapiv2.pb.go deleted file mode 100644 index 8ea807582e..0000000000 --- a/vendor/github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger/options/openapiv2.pb.go +++ /dev/null @@ -1,1638 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// source: protoc-gen-swagger/options/openapiv2.proto - -package options - -import ( - fmt "fmt" - proto "github.com/golang/protobuf/proto" - any "github.com/golang/protobuf/ptypes/any" - _struct "github.com/golang/protobuf/ptypes/struct" - math "math" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package - -type Swagger_SwaggerScheme int32 - -const ( - Swagger_UNKNOWN Swagger_SwaggerScheme = 0 - Swagger_HTTP Swagger_SwaggerScheme = 1 - Swagger_HTTPS Swagger_SwaggerScheme = 2 - Swagger_WS Swagger_SwaggerScheme = 3 - Swagger_WSS Swagger_SwaggerScheme = 4 -) - -var Swagger_SwaggerScheme_name = map[int32]string{ - 0: "UNKNOWN", - 1: "HTTP", - 2: "HTTPS", - 3: "WS", - 4: "WSS", -} - -var Swagger_SwaggerScheme_value = map[string]int32{ - "UNKNOWN": 0, - "HTTP": 1, - "HTTPS": 2, - "WS": 3, - "WSS": 4, -} - -func (x Swagger_SwaggerScheme) String() string { - return proto.EnumName(Swagger_SwaggerScheme_name, int32(x)) -} - -func (Swagger_SwaggerScheme) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_ba35ad8af024fb48, []int{0, 0} -} - -type JSONSchema_JSONSchemaSimpleTypes int32 - -const ( - JSONSchema_UNKNOWN JSONSchema_JSONSchemaSimpleTypes = 0 - JSONSchema_ARRAY JSONSchema_JSONSchemaSimpleTypes = 1 - JSONSchema_BOOLEAN JSONSchema_JSONSchemaSimpleTypes = 2 - JSONSchema_INTEGER JSONSchema_JSONSchemaSimpleTypes = 3 - JSONSchema_NULL JSONSchema_JSONSchemaSimpleTypes = 4 - JSONSchema_NUMBER JSONSchema_JSONSchemaSimpleTypes = 5 - JSONSchema_OBJECT JSONSchema_JSONSchemaSimpleTypes = 6 - JSONSchema_STRING JSONSchema_JSONSchemaSimpleTypes = 7 -) - -var JSONSchema_JSONSchemaSimpleTypes_name = map[int32]string{ - 0: "UNKNOWN", - 1: "ARRAY", - 2: "BOOLEAN", - 3: "INTEGER", - 4: "NULL", - 5: "NUMBER", - 6: "OBJECT", - 7: "STRING", -} - -var JSONSchema_JSONSchemaSimpleTypes_value = map[string]int32{ - "UNKNOWN": 0, - "ARRAY": 1, - "BOOLEAN": 2, - "INTEGER": 3, - "NULL": 4, - "NUMBER": 5, - "OBJECT": 6, - "STRING": 7, -} - -func (x JSONSchema_JSONSchemaSimpleTypes) String() string { - return proto.EnumName(JSONSchema_JSONSchemaSimpleTypes_name, int32(x)) -} - -func (JSONSchema_JSONSchemaSimpleTypes) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_ba35ad8af024fb48, []int{8, 0} -} - -// Required. The type of the security scheme. Valid values are "basic", -// "apiKey" or "oauth2". -type SecurityScheme_Type int32 - -const ( - SecurityScheme_TYPE_INVALID SecurityScheme_Type = 0 - SecurityScheme_TYPE_BASIC SecurityScheme_Type = 1 - SecurityScheme_TYPE_API_KEY SecurityScheme_Type = 2 - SecurityScheme_TYPE_OAUTH2 SecurityScheme_Type = 3 -) - -var SecurityScheme_Type_name = map[int32]string{ - 0: "TYPE_INVALID", - 1: "TYPE_BASIC", - 2: "TYPE_API_KEY", - 3: "TYPE_OAUTH2", -} - -var SecurityScheme_Type_value = map[string]int32{ - "TYPE_INVALID": 0, - "TYPE_BASIC": 1, - "TYPE_API_KEY": 2, - "TYPE_OAUTH2": 3, -} - -func (x SecurityScheme_Type) String() string { - return proto.EnumName(SecurityScheme_Type_name, int32(x)) -} - -func (SecurityScheme_Type) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_ba35ad8af024fb48, []int{11, 0} -} - -// Required. The location of the API key. Valid values are "query" or "header". -type SecurityScheme_In int32 - -const ( - SecurityScheme_IN_INVALID SecurityScheme_In = 0 - SecurityScheme_IN_QUERY SecurityScheme_In = 1 - SecurityScheme_IN_HEADER SecurityScheme_In = 2 -) - -var SecurityScheme_In_name = map[int32]string{ - 0: "IN_INVALID", - 1: "IN_QUERY", - 2: "IN_HEADER", -} - -var SecurityScheme_In_value = map[string]int32{ - "IN_INVALID": 0, - "IN_QUERY": 1, - "IN_HEADER": 2, -} - -func (x SecurityScheme_In) String() string { - return proto.EnumName(SecurityScheme_In_name, int32(x)) -} - -func (SecurityScheme_In) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_ba35ad8af024fb48, []int{11, 1} -} - -// Required. The flow used by the OAuth2 security scheme. Valid values are -// "implicit", "password", "application" or "accessCode". -type SecurityScheme_Flow int32 - -const ( - SecurityScheme_FLOW_INVALID SecurityScheme_Flow = 0 - SecurityScheme_FLOW_IMPLICIT SecurityScheme_Flow = 1 - SecurityScheme_FLOW_PASSWORD SecurityScheme_Flow = 2 - SecurityScheme_FLOW_APPLICATION SecurityScheme_Flow = 3 - SecurityScheme_FLOW_ACCESS_CODE SecurityScheme_Flow = 4 -) - -var SecurityScheme_Flow_name = map[int32]string{ - 0: "FLOW_INVALID", - 1: "FLOW_IMPLICIT", - 2: "FLOW_PASSWORD", - 3: "FLOW_APPLICATION", - 4: "FLOW_ACCESS_CODE", -} - -var SecurityScheme_Flow_value = map[string]int32{ - "FLOW_INVALID": 0, - "FLOW_IMPLICIT": 1, - "FLOW_PASSWORD": 2, - "FLOW_APPLICATION": 3, - "FLOW_ACCESS_CODE": 4, -} - -func (x SecurityScheme_Flow) String() string { - return proto.EnumName(SecurityScheme_Flow_name, int32(x)) -} - -func (SecurityScheme_Flow) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_ba35ad8af024fb48, []int{11, 2} -} - -// `Swagger` is a representation of OpenAPI v2 specification's Swagger object. -// -// See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#swaggerObject -// -// TODO(ivucica): document fields -type Swagger struct { - Swagger string `protobuf:"bytes,1,opt,name=swagger,proto3" json:"swagger,omitempty"` - Info *Info `protobuf:"bytes,2,opt,name=info,proto3" json:"info,omitempty"` - Host string `protobuf:"bytes,3,opt,name=host,proto3" json:"host,omitempty"` - // `base_path` is the common prefix path used on all API endpoints (ie. /api, /v1, etc.). By adding this, - // it allows you to remove this portion from the path endpoints in your Swagger file making them easier - // to read. Note that using `base_path` does not change the endpoint paths that are generated in the resulting - // Swagger file. If you wish to use `base_path` with relatively generated Swagger paths, the - // `base_path` prefix must be manually removed from your `google.api.http` paths and your code changed to - // serve the API from the `base_path`. - BasePath string `protobuf:"bytes,4,opt,name=base_path,json=basePath,proto3" json:"base_path,omitempty"` - Schemes []Swagger_SwaggerScheme `protobuf:"varint,5,rep,packed,name=schemes,proto3,enum=grpc.gateway.protoc_gen_swagger.options.Swagger_SwaggerScheme" json:"schemes,omitempty"` - Consumes []string `protobuf:"bytes,6,rep,name=consumes,proto3" json:"consumes,omitempty"` - Produces []string `protobuf:"bytes,7,rep,name=produces,proto3" json:"produces,omitempty"` - Responses map[string]*Response `protobuf:"bytes,10,rep,name=responses,proto3" json:"responses,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - SecurityDefinitions *SecurityDefinitions `protobuf:"bytes,11,opt,name=security_definitions,json=securityDefinitions,proto3" json:"security_definitions,omitempty"` - Security []*SecurityRequirement `protobuf:"bytes,12,rep,name=security,proto3" json:"security,omitempty"` - ExternalDocs *ExternalDocumentation `protobuf:"bytes,14,opt,name=external_docs,json=externalDocs,proto3" json:"external_docs,omitempty"` - Extensions map[string]*_struct.Value `protobuf:"bytes,15,rep,name=extensions,proto3" json:"extensions,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Swagger) Reset() { *m = Swagger{} } -func (m *Swagger) String() string { return proto.CompactTextString(m) } -func (*Swagger) ProtoMessage() {} -func (*Swagger) Descriptor() ([]byte, []int) { - return fileDescriptor_ba35ad8af024fb48, []int{0} -} - -func (m *Swagger) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Swagger.Unmarshal(m, b) -} -func (m *Swagger) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Swagger.Marshal(b, m, deterministic) -} -func (m *Swagger) XXX_Merge(src proto.Message) { - xxx_messageInfo_Swagger.Merge(m, src) -} -func (m *Swagger) XXX_Size() int { - return xxx_messageInfo_Swagger.Size(m) -} -func (m *Swagger) XXX_DiscardUnknown() { - xxx_messageInfo_Swagger.DiscardUnknown(m) -} - -var xxx_messageInfo_Swagger proto.InternalMessageInfo - -func (m *Swagger) GetSwagger() string { - if m != nil { - return m.Swagger - } - return "" -} - -func (m *Swagger) GetInfo() *Info { - if m != nil { - return m.Info - } - return nil -} - -func (m *Swagger) GetHost() string { - if m != nil { - return m.Host - } - return "" -} - -func (m *Swagger) GetBasePath() string { - if m != nil { - return m.BasePath - } - return "" -} - -func (m *Swagger) GetSchemes() []Swagger_SwaggerScheme { - if m != nil { - return m.Schemes - } - return nil -} - -func (m *Swagger) GetConsumes() []string { - if m != nil { - return m.Consumes - } - return nil -} - -func (m *Swagger) GetProduces() []string { - if m != nil { - return m.Produces - } - return nil -} - -func (m *Swagger) GetResponses() map[string]*Response { - if m != nil { - return m.Responses - } - return nil -} - -func (m *Swagger) GetSecurityDefinitions() *SecurityDefinitions { - if m != nil { - return m.SecurityDefinitions - } - return nil -} - -func (m *Swagger) GetSecurity() []*SecurityRequirement { - if m != nil { - return m.Security - } - return nil -} - -func (m *Swagger) GetExternalDocs() *ExternalDocumentation { - if m != nil { - return m.ExternalDocs - } - return nil -} - -func (m *Swagger) GetExtensions() map[string]*_struct.Value { - if m != nil { - return m.Extensions - } - return nil -} - -// `Operation` is a representation of OpenAPI v2 specification's Operation object. -// -// See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#operationObject -// -// TODO(ivucica): document fields -type Operation struct { - Tags []string `protobuf:"bytes,1,rep,name=tags,proto3" json:"tags,omitempty"` - Summary string `protobuf:"bytes,2,opt,name=summary,proto3" json:"summary,omitempty"` - Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` - ExternalDocs *ExternalDocumentation `protobuf:"bytes,4,opt,name=external_docs,json=externalDocs,proto3" json:"external_docs,omitempty"` - OperationId string `protobuf:"bytes,5,opt,name=operation_id,json=operationId,proto3" json:"operation_id,omitempty"` - Consumes []string `protobuf:"bytes,6,rep,name=consumes,proto3" json:"consumes,omitempty"` - Produces []string `protobuf:"bytes,7,rep,name=produces,proto3" json:"produces,omitempty"` - Responses map[string]*Response `protobuf:"bytes,9,rep,name=responses,proto3" json:"responses,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - Schemes []string `protobuf:"bytes,10,rep,name=schemes,proto3" json:"schemes,omitempty"` - Deprecated bool `protobuf:"varint,11,opt,name=deprecated,proto3" json:"deprecated,omitempty"` - Security []*SecurityRequirement `protobuf:"bytes,12,rep,name=security,proto3" json:"security,omitempty"` - Extensions map[string]*_struct.Value `protobuf:"bytes,13,rep,name=extensions,proto3" json:"extensions,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Operation) Reset() { *m = Operation{} } -func (m *Operation) String() string { return proto.CompactTextString(m) } -func (*Operation) ProtoMessage() {} -func (*Operation) Descriptor() ([]byte, []int) { - return fileDescriptor_ba35ad8af024fb48, []int{1} -} - -func (m *Operation) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Operation.Unmarshal(m, b) -} -func (m *Operation) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Operation.Marshal(b, m, deterministic) -} -func (m *Operation) XXX_Merge(src proto.Message) { - xxx_messageInfo_Operation.Merge(m, src) -} -func (m *Operation) XXX_Size() int { - return xxx_messageInfo_Operation.Size(m) -} -func (m *Operation) XXX_DiscardUnknown() { - xxx_messageInfo_Operation.DiscardUnknown(m) -} - -var xxx_messageInfo_Operation proto.InternalMessageInfo - -func (m *Operation) GetTags() []string { - if m != nil { - return m.Tags - } - return nil -} - -func (m *Operation) GetSummary() string { - if m != nil { - return m.Summary - } - return "" -} - -func (m *Operation) GetDescription() string { - if m != nil { - return m.Description - } - return "" -} - -func (m *Operation) GetExternalDocs() *ExternalDocumentation { - if m != nil { - return m.ExternalDocs - } - return nil -} - -func (m *Operation) GetOperationId() string { - if m != nil { - return m.OperationId - } - return "" -} - -func (m *Operation) GetConsumes() []string { - if m != nil { - return m.Consumes - } - return nil -} - -func (m *Operation) GetProduces() []string { - if m != nil { - return m.Produces - } - return nil -} - -func (m *Operation) GetResponses() map[string]*Response { - if m != nil { - return m.Responses - } - return nil -} - -func (m *Operation) GetSchemes() []string { - if m != nil { - return m.Schemes - } - return nil -} - -func (m *Operation) GetDeprecated() bool { - if m != nil { - return m.Deprecated - } - return false -} - -func (m *Operation) GetSecurity() []*SecurityRequirement { - if m != nil { - return m.Security - } - return nil -} - -func (m *Operation) GetExtensions() map[string]*_struct.Value { - if m != nil { - return m.Extensions - } - return nil -} - -// `Response` is a representation of OpenAPI v2 specification's Response object. -// -// See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#responseObject -// -type Response struct { - // `Description` is a short description of the response. - // GFM syntax can be used for rich text representation. - Description string `protobuf:"bytes,1,opt,name=description,proto3" json:"description,omitempty"` - // `Schema` optionally defines the structure of the response. - // If `Schema` is not provided, it means there is no content to the response. - Schema *Schema `protobuf:"bytes,2,opt,name=schema,proto3" json:"schema,omitempty"` - // `Examples` gives per-mimetype response examples. - // See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#example-object - Examples map[string]string `protobuf:"bytes,4,rep,name=examples,proto3" json:"examples,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - Extensions map[string]*_struct.Value `protobuf:"bytes,5,rep,name=extensions,proto3" json:"extensions,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Response) Reset() { *m = Response{} } -func (m *Response) String() string { return proto.CompactTextString(m) } -func (*Response) ProtoMessage() {} -func (*Response) Descriptor() ([]byte, []int) { - return fileDescriptor_ba35ad8af024fb48, []int{2} -} - -func (m *Response) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Response.Unmarshal(m, b) -} -func (m *Response) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Response.Marshal(b, m, deterministic) -} -func (m *Response) XXX_Merge(src proto.Message) { - xxx_messageInfo_Response.Merge(m, src) -} -func (m *Response) XXX_Size() int { - return xxx_messageInfo_Response.Size(m) -} -func (m *Response) XXX_DiscardUnknown() { - xxx_messageInfo_Response.DiscardUnknown(m) -} - -var xxx_messageInfo_Response proto.InternalMessageInfo - -func (m *Response) GetDescription() string { - if m != nil { - return m.Description - } - return "" -} - -func (m *Response) GetSchema() *Schema { - if m != nil { - return m.Schema - } - return nil -} - -func (m *Response) GetExamples() map[string]string { - if m != nil { - return m.Examples - } - return nil -} - -func (m *Response) GetExtensions() map[string]*_struct.Value { - if m != nil { - return m.Extensions - } - return nil -} - -// `Info` is a representation of OpenAPI v2 specification's Info object. -// -// See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#infoObject -// -// TODO(ivucica): document fields -type Info struct { - Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` - Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` - TermsOfService string `protobuf:"bytes,3,opt,name=terms_of_service,json=termsOfService,proto3" json:"terms_of_service,omitempty"` - Contact *Contact `protobuf:"bytes,4,opt,name=contact,proto3" json:"contact,omitempty"` - License *License `protobuf:"bytes,5,opt,name=license,proto3" json:"license,omitempty"` - Version string `protobuf:"bytes,6,opt,name=version,proto3" json:"version,omitempty"` - Extensions map[string]*_struct.Value `protobuf:"bytes,7,rep,name=extensions,proto3" json:"extensions,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Info) Reset() { *m = Info{} } -func (m *Info) String() string { return proto.CompactTextString(m) } -func (*Info) ProtoMessage() {} -func (*Info) Descriptor() ([]byte, []int) { - return fileDescriptor_ba35ad8af024fb48, []int{3} -} - -func (m *Info) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Info.Unmarshal(m, b) -} -func (m *Info) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Info.Marshal(b, m, deterministic) -} -func (m *Info) XXX_Merge(src proto.Message) { - xxx_messageInfo_Info.Merge(m, src) -} -func (m *Info) XXX_Size() int { - return xxx_messageInfo_Info.Size(m) -} -func (m *Info) XXX_DiscardUnknown() { - xxx_messageInfo_Info.DiscardUnknown(m) -} - -var xxx_messageInfo_Info proto.InternalMessageInfo - -func (m *Info) GetTitle() string { - if m != nil { - return m.Title - } - return "" -} - -func (m *Info) GetDescription() string { - if m != nil { - return m.Description - } - return "" -} - -func (m *Info) GetTermsOfService() string { - if m != nil { - return m.TermsOfService - } - return "" -} - -func (m *Info) GetContact() *Contact { - if m != nil { - return m.Contact - } - return nil -} - -func (m *Info) GetLicense() *License { - if m != nil { - return m.License - } - return nil -} - -func (m *Info) GetVersion() string { - if m != nil { - return m.Version - } - return "" -} - -func (m *Info) GetExtensions() map[string]*_struct.Value { - if m != nil { - return m.Extensions - } - return nil -} - -// `Contact` is a representation of OpenAPI v2 specification's Contact object. -// -// See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#contactObject -// -// TODO(ivucica): document fields -type Contact struct { - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - Url string `protobuf:"bytes,2,opt,name=url,proto3" json:"url,omitempty"` - Email string `protobuf:"bytes,3,opt,name=email,proto3" json:"email,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Contact) Reset() { *m = Contact{} } -func (m *Contact) String() string { return proto.CompactTextString(m) } -func (*Contact) ProtoMessage() {} -func (*Contact) Descriptor() ([]byte, []int) { - return fileDescriptor_ba35ad8af024fb48, []int{4} -} - -func (m *Contact) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Contact.Unmarshal(m, b) -} -func (m *Contact) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Contact.Marshal(b, m, deterministic) -} -func (m *Contact) XXX_Merge(src proto.Message) { - xxx_messageInfo_Contact.Merge(m, src) -} -func (m *Contact) XXX_Size() int { - return xxx_messageInfo_Contact.Size(m) -} -func (m *Contact) XXX_DiscardUnknown() { - xxx_messageInfo_Contact.DiscardUnknown(m) -} - -var xxx_messageInfo_Contact proto.InternalMessageInfo - -func (m *Contact) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -func (m *Contact) GetUrl() string { - if m != nil { - return m.Url - } - return "" -} - -func (m *Contact) GetEmail() string { - if m != nil { - return m.Email - } - return "" -} - -// `License` is a representation of OpenAPI v2 specification's License object. -// -// See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#licenseObject -// -type License struct { - // Required. The license name used for the API. - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - // A URL to the license used for the API. - Url string `protobuf:"bytes,2,opt,name=url,proto3" json:"url,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *License) Reset() { *m = License{} } -func (m *License) String() string { return proto.CompactTextString(m) } -func (*License) ProtoMessage() {} -func (*License) Descriptor() ([]byte, []int) { - return fileDescriptor_ba35ad8af024fb48, []int{5} -} - -func (m *License) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_License.Unmarshal(m, b) -} -func (m *License) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_License.Marshal(b, m, deterministic) -} -func (m *License) XXX_Merge(src proto.Message) { - xxx_messageInfo_License.Merge(m, src) -} -func (m *License) XXX_Size() int { - return xxx_messageInfo_License.Size(m) -} -func (m *License) XXX_DiscardUnknown() { - xxx_messageInfo_License.DiscardUnknown(m) -} - -var xxx_messageInfo_License proto.InternalMessageInfo - -func (m *License) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -func (m *License) GetUrl() string { - if m != nil { - return m.Url - } - return "" -} - -// `ExternalDocumentation` is a representation of OpenAPI v2 specification's -// ExternalDocumentation object. -// -// See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#externalDocumentationObject -// -// TODO(ivucica): document fields -type ExternalDocumentation struct { - Description string `protobuf:"bytes,1,opt,name=description,proto3" json:"description,omitempty"` - Url string `protobuf:"bytes,2,opt,name=url,proto3" json:"url,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ExternalDocumentation) Reset() { *m = ExternalDocumentation{} } -func (m *ExternalDocumentation) String() string { return proto.CompactTextString(m) } -func (*ExternalDocumentation) ProtoMessage() {} -func (*ExternalDocumentation) Descriptor() ([]byte, []int) { - return fileDescriptor_ba35ad8af024fb48, []int{6} -} - -func (m *ExternalDocumentation) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ExternalDocumentation.Unmarshal(m, b) -} -func (m *ExternalDocumentation) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ExternalDocumentation.Marshal(b, m, deterministic) -} -func (m *ExternalDocumentation) XXX_Merge(src proto.Message) { - xxx_messageInfo_ExternalDocumentation.Merge(m, src) -} -func (m *ExternalDocumentation) XXX_Size() int { - return xxx_messageInfo_ExternalDocumentation.Size(m) -} -func (m *ExternalDocumentation) XXX_DiscardUnknown() { - xxx_messageInfo_ExternalDocumentation.DiscardUnknown(m) -} - -var xxx_messageInfo_ExternalDocumentation proto.InternalMessageInfo - -func (m *ExternalDocumentation) GetDescription() string { - if m != nil { - return m.Description - } - return "" -} - -func (m *ExternalDocumentation) GetUrl() string { - if m != nil { - return m.Url - } - return "" -} - -// `Schema` is a representation of OpenAPI v2 specification's Schema object. -// -// See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#schemaObject -// -// TODO(ivucica): document fields -type Schema struct { - JsonSchema *JSONSchema `protobuf:"bytes,1,opt,name=json_schema,json=jsonSchema,proto3" json:"json_schema,omitempty"` - Discriminator string `protobuf:"bytes,2,opt,name=discriminator,proto3" json:"discriminator,omitempty"` - ReadOnly bool `protobuf:"varint,3,opt,name=read_only,json=readOnly,proto3" json:"read_only,omitempty"` - ExternalDocs *ExternalDocumentation `protobuf:"bytes,5,opt,name=external_docs,json=externalDocs,proto3" json:"external_docs,omitempty"` - Example *any.Any `protobuf:"bytes,6,opt,name=example,proto3" json:"example,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Schema) Reset() { *m = Schema{} } -func (m *Schema) String() string { return proto.CompactTextString(m) } -func (*Schema) ProtoMessage() {} -func (*Schema) Descriptor() ([]byte, []int) { - return fileDescriptor_ba35ad8af024fb48, []int{7} -} - -func (m *Schema) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Schema.Unmarshal(m, b) -} -func (m *Schema) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Schema.Marshal(b, m, deterministic) -} -func (m *Schema) XXX_Merge(src proto.Message) { - xxx_messageInfo_Schema.Merge(m, src) -} -func (m *Schema) XXX_Size() int { - return xxx_messageInfo_Schema.Size(m) -} -func (m *Schema) XXX_DiscardUnknown() { - xxx_messageInfo_Schema.DiscardUnknown(m) -} - -var xxx_messageInfo_Schema proto.InternalMessageInfo - -func (m *Schema) GetJsonSchema() *JSONSchema { - if m != nil { - return m.JsonSchema - } - return nil -} - -func (m *Schema) GetDiscriminator() string { - if m != nil { - return m.Discriminator - } - return "" -} - -func (m *Schema) GetReadOnly() bool { - if m != nil { - return m.ReadOnly - } - return false -} - -func (m *Schema) GetExternalDocs() *ExternalDocumentation { - if m != nil { - return m.ExternalDocs - } - return nil -} - -func (m *Schema) GetExample() *any.Any { - if m != nil { - return m.Example - } - return nil -} - -// `JSONSchema` represents properties from JSON Schema taken, and as used, in -// the OpenAPI v2 spec. -// -// This includes changes made by OpenAPI v2. -// -// See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#schemaObject -// -// See also: https://cswr.github.io/JsonSchema/spec/basic_types/, -// https://github.com/json-schema-org/json-schema-spec/blob/master/schema.json -// -// TODO(ivucica): document fields -type JSONSchema struct { - // Ref is used to define an external reference to include in the message. - // This could be a fully qualified proto message reference, and that type must be imported - // into the protofile. If no message is identified, the Ref will be used verbatim in - // the output. - // For example: - // `ref: ".google.protobuf.Timestamp"`. - Ref string `protobuf:"bytes,3,opt,name=ref,proto3" json:"ref,omitempty"` - Title string `protobuf:"bytes,5,opt,name=title,proto3" json:"title,omitempty"` - Description string `protobuf:"bytes,6,opt,name=description,proto3" json:"description,omitempty"` - Default string `protobuf:"bytes,7,opt,name=default,proto3" json:"default,omitempty"` - ReadOnly bool `protobuf:"varint,8,opt,name=read_only,json=readOnly,proto3" json:"read_only,omitempty"` - MultipleOf float64 `protobuf:"fixed64,10,opt,name=multiple_of,json=multipleOf,proto3" json:"multiple_of,omitempty"` - Maximum float64 `protobuf:"fixed64,11,opt,name=maximum,proto3" json:"maximum,omitempty"` - ExclusiveMaximum bool `protobuf:"varint,12,opt,name=exclusive_maximum,json=exclusiveMaximum,proto3" json:"exclusive_maximum,omitempty"` - Minimum float64 `protobuf:"fixed64,13,opt,name=minimum,proto3" json:"minimum,omitempty"` - ExclusiveMinimum bool `protobuf:"varint,14,opt,name=exclusive_minimum,json=exclusiveMinimum,proto3" json:"exclusive_minimum,omitempty"` - MaxLength uint64 `protobuf:"varint,15,opt,name=max_length,json=maxLength,proto3" json:"max_length,omitempty"` - MinLength uint64 `protobuf:"varint,16,opt,name=min_length,json=minLength,proto3" json:"min_length,omitempty"` - Pattern string `protobuf:"bytes,17,opt,name=pattern,proto3" json:"pattern,omitempty"` - MaxItems uint64 `protobuf:"varint,20,opt,name=max_items,json=maxItems,proto3" json:"max_items,omitempty"` - MinItems uint64 `protobuf:"varint,21,opt,name=min_items,json=minItems,proto3" json:"min_items,omitempty"` - UniqueItems bool `protobuf:"varint,22,opt,name=unique_items,json=uniqueItems,proto3" json:"unique_items,omitempty"` - MaxProperties uint64 `protobuf:"varint,24,opt,name=max_properties,json=maxProperties,proto3" json:"max_properties,omitempty"` - MinProperties uint64 `protobuf:"varint,25,opt,name=min_properties,json=minProperties,proto3" json:"min_properties,omitempty"` - Required []string `protobuf:"bytes,26,rep,name=required,proto3" json:"required,omitempty"` - // Items in 'array' must be unique. - Array []string `protobuf:"bytes,34,rep,name=array,proto3" json:"array,omitempty"` - Type []JSONSchema_JSONSchemaSimpleTypes `protobuf:"varint,35,rep,packed,name=type,proto3,enum=grpc.gateway.protoc_gen_swagger.options.JSONSchema_JSONSchemaSimpleTypes" json:"type,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *JSONSchema) Reset() { *m = JSONSchema{} } -func (m *JSONSchema) String() string { return proto.CompactTextString(m) } -func (*JSONSchema) ProtoMessage() {} -func (*JSONSchema) Descriptor() ([]byte, []int) { - return fileDescriptor_ba35ad8af024fb48, []int{8} -} - -func (m *JSONSchema) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_JSONSchema.Unmarshal(m, b) -} -func (m *JSONSchema) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_JSONSchema.Marshal(b, m, deterministic) -} -func (m *JSONSchema) XXX_Merge(src proto.Message) { - xxx_messageInfo_JSONSchema.Merge(m, src) -} -func (m *JSONSchema) XXX_Size() int { - return xxx_messageInfo_JSONSchema.Size(m) -} -func (m *JSONSchema) XXX_DiscardUnknown() { - xxx_messageInfo_JSONSchema.DiscardUnknown(m) -} - -var xxx_messageInfo_JSONSchema proto.InternalMessageInfo - -func (m *JSONSchema) GetRef() string { - if m != nil { - return m.Ref - } - return "" -} - -func (m *JSONSchema) GetTitle() string { - if m != nil { - return m.Title - } - return "" -} - -func (m *JSONSchema) GetDescription() string { - if m != nil { - return m.Description - } - return "" -} - -func (m *JSONSchema) GetDefault() string { - if m != nil { - return m.Default - } - return "" -} - -func (m *JSONSchema) GetReadOnly() bool { - if m != nil { - return m.ReadOnly - } - return false -} - -func (m *JSONSchema) GetMultipleOf() float64 { - if m != nil { - return m.MultipleOf - } - return 0 -} - -func (m *JSONSchema) GetMaximum() float64 { - if m != nil { - return m.Maximum - } - return 0 -} - -func (m *JSONSchema) GetExclusiveMaximum() bool { - if m != nil { - return m.ExclusiveMaximum - } - return false -} - -func (m *JSONSchema) GetMinimum() float64 { - if m != nil { - return m.Minimum - } - return 0 -} - -func (m *JSONSchema) GetExclusiveMinimum() bool { - if m != nil { - return m.ExclusiveMinimum - } - return false -} - -func (m *JSONSchema) GetMaxLength() uint64 { - if m != nil { - return m.MaxLength - } - return 0 -} - -func (m *JSONSchema) GetMinLength() uint64 { - if m != nil { - return m.MinLength - } - return 0 -} - -func (m *JSONSchema) GetPattern() string { - if m != nil { - return m.Pattern - } - return "" -} - -func (m *JSONSchema) GetMaxItems() uint64 { - if m != nil { - return m.MaxItems - } - return 0 -} - -func (m *JSONSchema) GetMinItems() uint64 { - if m != nil { - return m.MinItems - } - return 0 -} - -func (m *JSONSchema) GetUniqueItems() bool { - if m != nil { - return m.UniqueItems - } - return false -} - -func (m *JSONSchema) GetMaxProperties() uint64 { - if m != nil { - return m.MaxProperties - } - return 0 -} - -func (m *JSONSchema) GetMinProperties() uint64 { - if m != nil { - return m.MinProperties - } - return 0 -} - -func (m *JSONSchema) GetRequired() []string { - if m != nil { - return m.Required - } - return nil -} - -func (m *JSONSchema) GetArray() []string { - if m != nil { - return m.Array - } - return nil -} - -func (m *JSONSchema) GetType() []JSONSchema_JSONSchemaSimpleTypes { - if m != nil { - return m.Type - } - return nil -} - -// `Tag` is a representation of OpenAPI v2 specification's Tag object. -// -// See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#tagObject -// -// TODO(ivucica): document fields -type Tag struct { - // TODO(ivucica): Description should be extracted from comments on the proto - // service object. - Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` - ExternalDocs *ExternalDocumentation `protobuf:"bytes,3,opt,name=external_docs,json=externalDocs,proto3" json:"external_docs,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Tag) Reset() { *m = Tag{} } -func (m *Tag) String() string { return proto.CompactTextString(m) } -func (*Tag) ProtoMessage() {} -func (*Tag) Descriptor() ([]byte, []int) { - return fileDescriptor_ba35ad8af024fb48, []int{9} -} - -func (m *Tag) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Tag.Unmarshal(m, b) -} -func (m *Tag) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Tag.Marshal(b, m, deterministic) -} -func (m *Tag) XXX_Merge(src proto.Message) { - xxx_messageInfo_Tag.Merge(m, src) -} -func (m *Tag) XXX_Size() int { - return xxx_messageInfo_Tag.Size(m) -} -func (m *Tag) XXX_DiscardUnknown() { - xxx_messageInfo_Tag.DiscardUnknown(m) -} - -var xxx_messageInfo_Tag proto.InternalMessageInfo - -func (m *Tag) GetDescription() string { - if m != nil { - return m.Description - } - return "" -} - -func (m *Tag) GetExternalDocs() *ExternalDocumentation { - if m != nil { - return m.ExternalDocs - } - return nil -} - -// `SecurityDefinitions` is a representation of OpenAPI v2 specification's -// Security Definitions object. -// -// See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#securityDefinitionsObject -// -// A declaration of the security schemes available to be used in the -// specification. This does not enforce the security schemes on the operations -// and only serves to provide the relevant details for each scheme. -type SecurityDefinitions struct { - // A single security scheme definition, mapping a "name" to the scheme it defines. - Security map[string]*SecurityScheme `protobuf:"bytes,1,rep,name=security,proto3" json:"security,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *SecurityDefinitions) Reset() { *m = SecurityDefinitions{} } -func (m *SecurityDefinitions) String() string { return proto.CompactTextString(m) } -func (*SecurityDefinitions) ProtoMessage() {} -func (*SecurityDefinitions) Descriptor() ([]byte, []int) { - return fileDescriptor_ba35ad8af024fb48, []int{10} -} - -func (m *SecurityDefinitions) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_SecurityDefinitions.Unmarshal(m, b) -} -func (m *SecurityDefinitions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_SecurityDefinitions.Marshal(b, m, deterministic) -} -func (m *SecurityDefinitions) XXX_Merge(src proto.Message) { - xxx_messageInfo_SecurityDefinitions.Merge(m, src) -} -func (m *SecurityDefinitions) XXX_Size() int { - return xxx_messageInfo_SecurityDefinitions.Size(m) -} -func (m *SecurityDefinitions) XXX_DiscardUnknown() { - xxx_messageInfo_SecurityDefinitions.DiscardUnknown(m) -} - -var xxx_messageInfo_SecurityDefinitions proto.InternalMessageInfo - -func (m *SecurityDefinitions) GetSecurity() map[string]*SecurityScheme { - if m != nil { - return m.Security - } - return nil -} - -// `SecurityScheme` is a representation of OpenAPI v2 specification's -// Security Scheme object. -// -// See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#securitySchemeObject -// -// Allows the definition of a security scheme that can be used by the -// operations. Supported schemes are basic authentication, an API key (either as -// a header or as a query parameter) and OAuth2's common flows (implicit, -// password, application and access code). -type SecurityScheme struct { - // Required. The type of the security scheme. Valid values are "basic", - // "apiKey" or "oauth2". - Type SecurityScheme_Type `protobuf:"varint,1,opt,name=type,proto3,enum=grpc.gateway.protoc_gen_swagger.options.SecurityScheme_Type" json:"type,omitempty"` - // A short description for security scheme. - Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` - // Required. The name of the header or query parameter to be used. - // - // Valid for apiKey. - Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` - // Required. The location of the API key. Valid values are "query" or "header". - // - // Valid for apiKey. - In SecurityScheme_In `protobuf:"varint,4,opt,name=in,proto3,enum=grpc.gateway.protoc_gen_swagger.options.SecurityScheme_In" json:"in,omitempty"` - // Required. The flow used by the OAuth2 security scheme. Valid values are - // "implicit", "password", "application" or "accessCode". - // - // Valid for oauth2. - Flow SecurityScheme_Flow `protobuf:"varint,5,opt,name=flow,proto3,enum=grpc.gateway.protoc_gen_swagger.options.SecurityScheme_Flow" json:"flow,omitempty"` - // Required. The authorization URL to be used for this flow. This SHOULD be in - // the form of a URL. - // - // Valid for oauth2/implicit and oauth2/accessCode. - AuthorizationUrl string `protobuf:"bytes,6,opt,name=authorization_url,json=authorizationUrl,proto3" json:"authorization_url,omitempty"` - // Required. The token URL to be used for this flow. This SHOULD be in the - // form of a URL. - // - // Valid for oauth2/password, oauth2/application and oauth2/accessCode. - TokenUrl string `protobuf:"bytes,7,opt,name=token_url,json=tokenUrl,proto3" json:"token_url,omitempty"` - // Required. The available scopes for the OAuth2 security scheme. - // - // Valid for oauth2. - Scopes *Scopes `protobuf:"bytes,8,opt,name=scopes,proto3" json:"scopes,omitempty"` - Extensions map[string]*_struct.Value `protobuf:"bytes,9,rep,name=extensions,proto3" json:"extensions,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *SecurityScheme) Reset() { *m = SecurityScheme{} } -func (m *SecurityScheme) String() string { return proto.CompactTextString(m) } -func (*SecurityScheme) ProtoMessage() {} -func (*SecurityScheme) Descriptor() ([]byte, []int) { - return fileDescriptor_ba35ad8af024fb48, []int{11} -} - -func (m *SecurityScheme) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_SecurityScheme.Unmarshal(m, b) -} -func (m *SecurityScheme) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_SecurityScheme.Marshal(b, m, deterministic) -} -func (m *SecurityScheme) XXX_Merge(src proto.Message) { - xxx_messageInfo_SecurityScheme.Merge(m, src) -} -func (m *SecurityScheme) XXX_Size() int { - return xxx_messageInfo_SecurityScheme.Size(m) -} -func (m *SecurityScheme) XXX_DiscardUnknown() { - xxx_messageInfo_SecurityScheme.DiscardUnknown(m) -} - -var xxx_messageInfo_SecurityScheme proto.InternalMessageInfo - -func (m *SecurityScheme) GetType() SecurityScheme_Type { - if m != nil { - return m.Type - } - return SecurityScheme_TYPE_INVALID -} - -func (m *SecurityScheme) GetDescription() string { - if m != nil { - return m.Description - } - return "" -} - -func (m *SecurityScheme) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -func (m *SecurityScheme) GetIn() SecurityScheme_In { - if m != nil { - return m.In - } - return SecurityScheme_IN_INVALID -} - -func (m *SecurityScheme) GetFlow() SecurityScheme_Flow { - if m != nil { - return m.Flow - } - return SecurityScheme_FLOW_INVALID -} - -func (m *SecurityScheme) GetAuthorizationUrl() string { - if m != nil { - return m.AuthorizationUrl - } - return "" -} - -func (m *SecurityScheme) GetTokenUrl() string { - if m != nil { - return m.TokenUrl - } - return "" -} - -func (m *SecurityScheme) GetScopes() *Scopes { - if m != nil { - return m.Scopes - } - return nil -} - -func (m *SecurityScheme) GetExtensions() map[string]*_struct.Value { - if m != nil { - return m.Extensions - } - return nil -} - -// `SecurityRequirement` is a representation of OpenAPI v2 specification's -// Security Requirement object. -// -// See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#securityRequirementObject -// -// Lists the required security schemes to execute this operation. The object can -// have multiple security schemes declared in it which are all required (that -// is, there is a logical AND between the schemes). -// -// The name used for each property MUST correspond to a security scheme -// declared in the Security Definitions. -type SecurityRequirement struct { - // Each name must correspond to a security scheme which is declared in - // the Security Definitions. If the security scheme is of type "oauth2", - // then the value is a list of scope names required for the execution. - // For other security scheme types, the array MUST be empty. - SecurityRequirement map[string]*SecurityRequirement_SecurityRequirementValue `protobuf:"bytes,1,rep,name=security_requirement,json=securityRequirement,proto3" json:"security_requirement,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *SecurityRequirement) Reset() { *m = SecurityRequirement{} } -func (m *SecurityRequirement) String() string { return proto.CompactTextString(m) } -func (*SecurityRequirement) ProtoMessage() {} -func (*SecurityRequirement) Descriptor() ([]byte, []int) { - return fileDescriptor_ba35ad8af024fb48, []int{12} -} - -func (m *SecurityRequirement) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_SecurityRequirement.Unmarshal(m, b) -} -func (m *SecurityRequirement) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_SecurityRequirement.Marshal(b, m, deterministic) -} -func (m *SecurityRequirement) XXX_Merge(src proto.Message) { - xxx_messageInfo_SecurityRequirement.Merge(m, src) -} -func (m *SecurityRequirement) XXX_Size() int { - return xxx_messageInfo_SecurityRequirement.Size(m) -} -func (m *SecurityRequirement) XXX_DiscardUnknown() { - xxx_messageInfo_SecurityRequirement.DiscardUnknown(m) -} - -var xxx_messageInfo_SecurityRequirement proto.InternalMessageInfo - -func (m *SecurityRequirement) GetSecurityRequirement() map[string]*SecurityRequirement_SecurityRequirementValue { - if m != nil { - return m.SecurityRequirement - } - return nil -} - -// If the security scheme is of type "oauth2", then the value is a list of -// scope names required for the execution. For other security scheme types, -// the array MUST be empty. -type SecurityRequirement_SecurityRequirementValue struct { - Scope []string `protobuf:"bytes,1,rep,name=scope,proto3" json:"scope,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *SecurityRequirement_SecurityRequirementValue) Reset() { - *m = SecurityRequirement_SecurityRequirementValue{} -} -func (m *SecurityRequirement_SecurityRequirementValue) String() string { - return proto.CompactTextString(m) -} -func (*SecurityRequirement_SecurityRequirementValue) ProtoMessage() {} -func (*SecurityRequirement_SecurityRequirementValue) Descriptor() ([]byte, []int) { - return fileDescriptor_ba35ad8af024fb48, []int{12, 0} -} - -func (m *SecurityRequirement_SecurityRequirementValue) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_SecurityRequirement_SecurityRequirementValue.Unmarshal(m, b) -} -func (m *SecurityRequirement_SecurityRequirementValue) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_SecurityRequirement_SecurityRequirementValue.Marshal(b, m, deterministic) -} -func (m *SecurityRequirement_SecurityRequirementValue) XXX_Merge(src proto.Message) { - xxx_messageInfo_SecurityRequirement_SecurityRequirementValue.Merge(m, src) -} -func (m *SecurityRequirement_SecurityRequirementValue) XXX_Size() int { - return xxx_messageInfo_SecurityRequirement_SecurityRequirementValue.Size(m) -} -func (m *SecurityRequirement_SecurityRequirementValue) XXX_DiscardUnknown() { - xxx_messageInfo_SecurityRequirement_SecurityRequirementValue.DiscardUnknown(m) -} - -var xxx_messageInfo_SecurityRequirement_SecurityRequirementValue proto.InternalMessageInfo - -func (m *SecurityRequirement_SecurityRequirementValue) GetScope() []string { - if m != nil { - return m.Scope - } - return nil -} - -// `Scopes` is a representation of OpenAPI v2 specification's Scopes object. -// -// See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#scopesObject -// -// Lists the available scopes for an OAuth2 security scheme. -type Scopes struct { - // Maps between a name of a scope to a short description of it (as the value - // of the property). - Scope map[string]string `protobuf:"bytes,1,rep,name=scope,proto3" json:"scope,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Scopes) Reset() { *m = Scopes{} } -func (m *Scopes) String() string { return proto.CompactTextString(m) } -func (*Scopes) ProtoMessage() {} -func (*Scopes) Descriptor() ([]byte, []int) { - return fileDescriptor_ba35ad8af024fb48, []int{13} -} - -func (m *Scopes) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Scopes.Unmarshal(m, b) -} -func (m *Scopes) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Scopes.Marshal(b, m, deterministic) -} -func (m *Scopes) XXX_Merge(src proto.Message) { - xxx_messageInfo_Scopes.Merge(m, src) -} -func (m *Scopes) XXX_Size() int { - return xxx_messageInfo_Scopes.Size(m) -} -func (m *Scopes) XXX_DiscardUnknown() { - xxx_messageInfo_Scopes.DiscardUnknown(m) -} - -var xxx_messageInfo_Scopes proto.InternalMessageInfo - -func (m *Scopes) GetScope() map[string]string { - if m != nil { - return m.Scope - } - return nil -} - -func init() { - proto.RegisterEnum("grpc.gateway.protoc_gen_swagger.options.Swagger_SwaggerScheme", Swagger_SwaggerScheme_name, Swagger_SwaggerScheme_value) - proto.RegisterEnum("grpc.gateway.protoc_gen_swagger.options.JSONSchema_JSONSchemaSimpleTypes", JSONSchema_JSONSchemaSimpleTypes_name, JSONSchema_JSONSchemaSimpleTypes_value) - proto.RegisterEnum("grpc.gateway.protoc_gen_swagger.options.SecurityScheme_Type", SecurityScheme_Type_name, SecurityScheme_Type_value) - proto.RegisterEnum("grpc.gateway.protoc_gen_swagger.options.SecurityScheme_In", SecurityScheme_In_name, SecurityScheme_In_value) - proto.RegisterEnum("grpc.gateway.protoc_gen_swagger.options.SecurityScheme_Flow", SecurityScheme_Flow_name, SecurityScheme_Flow_value) - proto.RegisterType((*Swagger)(nil), "grpc.gateway.protoc_gen_swagger.options.Swagger") - proto.RegisterMapType((map[string]*_struct.Value)(nil), "grpc.gateway.protoc_gen_swagger.options.Swagger.ExtensionsEntry") - proto.RegisterMapType((map[string]*Response)(nil), "grpc.gateway.protoc_gen_swagger.options.Swagger.ResponsesEntry") - proto.RegisterType((*Operation)(nil), "grpc.gateway.protoc_gen_swagger.options.Operation") - proto.RegisterMapType((map[string]*_struct.Value)(nil), "grpc.gateway.protoc_gen_swagger.options.Operation.ExtensionsEntry") - proto.RegisterMapType((map[string]*Response)(nil), "grpc.gateway.protoc_gen_swagger.options.Operation.ResponsesEntry") - proto.RegisterType((*Response)(nil), "grpc.gateway.protoc_gen_swagger.options.Response") - proto.RegisterMapType((map[string]string)(nil), "grpc.gateway.protoc_gen_swagger.options.Response.ExamplesEntry") - proto.RegisterMapType((map[string]*_struct.Value)(nil), "grpc.gateway.protoc_gen_swagger.options.Response.ExtensionsEntry") - proto.RegisterType((*Info)(nil), "grpc.gateway.protoc_gen_swagger.options.Info") - proto.RegisterMapType((map[string]*_struct.Value)(nil), "grpc.gateway.protoc_gen_swagger.options.Info.ExtensionsEntry") - proto.RegisterType((*Contact)(nil), "grpc.gateway.protoc_gen_swagger.options.Contact") - proto.RegisterType((*License)(nil), "grpc.gateway.protoc_gen_swagger.options.License") - proto.RegisterType((*ExternalDocumentation)(nil), "grpc.gateway.protoc_gen_swagger.options.ExternalDocumentation") - proto.RegisterType((*Schema)(nil), "grpc.gateway.protoc_gen_swagger.options.Schema") - proto.RegisterType((*JSONSchema)(nil), "grpc.gateway.protoc_gen_swagger.options.JSONSchema") - proto.RegisterType((*Tag)(nil), "grpc.gateway.protoc_gen_swagger.options.Tag") - proto.RegisterType((*SecurityDefinitions)(nil), "grpc.gateway.protoc_gen_swagger.options.SecurityDefinitions") - proto.RegisterMapType((map[string]*SecurityScheme)(nil), "grpc.gateway.protoc_gen_swagger.options.SecurityDefinitions.SecurityEntry") - proto.RegisterType((*SecurityScheme)(nil), "grpc.gateway.protoc_gen_swagger.options.SecurityScheme") - proto.RegisterMapType((map[string]*_struct.Value)(nil), "grpc.gateway.protoc_gen_swagger.options.SecurityScheme.ExtensionsEntry") - proto.RegisterType((*SecurityRequirement)(nil), "grpc.gateway.protoc_gen_swagger.options.SecurityRequirement") - proto.RegisterMapType((map[string]*SecurityRequirement_SecurityRequirementValue)(nil), "grpc.gateway.protoc_gen_swagger.options.SecurityRequirement.SecurityRequirementEntry") - proto.RegisterType((*SecurityRequirement_SecurityRequirementValue)(nil), "grpc.gateway.protoc_gen_swagger.options.SecurityRequirement.SecurityRequirementValue") - proto.RegisterType((*Scopes)(nil), "grpc.gateway.protoc_gen_swagger.options.Scopes") - proto.RegisterMapType((map[string]string)(nil), "grpc.gateway.protoc_gen_swagger.options.Scopes.ScopeEntry") -} - -func init() { - proto.RegisterFile("protoc-gen-swagger/options/openapiv2.proto", fileDescriptor_ba35ad8af024fb48) -} - -var fileDescriptor_ba35ad8af024fb48 = []byte{ - // 1910 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe4, 0x59, 0x5b, 0x73, 0x1a, 0xd7, - 0x1d, 0xcf, 0xc2, 0x02, 0xcb, 0x1f, 0x81, 0x8f, 0x8f, 0xe5, 0x74, 0x43, 0x6c, 0x57, 0xa1, 0xe9, - 0x54, 0x63, 0xd7, 0x28, 0x51, 0x1e, 0x9a, 0x49, 0xaf, 0x48, 0x22, 0xf2, 0xae, 0x65, 0xa0, 0x0b, - 0x8a, 0xe2, 0x76, 0x3c, 0xdb, 0xd5, 0x72, 0x40, 0x1b, 0xef, 0x85, 0xec, 0x45, 0x12, 0xfd, 0x04, - 0x7d, 0xee, 0xf4, 0x35, 0xdf, 0xa3, 0x0f, 0x7d, 0xea, 0x17, 0x68, 0x3f, 0x4b, 0x3b, 0x7d, 0xef, - 0x9c, 0xcb, 0xc2, 0x22, 0x61, 0x0f, 0xc8, 0x76, 0xfb, 0x90, 0x27, 0xce, 0xff, 0xf6, 0x3b, 0x97, - 0xff, 0xed, 0x9c, 0x05, 0x1e, 0x4e, 0xc2, 0x20, 0x0e, 0xec, 0xc7, 0x63, 0xe2, 0x3f, 0x8e, 0x2e, - 0xac, 0xf1, 0x98, 0x84, 0x3b, 0xc1, 0x24, 0x76, 0x02, 0x3f, 0xda, 0x09, 0x26, 0xc4, 0xb7, 0x26, - 0xce, 0xf9, 0x6e, 0x93, 0x29, 0xe1, 0x9f, 0x8c, 0xc3, 0x89, 0xdd, 0x1c, 0x5b, 0x31, 0xb9, 0xb0, - 0xa6, 0x9c, 0x67, 0x9b, 0x63, 0xe2, 0x9b, 0xc2, 0xb0, 0x29, 0x0c, 0xeb, 0x1f, 0x8c, 0x83, 0x60, - 0xec, 0x92, 0x1d, 0xa6, 0x72, 0x9a, 0x8c, 0x76, 0x2c, 0x5f, 0xe8, 0xd7, 0xef, 0x5d, 0x15, 0x45, - 0x71, 0x98, 0xd8, 0x31, 0x97, 0x36, 0xfe, 0xaa, 0x40, 0xa9, 0xcf, 0xc1, 0xb0, 0x0a, 0x25, 0x81, - 0xab, 0x4a, 0x5b, 0xd2, 0x76, 0xd9, 0x48, 0x49, 0xdc, 0x02, 0xd9, 0xf1, 0x47, 0x81, 0x9a, 0xdb, - 0x92, 0xb6, 0x2b, 0xbb, 0x8f, 0x9b, 0x2b, 0x2e, 0xab, 0xa9, 0xf9, 0xa3, 0xc0, 0x60, 0xa6, 0x18, - 0x83, 0x7c, 0x16, 0x44, 0xb1, 0x9a, 0x67, 0xc8, 0x6c, 0x8c, 0x3f, 0x84, 0xf2, 0xa9, 0x15, 0x11, - 0x73, 0x62, 0xc5, 0x67, 0xaa, 0xcc, 0x04, 0x0a, 0x65, 0xf4, 0xac, 0xf8, 0x0c, 0x7f, 0x0d, 0xa5, - 0xc8, 0x3e, 0x23, 0x1e, 0x89, 0xd4, 0xc2, 0x56, 0x7e, 0xbb, 0xb6, 0xfb, 0xab, 0x95, 0xa7, 0x15, - 0x1b, 0x4a, 0x7f, 0xfb, 0x0c, 0xc6, 0x48, 0xe1, 0x70, 0x1d, 0x14, 0x3b, 0xf0, 0xa3, 0x84, 0x42, - 0x17, 0xb7, 0xf2, 0x74, 0xd6, 0x94, 0xa6, 0xb2, 0x49, 0x18, 0x0c, 0x13, 0x9b, 0x44, 0x6a, 0x89, - 0xcb, 0x52, 0x1a, 0xbf, 0x80, 0x72, 0x48, 0xa2, 0x49, 0xe0, 0x47, 0x24, 0x52, 0x61, 0x2b, 0xbf, - 0x5d, 0xd9, 0xfd, 0xf5, 0xda, 0x6b, 0x32, 0x52, 0x84, 0xb6, 0x1f, 0x87, 0x53, 0x63, 0x8e, 0x88, - 0x03, 0xd8, 0x8c, 0x88, 0x9d, 0x84, 0x4e, 0x3c, 0x35, 0x87, 0x64, 0xe4, 0xf8, 0x0e, 0xb3, 0x54, - 0x2b, 0xec, 0xd0, 0x7f, 0xb1, 0xfa, 0x4c, 0x02, 0xe4, 0x60, 0x8e, 0x61, 0xdc, 0x89, 0xae, 0x33, - 0xf1, 0xd7, 0xa0, 0xa4, 0x6c, 0x75, 0x83, 0x6d, 0x67, 0xfd, 0x49, 0x0c, 0xf2, 0x6d, 0xe2, 0x84, - 0xc4, 0x23, 0x7e, 0x6c, 0xcc, 0xd0, 0xb0, 0x0d, 0x55, 0x72, 0x19, 0x93, 0xd0, 0xb7, 0x5c, 0x73, - 0x18, 0xd8, 0x91, 0x5a, 0x63, 0x7b, 0x58, 0xdd, 0x83, 0x6d, 0x61, 0x7d, 0x10, 0xd8, 0x09, 0xc5, - 0xb6, 0x28, 0xdb, 0xd8, 0x20, 0x73, 0x76, 0x84, 0xff, 0x00, 0x40, 0x69, 0x3f, 0x62, 0xa7, 0x74, - 0x8b, 0x6d, 0xe0, 0x37, 0x6b, 0xfb, 0xa3, 0x3d, 0x83, 0xe0, 0x0e, 0xc9, 0x60, 0xd6, 0x03, 0xa8, - 0x2d, 0xba, 0x0b, 0x23, 0xc8, 0xbf, 0x24, 0x53, 0x91, 0x1e, 0x74, 0x88, 0x0f, 0xa1, 0x70, 0x6e, - 0xb9, 0x09, 0x11, 0xb9, 0xf1, 0xe9, 0xca, 0x0b, 0x48, 0x91, 0x0d, 0x6e, 0xff, 0x45, 0xee, 0x73, - 0xa9, 0x7e, 0x0c, 0xb7, 0xae, 0xac, 0x67, 0xc9, 0x8c, 0x3f, 0x5d, 0x9c, 0xf1, 0xfd, 0x26, 0x4f, - 0xf0, 0x66, 0x9a, 0xe0, 0xcd, 0xaf, 0xa8, 0x34, 0x03, 0xdb, 0xd8, 0x83, 0xea, 0x42, 0x2a, 0xe0, - 0x0a, 0x94, 0x8e, 0x3b, 0x4f, 0x3b, 0xdd, 0x93, 0x0e, 0x7a, 0x0f, 0x2b, 0x20, 0x3f, 0x19, 0x0c, - 0x7a, 0x48, 0xc2, 0x65, 0x28, 0xd0, 0x51, 0x1f, 0xe5, 0x70, 0x11, 0x72, 0x27, 0x7d, 0x94, 0xc7, - 0x25, 0xc8, 0x9f, 0xf4, 0xfb, 0x48, 0xd6, 0x65, 0x45, 0x41, 0x65, 0x5d, 0x56, 0xca, 0x08, 0x74, - 0x59, 0xa9, 0xa2, 0x5a, 0xe3, 0xef, 0x45, 0x28, 0x77, 0x27, 0x24, 0x64, 0xbe, 0xa1, 0xf9, 0x1d, - 0x5b, 0xe3, 0x48, 0x95, 0x58, 0xd2, 0xb0, 0x31, 0x2b, 0x28, 0x89, 0xe7, 0x59, 0xe1, 0x94, 0xad, - 0x95, 0x16, 0x14, 0x4e, 0xe2, 0x2d, 0xa8, 0x0c, 0x49, 0x64, 0x87, 0x0e, 0x3b, 0x0c, 0x51, 0x14, - 0xb2, 0xac, 0xeb, 0x21, 0x24, 0xbf, 0x83, 0x10, 0xfa, 0x08, 0x36, 0x82, 0x74, 0x07, 0xa6, 0x33, - 0x54, 0x0b, 0x7c, 0x1d, 0x33, 0x9e, 0x36, 0xbc, 0x71, 0xb1, 0x30, 0xb3, 0xc5, 0xa2, 0xcc, 0x82, - 0xb3, 0xb5, 0xf2, 0xda, 0x67, 0xc7, 0xfa, 0x9a, 0x72, 0xa1, 0xce, 0xeb, 0x23, 0xb0, 0xb9, 0x67, - 0xf5, 0xed, 0x01, 0xc0, 0x90, 0x4c, 0x42, 0x62, 0x5b, 0x31, 0x19, 0xb2, 0xf2, 0xa1, 0x18, 0x19, - 0xce, 0x3b, 0xcc, 0xfb, 0xd3, 0x85, 0x94, 0xac, 0x32, 0xec, 0xbd, 0x1b, 0xec, 0xfa, 0x7b, 0x90, - 0x94, 0x3c, 0xa1, 0x1a, 0xff, 0xc8, 0x83, 0x92, 0x4e, 0x7a, 0x35, 0x2b, 0xa4, 0xeb, 0x59, 0x71, - 0x08, 0x45, 0xe6, 0x65, 0x4b, 0xcc, 0xb3, 0xb3, 0xba, 0xe3, 0x98, 0x99, 0x21, 0xcc, 0xf1, 0xef, - 0x41, 0x21, 0x97, 0x96, 0x37, 0x71, 0x09, 0xcd, 0xac, 0xf5, 0x5a, 0x59, 0xba, 0xde, 0x66, 0x5b, - 0x20, 0x70, 0x27, 0xcd, 0x00, 0xb1, 0xb5, 0x10, 0x06, 0x85, 0x35, 0x83, 0x3f, 0x03, 0xff, 0xea, - 0x28, 0xf8, 0x39, 0x54, 0x17, 0x66, 0x5f, 0xe2, 0x92, 0xcd, 0xac, 0x4b, 0xca, 0xff, 0x13, 0x8f, - 0xe6, 0x91, 0xdc, 0xf8, 0x67, 0x1e, 0x64, 0x7a, 0xef, 0xa1, 0xf3, 0xc7, 0x4e, 0xec, 0x12, 0x01, - 0xca, 0x89, 0xab, 0x3e, 0xce, 0x5d, 0xf7, 0xf1, 0x36, 0xa0, 0x98, 0x84, 0x5e, 0x64, 0x06, 0x23, - 0x33, 0x22, 0xe1, 0xb9, 0x63, 0x13, 0x51, 0x20, 0x6b, 0x8c, 0xdf, 0x1d, 0xf5, 0x39, 0x17, 0xeb, - 0x50, 0xb2, 0x03, 0x3f, 0xb6, 0xec, 0x58, 0x54, 0xc7, 0x4f, 0x56, 0x3e, 0xe4, 0x7d, 0x6e, 0x67, - 0xa4, 0x00, 0x14, 0xcb, 0x75, 0x6c, 0xe2, 0x47, 0x84, 0x55, 0xc1, 0x75, 0xb0, 0x8e, 0xb8, 0x9d, - 0x91, 0x02, 0xd0, 0xd2, 0x74, 0x4e, 0x42, 0x7a, 0xba, 0x6a, 0x91, 0xd7, 0x7d, 0x41, 0xe2, 0x17, - 0x0b, 0x91, 0x51, 0x62, 0x91, 0xf1, 0xcb, 0xb5, 0xae, 0x93, 0xaf, 0x8d, 0x8a, 0x77, 0xd4, 0x3f, - 0xdb, 0x50, 0x12, 0xe7, 0x45, 0xdb, 0x9c, 0x6f, 0x79, 0xa9, 0x4f, 0xd9, 0x98, 0x4e, 0x91, 0x84, - 0xae, 0x70, 0x25, 0x1d, 0x52, 0xd7, 0x13, 0xcf, 0x72, 0x5c, 0xe1, 0x37, 0x4e, 0x34, 0x76, 0xa0, - 0x24, 0x8e, 0x6a, 0x35, 0x98, 0xc6, 0x53, 0xb8, 0xbb, 0xb4, 0x8b, 0xad, 0x50, 0x28, 0xae, 0x83, - 0xfd, 0x2d, 0x07, 0x45, 0x5e, 0x04, 0xf0, 0x00, 0x2a, 0xdf, 0x44, 0x81, 0x6f, 0x8a, 0x52, 0x22, - 0xb1, 0x73, 0xf8, 0x6c, 0x65, 0x37, 0xe8, 0xfd, 0x6e, 0x47, 0x94, 0x13, 0xa0, 0x38, 0x02, 0xf5, - 0x63, 0xa8, 0x0e, 0x1d, 0xba, 0x02, 0xcf, 0xf1, 0xad, 0x38, 0x08, 0xc5, 0xe4, 0x8b, 0x4c, 0x7a, - 0xe7, 0x0f, 0x89, 0x35, 0x34, 0x03, 0xdf, 0x9d, 0xb2, 0xe3, 0x51, 0x0c, 0x85, 0x32, 0xba, 0xbe, - 0xbb, 0xe4, 0xde, 0x58, 0x78, 0x07, 0x4d, 0xbf, 0x09, 0x25, 0x51, 0xa9, 0x58, 0x74, 0x56, 0x76, - 0x37, 0xaf, 0x45, 0x40, 0xcb, 0x9f, 0x1a, 0xa9, 0x92, 0x2e, 0x2b, 0x32, 0x2a, 0x34, 0xbe, 0x2b, - 0x01, 0xcc, 0x37, 0x4e, 0xcf, 0x37, 0x24, 0x23, 0xe1, 0x5f, 0x3a, 0x9c, 0xa7, 0x7b, 0xe1, 0x35, - 0xe9, 0x5e, 0xbc, 0xee, 0x29, 0x15, 0x4a, 0x43, 0x32, 0xb2, 0x12, 0x37, 0x56, 0x4b, 0x3c, 0x59, - 0x04, 0xb9, 0x78, 0x54, 0xca, 0x95, 0xa3, 0xfa, 0x21, 0x54, 0xbc, 0xc4, 0x8d, 0x9d, 0x89, 0x4b, - 0xcc, 0x60, 0xa4, 0xc2, 0x96, 0xb4, 0x2d, 0x19, 0x90, 0xb2, 0xba, 0x23, 0x8a, 0xeb, 0x59, 0x97, - 0x8e, 0x97, 0x78, 0xec, 0x0a, 0x20, 0x19, 0x29, 0x89, 0x1f, 0xc1, 0x6d, 0x72, 0x69, 0xbb, 0x49, - 0xe4, 0x9c, 0x13, 0x33, 0xd5, 0xd9, 0x60, 0xf8, 0x68, 0x26, 0x78, 0x26, 0x94, 0x29, 0x8c, 0xe3, - 0x33, 0x95, 0xaa, 0x80, 0xe1, 0xe4, 0x15, 0x18, 0xa1, 0x53, 0xbb, 0x0a, 0x23, 0x94, 0xef, 0x03, - 0x78, 0xd6, 0xa5, 0xe9, 0x12, 0x7f, 0x1c, 0x9f, 0xa9, 0xb7, 0xb6, 0xa4, 0x6d, 0xd9, 0x28, 0x7b, - 0xd6, 0xe5, 0x11, 0x63, 0x30, 0xb1, 0xe3, 0xa7, 0x62, 0x24, 0xc4, 0x8e, 0x2f, 0xc4, 0x2a, 0x94, - 0x26, 0x56, 0x4c, 0x7d, 0xa8, 0xde, 0xe6, 0x67, 0x24, 0x48, 0x7a, 0x46, 0x14, 0xd7, 0x89, 0x89, - 0x17, 0xa9, 0x9b, 0xcc, 0x4e, 0xf1, 0xac, 0x4b, 0x8d, 0xd2, 0x4c, 0xe8, 0xf8, 0x42, 0x78, 0x57, - 0x08, 0x1d, 0x9f, 0x0b, 0x3f, 0x82, 0x8d, 0xc4, 0x77, 0xbe, 0x4d, 0x88, 0x90, 0xbf, 0xcf, 0x56, - 0x5e, 0xe1, 0x3c, 0xae, 0xf2, 0x63, 0xa8, 0x51, 0xf0, 0x49, 0x48, 0x2f, 0x84, 0xb1, 0x43, 0x22, - 0x55, 0x65, 0x20, 0x55, 0xcf, 0xba, 0xec, 0xcd, 0x98, 0x4c, 0xcd, 0xf1, 0xb3, 0x6a, 0x1f, 0x08, - 0x35, 0xc7, 0xcf, 0xa8, 0xd5, 0x41, 0x09, 0xf9, 0xad, 0x69, 0xa8, 0xd6, 0xf9, 0x6d, 0x31, 0xa5, - 0x69, 0xf0, 0x58, 0x61, 0x68, 0x4d, 0xd5, 0x06, 0x13, 0x70, 0x02, 0xbf, 0x00, 0x39, 0x9e, 0x4e, - 0x88, 0xfa, 0x23, 0xf6, 0xfe, 0xd5, 0x6e, 0x90, 0xa0, 0x99, 0x61, 0xdf, 0xa1, 0xd1, 0x3c, 0x98, - 0x4e, 0x48, 0x64, 0x30, 0xd8, 0xc6, 0x05, 0xdc, 0x5d, 0x2a, 0x5e, 0x7c, 0x1e, 0x94, 0xa1, 0xd0, - 0x32, 0x8c, 0xd6, 0x73, 0x24, 0x51, 0xfe, 0x5e, 0xb7, 0x7b, 0xd4, 0x6e, 0x75, 0x50, 0x8e, 0x12, - 0x5a, 0x67, 0xd0, 0x3e, 0x6c, 0x1b, 0x28, 0x4f, 0xdf, 0x10, 0x9d, 0xe3, 0xa3, 0x23, 0x24, 0x63, - 0x80, 0x62, 0xe7, 0xf8, 0xd9, 0x5e, 0xdb, 0x40, 0x05, 0x3a, 0xee, 0xee, 0xe9, 0xed, 0xfd, 0x01, - 0x2a, 0xd2, 0x71, 0x7f, 0x60, 0x68, 0x9d, 0x43, 0x54, 0xd2, 0x65, 0x45, 0x42, 0x39, 0x5d, 0x56, - 0x72, 0x28, 0xcf, 0xb3, 0x6b, 0xf6, 0xae, 0xc0, 0xe8, 0x8e, 0x2e, 0x2b, 0x77, 0xd0, 0xa6, 0x2e, - 0x2b, 0x3f, 0x40, 0xaa, 0x2e, 0x2b, 0x1f, 0xa2, 0x7b, 0xba, 0xac, 0xdc, 0x43, 0xf7, 0x75, 0x59, - 0xb9, 0x8f, 0x1e, 0xe8, 0xb2, 0xf2, 0x00, 0x35, 0x74, 0x59, 0xf9, 0x18, 0x3d, 0xd4, 0x65, 0xe5, - 0x21, 0x7a, 0xa4, 0xcb, 0xca, 0x23, 0xd4, 0x6c, 0xfc, 0x59, 0x82, 0xfc, 0xc0, 0x1a, 0xaf, 0xd0, - 0x5f, 0xaf, 0x15, 0x99, 0xfc, 0xdb, 0x2f, 0x32, 0x7c, 0x8b, 0x8d, 0x7f, 0x4b, 0x70, 0x67, 0xc9, - 0x73, 0x1c, 0x8f, 0x32, 0x37, 0x70, 0x89, 0x35, 0x41, 0xfd, 0x4d, 0x9e, 0xf7, 0x33, 0x9e, 0xb8, - 0x88, 0xa5, 0xd8, 0xf5, 0x18, 0xaa, 0x0b, 0xa2, 0x25, 0xdd, 0xf0, 0xd9, 0x62, 0x37, 0xfc, 0xd9, - 0xda, 0xeb, 0x10, 0x5f, 0x57, 0x32, 0xed, 0xf2, 0x3f, 0x45, 0xa8, 0x2d, 0x4a, 0x71, 0x4f, 0x44, - 0x32, 0x9d, 0xb8, 0x76, 0x83, 0xe7, 0x06, 0x87, 0x69, 0xd2, 0xf0, 0xe4, 0xc1, 0xbb, 0x82, 0x9f, - 0xd3, 0x1e, 0x9b, 0xcf, 0xf4, 0x58, 0x1d, 0x72, 0x8e, 0xcf, 0x2e, 0x4b, 0xb5, 0xdd, 0x2f, 0x6e, - 0xba, 0x0a, 0xcd, 0x37, 0x72, 0x8e, 0x4f, 0xf7, 0x34, 0x72, 0x83, 0x0b, 0x56, 0xef, 0xdf, 0x60, - 0x4f, 0x5f, 0xba, 0xc1, 0x85, 0xc1, 0x90, 0x68, 0x45, 0xb5, 0x92, 0xf8, 0x2c, 0x08, 0x9d, 0x3f, - 0xf2, 0x27, 0x29, 0x6d, 0xe1, 0xbc, 0x65, 0xa0, 0x05, 0xc1, 0x71, 0xe8, 0xd2, 0xe2, 0x16, 0x07, - 0x2f, 0x09, 0x57, 0xe2, 0x9d, 0x43, 0x61, 0x0c, 0x2a, 0x64, 0xef, 0x84, 0x60, 0x42, 0x22, 0xd6, - 0x37, 0xd6, 0x7b, 0x27, 0x50, 0x33, 0x43, 0x98, 0xe3, 0xf1, 0xc2, 0x85, 0x8d, 0xbf, 0x63, 0x0f, - 0x6f, 0xba, 0xd5, 0xff, 0xc3, 0xd5, 0xed, 0x29, 0xc8, 0x34, 0x68, 0x30, 0x82, 0x8d, 0xc1, 0xf3, - 0x5e, 0xdb, 0xd4, 0x3a, 0x5f, 0xb5, 0x8e, 0xb4, 0x03, 0xf4, 0x1e, 0xae, 0x01, 0x30, 0xce, 0x5e, - 0xab, 0xaf, 0xed, 0x23, 0x69, 0xa6, 0xd1, 0xea, 0x69, 0xe6, 0xd3, 0xf6, 0x73, 0x94, 0xc3, 0xb7, - 0xa0, 0xc2, 0x38, 0xdd, 0xd6, 0xf1, 0xe0, 0xc9, 0x2e, 0xca, 0x37, 0x3e, 0x85, 0x9c, 0xe6, 0x53, - 0x43, 0xad, 0x93, 0x01, 0xda, 0x00, 0x45, 0xeb, 0x98, 0xbf, 0x3d, 0x6e, 0x1b, 0xb4, 0x46, 0x56, - 0xa1, 0xac, 0x75, 0xcc, 0x27, 0xed, 0xd6, 0x41, 0xdb, 0x40, 0xb9, 0xc6, 0x37, 0x20, 0x53, 0x07, - 0x53, 0xf4, 0x2f, 0x8f, 0xba, 0x27, 0x19, 0xb3, 0xdb, 0x50, 0xe5, 0x9c, 0x67, 0xbd, 0x23, 0x6d, - 0x5f, 0x1b, 0x20, 0x69, 0xc6, 0xea, 0xb5, 0xfa, 0xfd, 0x93, 0xae, 0x71, 0x80, 0x72, 0x78, 0x13, - 0x10, 0x63, 0xb5, 0x7a, 0x54, 0xab, 0x35, 0xd0, 0xba, 0x1d, 0x94, 0x9f, 0x73, 0xf7, 0xf7, 0xdb, - 0xfd, 0xbe, 0xb9, 0xdf, 0x3d, 0x68, 0x23, 0xb9, 0xf1, 0xaf, 0xdc, 0xbc, 0xda, 0x64, 0xde, 0xe7, - 0xf8, 0x4f, 0x52, 0xe6, 0xcb, 0x62, 0x38, 0x17, 0x88, 0xd2, 0x73, 0xfc, 0x26, 0x8f, 0xff, 0x65, - 0x3c, 0xee, 0xdc, 0xd9, 0x27, 0xc7, 0x8c, 0xa4, 0xfe, 0x09, 0xa8, 0x4b, 0x0c, 0x98, 0xd7, 0x68, - 0x0f, 0x64, 0x41, 0x27, 0x3e, 0x21, 0x71, 0xa2, 0xfe, 0x9d, 0xb4, 0xd4, 0xe4, 0x55, 0x11, 0xf2, - 0x72, 0x31, 0x42, 0xde, 0xfa, 0xde, 0xae, 0x05, 0xd8, 0x5f, 0x24, 0x7a, 0xad, 0x66, 0xb9, 0xd2, - 0xcb, 0x6e, 0xa0, 0xb2, 0x4e, 0x7d, 0x61, 0xf6, 0xfc, 0x87, 0x1f, 0x9e, 0xd8, 0xfc, 0xe7, 0x00, - 0x73, 0xe6, 0x3a, 0x4f, 0xdc, 0xbd, 0xfd, 0xdf, 0xb5, 0xc6, 0x4e, 0x7c, 0x96, 0x9c, 0x36, 0xed, - 0xc0, 0xdb, 0xa1, 0x0b, 0x79, 0x4c, 0xec, 0x20, 0x9a, 0x46, 0x31, 0x11, 0xa4, 0x58, 0xd7, 0xce, - 0xab, 0xff, 0x8e, 0x38, 0x2d, 0x32, 0xd9, 0x67, 0xff, 0x0d, 0x00, 0x00, 0xff, 0xff, 0xe3, 0xbc, - 0xdd, 0xdd, 0xb3, 0x18, 0x00, 0x00, -} diff --git a/vendor/github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger/options/openapiv2.proto b/vendor/github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger/options/openapiv2.proto deleted file mode 100644 index 3dcac4d99f..0000000000 --- a/vendor/github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger/options/openapiv2.proto +++ /dev/null @@ -1,380 +0,0 @@ -syntax = "proto3"; - -package grpc.gateway.protoc_gen_swagger.options; - -option go_package = "github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger/options"; - -import "google/protobuf/any.proto"; -import "google/protobuf/struct.proto"; - -// `Swagger` is a representation of OpenAPI v2 specification's Swagger object. -// -// See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#swaggerObject -// -// TODO(ivucica): document fields -message Swagger { - string swagger = 1; - Info info = 2; - string host = 3; - // `base_path` is the common prefix path used on all API endpoints (ie. /api, /v1, etc.). By adding this, - // it allows you to remove this portion from the path endpoints in your Swagger file making them easier - // to read. Note that using `base_path` does not change the endpoint paths that are generated in the resulting - // Swagger file. If you wish to use `base_path` with relatively generated Swagger paths, the - // `base_path` prefix must be manually removed from your `google.api.http` paths and your code changed to - // serve the API from the `base_path`. - string base_path = 4; - enum SwaggerScheme { - UNKNOWN = 0; - HTTP = 1; - HTTPS = 2; - WS = 3; - WSS = 4; - } - repeated SwaggerScheme schemes = 5; - repeated string consumes = 6; - repeated string produces = 7; - // field 8 is reserved for 'paths'. - reserved 8; - // field 9 is reserved for 'definitions', which at this time are already - // exposed as and customizable as proto messages. - reserved 9; - map responses = 10; - SecurityDefinitions security_definitions = 11; - repeated SecurityRequirement security = 12; - // field 13 is reserved for 'tags', which are supposed to be exposed as and - // customizable as proto services. TODO(ivucica): add processing of proto - // service objects into OpenAPI v2 Tag objects. - reserved 13; - ExternalDocumentation external_docs = 14; - map extensions = 15; -} - -// `Operation` is a representation of OpenAPI v2 specification's Operation object. -// -// See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#operationObject -// -// TODO(ivucica): document fields -message Operation { - repeated string tags = 1; - string summary = 2; - string description = 3; - ExternalDocumentation external_docs = 4; - string operation_id = 5; - repeated string consumes = 6; - repeated string produces = 7; - // field 8 is reserved for 'parameters'. - reserved 8; - map responses = 9; - repeated string schemes = 10; - bool deprecated = 11; - repeated SecurityRequirement security = 12; - map extensions = 13; -} - -// `Response` is a representation of OpenAPI v2 specification's Response object. -// -// See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#responseObject -// -message Response { - // `Description` is a short description of the response. - // GFM syntax can be used for rich text representation. - string description = 1; - // `Schema` optionally defines the structure of the response. - // If `Schema` is not provided, it means there is no content to the response. - Schema schema = 2; - // field 3 is reserved for 'headers'. - reserved 3; - // `Examples` gives per-mimetype response examples. - // See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#example-object - map examples = 4; - map extensions = 5; -} - -// `Info` is a representation of OpenAPI v2 specification's Info object. -// -// See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#infoObject -// -// TODO(ivucica): document fields -message Info { - string title = 1; - string description = 2; - string terms_of_service = 3; - Contact contact = 4; - License license = 5; - string version = 6; - map extensions = 7; -} - -// `Contact` is a representation of OpenAPI v2 specification's Contact object. -// -// See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#contactObject -// -// TODO(ivucica): document fields -message Contact { - string name = 1; - string url = 2; - string email = 3; -} - -// `License` is a representation of OpenAPI v2 specification's License object. -// -// See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#licenseObject -// -message License { - // Required. The license name used for the API. - string name = 1; - // A URL to the license used for the API. - string url = 2; -} - -// `ExternalDocumentation` is a representation of OpenAPI v2 specification's -// ExternalDocumentation object. -// -// See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#externalDocumentationObject -// -// TODO(ivucica): document fields -message ExternalDocumentation { - string description = 1; - string url = 2; -} - -// `Schema` is a representation of OpenAPI v2 specification's Schema object. -// -// See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#schemaObject -// -// TODO(ivucica): document fields -message Schema { - JSONSchema json_schema = 1; - string discriminator = 2; - bool read_only = 3; - // field 4 is reserved for 'xml'. - reserved 4; - ExternalDocumentation external_docs = 5; - google.protobuf.Any example = 6; -} - -// `JSONSchema` represents properties from JSON Schema taken, and as used, in -// the OpenAPI v2 spec. -// -// This includes changes made by OpenAPI v2. -// -// See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#schemaObject -// -// See also: https://cswr.github.io/JsonSchema/spec/basic_types/, -// https://github.com/json-schema-org/json-schema-spec/blob/master/schema.json -// -// TODO(ivucica): document fields -message JSONSchema { - // field 1 is reserved for '$id', omitted from OpenAPI v2. - reserved 1; - // field 2 is reserved for '$schema', omitted from OpenAPI v2. - reserved 2; - // Ref is used to define an external reference to include in the message. - // This could be a fully qualified proto message reference, and that type must be imported - // into the protofile. If no message is identified, the Ref will be used verbatim in - // the output. - // For example: - // `ref: ".google.protobuf.Timestamp"`. - string ref = 3; - // field 4 is reserved for '$comment', omitted from OpenAPI v2. - reserved 4; - string title = 5; - string description = 6; - string default = 7; - bool read_only = 8; - // field 9 is reserved for 'examples', which is omitted from OpenAPI v2 in favor of 'example' field. - reserved 9; - double multiple_of = 10; - double maximum = 11; - bool exclusive_maximum = 12; - double minimum = 13; - bool exclusive_minimum = 14; - uint64 max_length = 15; - uint64 min_length = 16; - string pattern = 17; - // field 18 is reserved for 'additionalItems', omitted from OpenAPI v2. - reserved 18; - // field 19 is reserved for 'items', but in OpenAPI-specific way. TODO(ivucica): add 'items'? - reserved 19; - uint64 max_items = 20; - uint64 min_items = 21; - bool unique_items = 22; - // field 23 is reserved for 'contains', omitted from OpenAPI v2. - reserved 23; - uint64 max_properties = 24; - uint64 min_properties = 25; - repeated string required = 26; - // field 27 is reserved for 'additionalProperties', but in OpenAPI-specific way. TODO(ivucica): add 'additionalProperties'? - reserved 27; - // field 28 is reserved for 'definitions', omitted from OpenAPI v2. - reserved 28; - // field 29 is reserved for 'properties', but in OpenAPI-specific way. TODO(ivucica): add 'additionalProperties'? - reserved 29; - // following fields are reserved, as the properties have been omitted from OpenAPI v2: - // patternProperties, dependencies, propertyNames, const - reserved 30 to 33; - // Items in 'array' must be unique. - repeated string array = 34; - - enum JSONSchemaSimpleTypes { - UNKNOWN = 0; - ARRAY = 1; - BOOLEAN = 2; - INTEGER = 3; - NULL = 4; - NUMBER = 5; - OBJECT = 6; - STRING = 7; - } - - repeated JSONSchemaSimpleTypes type = 35; - // following fields are reserved, as the properties have been omitted from OpenAPI v2: - // format, contentMediaType, contentEncoding, if, then, else - reserved 36 to 41; - // field 42 is reserved for 'allOf', but in OpenAPI-specific way. TODO(ivucica): add 'allOf'? - reserved 42; - // following fields are reserved, as the properties have been omitted from OpenAPI v2: - // anyOf, oneOf, not - reserved 43 to 45; -} - -// `Tag` is a representation of OpenAPI v2 specification's Tag object. -// -// See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#tagObject -// -// TODO(ivucica): document fields -message Tag { - // field 1 is reserved for 'name'. In our generator, this is (to be) extracted - // from the name of proto service, and thus not exposed to the user, as - // changing tag object's name would break the link to the references to the - // tag in individual operation specifications. - // - // TODO(ivucica): Add 'name' property. Use it to allow override of the name of - // global Tag object, then use that name to reference the tag throughout the - // Swagger file. - reserved 1; - // TODO(ivucica): Description should be extracted from comments on the proto - // service object. - string description = 2; - ExternalDocumentation external_docs = 3; -} - -// `SecurityDefinitions` is a representation of OpenAPI v2 specification's -// Security Definitions object. -// -// See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#securityDefinitionsObject -// -// A declaration of the security schemes available to be used in the -// specification. This does not enforce the security schemes on the operations -// and only serves to provide the relevant details for each scheme. -message SecurityDefinitions { - // A single security scheme definition, mapping a "name" to the scheme it defines. - map security = 1; -} - -// `SecurityScheme` is a representation of OpenAPI v2 specification's -// Security Scheme object. -// -// See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#securitySchemeObject -// -// Allows the definition of a security scheme that can be used by the -// operations. Supported schemes are basic authentication, an API key (either as -// a header or as a query parameter) and OAuth2's common flows (implicit, -// password, application and access code). -message SecurityScheme { - // Required. The type of the security scheme. Valid values are "basic", - // "apiKey" or "oauth2". - enum Type { - TYPE_INVALID = 0; - TYPE_BASIC = 1; - TYPE_API_KEY = 2; - TYPE_OAUTH2 = 3; - } - - // Required. The location of the API key. Valid values are "query" or "header". - enum In { - IN_INVALID = 0; - IN_QUERY = 1; - IN_HEADER = 2; - } - - // Required. The flow used by the OAuth2 security scheme. Valid values are - // "implicit", "password", "application" or "accessCode". - enum Flow { - FLOW_INVALID = 0; - FLOW_IMPLICIT = 1; - FLOW_PASSWORD = 2; - FLOW_APPLICATION = 3; - FLOW_ACCESS_CODE = 4; - } - - // Required. The type of the security scheme. Valid values are "basic", - // "apiKey" or "oauth2". - Type type = 1; - // A short description for security scheme. - string description = 2; - // Required. The name of the header or query parameter to be used. - // - // Valid for apiKey. - string name = 3; - // Required. The location of the API key. Valid values are "query" or "header". - // - // Valid for apiKey. - In in = 4; - // Required. The flow used by the OAuth2 security scheme. Valid values are - // "implicit", "password", "application" or "accessCode". - // - // Valid for oauth2. - Flow flow = 5; - // Required. The authorization URL to be used for this flow. This SHOULD be in - // the form of a URL. - // - // Valid for oauth2/implicit and oauth2/accessCode. - string authorization_url = 6; - // Required. The token URL to be used for this flow. This SHOULD be in the - // form of a URL. - // - // Valid for oauth2/password, oauth2/application and oauth2/accessCode. - string token_url = 7; - // Required. The available scopes for the OAuth2 security scheme. - // - // Valid for oauth2. - Scopes scopes = 8; - map extensions = 9; -} - -// `SecurityRequirement` is a representation of OpenAPI v2 specification's -// Security Requirement object. -// -// See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#securityRequirementObject -// -// Lists the required security schemes to execute this operation. The object can -// have multiple security schemes declared in it which are all required (that -// is, there is a logical AND between the schemes). -// -// The name used for each property MUST correspond to a security scheme -// declared in the Security Definitions. -message SecurityRequirement { - // If the security scheme is of type "oauth2", then the value is a list of - // scope names required for the execution. For other security scheme types, - // the array MUST be empty. - message SecurityRequirementValue { - repeated string scope = 1; - } - // Each name must correspond to a security scheme which is declared in - // the Security Definitions. If the security scheme is of type "oauth2", - // then the value is a list of scope names required for the execution. - // For other security scheme types, the array MUST be empty. - map security_requirement = 1; -} - -// `Scopes` is a representation of OpenAPI v2 specification's Scopes object. -// -// See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#scopesObject -// -// Lists the available scopes for an OAuth2 security scheme. -message Scopes { - // Maps between a name of a scope to a short description of it (as the value - // of the property). - map scope = 1; -} diff --git a/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/BUILD.bazel b/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/BUILD.bazel deleted file mode 100644 index c4d18f624a..0000000000 --- a/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/BUILD.bazel +++ /dev/null @@ -1,86 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") - -package(default_visibility = ["//visibility:public"]) - -go_library( - name = "go_default_library", - srcs = [ - "context.go", - "convert.go", - "doc.go", - "errors.go", - "fieldmask.go", - "handler.go", - "marshal_httpbodyproto.go", - "marshal_json.go", - "marshal_jsonpb.go", - "marshal_proto.go", - "marshaler.go", - "marshaler_registry.go", - "mux.go", - "pattern.go", - "proto2_convert.go", - "proto_errors.go", - "query.go", - ], - importpath = "github.com/grpc-ecosystem/grpc-gateway/runtime", - deps = [ - "//internal:go_default_library", - "//utilities:go_default_library", - "@com_github_golang_protobuf//descriptor:go_default_library_gen", - "@com_github_golang_protobuf//jsonpb:go_default_library_gen", - "@com_github_golang_protobuf//proto:go_default_library", - "@go_googleapis//google/api:httpbody_go_proto", - "@io_bazel_rules_go//proto/wkt:any_go_proto", - "@io_bazel_rules_go//proto/wkt:descriptor_go_proto", - "@io_bazel_rules_go//proto/wkt:duration_go_proto", - "@io_bazel_rules_go//proto/wkt:field_mask_go_proto", - "@io_bazel_rules_go//proto/wkt:timestamp_go_proto", - "@io_bazel_rules_go//proto/wkt:wrappers_go_proto", - "@org_golang_google_grpc//codes:go_default_library", - "@org_golang_google_grpc//grpclog:go_default_library", - "@org_golang_google_grpc//metadata:go_default_library", - "@org_golang_google_grpc//status:go_default_library", - ], -) - -go_test( - name = "go_default_test", - size = "small", - srcs = [ - "context_test.go", - "convert_test.go", - "errors_test.go", - "fieldmask_test.go", - "handler_test.go", - "marshal_httpbodyproto_test.go", - "marshal_json_test.go", - "marshal_jsonpb_test.go", - "marshal_proto_test.go", - "marshaler_registry_test.go", - "mux_test.go", - "pattern_test.go", - "query_test.go", - ], - embed = [":go_default_library"], - deps = [ - "//internal:go_default_library", - "//runtime/internal/examplepb:go_default_library", - "//utilities:go_default_library", - "@com_github_golang_protobuf//jsonpb:go_default_library_gen", - "@com_github_golang_protobuf//proto:go_default_library", - "@com_github_golang_protobuf//ptypes:go_default_library_gen", - "@go_googleapis//google/api:httpbody_go_proto", - "@go_googleapis//google/rpc:errdetails_go_proto", - "@io_bazel_rules_go//proto/wkt:duration_go_proto", - "@io_bazel_rules_go//proto/wkt:empty_go_proto", - "@io_bazel_rules_go//proto/wkt:field_mask_go_proto", - "@io_bazel_rules_go//proto/wkt:struct_go_proto", - "@io_bazel_rules_go//proto/wkt:timestamp_go_proto", - "@io_bazel_rules_go//proto/wkt:wrappers_go_proto", - "@org_golang_google_grpc//:go_default_library", - "@org_golang_google_grpc//codes:go_default_library", - "@org_golang_google_grpc//metadata:go_default_library", - "@org_golang_google_grpc//status:go_default_library", - ], -) diff --git a/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/context.go b/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/context.go deleted file mode 100644 index f8083821f3..0000000000 --- a/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/context.go +++ /dev/null @@ -1,236 +0,0 @@ -package runtime - -import ( - "context" - "encoding/base64" - "fmt" - "net" - "net/http" - "net/textproto" - "strconv" - "strings" - "time" - - "google.golang.org/grpc/codes" - "google.golang.org/grpc/grpclog" - "google.golang.org/grpc/metadata" - "google.golang.org/grpc/status" -) - -// MetadataHeaderPrefix is the http prefix that represents custom metadata -// parameters to or from a gRPC call. -const MetadataHeaderPrefix = "Grpc-Metadata-" - -// MetadataPrefix is prepended to permanent HTTP header keys (as specified -// by the IANA) when added to the gRPC context. -const MetadataPrefix = "grpcgateway-" - -// MetadataTrailerPrefix is prepended to gRPC metadata as it is converted to -// HTTP headers in a response handled by grpc-gateway -const MetadataTrailerPrefix = "Grpc-Trailer-" - -const metadataGrpcTimeout = "Grpc-Timeout" -const metadataHeaderBinarySuffix = "-Bin" - -const xForwardedFor = "X-Forwarded-For" -const xForwardedHost = "X-Forwarded-Host" - -var ( - // DefaultContextTimeout is used for gRPC call context.WithTimeout whenever a Grpc-Timeout inbound - // header isn't present. If the value is 0 the sent `context` will not have a timeout. - DefaultContextTimeout = 0 * time.Second -) - -func decodeBinHeader(v string) ([]byte, error) { - if len(v)%4 == 0 { - // Input was padded, or padding was not necessary. - return base64.StdEncoding.DecodeString(v) - } - return base64.RawStdEncoding.DecodeString(v) -} - -/* -AnnotateContext adds context information such as metadata from the request. - -At a minimum, the RemoteAddr is included in the fashion of "X-Forwarded-For", -except that the forwarded destination is not another HTTP service but rather -a gRPC service. -*/ -func AnnotateContext(ctx context.Context, mux *ServeMux, req *http.Request) (context.Context, error) { - ctx, md, err := annotateContext(ctx, mux, req) - if err != nil { - return nil, err - } - if md == nil { - return ctx, nil - } - - return metadata.NewOutgoingContext(ctx, md), nil -} - -// AnnotateIncomingContext adds context information such as metadata from the request. -// Attach metadata as incoming context. -func AnnotateIncomingContext(ctx context.Context, mux *ServeMux, req *http.Request) (context.Context, error) { - ctx, md, err := annotateContext(ctx, mux, req) - if err != nil { - return nil, err - } - if md == nil { - return ctx, nil - } - - return metadata.NewIncomingContext(ctx, md), nil -} - -func annotateContext(ctx context.Context, mux *ServeMux, req *http.Request) (context.Context, metadata.MD, error) { - var pairs []string - timeout := DefaultContextTimeout - if tm := req.Header.Get(metadataGrpcTimeout); tm != "" { - var err error - timeout, err = timeoutDecode(tm) - if err != nil { - return nil, nil, status.Errorf(codes.InvalidArgument, "invalid grpc-timeout: %s", tm) - } - } - - for key, vals := range req.Header { - for _, val := range vals { - key = textproto.CanonicalMIMEHeaderKey(key) - // For backwards-compatibility, pass through 'authorization' header with no prefix. - if key == "Authorization" { - pairs = append(pairs, "authorization", val) - } - if h, ok := mux.incomingHeaderMatcher(key); ok { - // Handles "-bin" metadata in grpc, since grpc will do another base64 - // encode before sending to server, we need to decode it first. - if strings.HasSuffix(key, metadataHeaderBinarySuffix) { - b, err := decodeBinHeader(val) - if err != nil { - return nil, nil, status.Errorf(codes.InvalidArgument, "invalid binary header %s: %s", key, err) - } - - val = string(b) - } - pairs = append(pairs, h, val) - } - } - } - if host := req.Header.Get(xForwardedHost); host != "" { - pairs = append(pairs, strings.ToLower(xForwardedHost), host) - } else if req.Host != "" { - pairs = append(pairs, strings.ToLower(xForwardedHost), req.Host) - } - - if addr := req.RemoteAddr; addr != "" { - if remoteIP, _, err := net.SplitHostPort(addr); err == nil { - if fwd := req.Header.Get(xForwardedFor); fwd == "" { - pairs = append(pairs, strings.ToLower(xForwardedFor), remoteIP) - } else { - pairs = append(pairs, strings.ToLower(xForwardedFor), fmt.Sprintf("%s, %s", fwd, remoteIP)) - } - } else { - grpclog.Infof("invalid remote addr: %s", addr) - } - } - - if timeout != 0 { - ctx, _ = context.WithTimeout(ctx, timeout) - } - if len(pairs) == 0 { - return ctx, nil, nil - } - md := metadata.Pairs(pairs...) - for _, mda := range mux.metadataAnnotators { - md = metadata.Join(md, mda(ctx, req)) - } - return ctx, md, nil -} - -// ServerMetadata consists of metadata sent from gRPC server. -type ServerMetadata struct { - HeaderMD metadata.MD - TrailerMD metadata.MD -} - -type serverMetadataKey struct{} - -// NewServerMetadataContext creates a new context with ServerMetadata -func NewServerMetadataContext(ctx context.Context, md ServerMetadata) context.Context { - return context.WithValue(ctx, serverMetadataKey{}, md) -} - -// ServerMetadataFromContext returns the ServerMetadata in ctx -func ServerMetadataFromContext(ctx context.Context) (md ServerMetadata, ok bool) { - md, ok = ctx.Value(serverMetadataKey{}).(ServerMetadata) - return -} - -func timeoutDecode(s string) (time.Duration, error) { - size := len(s) - if size < 2 { - return 0, fmt.Errorf("timeout string is too short: %q", s) - } - d, ok := timeoutUnitToDuration(s[size-1]) - if !ok { - return 0, fmt.Errorf("timeout unit is not recognized: %q", s) - } - t, err := strconv.ParseInt(s[:size-1], 10, 64) - if err != nil { - return 0, err - } - return d * time.Duration(t), nil -} - -func timeoutUnitToDuration(u uint8) (d time.Duration, ok bool) { - switch u { - case 'H': - return time.Hour, true - case 'M': - return time.Minute, true - case 'S': - return time.Second, true - case 'm': - return time.Millisecond, true - case 'u': - return time.Microsecond, true - case 'n': - return time.Nanosecond, true - default: - } - return -} - -// isPermanentHTTPHeader checks whether hdr belongs to the list of -// permenant request headers maintained by IANA. -// http://www.iana.org/assignments/message-headers/message-headers.xml -func isPermanentHTTPHeader(hdr string) bool { - switch hdr { - case - "Accept", - "Accept-Charset", - "Accept-Language", - "Accept-Ranges", - "Authorization", - "Cache-Control", - "Content-Type", - "Cookie", - "Date", - "Expect", - "From", - "Host", - "If-Match", - "If-Modified-Since", - "If-None-Match", - "If-Schedule-Tag-Match", - "If-Unmodified-Since", - "Max-Forwards", - "Origin", - "Pragma", - "Referer", - "User-Agent", - "Via", - "Warning": - return true - } - return false -} diff --git a/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/convert.go b/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/convert.go deleted file mode 100644 index 2c279344dc..0000000000 --- a/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/convert.go +++ /dev/null @@ -1,318 +0,0 @@ -package runtime - -import ( - "encoding/base64" - "fmt" - "strconv" - "strings" - - "github.com/golang/protobuf/jsonpb" - "github.com/golang/protobuf/ptypes/duration" - "github.com/golang/protobuf/ptypes/timestamp" - "github.com/golang/protobuf/ptypes/wrappers" -) - -// String just returns the given string. -// It is just for compatibility to other types. -func String(val string) (string, error) { - return val, nil -} - -// StringSlice converts 'val' where individual strings are separated by -// 'sep' into a string slice. -func StringSlice(val, sep string) ([]string, error) { - return strings.Split(val, sep), nil -} - -// Bool converts the given string representation of a boolean value into bool. -func Bool(val string) (bool, error) { - return strconv.ParseBool(val) -} - -// BoolSlice converts 'val' where individual booleans are separated by -// 'sep' into a bool slice. -func BoolSlice(val, sep string) ([]bool, error) { - s := strings.Split(val, sep) - values := make([]bool, len(s)) - for i, v := range s { - value, err := Bool(v) - if err != nil { - return values, err - } - values[i] = value - } - return values, nil -} - -// Float64 converts the given string representation into representation of a floating point number into float64. -func Float64(val string) (float64, error) { - return strconv.ParseFloat(val, 64) -} - -// Float64Slice converts 'val' where individual floating point numbers are separated by -// 'sep' into a float64 slice. -func Float64Slice(val, sep string) ([]float64, error) { - s := strings.Split(val, sep) - values := make([]float64, len(s)) - for i, v := range s { - value, err := Float64(v) - if err != nil { - return values, err - } - values[i] = value - } - return values, nil -} - -// Float32 converts the given string representation of a floating point number into float32. -func Float32(val string) (float32, error) { - f, err := strconv.ParseFloat(val, 32) - if err != nil { - return 0, err - } - return float32(f), nil -} - -// Float32Slice converts 'val' where individual floating point numbers are separated by -// 'sep' into a float32 slice. -func Float32Slice(val, sep string) ([]float32, error) { - s := strings.Split(val, sep) - values := make([]float32, len(s)) - for i, v := range s { - value, err := Float32(v) - if err != nil { - return values, err - } - values[i] = value - } - return values, nil -} - -// Int64 converts the given string representation of an integer into int64. -func Int64(val string) (int64, error) { - return strconv.ParseInt(val, 0, 64) -} - -// Int64Slice converts 'val' where individual integers are separated by -// 'sep' into a int64 slice. -func Int64Slice(val, sep string) ([]int64, error) { - s := strings.Split(val, sep) - values := make([]int64, len(s)) - for i, v := range s { - value, err := Int64(v) - if err != nil { - return values, err - } - values[i] = value - } - return values, nil -} - -// Int32 converts the given string representation of an integer into int32. -func Int32(val string) (int32, error) { - i, err := strconv.ParseInt(val, 0, 32) - if err != nil { - return 0, err - } - return int32(i), nil -} - -// Int32Slice converts 'val' where individual integers are separated by -// 'sep' into a int32 slice. -func Int32Slice(val, sep string) ([]int32, error) { - s := strings.Split(val, sep) - values := make([]int32, len(s)) - for i, v := range s { - value, err := Int32(v) - if err != nil { - return values, err - } - values[i] = value - } - return values, nil -} - -// Uint64 converts the given string representation of an integer into uint64. -func Uint64(val string) (uint64, error) { - return strconv.ParseUint(val, 0, 64) -} - -// Uint64Slice converts 'val' where individual integers are separated by -// 'sep' into a uint64 slice. -func Uint64Slice(val, sep string) ([]uint64, error) { - s := strings.Split(val, sep) - values := make([]uint64, len(s)) - for i, v := range s { - value, err := Uint64(v) - if err != nil { - return values, err - } - values[i] = value - } - return values, nil -} - -// Uint32 converts the given string representation of an integer into uint32. -func Uint32(val string) (uint32, error) { - i, err := strconv.ParseUint(val, 0, 32) - if err != nil { - return 0, err - } - return uint32(i), nil -} - -// Uint32Slice converts 'val' where individual integers are separated by -// 'sep' into a uint32 slice. -func Uint32Slice(val, sep string) ([]uint32, error) { - s := strings.Split(val, sep) - values := make([]uint32, len(s)) - for i, v := range s { - value, err := Uint32(v) - if err != nil { - return values, err - } - values[i] = value - } - return values, nil -} - -// Bytes converts the given string representation of a byte sequence into a slice of bytes -// A bytes sequence is encoded in URL-safe base64 without padding -func Bytes(val string) ([]byte, error) { - b, err := base64.StdEncoding.DecodeString(val) - if err != nil { - b, err = base64.URLEncoding.DecodeString(val) - if err != nil { - return nil, err - } - } - return b, nil -} - -// BytesSlice converts 'val' where individual bytes sequences, encoded in URL-safe -// base64 without padding, are separated by 'sep' into a slice of bytes slices slice. -func BytesSlice(val, sep string) ([][]byte, error) { - s := strings.Split(val, sep) - values := make([][]byte, len(s)) - for i, v := range s { - value, err := Bytes(v) - if err != nil { - return values, err - } - values[i] = value - } - return values, nil -} - -// Timestamp converts the given RFC3339 formatted string into a timestamp.Timestamp. -func Timestamp(val string) (*timestamp.Timestamp, error) { - var r timestamp.Timestamp - err := jsonpb.UnmarshalString(val, &r) - if err != nil { - return nil, err - } - return &r, nil -} - -// Duration converts the given string into a timestamp.Duration. -func Duration(val string) (*duration.Duration, error) { - var r duration.Duration - err := jsonpb.UnmarshalString(val, &r) - if err != nil { - return nil, err - } - return &r, nil -} - -// Enum converts the given string into an int32 that should be type casted into the -// correct enum proto type. -func Enum(val string, enumValMap map[string]int32) (int32, error) { - e, ok := enumValMap[val] - if ok { - return e, nil - } - - i, err := Int32(val) - if err != nil { - return 0, fmt.Errorf("%s is not valid", val) - } - for _, v := range enumValMap { - if v == i { - return i, nil - } - } - return 0, fmt.Errorf("%s is not valid", val) -} - -// EnumSlice converts 'val' where individual enums are separated by 'sep' -// into a int32 slice. Each individual int32 should be type casted into the -// correct enum proto type. -func EnumSlice(val, sep string, enumValMap map[string]int32) ([]int32, error) { - s := strings.Split(val, sep) - values := make([]int32, len(s)) - for i, v := range s { - value, err := Enum(v, enumValMap) - if err != nil { - return values, err - } - values[i] = value - } - return values, nil -} - -/* - Support fot google.protobuf.wrappers on top of primitive types -*/ - -// StringValue well-known type support as wrapper around string type -func StringValue(val string) (*wrappers.StringValue, error) { - return &wrappers.StringValue{Value: val}, nil -} - -// FloatValue well-known type support as wrapper around float32 type -func FloatValue(val string) (*wrappers.FloatValue, error) { - parsedVal, err := Float32(val) - return &wrappers.FloatValue{Value: parsedVal}, err -} - -// DoubleValue well-known type support as wrapper around float64 type -func DoubleValue(val string) (*wrappers.DoubleValue, error) { - parsedVal, err := Float64(val) - return &wrappers.DoubleValue{Value: parsedVal}, err -} - -// BoolValue well-known type support as wrapper around bool type -func BoolValue(val string) (*wrappers.BoolValue, error) { - parsedVal, err := Bool(val) - return &wrappers.BoolValue{Value: parsedVal}, err -} - -// Int32Value well-known type support as wrapper around int32 type -func Int32Value(val string) (*wrappers.Int32Value, error) { - parsedVal, err := Int32(val) - return &wrappers.Int32Value{Value: parsedVal}, err -} - -// UInt32Value well-known type support as wrapper around uint32 type -func UInt32Value(val string) (*wrappers.UInt32Value, error) { - parsedVal, err := Uint32(val) - return &wrappers.UInt32Value{Value: parsedVal}, err -} - -// Int64Value well-known type support as wrapper around int64 type -func Int64Value(val string) (*wrappers.Int64Value, error) { - parsedVal, err := Int64(val) - return &wrappers.Int64Value{Value: parsedVal}, err -} - -// UInt64Value well-known type support as wrapper around uint64 type -func UInt64Value(val string) (*wrappers.UInt64Value, error) { - parsedVal, err := Uint64(val) - return &wrappers.UInt64Value{Value: parsedVal}, err -} - -// BytesValue well-known type support as wrapper around bytes[] type -func BytesValue(val string) (*wrappers.BytesValue, error) { - parsedVal, err := Bytes(val) - return &wrappers.BytesValue{Value: parsedVal}, err -} diff --git a/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/doc.go b/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/doc.go deleted file mode 100644 index b6e5ddf7a9..0000000000 --- a/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/doc.go +++ /dev/null @@ -1,5 +0,0 @@ -/* -Package runtime contains runtime helper functions used by -servers which protoc-gen-grpc-gateway generates. -*/ -package runtime diff --git a/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/errors.go b/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/errors.go deleted file mode 100644 index 65a5dc690d..0000000000 --- a/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/errors.go +++ /dev/null @@ -1,169 +0,0 @@ -package runtime - -import ( - "context" - "io" - "net/http" - - "github.com/grpc-ecosystem/grpc-gateway/internal" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/grpclog" - "google.golang.org/grpc/status" -) - -// HTTPStatusFromCode converts a gRPC error code into the corresponding HTTP response status. -// See: https://github.com/googleapis/googleapis/blob/master/google/rpc/code.proto -func HTTPStatusFromCode(code codes.Code) int { - switch code { - case codes.OK: - return http.StatusOK - case codes.Canceled: - return http.StatusRequestTimeout - case codes.Unknown: - return http.StatusInternalServerError - case codes.InvalidArgument: - return http.StatusBadRequest - case codes.DeadlineExceeded: - return http.StatusGatewayTimeout - case codes.NotFound: - return http.StatusNotFound - case codes.AlreadyExists: - return http.StatusConflict - case codes.PermissionDenied: - return http.StatusForbidden - case codes.Unauthenticated: - return http.StatusUnauthorized - case codes.ResourceExhausted: - return http.StatusTooManyRequests - case codes.FailedPrecondition: - // Note, this deliberately doesn't translate to the similarly named '412 Precondition Failed' HTTP response status. - return http.StatusBadRequest - case codes.Aborted: - return http.StatusConflict - case codes.OutOfRange: - return http.StatusBadRequest - case codes.Unimplemented: - return http.StatusNotImplemented - case codes.Internal: - return http.StatusInternalServerError - case codes.Unavailable: - return http.StatusServiceUnavailable - case codes.DataLoss: - return http.StatusInternalServerError - } - - grpclog.Infof("Unknown gRPC error code: %v", code) - return http.StatusInternalServerError -} - -var ( - // HTTPError replies to the request with an error. - // - // HTTPError is called: - // - From generated per-endpoint gateway handler code, when calling the backend results in an error. - // - From gateway runtime code, when forwarding the response message results in an error. - // - // The default value for HTTPError calls the custom error handler configured on the ServeMux via the - // WithProtoErrorHandler serve option if that option was used, calling GlobalHTTPErrorHandler otherwise. - // - // To customize the error handling of a particular ServeMux instance, use the WithProtoErrorHandler - // serve option. - // - // To customize the error format for all ServeMux instances not using the WithProtoErrorHandler serve - // option, set GlobalHTTPErrorHandler to a custom function. - // - // Setting this variable directly to customize error format is deprecated. - HTTPError = MuxOrGlobalHTTPError - - // GlobalHTTPErrorHandler is the HTTPError handler for all ServeMux instances not using the - // WithProtoErrorHandler serve option. - // - // You can set a custom function to this variable to customize error format. - GlobalHTTPErrorHandler = DefaultHTTPError - - // OtherErrorHandler handles gateway errors from parsing and routing client requests for all - // ServeMux instances not using the WithProtoErrorHandler serve option. - // - // It returns the following error codes: StatusMethodNotAllowed StatusNotFound StatusBadRequest - // - // To customize parsing and routing error handling of a particular ServeMux instance, use the - // WithProtoErrorHandler serve option. - // - // To customize parsing and routing error handling of all ServeMux instances not using the - // WithProtoErrorHandler serve option, set a custom function to this variable. - OtherErrorHandler = DefaultOtherErrorHandler -) - -// MuxOrGlobalHTTPError uses the mux-configured error handler, falling back to GlobalErrorHandler. -func MuxOrGlobalHTTPError(ctx context.Context, mux *ServeMux, marshaler Marshaler, w http.ResponseWriter, r *http.Request, err error) { - if mux.protoErrorHandler != nil { - mux.protoErrorHandler(ctx, mux, marshaler, w, r, err) - } else { - GlobalHTTPErrorHandler(ctx, mux, marshaler, w, r, err) - } -} - -// DefaultHTTPError is the default implementation of HTTPError. -// If "err" is an error from gRPC system, the function replies with the status code mapped by HTTPStatusFromCode. -// If otherwise, it replies with http.StatusInternalServerError. -// -// The response body returned by this function is a JSON object, -// which contains a member whose key is "error" and whose value is err.Error(). -func DefaultHTTPError(ctx context.Context, mux *ServeMux, marshaler Marshaler, w http.ResponseWriter, _ *http.Request, err error) { - const fallback = `{"error": "failed to marshal error message"}` - - s, ok := status.FromError(err) - if !ok { - s = status.New(codes.Unknown, err.Error()) - } - - w.Header().Del("Trailer") - - contentType := marshaler.ContentType() - // Check marshaler on run time in order to keep backwards compatability - // An interface param needs to be added to the ContentType() function on - // the Marshal interface to be able to remove this check - if typeMarshaler, ok := marshaler.(contentTypeMarshaler); ok { - pb := s.Proto() - contentType = typeMarshaler.ContentTypeFromMessage(pb) - } - w.Header().Set("Content-Type", contentType) - - body := &internal.Error{ - Error: s.Message(), - Message: s.Message(), - Code: int32(s.Code()), - Details: s.Proto().GetDetails(), - } - - buf, merr := marshaler.Marshal(body) - if merr != nil { - grpclog.Infof("Failed to marshal error message %q: %v", body, merr) - w.WriteHeader(http.StatusInternalServerError) - if _, err := io.WriteString(w, fallback); err != nil { - grpclog.Infof("Failed to write response: %v", err) - } - return - } - - md, ok := ServerMetadataFromContext(ctx) - if !ok { - grpclog.Infof("Failed to extract ServerMetadata from context") - } - - handleForwardResponseServerMetadata(w, mux, md) - handleForwardResponseTrailerHeader(w, md) - st := HTTPStatusFromCode(s.Code()) - w.WriteHeader(st) - if _, err := w.Write(buf); err != nil { - grpclog.Infof("Failed to write response: %v", err) - } - - handleForwardResponseTrailer(w, md) -} - -// DefaultOtherErrorHandler is the default implementation of OtherErrorHandler. -// It simply writes a string representation of the given error into "w". -func DefaultOtherErrorHandler(w http.ResponseWriter, _ *http.Request, msg string, code int) { - http.Error(w, msg, code) -} diff --git a/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/fieldmask.go b/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/fieldmask.go deleted file mode 100644 index 341aad5a3e..0000000000 --- a/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/fieldmask.go +++ /dev/null @@ -1,82 +0,0 @@ -package runtime - -import ( - "encoding/json" - "io" - "strings" - - descriptor2 "github.com/golang/protobuf/descriptor" - "github.com/golang/protobuf/protoc-gen-go/descriptor" - "google.golang.org/genproto/protobuf/field_mask" -) - -func translateName(name string, md *descriptor.DescriptorProto) (string, *descriptor.DescriptorProto) { - // TODO - should really gate this with a test that the marshaller has used json names - if md != nil { - for _, f := range md.Field { - if f.JsonName != nil && f.Name != nil && *f.JsonName == name { - var subType *descriptor.DescriptorProto - - // If the field has a TypeName then we retrieve the nested type for translating the embedded message names. - if f.TypeName != nil { - typeSplit := strings.Split(*f.TypeName, ".") - typeName := typeSplit[len(typeSplit)-1] - for _, t := range md.NestedType { - if typeName == *t.Name { - subType = t - } - } - } - return *f.Name, subType - } - } - } - return name, nil -} - -// FieldMaskFromRequestBody creates a FieldMask printing all complete paths from the JSON body. -func FieldMaskFromRequestBody(r io.Reader, md *descriptor.DescriptorProto) (*field_mask.FieldMask, error) { - fm := &field_mask.FieldMask{} - var root interface{} - if err := json.NewDecoder(r).Decode(&root); err != nil { - if err == io.EOF { - return fm, nil - } - return nil, err - } - - queue := []fieldMaskPathItem{{node: root, md: md}} - for len(queue) > 0 { - // dequeue an item - item := queue[0] - queue = queue[1:] - - if m, ok := item.node.(map[string]interface{}); ok { - // if the item is an object, then enqueue all of its children - for k, v := range m { - protoName, subMd := translateName(k, item.md) - if subMsg, ok := v.(descriptor2.Message); ok { - _, subMd = descriptor2.ForMessage(subMsg) - } - queue = append(queue, fieldMaskPathItem{path: append(item.path, protoName), node: v, md: subMd}) - } - } else if len(item.path) > 0 { - // otherwise, it's a leaf node so print its path - fm.Paths = append(fm.Paths, strings.Join(item.path, ".")) - } - } - - return fm, nil -} - -// fieldMaskPathItem stores a in-progress deconstruction of a path for a fieldmask -type fieldMaskPathItem struct { - // the list of prior fields leading up to node - path []string - - // a generic decoded json object the current item to inspect for further path extraction - node interface{} - - // descriptor for parent message - md *descriptor.DescriptorProto -} diff --git a/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/handler.go b/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/handler.go deleted file mode 100644 index 2c62382ef0..0000000000 --- a/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/handler.go +++ /dev/null @@ -1,212 +0,0 @@ -package runtime - -import ( - "context" - "errors" - "fmt" - "io" - "net/http" - "net/textproto" - - "github.com/golang/protobuf/proto" - "github.com/grpc-ecosystem/grpc-gateway/internal" - "google.golang.org/grpc/grpclog" -) - -var errEmptyResponse = errors.New("empty response") - -// ForwardResponseStream forwards the stream from gRPC server to REST client. -func ForwardResponseStream(ctx context.Context, mux *ServeMux, marshaler Marshaler, w http.ResponseWriter, req *http.Request, recv func() (proto.Message, error), opts ...func(context.Context, http.ResponseWriter, proto.Message) error) { - f, ok := w.(http.Flusher) - if !ok { - grpclog.Infof("Flush not supported in %T", w) - http.Error(w, "unexpected type of web server", http.StatusInternalServerError) - return - } - - md, ok := ServerMetadataFromContext(ctx) - if !ok { - grpclog.Infof("Failed to extract ServerMetadata from context") - http.Error(w, "unexpected error", http.StatusInternalServerError) - return - } - handleForwardResponseServerMetadata(w, mux, md) - - w.Header().Set("Transfer-Encoding", "chunked") - w.Header().Set("Content-Type", marshaler.ContentType()) - if err := handleForwardResponseOptions(ctx, w, nil, opts); err != nil { - HTTPError(ctx, mux, marshaler, w, req, err) - return - } - - var delimiter []byte - if d, ok := marshaler.(Delimited); ok { - delimiter = d.Delimiter() - } else { - delimiter = []byte("\n") - } - - var wroteHeader bool - for { - resp, err := recv() - if err == io.EOF { - return - } - if err != nil { - handleForwardResponseStreamError(ctx, wroteHeader, marshaler, w, req, mux, err) - return - } - if err := handleForwardResponseOptions(ctx, w, resp, opts); err != nil { - handleForwardResponseStreamError(ctx, wroteHeader, marshaler, w, req, mux, err) - return - } - - var buf []byte - switch { - case resp == nil: - buf, err = marshaler.Marshal(errorChunk(streamError(ctx, mux.streamErrorHandler, errEmptyResponse))) - default: - result := map[string]interface{}{"result": resp} - if rb, ok := resp.(responseBody); ok { - result["result"] = rb.XXX_ResponseBody() - } - - buf, err = marshaler.Marshal(result) - } - - if err != nil { - grpclog.Infof("Failed to marshal response chunk: %v", err) - handleForwardResponseStreamError(ctx, wroteHeader, marshaler, w, req, mux, err) - return - } - if _, err = w.Write(buf); err != nil { - grpclog.Infof("Failed to send response chunk: %v", err) - return - } - wroteHeader = true - if _, err = w.Write(delimiter); err != nil { - grpclog.Infof("Failed to send delimiter chunk: %v", err) - return - } - f.Flush() - } -} - -func handleForwardResponseServerMetadata(w http.ResponseWriter, mux *ServeMux, md ServerMetadata) { - for k, vs := range md.HeaderMD { - if h, ok := mux.outgoingHeaderMatcher(k); ok { - for _, v := range vs { - w.Header().Add(h, v) - } - } - } -} - -func handleForwardResponseTrailerHeader(w http.ResponseWriter, md ServerMetadata) { - for k := range md.TrailerMD { - tKey := textproto.CanonicalMIMEHeaderKey(fmt.Sprintf("%s%s", MetadataTrailerPrefix, k)) - w.Header().Add("Trailer", tKey) - } -} - -func handleForwardResponseTrailer(w http.ResponseWriter, md ServerMetadata) { - for k, vs := range md.TrailerMD { - tKey := fmt.Sprintf("%s%s", MetadataTrailerPrefix, k) - for _, v := range vs { - w.Header().Add(tKey, v) - } - } -} - -// responseBody interface contains method for getting field for marshaling to the response body -// this method is generated for response struct from the value of `response_body` in the `google.api.HttpRule` -type responseBody interface { - XXX_ResponseBody() interface{} -} - -// ForwardResponseMessage forwards the message "resp" from gRPC server to REST client. -func ForwardResponseMessage(ctx context.Context, mux *ServeMux, marshaler Marshaler, w http.ResponseWriter, req *http.Request, resp proto.Message, opts ...func(context.Context, http.ResponseWriter, proto.Message) error) { - md, ok := ServerMetadataFromContext(ctx) - if !ok { - grpclog.Infof("Failed to extract ServerMetadata from context") - } - - handleForwardResponseServerMetadata(w, mux, md) - handleForwardResponseTrailerHeader(w, md) - - contentType := marshaler.ContentType() - // Check marshaler on run time in order to keep backwards compatability - // An interface param needs to be added to the ContentType() function on - // the Marshal interface to be able to remove this check - if typeMarshaler, ok := marshaler.(contentTypeMarshaler); ok { - contentType = typeMarshaler.ContentTypeFromMessage(resp) - } - w.Header().Set("Content-Type", contentType) - - if err := handleForwardResponseOptions(ctx, w, resp, opts); err != nil { - HTTPError(ctx, mux, marshaler, w, req, err) - return - } - var buf []byte - var err error - if rb, ok := resp.(responseBody); ok { - buf, err = marshaler.Marshal(rb.XXX_ResponseBody()) - } else { - buf, err = marshaler.Marshal(resp) - } - if err != nil { - grpclog.Infof("Marshal error: %v", err) - HTTPError(ctx, mux, marshaler, w, req, err) - return - } - - if _, err = w.Write(buf); err != nil { - grpclog.Infof("Failed to write response: %v", err) - } - - handleForwardResponseTrailer(w, md) -} - -func handleForwardResponseOptions(ctx context.Context, w http.ResponseWriter, resp proto.Message, opts []func(context.Context, http.ResponseWriter, proto.Message) error) error { - if len(opts) == 0 { - return nil - } - for _, opt := range opts { - if err := opt(ctx, w, resp); err != nil { - grpclog.Infof("Error handling ForwardResponseOptions: %v", err) - return err - } - } - return nil -} - -func handleForwardResponseStreamError(ctx context.Context, wroteHeader bool, marshaler Marshaler, w http.ResponseWriter, req *http.Request, mux *ServeMux, err error) { - serr := streamError(ctx, mux.streamErrorHandler, err) - if !wroteHeader { - w.WriteHeader(int(serr.HttpCode)) - } - buf, merr := marshaler.Marshal(errorChunk(serr)) - if merr != nil { - grpclog.Infof("Failed to marshal an error: %v", merr) - return - } - if _, werr := w.Write(buf); werr != nil { - grpclog.Infof("Failed to notify error to client: %v", werr) - return - } -} - -// streamError returns the payload for the final message in a response stream -// that represents the given err. -func streamError(ctx context.Context, errHandler StreamErrorHandlerFunc, err error) *StreamError { - serr := errHandler(ctx, err) - if serr != nil { - return serr - } - // TODO: log about misbehaving stream error handler? - return DefaultHTTPStreamErrorHandler(ctx, err) -} - -func errorChunk(err *StreamError) map[string]proto.Message { - return map[string]proto.Message{"error": (*internal.StreamError)(err)} -} diff --git a/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/marshal_httpbodyproto.go b/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/marshal_httpbodyproto.go deleted file mode 100644 index f55285b5d6..0000000000 --- a/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/marshal_httpbodyproto.go +++ /dev/null @@ -1,43 +0,0 @@ -package runtime - -import ( - "google.golang.org/genproto/googleapis/api/httpbody" -) - -// SetHTTPBodyMarshaler overwrite the default marshaler with the HTTPBodyMarshaler -func SetHTTPBodyMarshaler(serveMux *ServeMux) { - serveMux.marshalers.mimeMap[MIMEWildcard] = &HTTPBodyMarshaler{ - Marshaler: &JSONPb{OrigName: true}, - } -} - -// HTTPBodyMarshaler is a Marshaler which supports marshaling of a -// google.api.HttpBody message as the full response body if it is -// the actual message used as the response. If not, then this will -// simply fallback to the Marshaler specified as its default Marshaler. -type HTTPBodyMarshaler struct { - Marshaler -} - -// ContentType implementation to keep backwards compatability with marshal interface -func (h *HTTPBodyMarshaler) ContentType() string { - return h.ContentTypeFromMessage(nil) -} - -// ContentTypeFromMessage in case v is a google.api.HttpBody message it returns -// its specified content type otherwise fall back to the default Marshaler. -func (h *HTTPBodyMarshaler) ContentTypeFromMessage(v interface{}) string { - if httpBody, ok := v.(*httpbody.HttpBody); ok { - return httpBody.GetContentType() - } - return h.Marshaler.ContentType() -} - -// Marshal marshals "v" by returning the body bytes if v is a -// google.api.HttpBody message, otherwise it falls back to the default Marshaler. -func (h *HTTPBodyMarshaler) Marshal(v interface{}) ([]byte, error) { - if httpBody, ok := v.(*httpbody.HttpBody); ok { - return httpBody.Data, nil - } - return h.Marshaler.Marshal(v) -} diff --git a/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/marshal_json.go b/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/marshal_json.go deleted file mode 100644 index f9d3a585a4..0000000000 --- a/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/marshal_json.go +++ /dev/null @@ -1,45 +0,0 @@ -package runtime - -import ( - "encoding/json" - "io" -) - -// JSONBuiltin is a Marshaler which marshals/unmarshals into/from JSON -// with the standard "encoding/json" package of Golang. -// Although it is generally faster for simple proto messages than JSONPb, -// it does not support advanced features of protobuf, e.g. map, oneof, .... -// -// The NewEncoder and NewDecoder types return *json.Encoder and -// *json.Decoder respectively. -type JSONBuiltin struct{} - -// ContentType always Returns "application/json". -func (*JSONBuiltin) ContentType() string { - return "application/json" -} - -// Marshal marshals "v" into JSON -func (j *JSONBuiltin) Marshal(v interface{}) ([]byte, error) { - return json.Marshal(v) -} - -// Unmarshal unmarshals JSON data into "v". -func (j *JSONBuiltin) Unmarshal(data []byte, v interface{}) error { - return json.Unmarshal(data, v) -} - -// NewDecoder returns a Decoder which reads JSON stream from "r". -func (j *JSONBuiltin) NewDecoder(r io.Reader) Decoder { - return json.NewDecoder(r) -} - -// NewEncoder returns an Encoder which writes JSON stream into "w". -func (j *JSONBuiltin) NewEncoder(w io.Writer) Encoder { - return json.NewEncoder(w) -} - -// Delimiter for newline encoded JSON streams. -func (j *JSONBuiltin) Delimiter() []byte { - return []byte("\n") -} diff --git a/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/marshal_jsonpb.go b/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/marshal_jsonpb.go deleted file mode 100644 index f0de351b21..0000000000 --- a/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/marshal_jsonpb.go +++ /dev/null @@ -1,262 +0,0 @@ -package runtime - -import ( - "bytes" - "encoding/json" - "fmt" - "io" - "reflect" - - "github.com/golang/protobuf/jsonpb" - "github.com/golang/protobuf/proto" -) - -// JSONPb is a Marshaler which marshals/unmarshals into/from JSON -// with the "github.com/golang/protobuf/jsonpb". -// It supports fully functionality of protobuf unlike JSONBuiltin. -// -// The NewDecoder method returns a DecoderWrapper, so the underlying -// *json.Decoder methods can be used. -type JSONPb jsonpb.Marshaler - -// ContentType always returns "application/json". -func (*JSONPb) ContentType() string { - return "application/json" -} - -// Marshal marshals "v" into JSON. -func (j *JSONPb) Marshal(v interface{}) ([]byte, error) { - if _, ok := v.(proto.Message); !ok { - return j.marshalNonProtoField(v) - } - - var buf bytes.Buffer - if err := j.marshalTo(&buf, v); err != nil { - return nil, err - } - return buf.Bytes(), nil -} - -func (j *JSONPb) marshalTo(w io.Writer, v interface{}) error { - p, ok := v.(proto.Message) - if !ok { - buf, err := j.marshalNonProtoField(v) - if err != nil { - return err - } - _, err = w.Write(buf) - return err - } - return (*jsonpb.Marshaler)(j).Marshal(w, p) -} - -var ( - // protoMessageType is stored to prevent constant lookup of the same type at runtime. - protoMessageType = reflect.TypeOf((*proto.Message)(nil)).Elem() -) - -// marshalNonProto marshals a non-message field of a protobuf message. -// This function does not correctly marshals arbitrary data structure into JSON, -// but it is only capable of marshaling non-message field values of protobuf, -// i.e. primitive types, enums; pointers to primitives or enums; maps from -// integer/string types to primitives/enums/pointers to messages. -func (j *JSONPb) marshalNonProtoField(v interface{}) ([]byte, error) { - if v == nil { - return []byte("null"), nil - } - rv := reflect.ValueOf(v) - for rv.Kind() == reflect.Ptr { - if rv.IsNil() { - return []byte("null"), nil - } - rv = rv.Elem() - } - - if rv.Kind() == reflect.Slice { - if rv.IsNil() { - if j.EmitDefaults { - return []byte("[]"), nil - } - return []byte("null"), nil - } - - if rv.Type().Elem().Implements(protoMessageType) { - var buf bytes.Buffer - err := buf.WriteByte('[') - if err != nil { - return nil, err - } - for i := 0; i < rv.Len(); i++ { - if i != 0 { - err = buf.WriteByte(',') - if err != nil { - return nil, err - } - } - if err = (*jsonpb.Marshaler)(j).Marshal(&buf, rv.Index(i).Interface().(proto.Message)); err != nil { - return nil, err - } - } - err = buf.WriteByte(']') - if err != nil { - return nil, err - } - - return buf.Bytes(), nil - } - } - - if rv.Kind() == reflect.Map { - m := make(map[string]*json.RawMessage) - for _, k := range rv.MapKeys() { - buf, err := j.Marshal(rv.MapIndex(k).Interface()) - if err != nil { - return nil, err - } - m[fmt.Sprintf("%v", k.Interface())] = (*json.RawMessage)(&buf) - } - if j.Indent != "" { - return json.MarshalIndent(m, "", j.Indent) - } - return json.Marshal(m) - } - if enum, ok := rv.Interface().(protoEnum); ok && !j.EnumsAsInts { - return json.Marshal(enum.String()) - } - return json.Marshal(rv.Interface()) -} - -// Unmarshal unmarshals JSON "data" into "v" -func (j *JSONPb) Unmarshal(data []byte, v interface{}) error { - return unmarshalJSONPb(data, v) -} - -// NewDecoder returns a Decoder which reads JSON stream from "r". -func (j *JSONPb) NewDecoder(r io.Reader) Decoder { - d := json.NewDecoder(r) - return DecoderWrapper{Decoder: d} -} - -// DecoderWrapper is a wrapper around a *json.Decoder that adds -// support for protos to the Decode method. -type DecoderWrapper struct { - *json.Decoder -} - -// Decode wraps the embedded decoder's Decode method to support -// protos using a jsonpb.Unmarshaler. -func (d DecoderWrapper) Decode(v interface{}) error { - return decodeJSONPb(d.Decoder, v) -} - -// NewEncoder returns an Encoder which writes JSON stream into "w". -func (j *JSONPb) NewEncoder(w io.Writer) Encoder { - return EncoderFunc(func(v interface{}) error { - if err := j.marshalTo(w, v); err != nil { - return err - } - // mimic json.Encoder by adding a newline (makes output - // easier to read when it contains multiple encoded items) - _, err := w.Write(j.Delimiter()) - return err - }) -} - -func unmarshalJSONPb(data []byte, v interface{}) error { - d := json.NewDecoder(bytes.NewReader(data)) - return decodeJSONPb(d, v) -} - -func decodeJSONPb(d *json.Decoder, v interface{}) error { - p, ok := v.(proto.Message) - if !ok { - return decodeNonProtoField(d, v) - } - unmarshaler := &jsonpb.Unmarshaler{AllowUnknownFields: allowUnknownFields} - return unmarshaler.UnmarshalNext(d, p) -} - -func decodeNonProtoField(d *json.Decoder, v interface{}) error { - rv := reflect.ValueOf(v) - if rv.Kind() != reflect.Ptr { - return fmt.Errorf("%T is not a pointer", v) - } - for rv.Kind() == reflect.Ptr { - if rv.IsNil() { - rv.Set(reflect.New(rv.Type().Elem())) - } - if rv.Type().ConvertibleTo(typeProtoMessage) { - unmarshaler := &jsonpb.Unmarshaler{AllowUnknownFields: allowUnknownFields} - return unmarshaler.UnmarshalNext(d, rv.Interface().(proto.Message)) - } - rv = rv.Elem() - } - if rv.Kind() == reflect.Map { - if rv.IsNil() { - rv.Set(reflect.MakeMap(rv.Type())) - } - conv, ok := convFromType[rv.Type().Key().Kind()] - if !ok { - return fmt.Errorf("unsupported type of map field key: %v", rv.Type().Key()) - } - - m := make(map[string]*json.RawMessage) - if err := d.Decode(&m); err != nil { - return err - } - for k, v := range m { - result := conv.Call([]reflect.Value{reflect.ValueOf(k)}) - if err := result[1].Interface(); err != nil { - return err.(error) - } - bk := result[0] - bv := reflect.New(rv.Type().Elem()) - if err := unmarshalJSONPb([]byte(*v), bv.Interface()); err != nil { - return err - } - rv.SetMapIndex(bk, bv.Elem()) - } - return nil - } - if _, ok := rv.Interface().(protoEnum); ok { - var repr interface{} - if err := d.Decode(&repr); err != nil { - return err - } - switch repr.(type) { - case string: - // TODO(yugui) Should use proto.StructProperties? - return fmt.Errorf("unmarshaling of symbolic enum %q not supported: %T", repr, rv.Interface()) - case float64: - rv.Set(reflect.ValueOf(int32(repr.(float64))).Convert(rv.Type())) - return nil - default: - return fmt.Errorf("cannot assign %#v into Go type %T", repr, rv.Interface()) - } - } - return d.Decode(v) -} - -type protoEnum interface { - fmt.Stringer - EnumDescriptor() ([]byte, []int) -} - -var typeProtoMessage = reflect.TypeOf((*proto.Message)(nil)).Elem() - -// Delimiter for newline encoded JSON streams. -func (j *JSONPb) Delimiter() []byte { - return []byte("\n") -} - -// allowUnknownFields helps not to return an error when the destination -// is a struct and the input contains object keys which do not match any -// non-ignored, exported fields in the destination. -var allowUnknownFields = true - -// DisallowUnknownFields enables option in decoder (unmarshaller) to -// return an error when it finds an unknown field. This function must be -// called before using the JSON marshaller. -func DisallowUnknownFields() { - allowUnknownFields = false -} diff --git a/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/marshal_proto.go b/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/marshal_proto.go deleted file mode 100644 index f65d1a2676..0000000000 --- a/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/marshal_proto.go +++ /dev/null @@ -1,62 +0,0 @@ -package runtime - -import ( - "io" - - "errors" - "github.com/golang/protobuf/proto" - "io/ioutil" -) - -// ProtoMarshaller is a Marshaller which marshals/unmarshals into/from serialize proto bytes -type ProtoMarshaller struct{} - -// ContentType always returns "application/octet-stream". -func (*ProtoMarshaller) ContentType() string { - return "application/octet-stream" -} - -// Marshal marshals "value" into Proto -func (*ProtoMarshaller) Marshal(value interface{}) ([]byte, error) { - message, ok := value.(proto.Message) - if !ok { - return nil, errors.New("unable to marshal non proto field") - } - return proto.Marshal(message) -} - -// Unmarshal unmarshals proto "data" into "value" -func (*ProtoMarshaller) Unmarshal(data []byte, value interface{}) error { - message, ok := value.(proto.Message) - if !ok { - return errors.New("unable to unmarshal non proto field") - } - return proto.Unmarshal(data, message) -} - -// NewDecoder returns a Decoder which reads proto stream from "reader". -func (marshaller *ProtoMarshaller) NewDecoder(reader io.Reader) Decoder { - return DecoderFunc(func(value interface{}) error { - buffer, err := ioutil.ReadAll(reader) - if err != nil { - return err - } - return marshaller.Unmarshal(buffer, value) - }) -} - -// NewEncoder returns an Encoder which writes proto stream into "writer". -func (marshaller *ProtoMarshaller) NewEncoder(writer io.Writer) Encoder { - return EncoderFunc(func(value interface{}) error { - buffer, err := marshaller.Marshal(value) - if err != nil { - return err - } - _, err = writer.Write(buffer) - if err != nil { - return err - } - - return nil - }) -} diff --git a/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/marshaler.go b/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/marshaler.go deleted file mode 100644 index 3fdf9fd873..0000000000 --- a/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/marshaler.go +++ /dev/null @@ -1,55 +0,0 @@ -package runtime - -import ( - "io" -) - -// Marshaler defines a conversion between byte sequence and gRPC payloads / fields. -type Marshaler interface { - // Marshal marshals "v" into byte sequence. - Marshal(v interface{}) ([]byte, error) - // Unmarshal unmarshals "data" into "v". - // "v" must be a pointer value. - Unmarshal(data []byte, v interface{}) error - // NewDecoder returns a Decoder which reads byte sequence from "r". - NewDecoder(r io.Reader) Decoder - // NewEncoder returns an Encoder which writes bytes sequence into "w". - NewEncoder(w io.Writer) Encoder - // ContentType returns the Content-Type which this marshaler is responsible for. - ContentType() string -} - -// Marshalers that implement contentTypeMarshaler will have their ContentTypeFromMessage method called -// to set the Content-Type header on the response -type contentTypeMarshaler interface { - // ContentTypeFromMessage returns the Content-Type this marshaler produces from the provided message - ContentTypeFromMessage(v interface{}) string -} - -// Decoder decodes a byte sequence -type Decoder interface { - Decode(v interface{}) error -} - -// Encoder encodes gRPC payloads / fields into byte sequence. -type Encoder interface { - Encode(v interface{}) error -} - -// DecoderFunc adapts an decoder function into Decoder. -type DecoderFunc func(v interface{}) error - -// Decode delegates invocations to the underlying function itself. -func (f DecoderFunc) Decode(v interface{}) error { return f(v) } - -// EncoderFunc adapts an encoder function into Encoder -type EncoderFunc func(v interface{}) error - -// Encode delegates invocations to the underlying function itself. -func (f EncoderFunc) Encode(v interface{}) error { return f(v) } - -// Delimited defines the streaming delimiter. -type Delimited interface { - // Delimiter returns the record seperator for the stream. - Delimiter() []byte -} diff --git a/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/marshaler_registry.go b/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/marshaler_registry.go deleted file mode 100644 index 5cc53ae4f6..0000000000 --- a/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/marshaler_registry.go +++ /dev/null @@ -1,91 +0,0 @@ -package runtime - -import ( - "errors" - "net/http" -) - -// MIMEWildcard is the fallback MIME type used for requests which do not match -// a registered MIME type. -const MIMEWildcard = "*" - -var ( - acceptHeader = http.CanonicalHeaderKey("Accept") - contentTypeHeader = http.CanonicalHeaderKey("Content-Type") - - defaultMarshaler = &JSONPb{OrigName: true} -) - -// MarshalerForRequest returns the inbound/outbound marshalers for this request. -// It checks the registry on the ServeMux for the MIME type set by the Content-Type header. -// If it isn't set (or the request Content-Type is empty), checks for "*". -// If there are multiple Content-Type headers set, choose the first one that it can -// exactly match in the registry. -// Otherwise, it follows the above logic for "*"/InboundMarshaler/OutboundMarshaler. -func MarshalerForRequest(mux *ServeMux, r *http.Request) (inbound Marshaler, outbound Marshaler) { - for _, acceptVal := range r.Header[acceptHeader] { - if m, ok := mux.marshalers.mimeMap[acceptVal]; ok { - outbound = m - break - } - } - - for _, contentTypeVal := range r.Header[contentTypeHeader] { - if m, ok := mux.marshalers.mimeMap[contentTypeVal]; ok { - inbound = m - break - } - } - - if inbound == nil { - inbound = mux.marshalers.mimeMap[MIMEWildcard] - } - if outbound == nil { - outbound = inbound - } - - return inbound, outbound -} - -// marshalerRegistry is a mapping from MIME types to Marshalers. -type marshalerRegistry struct { - mimeMap map[string]Marshaler -} - -// add adds a marshaler for a case-sensitive MIME type string ("*" to match any -// MIME type). -func (m marshalerRegistry) add(mime string, marshaler Marshaler) error { - if len(mime) == 0 { - return errors.New("empty MIME type") - } - - m.mimeMap[mime] = marshaler - - return nil -} - -// makeMarshalerMIMERegistry returns a new registry of marshalers. -// It allows for a mapping of case-sensitive Content-Type MIME type string to runtime.Marshaler interfaces. -// -// For example, you could allow the client to specify the use of the runtime.JSONPb marshaler -// with a "application/jsonpb" Content-Type and the use of the runtime.JSONBuiltin marshaler -// with a "application/json" Content-Type. -// "*" can be used to match any Content-Type. -// This can be attached to a ServerMux with the marshaler option. -func makeMarshalerMIMERegistry() marshalerRegistry { - return marshalerRegistry{ - mimeMap: map[string]Marshaler{ - MIMEWildcard: defaultMarshaler, - }, - } -} - -// WithMarshalerOption returns a ServeMuxOption which associates inbound and outbound -// Marshalers to a MIME type in mux. -func WithMarshalerOption(mime string, marshaler Marshaler) ServeMuxOption { - return func(mux *ServeMux) { - if err := mux.marshalers.add(mime, marshaler); err != nil { - panic(err) - } - } -} diff --git a/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/mux.go b/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/mux.go deleted file mode 100644 index 523a9cb43c..0000000000 --- a/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/mux.go +++ /dev/null @@ -1,300 +0,0 @@ -package runtime - -import ( - "context" - "fmt" - "net/http" - "net/textproto" - "strings" - - "github.com/golang/protobuf/proto" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/metadata" - "google.golang.org/grpc/status" -) - -// A HandlerFunc handles a specific pair of path pattern and HTTP method. -type HandlerFunc func(w http.ResponseWriter, r *http.Request, pathParams map[string]string) - -// ErrUnknownURI is the error supplied to a custom ProtoErrorHandlerFunc when -// a request is received with a URI path that does not match any registered -// service method. -// -// Since gRPC servers return an "Unimplemented" code for requests with an -// unrecognized URI path, this error also has a gRPC "Unimplemented" code. -var ErrUnknownURI = status.Error(codes.Unimplemented, http.StatusText(http.StatusNotImplemented)) - -// ServeMux is a request multiplexer for grpc-gateway. -// It matches http requests to patterns and invokes the corresponding handler. -type ServeMux struct { - // handlers maps HTTP method to a list of handlers. - handlers map[string][]handler - forwardResponseOptions []func(context.Context, http.ResponseWriter, proto.Message) error - marshalers marshalerRegistry - incomingHeaderMatcher HeaderMatcherFunc - outgoingHeaderMatcher HeaderMatcherFunc - metadataAnnotators []func(context.Context, *http.Request) metadata.MD - streamErrorHandler StreamErrorHandlerFunc - protoErrorHandler ProtoErrorHandlerFunc - disablePathLengthFallback bool - lastMatchWins bool -} - -// ServeMuxOption is an option that can be given to a ServeMux on construction. -type ServeMuxOption func(*ServeMux) - -// WithForwardResponseOption returns a ServeMuxOption representing the forwardResponseOption. -// -// forwardResponseOption is an option that will be called on the relevant context.Context, -// http.ResponseWriter, and proto.Message before every forwarded response. -// -// The message may be nil in the case where just a header is being sent. -func WithForwardResponseOption(forwardResponseOption func(context.Context, http.ResponseWriter, proto.Message) error) ServeMuxOption { - return func(serveMux *ServeMux) { - serveMux.forwardResponseOptions = append(serveMux.forwardResponseOptions, forwardResponseOption) - } -} - -// SetQueryParameterParser sets the query parameter parser, used to populate message from query parameters. -// Configuring this will mean the generated swagger output is no longer correct, and it should be -// done with careful consideration. -func SetQueryParameterParser(queryParameterParser QueryParameterParser) ServeMuxOption { - return func(serveMux *ServeMux) { - currentQueryParser = queryParameterParser - } -} - -// HeaderMatcherFunc checks whether a header key should be forwarded to/from gRPC context. -type HeaderMatcherFunc func(string) (string, bool) - -// DefaultHeaderMatcher is used to pass http request headers to/from gRPC context. This adds permanent HTTP header -// keys (as specified by the IANA) to gRPC context with grpcgateway- prefix. HTTP headers that start with -// 'Grpc-Metadata-' are mapped to gRPC metadata after removing prefix 'Grpc-Metadata-'. -func DefaultHeaderMatcher(key string) (string, bool) { - key = textproto.CanonicalMIMEHeaderKey(key) - if isPermanentHTTPHeader(key) { - return MetadataPrefix + key, true - } else if strings.HasPrefix(key, MetadataHeaderPrefix) { - return key[len(MetadataHeaderPrefix):], true - } - return "", false -} - -// WithIncomingHeaderMatcher returns a ServeMuxOption representing a headerMatcher for incoming request to gateway. -// -// This matcher will be called with each header in http.Request. If matcher returns true, that header will be -// passed to gRPC context. To transform the header before passing to gRPC context, matcher should return modified header. -func WithIncomingHeaderMatcher(fn HeaderMatcherFunc) ServeMuxOption { - return func(mux *ServeMux) { - mux.incomingHeaderMatcher = fn - } -} - -// WithOutgoingHeaderMatcher returns a ServeMuxOption representing a headerMatcher for outgoing response from gateway. -// -// This matcher will be called with each header in response header metadata. If matcher returns true, that header will be -// passed to http response returned from gateway. To transform the header before passing to response, -// matcher should return modified header. -func WithOutgoingHeaderMatcher(fn HeaderMatcherFunc) ServeMuxOption { - return func(mux *ServeMux) { - mux.outgoingHeaderMatcher = fn - } -} - -// WithMetadata returns a ServeMuxOption for passing metadata to a gRPC context. -// -// This can be used by services that need to read from http.Request and modify gRPC context. A common use case -// is reading token from cookie and adding it in gRPC context. -func WithMetadata(annotator func(context.Context, *http.Request) metadata.MD) ServeMuxOption { - return func(serveMux *ServeMux) { - serveMux.metadataAnnotators = append(serveMux.metadataAnnotators, annotator) - } -} - -// WithProtoErrorHandler returns a ServeMuxOption for configuring a custom error handler. -// -// This can be used to handle an error as general proto message defined by gRPC. -// When this option is used, the mux uses the configured error handler instead of HTTPError and -// OtherErrorHandler. -func WithProtoErrorHandler(fn ProtoErrorHandlerFunc) ServeMuxOption { - return func(serveMux *ServeMux) { - serveMux.protoErrorHandler = fn - } -} - -// WithDisablePathLengthFallback returns a ServeMuxOption for disable path length fallback. -func WithDisablePathLengthFallback() ServeMuxOption { - return func(serveMux *ServeMux) { - serveMux.disablePathLengthFallback = true - } -} - -// WithStreamErrorHandler returns a ServeMuxOption that will use the given custom stream -// error handler, which allows for customizing the error trailer for server-streaming -// calls. -// -// For stream errors that occur before any response has been written, the mux's -// ProtoErrorHandler will be invoked. However, once data has been written, the errors must -// be handled differently: they must be included in the response body. The response body's -// final message will include the error details returned by the stream error handler. -func WithStreamErrorHandler(fn StreamErrorHandlerFunc) ServeMuxOption { - return func(serveMux *ServeMux) { - serveMux.streamErrorHandler = fn - } -} - -// WithLastMatchWins returns a ServeMuxOption that will enable "last -// match wins" behavior, where if multiple path patterns match a -// request path, the last one defined in the .proto file will be used. -func WithLastMatchWins() ServeMuxOption { - return func(serveMux *ServeMux) { - serveMux.lastMatchWins = true - } -} - -// NewServeMux returns a new ServeMux whose internal mapping is empty. -func NewServeMux(opts ...ServeMuxOption) *ServeMux { - serveMux := &ServeMux{ - handlers: make(map[string][]handler), - forwardResponseOptions: make([]func(context.Context, http.ResponseWriter, proto.Message) error, 0), - marshalers: makeMarshalerMIMERegistry(), - streamErrorHandler: DefaultHTTPStreamErrorHandler, - } - - for _, opt := range opts { - opt(serveMux) - } - - if serveMux.incomingHeaderMatcher == nil { - serveMux.incomingHeaderMatcher = DefaultHeaderMatcher - } - - if serveMux.outgoingHeaderMatcher == nil { - serveMux.outgoingHeaderMatcher = func(key string) (string, bool) { - return fmt.Sprintf("%s%s", MetadataHeaderPrefix, key), true - } - } - - return serveMux -} - -// Handle associates "h" to the pair of HTTP method and path pattern. -func (s *ServeMux) Handle(meth string, pat Pattern, h HandlerFunc) { - if s.lastMatchWins { - s.handlers[meth] = append([]handler{handler{pat: pat, h: h}}, s.handlers[meth]...) - } else { - s.handlers[meth] = append(s.handlers[meth], handler{pat: pat, h: h}) - } -} - -// ServeHTTP dispatches the request to the first handler whose pattern matches to r.Method and r.Path. -func (s *ServeMux) ServeHTTP(w http.ResponseWriter, r *http.Request) { - ctx := r.Context() - - path := r.URL.Path - if !strings.HasPrefix(path, "/") { - if s.protoErrorHandler != nil { - _, outboundMarshaler := MarshalerForRequest(s, r) - sterr := status.Error(codes.InvalidArgument, http.StatusText(http.StatusBadRequest)) - s.protoErrorHandler(ctx, s, outboundMarshaler, w, r, sterr) - } else { - OtherErrorHandler(w, r, http.StatusText(http.StatusBadRequest), http.StatusBadRequest) - } - return - } - - components := strings.Split(path[1:], "/") - l := len(components) - var verb string - if idx := strings.LastIndex(components[l-1], ":"); idx == 0 { - if s.protoErrorHandler != nil { - _, outboundMarshaler := MarshalerForRequest(s, r) - s.protoErrorHandler(ctx, s, outboundMarshaler, w, r, ErrUnknownURI) - } else { - OtherErrorHandler(w, r, http.StatusText(http.StatusNotFound), http.StatusNotFound) - } - return - } else if idx > 0 { - c := components[l-1] - components[l-1], verb = c[:idx], c[idx+1:] - } - - if override := r.Header.Get("X-HTTP-Method-Override"); override != "" && s.isPathLengthFallback(r) { - r.Method = strings.ToUpper(override) - if err := r.ParseForm(); err != nil { - if s.protoErrorHandler != nil { - _, outboundMarshaler := MarshalerForRequest(s, r) - sterr := status.Error(codes.InvalidArgument, err.Error()) - s.protoErrorHandler(ctx, s, outboundMarshaler, w, r, sterr) - } else { - OtherErrorHandler(w, r, err.Error(), http.StatusBadRequest) - } - return - } - } - for _, h := range s.handlers[r.Method] { - pathParams, err := h.pat.Match(components, verb) - if err != nil { - continue - } - h.h(w, r, pathParams) - return - } - - // lookup other methods to handle fallback from GET to POST and - // to determine if it is MethodNotAllowed or NotFound. - for m, handlers := range s.handlers { - if m == r.Method { - continue - } - for _, h := range handlers { - pathParams, err := h.pat.Match(components, verb) - if err != nil { - continue - } - // X-HTTP-Method-Override is optional. Always allow fallback to POST. - if s.isPathLengthFallback(r) { - if err := r.ParseForm(); err != nil { - if s.protoErrorHandler != nil { - _, outboundMarshaler := MarshalerForRequest(s, r) - sterr := status.Error(codes.InvalidArgument, err.Error()) - s.protoErrorHandler(ctx, s, outboundMarshaler, w, r, sterr) - } else { - OtherErrorHandler(w, r, err.Error(), http.StatusBadRequest) - } - return - } - h.h(w, r, pathParams) - return - } - if s.protoErrorHandler != nil { - _, outboundMarshaler := MarshalerForRequest(s, r) - s.protoErrorHandler(ctx, s, outboundMarshaler, w, r, ErrUnknownURI) - } else { - OtherErrorHandler(w, r, http.StatusText(http.StatusMethodNotAllowed), http.StatusMethodNotAllowed) - } - return - } - } - - if s.protoErrorHandler != nil { - _, outboundMarshaler := MarshalerForRequest(s, r) - s.protoErrorHandler(ctx, s, outboundMarshaler, w, r, ErrUnknownURI) - } else { - OtherErrorHandler(w, r, http.StatusText(http.StatusNotFound), http.StatusNotFound) - } -} - -// GetForwardResponseOptions returns the ForwardResponseOptions associated with this ServeMux. -func (s *ServeMux) GetForwardResponseOptions() []func(context.Context, http.ResponseWriter, proto.Message) error { - return s.forwardResponseOptions -} - -func (s *ServeMux) isPathLengthFallback(r *http.Request) bool { - return !s.disablePathLengthFallback && r.Method == "POST" && r.Header.Get("Content-Type") == "application/x-www-form-urlencoded" -} - -type handler struct { - pat Pattern - h HandlerFunc -} diff --git a/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/pattern.go b/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/pattern.go deleted file mode 100644 index 09053695da..0000000000 --- a/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/pattern.go +++ /dev/null @@ -1,262 +0,0 @@ -package runtime - -import ( - "errors" - "fmt" - "strings" - - "github.com/grpc-ecosystem/grpc-gateway/utilities" - "google.golang.org/grpc/grpclog" -) - -var ( - // ErrNotMatch indicates that the given HTTP request path does not match to the pattern. - ErrNotMatch = errors.New("not match to the path pattern") - // ErrInvalidPattern indicates that the given definition of Pattern is not valid. - ErrInvalidPattern = errors.New("invalid pattern") -) - -type op struct { - code utilities.OpCode - operand int -} - -// Pattern is a template pattern of http request paths defined in github.com/googleapis/googleapis/google/api/http.proto. -type Pattern struct { - // ops is a list of operations - ops []op - // pool is a constant pool indexed by the operands or vars. - pool []string - // vars is a list of variables names to be bound by this pattern - vars []string - // stacksize is the max depth of the stack - stacksize int - // tailLen is the length of the fixed-size segments after a deep wildcard - tailLen int - // verb is the VERB part of the path pattern. It is empty if the pattern does not have VERB part. - verb string - // assumeColonVerb indicates whether a path suffix after a final - // colon may only be interpreted as a verb. - assumeColonVerb bool -} - -type patternOptions struct { - assumeColonVerb bool -} - -// PatternOpt is an option for creating Patterns. -type PatternOpt func(*patternOptions) - -// NewPattern returns a new Pattern from the given definition values. -// "ops" is a sequence of op codes. "pool" is a constant pool. -// "verb" is the verb part of the pattern. It is empty if the pattern does not have the part. -// "version" must be 1 for now. -// It returns an error if the given definition is invalid. -func NewPattern(version int, ops []int, pool []string, verb string, opts ...PatternOpt) (Pattern, error) { - options := patternOptions{ - assumeColonVerb: true, - } - for _, o := range opts { - o(&options) - } - - if version != 1 { - grpclog.Infof("unsupported version: %d", version) - return Pattern{}, ErrInvalidPattern - } - - l := len(ops) - if l%2 != 0 { - grpclog.Infof("odd number of ops codes: %d", l) - return Pattern{}, ErrInvalidPattern - } - - var ( - typedOps []op - stack, maxstack int - tailLen int - pushMSeen bool - vars []string - ) - for i := 0; i < l; i += 2 { - op := op{code: utilities.OpCode(ops[i]), operand: ops[i+1]} - switch op.code { - case utilities.OpNop: - continue - case utilities.OpPush: - if pushMSeen { - tailLen++ - } - stack++ - case utilities.OpPushM: - if pushMSeen { - grpclog.Infof("pushM appears twice") - return Pattern{}, ErrInvalidPattern - } - pushMSeen = true - stack++ - case utilities.OpLitPush: - if op.operand < 0 || len(pool) <= op.operand { - grpclog.Infof("negative literal index: %d", op.operand) - return Pattern{}, ErrInvalidPattern - } - if pushMSeen { - tailLen++ - } - stack++ - case utilities.OpConcatN: - if op.operand <= 0 { - grpclog.Infof("negative concat size: %d", op.operand) - return Pattern{}, ErrInvalidPattern - } - stack -= op.operand - if stack < 0 { - grpclog.Print("stack underflow") - return Pattern{}, ErrInvalidPattern - } - stack++ - case utilities.OpCapture: - if op.operand < 0 || len(pool) <= op.operand { - grpclog.Infof("variable name index out of bound: %d", op.operand) - return Pattern{}, ErrInvalidPattern - } - v := pool[op.operand] - op.operand = len(vars) - vars = append(vars, v) - stack-- - if stack < 0 { - grpclog.Infof("stack underflow") - return Pattern{}, ErrInvalidPattern - } - default: - grpclog.Infof("invalid opcode: %d", op.code) - return Pattern{}, ErrInvalidPattern - } - - if maxstack < stack { - maxstack = stack - } - typedOps = append(typedOps, op) - } - return Pattern{ - ops: typedOps, - pool: pool, - vars: vars, - stacksize: maxstack, - tailLen: tailLen, - verb: verb, - assumeColonVerb: options.assumeColonVerb, - }, nil -} - -// MustPattern is a helper function which makes it easier to call NewPattern in variable initialization. -func MustPattern(p Pattern, err error) Pattern { - if err != nil { - grpclog.Fatalf("Pattern initialization failed: %v", err) - } - return p -} - -// Match examines components if it matches to the Pattern. -// If it matches, the function returns a mapping from field paths to their captured values. -// If otherwise, the function returns an error. -func (p Pattern) Match(components []string, verb string) (map[string]string, error) { - if p.verb != verb { - if p.assumeColonVerb || p.verb != "" { - return nil, ErrNotMatch - } - if len(components) == 0 { - components = []string{":" + verb} - } else { - components = append([]string{}, components...) - components[len(components)-1] += ":" + verb - } - verb = "" - } - - var pos int - stack := make([]string, 0, p.stacksize) - captured := make([]string, len(p.vars)) - l := len(components) - for _, op := range p.ops { - switch op.code { - case utilities.OpNop: - continue - case utilities.OpPush, utilities.OpLitPush: - if pos >= l { - return nil, ErrNotMatch - } - c := components[pos] - if op.code == utilities.OpLitPush { - if lit := p.pool[op.operand]; c != lit { - return nil, ErrNotMatch - } - } - stack = append(stack, c) - pos++ - case utilities.OpPushM: - end := len(components) - if end < pos+p.tailLen { - return nil, ErrNotMatch - } - end -= p.tailLen - stack = append(stack, strings.Join(components[pos:end], "/")) - pos = end - case utilities.OpConcatN: - n := op.operand - l := len(stack) - n - stack = append(stack[:l], strings.Join(stack[l:], "/")) - case utilities.OpCapture: - n := len(stack) - 1 - captured[op.operand] = stack[n] - stack = stack[:n] - } - } - if pos < l { - return nil, ErrNotMatch - } - bindings := make(map[string]string) - for i, val := range captured { - bindings[p.vars[i]] = val - } - return bindings, nil -} - -// Verb returns the verb part of the Pattern. -func (p Pattern) Verb() string { return p.verb } - -func (p Pattern) String() string { - var stack []string - for _, op := range p.ops { - switch op.code { - case utilities.OpNop: - continue - case utilities.OpPush: - stack = append(stack, "*") - case utilities.OpLitPush: - stack = append(stack, p.pool[op.operand]) - case utilities.OpPushM: - stack = append(stack, "**") - case utilities.OpConcatN: - n := op.operand - l := len(stack) - n - stack = append(stack[:l], strings.Join(stack[l:], "/")) - case utilities.OpCapture: - n := len(stack) - 1 - stack[n] = fmt.Sprintf("{%s=%s}", p.vars[op.operand], stack[n]) - } - } - segs := strings.Join(stack, "/") - if p.verb != "" { - return fmt.Sprintf("/%s:%s", segs, p.verb) - } - return "/" + segs -} - -// AssumeColonVerbOpt indicates whether a path suffix after a final -// colon may only be interpreted as a verb. -func AssumeColonVerbOpt(val bool) PatternOpt { - return PatternOpt(func(o *patternOptions) { - o.assumeColonVerb = val - }) -} diff --git a/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/proto2_convert.go b/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/proto2_convert.go deleted file mode 100644 index a3151e2a55..0000000000 --- a/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/proto2_convert.go +++ /dev/null @@ -1,80 +0,0 @@ -package runtime - -import ( - "github.com/golang/protobuf/proto" -) - -// StringP returns a pointer to a string whose pointee is same as the given string value. -func StringP(val string) (*string, error) { - return proto.String(val), nil -} - -// BoolP parses the given string representation of a boolean value, -// and returns a pointer to a bool whose value is same as the parsed value. -func BoolP(val string) (*bool, error) { - b, err := Bool(val) - if err != nil { - return nil, err - } - return proto.Bool(b), nil -} - -// Float64P parses the given string representation of a floating point number, -// and returns a pointer to a float64 whose value is same as the parsed number. -func Float64P(val string) (*float64, error) { - f, err := Float64(val) - if err != nil { - return nil, err - } - return proto.Float64(f), nil -} - -// Float32P parses the given string representation of a floating point number, -// and returns a pointer to a float32 whose value is same as the parsed number. -func Float32P(val string) (*float32, error) { - f, err := Float32(val) - if err != nil { - return nil, err - } - return proto.Float32(f), nil -} - -// Int64P parses the given string representation of an integer -// and returns a pointer to a int64 whose value is same as the parsed integer. -func Int64P(val string) (*int64, error) { - i, err := Int64(val) - if err != nil { - return nil, err - } - return proto.Int64(i), nil -} - -// Int32P parses the given string representation of an integer -// and returns a pointer to a int32 whose value is same as the parsed integer. -func Int32P(val string) (*int32, error) { - i, err := Int32(val) - if err != nil { - return nil, err - } - return proto.Int32(i), err -} - -// Uint64P parses the given string representation of an integer -// and returns a pointer to a uint64 whose value is same as the parsed integer. -func Uint64P(val string) (*uint64, error) { - i, err := Uint64(val) - if err != nil { - return nil, err - } - return proto.Uint64(i), err -} - -// Uint32P parses the given string representation of an integer -// and returns a pointer to a uint32 whose value is same as the parsed integer. -func Uint32P(val string) (*uint32, error) { - i, err := Uint32(val) - if err != nil { - return nil, err - } - return proto.Uint32(i), err -} diff --git a/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/proto_errors.go b/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/proto_errors.go deleted file mode 100644 index ea75565868..0000000000 --- a/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/proto_errors.go +++ /dev/null @@ -1,106 +0,0 @@ -package runtime - -import ( - "context" - "io" - "net/http" - - "github.com/golang/protobuf/ptypes/any" - "github.com/grpc-ecosystem/grpc-gateway/internal" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/grpclog" - "google.golang.org/grpc/status" -) - -// StreamErrorHandlerFunc accepts an error as a gRPC error generated via status package and translates it into a -// a proto struct used to represent error at the end of a stream. -type StreamErrorHandlerFunc func(context.Context, error) *StreamError - -// StreamError is the payload for the final message in a server stream in the event that the server returns an -// error after a response message has already been sent. -type StreamError internal.StreamError - -// ProtoErrorHandlerFunc handles the error as a gRPC error generated via status package and replies to the request. -type ProtoErrorHandlerFunc func(context.Context, *ServeMux, Marshaler, http.ResponseWriter, *http.Request, error) - -var _ ProtoErrorHandlerFunc = DefaultHTTPProtoErrorHandler - -// DefaultHTTPProtoErrorHandler is an implementation of HTTPError. -// If "err" is an error from gRPC system, the function replies with the status code mapped by HTTPStatusFromCode. -// If otherwise, it replies with http.StatusInternalServerError. -// -// The response body returned by this function is a Status message marshaled by a Marshaler. -// -// Do not set this function to HTTPError variable directly, use WithProtoErrorHandler option instead. -func DefaultHTTPProtoErrorHandler(ctx context.Context, mux *ServeMux, marshaler Marshaler, w http.ResponseWriter, _ *http.Request, err error) { - // return Internal when Marshal failed - const fallback = `{"code": 13, "message": "failed to marshal error message"}` - - s, ok := status.FromError(err) - if !ok { - s = status.New(codes.Unknown, err.Error()) - } - - w.Header().Del("Trailer") - - contentType := marshaler.ContentType() - // Check marshaler on run time in order to keep backwards compatability - // An interface param needs to be added to the ContentType() function on - // the Marshal interface to be able to remove this check - if typeMarshaler, ok := marshaler.(contentTypeMarshaler); ok { - pb := s.Proto() - contentType = typeMarshaler.ContentTypeFromMessage(pb) - } - w.Header().Set("Content-Type", contentType) - - buf, merr := marshaler.Marshal(s.Proto()) - if merr != nil { - grpclog.Infof("Failed to marshal error message %q: %v", s.Proto(), merr) - w.WriteHeader(http.StatusInternalServerError) - if _, err := io.WriteString(w, fallback); err != nil { - grpclog.Infof("Failed to write response: %v", err) - } - return - } - - md, ok := ServerMetadataFromContext(ctx) - if !ok { - grpclog.Infof("Failed to extract ServerMetadata from context") - } - - handleForwardResponseServerMetadata(w, mux, md) - handleForwardResponseTrailerHeader(w, md) - st := HTTPStatusFromCode(s.Code()) - w.WriteHeader(st) - if _, err := w.Write(buf); err != nil { - grpclog.Infof("Failed to write response: %v", err) - } - - handleForwardResponseTrailer(w, md) -} - -// DefaultHTTPStreamErrorHandler converts the given err into a *StreamError via -// default logic. -// -// It extracts the gRPC status from err if possible. The fields of the status are -// used to populate the returned StreamError, and the HTTP status code is derived -// from the gRPC code via HTTPStatusFromCode. If the given err does not contain a -// gRPC status, an "Unknown" gRPC code is used and "Internal Server Error" HTTP code. -func DefaultHTTPStreamErrorHandler(_ context.Context, err error) *StreamError { - grpcCode := codes.Unknown - grpcMessage := err.Error() - var grpcDetails []*any.Any - if s, ok := status.FromError(err); ok { - grpcCode = s.Code() - grpcMessage = s.Message() - grpcDetails = s.Proto().GetDetails() - } - httpCode := HTTPStatusFromCode(grpcCode) - return &StreamError{ - GrpcCode: int32(grpcCode), - HttpCode: int32(httpCode), - Message: grpcMessage, - HttpStatus: http.StatusText(httpCode), - Details: grpcDetails, - } -} diff --git a/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/query.go b/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/query.go deleted file mode 100644 index ba66842c33..0000000000 --- a/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/query.go +++ /dev/null @@ -1,406 +0,0 @@ -package runtime - -import ( - "encoding/base64" - "fmt" - "net/url" - "reflect" - "regexp" - "strconv" - "strings" - "time" - - "github.com/golang/protobuf/proto" - "github.com/grpc-ecosystem/grpc-gateway/utilities" - "google.golang.org/grpc/grpclog" -) - -var valuesKeyRegexp = regexp.MustCompile("^(.*)\\[(.*)\\]$") - -var currentQueryParser QueryParameterParser = &defaultQueryParser{} - -// QueryParameterParser defines interface for all query parameter parsers -type QueryParameterParser interface { - Parse(msg proto.Message, values url.Values, filter *utilities.DoubleArray) error -} - -// PopulateQueryParameters parses query parameters -// into "msg" using current query parser -func PopulateQueryParameters(msg proto.Message, values url.Values, filter *utilities.DoubleArray) error { - return currentQueryParser.Parse(msg, values, filter) -} - -type defaultQueryParser struct{} - -// Parse populates "values" into "msg". -// A value is ignored if its key starts with one of the elements in "filter". -func (*defaultQueryParser) Parse(msg proto.Message, values url.Values, filter *utilities.DoubleArray) error { - for key, values := range values { - match := valuesKeyRegexp.FindStringSubmatch(key) - if len(match) == 3 { - key = match[1] - values = append([]string{match[2]}, values...) - } - fieldPath := strings.Split(key, ".") - if filter.HasCommonPrefix(fieldPath) { - continue - } - if err := populateFieldValueFromPath(msg, fieldPath, values); err != nil { - return err - } - } - return nil -} - -// PopulateFieldFromPath sets a value in a nested Protobuf structure. -// It instantiates missing protobuf fields as it goes. -func PopulateFieldFromPath(msg proto.Message, fieldPathString string, value string) error { - fieldPath := strings.Split(fieldPathString, ".") - return populateFieldValueFromPath(msg, fieldPath, []string{value}) -} - -func populateFieldValueFromPath(msg proto.Message, fieldPath []string, values []string) error { - m := reflect.ValueOf(msg) - if m.Kind() != reflect.Ptr { - return fmt.Errorf("unexpected type %T: %v", msg, msg) - } - var props *proto.Properties - m = m.Elem() - for i, fieldName := range fieldPath { - isLast := i == len(fieldPath)-1 - if !isLast && m.Kind() != reflect.Struct { - return fmt.Errorf("non-aggregate type in the mid of path: %s", strings.Join(fieldPath, ".")) - } - var f reflect.Value - var err error - f, props, err = fieldByProtoName(m, fieldName) - if err != nil { - return err - } else if !f.IsValid() { - grpclog.Infof("field not found in %T: %s", msg, strings.Join(fieldPath, ".")) - return nil - } - - switch f.Kind() { - case reflect.Bool, reflect.Float32, reflect.Float64, reflect.Int32, reflect.Int64, reflect.String, reflect.Uint32, reflect.Uint64: - if !isLast { - return fmt.Errorf("unexpected nested field %s in %s", fieldPath[i+1], strings.Join(fieldPath[:i+1], ".")) - } - m = f - case reflect.Slice: - if !isLast { - return fmt.Errorf("unexpected repeated field in %s", strings.Join(fieldPath, ".")) - } - // Handle []byte - if f.Type().Elem().Kind() == reflect.Uint8 { - m = f - break - } - return populateRepeatedField(f, values, props) - case reflect.Ptr: - if f.IsNil() { - m = reflect.New(f.Type().Elem()) - f.Set(m.Convert(f.Type())) - } - m = f.Elem() - continue - case reflect.Struct: - m = f - continue - case reflect.Map: - if !isLast { - return fmt.Errorf("unexpected nested field %s in %s", fieldPath[i+1], strings.Join(fieldPath[:i+1], ".")) - } - return populateMapField(f, values, props) - default: - return fmt.Errorf("unexpected type %s in %T", f.Type(), msg) - } - } - switch len(values) { - case 0: - return fmt.Errorf("no value of field: %s", strings.Join(fieldPath, ".")) - case 1: - default: - grpclog.Infof("too many field values: %s", strings.Join(fieldPath, ".")) - } - return populateField(m, values[0], props) -} - -// fieldByProtoName looks up a field whose corresponding protobuf field name is "name". -// "m" must be a struct value. It returns zero reflect.Value if no such field found. -func fieldByProtoName(m reflect.Value, name string) (reflect.Value, *proto.Properties, error) { - props := proto.GetProperties(m.Type()) - - // look up field name in oneof map - for _, op := range props.OneofTypes { - if name == op.Prop.OrigName || name == op.Prop.JSONName { - v := reflect.New(op.Type.Elem()) - field := m.Field(op.Field) - if !field.IsNil() { - return reflect.Value{}, nil, fmt.Errorf("field already set for %s oneof", props.Prop[op.Field].OrigName) - } - field.Set(v) - return v.Elem().Field(0), op.Prop, nil - } - } - - for _, p := range props.Prop { - if p.OrigName == name { - return m.FieldByName(p.Name), p, nil - } - if p.JSONName == name { - return m.FieldByName(p.Name), p, nil - } - } - return reflect.Value{}, nil, nil -} - -func populateMapField(f reflect.Value, values []string, props *proto.Properties) error { - if len(values) != 2 { - return fmt.Errorf("more than one value provided for key %s in map %s", values[0], props.Name) - } - - key, value := values[0], values[1] - keyType := f.Type().Key() - valueType := f.Type().Elem() - if f.IsNil() { - f.Set(reflect.MakeMap(f.Type())) - } - - keyConv, ok := convFromType[keyType.Kind()] - if !ok { - return fmt.Errorf("unsupported key type %s in map %s", keyType, props.Name) - } - valueConv, ok := convFromType[valueType.Kind()] - if !ok { - return fmt.Errorf("unsupported value type %s in map %s", valueType, props.Name) - } - - keyV := keyConv.Call([]reflect.Value{reflect.ValueOf(key)}) - if err := keyV[1].Interface(); err != nil { - return err.(error) - } - valueV := valueConv.Call([]reflect.Value{reflect.ValueOf(value)}) - if err := valueV[1].Interface(); err != nil { - return err.(error) - } - - f.SetMapIndex(keyV[0].Convert(keyType), valueV[0].Convert(valueType)) - - return nil -} - -func populateRepeatedField(f reflect.Value, values []string, props *proto.Properties) error { - elemType := f.Type().Elem() - - // is the destination field a slice of an enumeration type? - if enumValMap := proto.EnumValueMap(props.Enum); enumValMap != nil { - return populateFieldEnumRepeated(f, values, enumValMap) - } - - conv, ok := convFromType[elemType.Kind()] - if !ok { - return fmt.Errorf("unsupported field type %s", elemType) - } - f.Set(reflect.MakeSlice(f.Type(), len(values), len(values)).Convert(f.Type())) - for i, v := range values { - result := conv.Call([]reflect.Value{reflect.ValueOf(v)}) - if err := result[1].Interface(); err != nil { - return err.(error) - } - f.Index(i).Set(result[0].Convert(f.Index(i).Type())) - } - return nil -} - -func populateField(f reflect.Value, value string, props *proto.Properties) error { - i := f.Addr().Interface() - - // Handle protobuf well known types - var name string - switch m := i.(type) { - case interface{ XXX_WellKnownType() string }: - name = m.XXX_WellKnownType() - case proto.Message: - const wktPrefix = "google.protobuf." - if fullName := proto.MessageName(m); strings.HasPrefix(fullName, wktPrefix) { - name = fullName[len(wktPrefix):] - } - } - switch name { - case "Timestamp": - if value == "null" { - f.FieldByName("Seconds").SetInt(0) - f.FieldByName("Nanos").SetInt(0) - return nil - } - - t, err := time.Parse(time.RFC3339Nano, value) - if err != nil { - return fmt.Errorf("bad Timestamp: %v", err) - } - f.FieldByName("Seconds").SetInt(int64(t.Unix())) - f.FieldByName("Nanos").SetInt(int64(t.Nanosecond())) - return nil - case "Duration": - if value == "null" { - f.FieldByName("Seconds").SetInt(0) - f.FieldByName("Nanos").SetInt(0) - return nil - } - d, err := time.ParseDuration(value) - if err != nil { - return fmt.Errorf("bad Duration: %v", err) - } - - ns := d.Nanoseconds() - s := ns / 1e9 - ns %= 1e9 - f.FieldByName("Seconds").SetInt(s) - f.FieldByName("Nanos").SetInt(ns) - return nil - case "DoubleValue": - fallthrough - case "FloatValue": - float64Val, err := strconv.ParseFloat(value, 64) - if err != nil { - return fmt.Errorf("bad DoubleValue: %s", value) - } - f.FieldByName("Value").SetFloat(float64Val) - return nil - case "Int64Value": - fallthrough - case "Int32Value": - int64Val, err := strconv.ParseInt(value, 10, 64) - if err != nil { - return fmt.Errorf("bad DoubleValue: %s", value) - } - f.FieldByName("Value").SetInt(int64Val) - return nil - case "UInt64Value": - fallthrough - case "UInt32Value": - uint64Val, err := strconv.ParseUint(value, 10, 64) - if err != nil { - return fmt.Errorf("bad DoubleValue: %s", value) - } - f.FieldByName("Value").SetUint(uint64Val) - return nil - case "BoolValue": - if value == "true" { - f.FieldByName("Value").SetBool(true) - } else if value == "false" { - f.FieldByName("Value").SetBool(false) - } else { - return fmt.Errorf("bad BoolValue: %s", value) - } - return nil - case "StringValue": - f.FieldByName("Value").SetString(value) - return nil - case "BytesValue": - bytesVal, err := base64.StdEncoding.DecodeString(value) - if err != nil { - return fmt.Errorf("bad BytesValue: %s", value) - } - f.FieldByName("Value").SetBytes(bytesVal) - return nil - case "FieldMask": - p := f.FieldByName("Paths") - for _, v := range strings.Split(value, ",") { - if v != "" { - p.Set(reflect.Append(p, reflect.ValueOf(v))) - } - } - return nil - } - - // Handle Time and Duration stdlib types - switch t := i.(type) { - case *time.Time: - pt, err := time.Parse(time.RFC3339Nano, value) - if err != nil { - return fmt.Errorf("bad Timestamp: %v", err) - } - *t = pt - return nil - case *time.Duration: - d, err := time.ParseDuration(value) - if err != nil { - return fmt.Errorf("bad Duration: %v", err) - } - *t = d - return nil - } - - // is the destination field an enumeration type? - if enumValMap := proto.EnumValueMap(props.Enum); enumValMap != nil { - return populateFieldEnum(f, value, enumValMap) - } - - conv, ok := convFromType[f.Kind()] - if !ok { - return fmt.Errorf("field type %T is not supported in query parameters", i) - } - result := conv.Call([]reflect.Value{reflect.ValueOf(value)}) - if err := result[1].Interface(); err != nil { - return err.(error) - } - f.Set(result[0].Convert(f.Type())) - return nil -} - -func convertEnum(value string, t reflect.Type, enumValMap map[string]int32) (reflect.Value, error) { - // see if it's an enumeration string - if enumVal, ok := enumValMap[value]; ok { - return reflect.ValueOf(enumVal).Convert(t), nil - } - - // check for an integer that matches an enumeration value - eVal, err := strconv.Atoi(value) - if err != nil { - return reflect.Value{}, fmt.Errorf("%s is not a valid %s", value, t) - } - for _, v := range enumValMap { - if v == int32(eVal) { - return reflect.ValueOf(eVal).Convert(t), nil - } - } - return reflect.Value{}, fmt.Errorf("%s is not a valid %s", value, t) -} - -func populateFieldEnum(f reflect.Value, value string, enumValMap map[string]int32) error { - cval, err := convertEnum(value, f.Type(), enumValMap) - if err != nil { - return err - } - f.Set(cval) - return nil -} - -func populateFieldEnumRepeated(f reflect.Value, values []string, enumValMap map[string]int32) error { - elemType := f.Type().Elem() - f.Set(reflect.MakeSlice(f.Type(), len(values), len(values)).Convert(f.Type())) - for i, v := range values { - result, err := convertEnum(v, elemType, enumValMap) - if err != nil { - return err - } - f.Index(i).Set(result) - } - return nil -} - -var ( - convFromType = map[reflect.Kind]reflect.Value{ - reflect.String: reflect.ValueOf(String), - reflect.Bool: reflect.ValueOf(Bool), - reflect.Float64: reflect.ValueOf(Float64), - reflect.Float32: reflect.ValueOf(Float32), - reflect.Int64: reflect.ValueOf(Int64), - reflect.Int32: reflect.ValueOf(Int32), - reflect.Uint64: reflect.ValueOf(Uint64), - reflect.Uint32: reflect.ValueOf(Uint32), - reflect.Slice: reflect.ValueOf(Bytes), - } -) diff --git a/vendor/github.com/grpc-ecosystem/grpc-gateway/utilities/BUILD.bazel b/vendor/github.com/grpc-ecosystem/grpc-gateway/utilities/BUILD.bazel deleted file mode 100644 index 7109d79323..0000000000 --- a/vendor/github.com/grpc-ecosystem/grpc-gateway/utilities/BUILD.bazel +++ /dev/null @@ -1,21 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") - -package(default_visibility = ["//visibility:public"]) - -go_library( - name = "go_default_library", - srcs = [ - "doc.go", - "pattern.go", - "readerfactory.go", - "trie.go", - ], - importpath = "github.com/grpc-ecosystem/grpc-gateway/utilities", -) - -go_test( - name = "go_default_test", - size = "small", - srcs = ["trie_test.go"], - embed = [":go_default_library"], -) diff --git a/vendor/github.com/grpc-ecosystem/grpc-gateway/utilities/doc.go b/vendor/github.com/grpc-ecosystem/grpc-gateway/utilities/doc.go deleted file mode 100644 index cf79a4d588..0000000000 --- a/vendor/github.com/grpc-ecosystem/grpc-gateway/utilities/doc.go +++ /dev/null @@ -1,2 +0,0 @@ -// Package utilities provides members for internal use in grpc-gateway. -package utilities diff --git a/vendor/github.com/grpc-ecosystem/grpc-gateway/utilities/pattern.go b/vendor/github.com/grpc-ecosystem/grpc-gateway/utilities/pattern.go deleted file mode 100644 index dfe7de4864..0000000000 --- a/vendor/github.com/grpc-ecosystem/grpc-gateway/utilities/pattern.go +++ /dev/null @@ -1,22 +0,0 @@ -package utilities - -// An OpCode is a opcode of compiled path patterns. -type OpCode int - -// These constants are the valid values of OpCode. -const ( - // OpNop does nothing - OpNop = OpCode(iota) - // OpPush pushes a component to stack - OpPush - // OpLitPush pushes a component to stack if it matches to the literal - OpLitPush - // OpPushM concatenates the remaining components and pushes it to stack - OpPushM - // OpConcatN pops N items from stack, concatenates them and pushes it back to stack - OpConcatN - // OpCapture pops an item and binds it to the variable - OpCapture - // OpEnd is the least positive invalid opcode. - OpEnd -) diff --git a/vendor/github.com/grpc-ecosystem/grpc-gateway/utilities/readerfactory.go b/vendor/github.com/grpc-ecosystem/grpc-gateway/utilities/readerfactory.go deleted file mode 100644 index 6dd3854665..0000000000 --- a/vendor/github.com/grpc-ecosystem/grpc-gateway/utilities/readerfactory.go +++ /dev/null @@ -1,20 +0,0 @@ -package utilities - -import ( - "bytes" - "io" - "io/ioutil" -) - -// IOReaderFactory takes in an io.Reader and returns a function that will allow you to create a new reader that begins -// at the start of the stream -func IOReaderFactory(r io.Reader) (func() io.Reader, error) { - b, err := ioutil.ReadAll(r) - if err != nil { - return nil, err - } - - return func() io.Reader { - return bytes.NewReader(b) - }, nil -} diff --git a/vendor/github.com/grpc-ecosystem/grpc-gateway/utilities/trie.go b/vendor/github.com/grpc-ecosystem/grpc-gateway/utilities/trie.go deleted file mode 100644 index c2b7b30dd9..0000000000 --- a/vendor/github.com/grpc-ecosystem/grpc-gateway/utilities/trie.go +++ /dev/null @@ -1,177 +0,0 @@ -package utilities - -import ( - "sort" -) - -// DoubleArray is a Double Array implementation of trie on sequences of strings. -type DoubleArray struct { - // Encoding keeps an encoding from string to int - Encoding map[string]int - // Base is the base array of Double Array - Base []int - // Check is the check array of Double Array - Check []int -} - -// NewDoubleArray builds a DoubleArray from a set of sequences of strings. -func NewDoubleArray(seqs [][]string) *DoubleArray { - da := &DoubleArray{Encoding: make(map[string]int)} - if len(seqs) == 0 { - return da - } - - encoded := registerTokens(da, seqs) - sort.Sort(byLex(encoded)) - - root := node{row: -1, col: -1, left: 0, right: len(encoded)} - addSeqs(da, encoded, 0, root) - - for i := len(da.Base); i > 0; i-- { - if da.Check[i-1] != 0 { - da.Base = da.Base[:i] - da.Check = da.Check[:i] - break - } - } - return da -} - -func registerTokens(da *DoubleArray, seqs [][]string) [][]int { - var result [][]int - for _, seq := range seqs { - var encoded []int - for _, token := range seq { - if _, ok := da.Encoding[token]; !ok { - da.Encoding[token] = len(da.Encoding) - } - encoded = append(encoded, da.Encoding[token]) - } - result = append(result, encoded) - } - for i := range result { - result[i] = append(result[i], len(da.Encoding)) - } - return result -} - -type node struct { - row, col int - left, right int -} - -func (n node) value(seqs [][]int) int { - return seqs[n.row][n.col] -} - -func (n node) children(seqs [][]int) []*node { - var result []*node - lastVal := int(-1) - last := new(node) - for i := n.left; i < n.right; i++ { - if lastVal == seqs[i][n.col+1] { - continue - } - last.right = i - last = &node{ - row: i, - col: n.col + 1, - left: i, - } - result = append(result, last) - } - last.right = n.right - return result -} - -func addSeqs(da *DoubleArray, seqs [][]int, pos int, n node) { - ensureSize(da, pos) - - children := n.children(seqs) - var i int - for i = 1; ; i++ { - ok := func() bool { - for _, child := range children { - code := child.value(seqs) - j := i + code - ensureSize(da, j) - if da.Check[j] != 0 { - return false - } - } - return true - }() - if ok { - break - } - } - da.Base[pos] = i - for _, child := range children { - code := child.value(seqs) - j := i + code - da.Check[j] = pos + 1 - } - terminator := len(da.Encoding) - for _, child := range children { - code := child.value(seqs) - if code == terminator { - continue - } - j := i + code - addSeqs(da, seqs, j, *child) - } -} - -func ensureSize(da *DoubleArray, i int) { - for i >= len(da.Base) { - da.Base = append(da.Base, make([]int, len(da.Base)+1)...) - da.Check = append(da.Check, make([]int, len(da.Check)+1)...) - } -} - -type byLex [][]int - -func (l byLex) Len() int { return len(l) } -func (l byLex) Swap(i, j int) { l[i], l[j] = l[j], l[i] } -func (l byLex) Less(i, j int) bool { - si := l[i] - sj := l[j] - var k int - for k = 0; k < len(si) && k < len(sj); k++ { - if si[k] < sj[k] { - return true - } - if si[k] > sj[k] { - return false - } - } - if k < len(sj) { - return true - } - return false -} - -// HasCommonPrefix determines if any sequence in the DoubleArray is a prefix of the given sequence. -func (da *DoubleArray) HasCommonPrefix(seq []string) bool { - if len(da.Base) == 0 { - return false - } - - var i int - for _, t := range seq { - code, ok := da.Encoding[t] - if !ok { - break - } - j := da.Base[i] + code - if len(da.Check) <= j || da.Check[j] != i+1 { - break - } - i = j - } - j := da.Base[i] + len(da.Encoding) - if len(da.Check) <= j || da.Check[j] != i+1 { - return false - } - return true -} diff --git a/vendor/github.com/koding/multiconfig/.travis.yml b/vendor/github.com/koding/multiconfig/.travis.yml deleted file mode 100644 index 8185327c8a..0000000000 --- a/vendor/github.com/koding/multiconfig/.travis.yml +++ /dev/null @@ -1,4 +0,0 @@ -language: go -go: 1.3 -script: go test ./... - diff --git a/vendor/github.com/koding/multiconfig/README.md b/vendor/github.com/koding/multiconfig/README.md deleted file mode 100644 index 806d945fb9..0000000000 --- a/vendor/github.com/koding/multiconfig/README.md +++ /dev/null @@ -1,92 +0,0 @@ -# Multiconfig [![GoDoc](https://godoc.org/github.com/koding/multiconfig?status.svg)](http://godoc.org/github.com/koding/multiconfig) [![Build Status](https://travis-ci.org/koding/multiconfig.svg?branch=master)](https://travis-ci.org/koding/multiconfig) - -Load configuration from multiple sources. Multiconfig makes loading/parsing -from different configuration sources an easy task. The problem with any app is -that with time there are many options how to populate a set of configs. -Multiconfig makes it easy by dynamically creating all necessary options. -Checkout the example below to see it in action. - -## Features - -Multiconfig is able to read configuration automatically based on the given struct's field names from the following sources: - -* Struct tags -* TOML file -* JSON file -* YAML file -* Environment variables -* Flags - - -## Install - -```bash -go get github.com/koding/multiconfig -``` - -## Usage and Examples - -Lets define and struct that defines our configuration - -```go -type Server struct { - Name string `required:"true"` - Port int `default:"6060"` - Enabled bool - Users []string -} -``` - -Load the configuration into multiconfig: - -```go -// Create a new DefaultLoader without or with an initial config file -m := multiconfig.New() -m := multiconfig.NewWithPath("config.toml") // supports TOML, JSON and YAML - -// Get an empty struct for your configuration -serverConf := new(Server) - -// Populated the serverConf struct -err := m.Load(serverConf) // Check for error -m.MustLoad(serverConf) // Panic's if there is any error - -// Access now populated fields -serverConf.Port // by default 6060 -serverConf.Name // "koding" -``` - -Run your app: - -```sh -# Sets default values first which are defined in each field tag value. -# Starts to load from config.toml -$ app - -# Override any config easily with environment variables, environment variables -# are automatically generated in the form of STRUCTNAME_FIELDNAME -$ SERVER_PORT=4000 SERVER_NAME="koding" app - -# Or pass via flag. Flags are also automatically generated based on the field -# name -$ app -port 4000 -users "gopher,koding" - -# Print dynamically generated flags and environment variables: -$ app -help -Usage of app: - -enabled=true: Change value of Enabled. - -name=Koding: Change value of Name. - -port=6060: Change value of Port. - -users=[ankara istanbul]: Change value of Users. - -Generated environment variables: - SERVER_NAME - SERVER_PORT - SERVER_ENABLED - SERVER_USERS -``` - - -## License - -The MIT License (MIT) - see [LICENSE](/LICENSE) for more details diff --git a/vendor/github.com/koding/multiconfig/doc.go b/vendor/github.com/koding/multiconfig/doc.go deleted file mode 100644 index 54a81490dd..0000000000 --- a/vendor/github.com/koding/multiconfig/doc.go +++ /dev/null @@ -1,5 +0,0 @@ -// Package multiconfig provides a way to load and read configurations from -// multiple sources. You can read from TOML file, JSON file, YAML file, Environment -// Variables and flags. You can set the order of reader with MultiLoader. Package -// is extensible, you can add your custom Loader by implementing the Load interface. -package multiconfig diff --git a/vendor/github.com/koding/multiconfig/env.go b/vendor/github.com/koding/multiconfig/env.go deleted file mode 100644 index 2840d8bbd2..0000000000 --- a/vendor/github.com/koding/multiconfig/env.go +++ /dev/null @@ -1,129 +0,0 @@ -package multiconfig - -import ( - "fmt" - "os" - "sort" - "strings" - - "github.com/fatih/camelcase" - "github.com/fatih/structs" -) - -// EnvironmentLoader satisifies the loader interface. It loads the -// configuration from the environment variables in the form of -// STRUCTNAME_FIELDNAME. -type EnvironmentLoader struct { - // Prefix prepends given string to every environment variable - // {STRUCTNAME}_FIELDNAME will be {PREFIX}_FIELDNAME - Prefix string - - // CamelCase adds a separator for field names in camelcase form. A - // fieldname of "AccessKey" would generate a environment name of - // "STRUCTNAME_ACCESSKEY". If CamelCase is enabled, the environment name - // will be generated in the form of "STRUCTNAME_ACCESS_KEY" - CamelCase bool -} - -func (e *EnvironmentLoader) getPrefix(s *structs.Struct) string { - if e.Prefix != "" { - return e.Prefix - } - - return s.Name() -} - -// Load loads the source into the config defined by struct s -func (e *EnvironmentLoader) Load(s interface{}) error { - strct := structs.New(s) - strctMap := strct.Map() - prefix := e.getPrefix(strct) - - for key, val := range strctMap { - field := strct.Field(key) - - if err := e.processField(prefix, field, key, val); err != nil { - return err - } - } - - return nil -} - -// processField gets leading name for the env variable and combines the current -// field's name and generates environment variable names recursively -func (e *EnvironmentLoader) processField(prefix string, field *structs.Field, name string, strctMap interface{}) error { - fieldName := e.generateFieldName(prefix, name) - - switch strctMap.(type) { - case map[string]interface{}: - for key, val := range strctMap.(map[string]interface{}) { - field := field.Field(key) - - if err := e.processField(fieldName, field, key, val); err != nil { - return err - } - } - default: - v := os.Getenv(fieldName) - if v == "" { - return nil - } - - if err := fieldSet(field, v); err != nil { - return err - } - } - - return nil -} - -// PrintEnvs prints the generated environment variables to the std out. -func (e *EnvironmentLoader) PrintEnvs(s interface{}) { - strct := structs.New(s) - strctMap := strct.Map() - prefix := e.getPrefix(strct) - - keys := make([]string, 0, len(strctMap)) - for key := range strctMap { - keys = append(keys, key) - } - sort.Strings(keys) - - for _, key := range keys { - field := strct.Field(key) - e.printField(prefix, field, key, strctMap[key]) - } -} - -// printField prints the field of the config struct for the flag.Usage -func (e *EnvironmentLoader) printField(prefix string, field *structs.Field, name string, strctMap interface{}) { - fieldName := e.generateFieldName(prefix, name) - - switch strctMap.(type) { - case map[string]interface{}: - smap := strctMap.(map[string]interface{}) - keys := make([]string, 0, len(smap)) - for key := range smap { - keys = append(keys, key) - } - sort.Strings(keys) - for _, key := range keys { - field := field.Field(key) - e.printField(fieldName, field, key, smap[key]) - } - default: - fmt.Println(" ", fieldName) - } -} - -// generateFieldName generates the field name combined with the prefix and the -// struct's field name -func (e *EnvironmentLoader) generateFieldName(prefix string, name string) string { - fieldName := strings.ToUpper(name) - if e.CamelCase { - fieldName = strings.ToUpper(strings.Join(camelcase.Split(name), "_")) - } - - return strings.ToUpper(prefix) + "_" + fieldName -} diff --git a/vendor/github.com/koding/multiconfig/file.go b/vendor/github.com/koding/multiconfig/file.go deleted file mode 100644 index 3416a9e569..0000000000 --- a/vendor/github.com/koding/multiconfig/file.go +++ /dev/null @@ -1,139 +0,0 @@ -package multiconfig - -import ( - "encoding/json" - "errors" - "io" - "io/ioutil" - "os" - "path/filepath" - - "github.com/BurntSushi/toml" - yaml "gopkg.in/yaml.v2" -) - -var ( - // ErrSourceNotSet states that neither the path or the reader is set on the loader - ErrSourceNotSet = errors.New("config path or reader is not set") - - // ErrFileNotFound states that given file is not exists - ErrFileNotFound = errors.New("config file not found") -) - -// TOMLLoader satisifies the loader interface. It loads the configuration from -// the given toml file or Reader. -type TOMLLoader struct { - Path string - Reader io.Reader -} - -// Load loads the source into the config defined by struct s -// Defaults to using the Reader if provided, otherwise tries to read from the -// file -func (t *TOMLLoader) Load(s interface{}) error { - var r io.Reader - - if t.Reader != nil { - r = t.Reader - } else if t.Path != "" { - file, err := getConfig(t.Path) - if err != nil { - return err - } - defer file.Close() - r = file - } else { - return ErrSourceNotSet - } - - if _, err := toml.DecodeReader(r, s); err != nil { - return err - } - - return nil -} - -// JSONLoader satisifies the loader interface. It loads the configuration from -// the given json file or Reader. -type JSONLoader struct { - Path string - Reader io.Reader -} - -// Load loads the source into the config defined by struct s. -// Defaults to using the Reader if provided, otherwise tries to read from the -// file -func (j *JSONLoader) Load(s interface{}) error { - var r io.Reader - if j.Reader != nil { - r = j.Reader - } else if j.Path != "" { - file, err := getConfig(j.Path) - if err != nil { - return err - } - defer file.Close() - r = file - } else { - return ErrSourceNotSet - } - - return json.NewDecoder(r).Decode(s) -} - -// YAMLLoader satisifies the loader interface. It loads the configuration from -// the given yaml file. -type YAMLLoader struct { - Path string - Reader io.Reader -} - -// Load loads the source into the config defined by struct s. -// Defaults to using the Reader if provided, otherwise tries to read from the -// file -func (y *YAMLLoader) Load(s interface{}) error { - var r io.Reader - - if y.Reader != nil { - r = y.Reader - } else if y.Path != "" { - file, err := getConfig(y.Path) - if err != nil { - return err - } - defer file.Close() - r = file - } else { - return ErrSourceNotSet - } - - data, err := ioutil.ReadAll(r) - if err != nil { - return err - } - - return yaml.Unmarshal(data, s) -} - -func getConfig(path string) (*os.File, error) { - pwd, err := os.Getwd() - if err != nil { - return nil, err - } - - configPath := path - if !filepath.IsAbs(path) { - configPath = filepath.Join(pwd, path) - } - - // check if file with combined path is exists(relative path) - if _, err := os.Stat(configPath); !os.IsNotExist(err) { - return os.Open(configPath) - } - - f, err := os.Open(path) - if os.IsNotExist(err) { - return nil, ErrFileNotFound - } - return f, err -} diff --git a/vendor/github.com/koding/multiconfig/flag.go b/vendor/github.com/koding/multiconfig/flag.go deleted file mode 100644 index 56cd64bc89..0000000000 --- a/vendor/github.com/koding/multiconfig/flag.go +++ /dev/null @@ -1,207 +0,0 @@ -package multiconfig - -import ( - "flag" - "fmt" - "os" - "reflect" - "strings" - - "github.com/fatih/camelcase" - "github.com/fatih/structs" -) - -// FlagLoader satisfies the loader interface. It creates on the fly flags based -// on the field names and parses them to load into the given pointer of struct -// s. -type FlagLoader struct { - // Prefix prepends the prefix to each flag name i.e: - // --foo is converted to --prefix-foo. - // --foo-bar is converted to --prefix-foo-bar. - Prefix string - - // Flatten doesn't add prefixes for nested structs. So previously if we had - // a nested struct `type T struct{Name struct{ ...}}`, this would generate - // --name-foo, --name-bar, etc. When Flatten is enabled, the flags will be - // flattend to the form: --foo, --bar, etc.. Panics if the nested structs - // has a duplicate field name in the root level of the struct (outer - // struct). Use this option only if you know what you do. - Flatten bool - - // CamelCase adds a separator for field names in camelcase form. A - // fieldname of "AccessKey" would generate a flag name "--accesskey". If - // CamelCase is enabled, the flag name will be generated in the form of - // "--access-key" - CamelCase bool - - // EnvPrefix is just a placeholder to print the correct usages when an - // EnvLoader is used - EnvPrefix string - - // ErrorHandling is used to configure error handling used by - // *flag.FlagSet. - // - // By default it's flag.ContinueOnError. - ErrorHandling flag.ErrorHandling - - // Args defines a custom argument list. If nil, os.Args[1:] is used. - Args []string - - // FlagUsageFunc an optional function that is called to set a flag.Usage value - // The input is the raw flag name, and the output should be a string - // that will used in passed into the flag for Usage. - FlagUsageFunc func(name string) string - - // only exists for testing. This is the raw flagset that is to parse - flagSet *flag.FlagSet -} - -// Load loads the source into the config defined by struct s -func (f *FlagLoader) Load(s interface{}) error { - strct := structs.New(s) - structName := strct.Name() - - flagSet := flag.NewFlagSet(structName, f.ErrorHandling) - f.flagSet = flagSet - - for _, field := range strct.Fields() { - f.processField(field.Name(), field) - } - - flagSet.Usage = func() { - fmt.Fprintf(os.Stderr, "Usage of %s:\n", os.Args[0]) - flagSet.PrintDefaults() - fmt.Fprintf(os.Stderr, "\nGenerated environment variables:\n") - e := &EnvironmentLoader{ - Prefix: f.EnvPrefix, - CamelCase: f.CamelCase, - } - e.PrintEnvs(s) - fmt.Println("") - } - - args := filterArgs(os.Args[1:]) - if f.Args != nil { - args = f.Args - } - - return flagSet.Parse(args) -} - -func filterArgs(args []string) []string { - r := []string{} - for i := 0; i < len(args); i++ { - if strings.Index(args[i], "test.") >= 0 { - if i + 1 < len(args) && strings.Index(args[i + 1], "-") == -1 { - i++ - } - i++ - } else { - r = append(r, args[i]) - } - } - return r -} - -// processField generates a flag based on the given field and fieldName. If a -// nested struct is detected, a flag for each field of that nested struct is -// generated too. -func (f *FlagLoader) processField(fieldName string, field *structs.Field) error { - if f.CamelCase { - fieldName = strings.Join(camelcase.Split(fieldName), "-") - fieldName = strings.Replace(fieldName, "---", "-", -1) - } - - switch field.Kind() { - case reflect.Struct: - for _, ff := range field.Fields() { - flagName := field.Name() + "-" + ff.Name() - - if f.Flatten { - // first check if it's set or not, because if we have duplicate - // we don't want to break the flag. Panic by giving a readable - // output - f.flagSet.VisitAll(func(fl *flag.Flag) { - if strings.ToLower(ff.Name()) == fl.Name { - // already defined - panic(fmt.Sprintf("flag '%s' is already defined in outer struct", fl.Name)) - } - }) - - flagName = ff.Name() - } - - if err := f.processField(flagName, ff); err != nil { - return err - } - } - default: - // Add custom prefix to the flag if it's set - if f.Prefix != "" { - fieldName = f.Prefix + "-" + fieldName - } - - // we only can get the value from expored fields, unexported fields panics - if field.IsExported() { - f.flagSet.Var(newFieldValue(field), flagName(fieldName), f.flagUsage(fieldName, field)) - } - } - - return nil -} - -func (f *FlagLoader) flagUsage(fieldName string, field *structs.Field) string { - if f.FlagUsageFunc != nil { - return f.FlagUsageFunc(fieldName) - } - - usage := field.Tag("flagUsage") - if usage != "" { - return usage - } - - return fmt.Sprintf("Change value of %s.", fieldName) -} - -// fieldValue satisfies the flag.Value and flag.Getter interfaces -type fieldValue struct { - field *structs.Field -} - -func newFieldValue(f *structs.Field) *fieldValue { - return &fieldValue{ - field: f, - } -} - -func (f *fieldValue) Set(val string) error { - return fieldSet(f.field, val) -} - -func (f *fieldValue) String() string { - if f.IsZero() { - return "" - } - - return fmt.Sprintf("%v", f.field.Value()) -} - -func (f *fieldValue) Get() interface{} { - if f.IsZero() { - return nil - } - - return f.field.Value() -} - -func (f *fieldValue) IsZero() bool { - return f.field == nil -} - -// This is an unexported interface, be careful about it. -// https://code.google.com/p/go/source/browse/src/pkg/flag/flag.go?name=release#101 -func (f *fieldValue) IsBoolFlag() bool { - return f.field.Kind() == reflect.Bool -} - -func flagName(name string) string { return strings.ToLower(name) } diff --git a/vendor/github.com/koding/multiconfig/multiconfig.go b/vendor/github.com/koding/multiconfig/multiconfig.go deleted file mode 100644 index 00703444bb..0000000000 --- a/vendor/github.com/koding/multiconfig/multiconfig.go +++ /dev/null @@ -1,227 +0,0 @@ -package multiconfig - -import ( - "flag" - "fmt" - "os" - "reflect" - "strconv" - "strings" - "time" - - "github.com/fatih/structs" -) - -// Loader loads the configuration from a source. The implementer of Loader is -// responsible for setting the default values of the struct. -type Loader interface { - // Load loads the source into the config defined by struct s - Load(s interface{}) error -} - -// DefaultLoader implements the Loader interface. It initializes the given -// pointer of struct s with configuration from the default sources. The order -// of load is TagLoader, FileLoader, EnvLoader and lastly FlagLoader. An error -// in any step stops the loading process. Each step overrides the previous -// step's config (i.e: defining a flag will override previous environment or -// file config). To customize the order use the individual load functions. -type DefaultLoader struct { - Loader - Validator -} - -// NewWithPath returns a new instance of Loader to read from the given -// configuration file. -func NewWithPath(path string) *DefaultLoader { - loaders := []Loader{} - - // Read default values defined via tag fields "default" - loaders = append(loaders, &TagLoader{}) - - // Choose what while is passed - if strings.HasSuffix(path, "toml") { - loaders = append(loaders, &TOMLLoader{Path: path}) - } - - if strings.HasSuffix(path, "json") { - loaders = append(loaders, &JSONLoader{Path: path}) - } - - if strings.HasSuffix(path, "yml") || strings.HasSuffix(path, "yaml") { - loaders = append(loaders, &YAMLLoader{Path: path}) - } - - e := &EnvironmentLoader{} - f := &FlagLoader{} - - loaders = append(loaders, e, f) - loader := MultiLoader(loaders...) - - d := &DefaultLoader{} - d.Loader = loader - d.Validator = MultiValidator(&RequiredValidator{}) - return d -} - -// New returns a new instance of DefaultLoader without any file loaders. -func New() *DefaultLoader { - loader := MultiLoader( - &TagLoader{}, - &EnvironmentLoader{}, - &FlagLoader{}, - ) - - d := &DefaultLoader{} - d.Loader = loader - d.Validator = MultiValidator(&RequiredValidator{}) - return d -} - -// MustLoadWithPath loads with the DefaultLoader settings and from the given -// Path. It exits if the config cannot be parsed. -func MustLoadWithPath(path string, conf interface{}) { - d := NewWithPath(path) - d.MustLoad(conf) -} - -// MustLoad loads with the DefaultLoader settings. It exits if the config -// cannot be parsed. -func MustLoad(conf interface{}) { - d := New() - d.MustLoad(conf) -} - -// MustLoad is like Load but panics if the config cannot be parsed. -func (d *DefaultLoader) MustLoad(conf interface{}) { - if err := d.Load(conf); err != nil { - fmt.Fprintln(os.Stderr, err) - os.Exit(2) - } - - // we at koding, believe having sane defaults in our system, this is the - // reason why we have default validators in DefaultLoader. But do not cause - // nil pointer panics if one uses DefaultLoader directly. - if d.Validator != nil { - d.MustValidate(conf) - } -} - -// MustValidate validates the struct. It exits with status 1 if it can't -// validate. -func (d *DefaultLoader) MustValidate(conf interface{}) { - if err := d.Validate(conf); err != nil { - fmt.Fprintln(os.Stderr, err) - os.Exit(2) - } -} - -// fieldSet sets field value from the given string value. It converts the -// string value in a sane way and is usefulf or environment variables or flags -// which are by nature in string types. -func fieldSet(field *structs.Field, v string) error { - switch f := field.Value().(type) { - case flag.Value: - if v := reflect.ValueOf(field.Value()); v.IsNil() { - typ := v.Type() - if typ.Kind() == reflect.Ptr { - typ = typ.Elem() - } - - if err := field.Set(reflect.New(typ).Interface()); err != nil { - return err - } - - f = field.Value().(flag.Value) - } - - return f.Set(v) - } - - // TODO: add support for other types - switch field.Kind() { - case reflect.Bool: - val, err := strconv.ParseBool(v) - if err != nil { - return err - } - - if err := field.Set(val); err != nil { - return err - } - case reflect.Int: - i, err := strconv.Atoi(v) - if err != nil { - return err - } - - if err := field.Set(i); err != nil { - return err - } - case reflect.String: - if err := field.Set(v); err != nil { - return err - } - case reflect.Slice: - switch t := field.Value().(type) { - case []string: - if err := field.Set(strings.Split(v, ",")); err != nil { - return err - } - case []int: - var list []int - for _, in := range strings.Split(v, ",") { - i, err := strconv.Atoi(in) - if err != nil { - return err - } - - list = append(list, i) - } - - if err := field.Set(list); err != nil { - return err - } - default: - return fmt.Errorf("multiconfig: field '%s' of type slice is unsupported: %s (%T)", - field.Name(), field.Kind(), t) - } - case reflect.Float64: - f, err := strconv.ParseFloat(v, 64) - if err != nil { - return err - } - - if err := field.Set(f); err != nil { - return err - } - case reflect.Int64: - switch t := field.Value().(type) { - case time.Duration: - d, err := time.ParseDuration(v) - if err != nil { - return err - } - - if err := field.Set(d); err != nil { - return err - } - case int64: - p, err := strconv.ParseInt(v, 10, 0) - if err != nil { - return err - } - - if err := field.Set(p); err != nil { - return err - } - default: - return fmt.Errorf("multiconfig: field '%s' of type int64 is unsupported: %s (%T)", - field.Name(), field.Kind(), t) - } - - default: - return fmt.Errorf("multiconfig: field '%s' has unsupported type: %s", field.Name(), field.Kind()) - } - - return nil -} diff --git a/vendor/github.com/koding/multiconfig/multiloader.go b/vendor/github.com/koding/multiconfig/multiloader.go deleted file mode 100644 index 176f34493a..0000000000 --- a/vendor/github.com/koding/multiconfig/multiloader.go +++ /dev/null @@ -1,27 +0,0 @@ -package multiconfig - -type multiLoader []Loader - -// MultiLoader creates a loader that executes the loaders one by one in order -// and returns on the first error. -func MultiLoader(loader ...Loader) Loader { - return multiLoader(loader) -} - -// Load loads the source into the config defined by struct s -func (m multiLoader) Load(s interface{}) error { - for _, loader := range m { - if err := loader.Load(s); err != nil { - return err - } - } - - return nil -} - -// MustLoad loads the source into the struct, it panics if gets any error -func (m multiLoader) MustLoad(s interface{}) { - if err := m.Load(s); err != nil { - panic(err) - } -} diff --git a/vendor/github.com/koding/multiconfig/multivalidator.go b/vendor/github.com/koding/multiconfig/multivalidator.go deleted file mode 100644 index 726febfd16..0000000000 --- a/vendor/github.com/koding/multiconfig/multivalidator.go +++ /dev/null @@ -1,28 +0,0 @@ -package multiconfig - -type multiValidator []Validator - -// MultiValidator accepts variadic validators and satisfies Validator interface. -func MultiValidator(validators ...Validator) Validator { - return multiValidator(validators) -} - -// Validate tries to validate given struct with all the validators. If it doesn't -// have any Validator it will simply skip the validation step. If any of the -// given validators return err, it will stop validating and return it. -func (d multiValidator) Validate(s interface{}) error { - for _, validator := range d { - if err := validator.Validate(s); err != nil { - return err - } - } - - return nil -} - -// MustValidate validates the struct, it panics if gets any error -func (d multiValidator) MustValidate(s interface{}) { - if err := d.Validate(s); err != nil { - panic(err) - } -} diff --git a/vendor/github.com/koding/multiconfig/tag.go b/vendor/github.com/koding/multiconfig/tag.go deleted file mode 100644 index dddde0d130..0000000000 --- a/vendor/github.com/koding/multiconfig/tag.go +++ /dev/null @@ -1,60 +0,0 @@ -package multiconfig - -import ( - "reflect" - - "github.com/fatih/structs" -) - -// TagLoader satisfies the loader interface. It parses a struct's field tags -// and populates the each field with that given tag. -type TagLoader struct { - // DefaultTagName is the default tag name for struct fields to define - // default values for a field. Example: - // - // // Field's default value is "koding". - // Name string `default:"koding"` - // - // The default value is "default" if it's not set explicitly. - DefaultTagName string -} - -func (t *TagLoader) Load(s interface{}) error { - if t.DefaultTagName == "" { - t.DefaultTagName = "default" - } - - for _, field := range structs.Fields(s) { - - if err := t.processField(t.DefaultTagName, field); err != nil { - return err - } - } - - return nil -} - -// processField gets tagName and the field, recursively checks if the field has the given -// tag, if yes, sets it otherwise ignores -func (t *TagLoader) processField(tagName string, field *structs.Field) error { - switch field.Kind() { - case reflect.Struct: - for _, f := range field.Fields() { - if err := t.processField(tagName, f); err != nil { - return err - } - } - default: - defaultVal := field.Tag(t.DefaultTagName) - if defaultVal == "" { - return nil - } - - err := fieldSet(field, defaultVal) - if err != nil { - return err - } - } - - return nil -} diff --git a/vendor/github.com/koding/multiconfig/validator.go b/vendor/github.com/koding/multiconfig/validator.go deleted file mode 100644 index 67d04e242c..0000000000 --- a/vendor/github.com/koding/multiconfig/validator.go +++ /dev/null @@ -1,73 +0,0 @@ -package multiconfig - -import ( - "fmt" - "reflect" - - "github.com/fatih/structs" -) - -// Validator validates the config against any predefined rules, those predefined -// rules should be given to this package. The implementer will be responsible -// for the logic. -type Validator interface { - // Validate validates the config struct - Validate(s interface{}) error -} - -// RequiredValidator validates the struct against zero values. -type RequiredValidator struct { - // TagName holds the validator tag name. The default is "required" - TagName string - - // TagValue holds the expected value of the validator. The default is "true" - TagValue string -} - -// Validate validates the given struct agaist field's zero values. If -// intentionaly, the value of a field is `zero-valued`(e.g false, 0, "") -// required tag should not be set for that field. -func (e *RequiredValidator) Validate(s interface{}) error { - if e.TagName == "" { - e.TagName = "required" - } - - if e.TagValue == "" { - e.TagValue = "true" - } - - for _, field := range structs.Fields(s) { - if err := e.processField("", field); err != nil { - return err - } - } - - return nil -} - -func (e *RequiredValidator) processField(fieldName string, field *structs.Field) error { - fieldName += field.Name() - switch field.Kind() { - case reflect.Struct: - // this is used for error messages below, when we have an error at the - // child properties add parent properties into the error message as well - fieldName += "." - - for _, f := range field.Fields() { - if err := e.processField(fieldName, f); err != nil { - return err - } - } - default: - val := field.Tag(e.TagName) - if val != e.TagValue { - return nil - } - - if field.IsZero() { - return fmt.Errorf("multiconfig: field '%s' is required", fieldName) - } - } - - return nil -} diff --git a/vendor/golang.org/x/crypto/curve25519/const_amd64.h b/vendor/golang.org/x/crypto/curve25519/const_amd64.h deleted file mode 100644 index b3f74162f6..0000000000 --- a/vendor/golang.org/x/crypto/curve25519/const_amd64.h +++ /dev/null @@ -1,8 +0,0 @@ -// Copyright 2012 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// This code was translated into a form compatible with 6a from the public -// domain sources in SUPERCOP: https://bench.cr.yp.to/supercop.html - -#define REDMASK51 0x0007FFFFFFFFFFFF diff --git a/vendor/golang.org/x/crypto/curve25519/const_amd64.s b/vendor/golang.org/x/crypto/curve25519/const_amd64.s deleted file mode 100644 index ee7b4bd5f8..0000000000 --- a/vendor/golang.org/x/crypto/curve25519/const_amd64.s +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright 2012 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// This code was translated into a form compatible with 6a from the public -// domain sources in SUPERCOP: https://bench.cr.yp.to/supercop.html - -// +build amd64,!gccgo,!appengine - -// These constants cannot be encoded in non-MOVQ immediates. -// We access them directly from memory instead. - -DATA ·_121666_213(SB)/8, $996687872 -GLOBL ·_121666_213(SB), 8, $8 - -DATA ·_2P0(SB)/8, $0xFFFFFFFFFFFDA -GLOBL ·_2P0(SB), 8, $8 - -DATA ·_2P1234(SB)/8, $0xFFFFFFFFFFFFE -GLOBL ·_2P1234(SB), 8, $8 diff --git a/vendor/golang.org/x/crypto/curve25519/cswap_amd64.s b/vendor/golang.org/x/crypto/curve25519/cswap_amd64.s deleted file mode 100644 index cd793a5b5f..0000000000 --- a/vendor/golang.org/x/crypto/curve25519/cswap_amd64.s +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright 2012 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build amd64,!gccgo,!appengine - -// func cswap(inout *[4][5]uint64, v uint64) -TEXT ·cswap(SB),7,$0 - MOVQ inout+0(FP),DI - MOVQ v+8(FP),SI - - SUBQ $1, SI - NOTQ SI - MOVQ SI, X15 - PSHUFD $0x44, X15, X15 - - MOVOU 0(DI), X0 - MOVOU 16(DI), X2 - MOVOU 32(DI), X4 - MOVOU 48(DI), X6 - MOVOU 64(DI), X8 - MOVOU 80(DI), X1 - MOVOU 96(DI), X3 - MOVOU 112(DI), X5 - MOVOU 128(DI), X7 - MOVOU 144(DI), X9 - - MOVO X1, X10 - MOVO X3, X11 - MOVO X5, X12 - MOVO X7, X13 - MOVO X9, X14 - - PXOR X0, X10 - PXOR X2, X11 - PXOR X4, X12 - PXOR X6, X13 - PXOR X8, X14 - PAND X15, X10 - PAND X15, X11 - PAND X15, X12 - PAND X15, X13 - PAND X15, X14 - PXOR X10, X0 - PXOR X10, X1 - PXOR X11, X2 - PXOR X11, X3 - PXOR X12, X4 - PXOR X12, X5 - PXOR X13, X6 - PXOR X13, X7 - PXOR X14, X8 - PXOR X14, X9 - - MOVOU X0, 0(DI) - MOVOU X2, 16(DI) - MOVOU X4, 32(DI) - MOVOU X6, 48(DI) - MOVOU X8, 64(DI) - MOVOU X1, 80(DI) - MOVOU X3, 96(DI) - MOVOU X5, 112(DI) - MOVOU X7, 128(DI) - MOVOU X9, 144(DI) - RET diff --git a/vendor/golang.org/x/crypto/curve25519/doc.go b/vendor/golang.org/x/crypto/curve25519/doc.go deleted file mode 100644 index da9b10d9c1..0000000000 --- a/vendor/golang.org/x/crypto/curve25519/doc.go +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright 2012 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package curve25519 provides an implementation of scalar multiplication on -// the elliptic curve known as curve25519. See https://cr.yp.to/ecdh.html -package curve25519 // import "golang.org/x/crypto/curve25519" - -// basePoint is the x coordinate of the generator of the curve. -var basePoint = [32]byte{9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} - -// ScalarMult sets dst to the product in*base where dst and base are the x -// coordinates of group points and all values are in little-endian form. -func ScalarMult(dst, in, base *[32]byte) { - scalarMult(dst, in, base) -} - -// ScalarBaseMult sets dst to the product in*base where dst and base are the x -// coordinates of group points, base is the standard generator and all values -// are in little-endian form. -func ScalarBaseMult(dst, in *[32]byte) { - ScalarMult(dst, in, &basePoint) -} diff --git a/vendor/golang.org/x/crypto/curve25519/freeze_amd64.s b/vendor/golang.org/x/crypto/curve25519/freeze_amd64.s deleted file mode 100644 index 390816106e..0000000000 --- a/vendor/golang.org/x/crypto/curve25519/freeze_amd64.s +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright 2012 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// This code was translated into a form compatible with 6a from the public -// domain sources in SUPERCOP: https://bench.cr.yp.to/supercop.html - -// +build amd64,!gccgo,!appengine - -#include "const_amd64.h" - -// func freeze(inout *[5]uint64) -TEXT ·freeze(SB),7,$0-8 - MOVQ inout+0(FP), DI - - MOVQ 0(DI),SI - MOVQ 8(DI),DX - MOVQ 16(DI),CX - MOVQ 24(DI),R8 - MOVQ 32(DI),R9 - MOVQ $REDMASK51,AX - MOVQ AX,R10 - SUBQ $18,R10 - MOVQ $3,R11 -REDUCELOOP: - MOVQ SI,R12 - SHRQ $51,R12 - ANDQ AX,SI - ADDQ R12,DX - MOVQ DX,R12 - SHRQ $51,R12 - ANDQ AX,DX - ADDQ R12,CX - MOVQ CX,R12 - SHRQ $51,R12 - ANDQ AX,CX - ADDQ R12,R8 - MOVQ R8,R12 - SHRQ $51,R12 - ANDQ AX,R8 - ADDQ R12,R9 - MOVQ R9,R12 - SHRQ $51,R12 - ANDQ AX,R9 - IMUL3Q $19,R12,R12 - ADDQ R12,SI - SUBQ $1,R11 - JA REDUCELOOP - MOVQ $1,R12 - CMPQ R10,SI - CMOVQLT R11,R12 - CMPQ AX,DX - CMOVQNE R11,R12 - CMPQ AX,CX - CMOVQNE R11,R12 - CMPQ AX,R8 - CMOVQNE R11,R12 - CMPQ AX,R9 - CMOVQNE R11,R12 - NEGQ R12 - ANDQ R12,AX - ANDQ R12,R10 - SUBQ R10,SI - SUBQ AX,DX - SUBQ AX,CX - SUBQ AX,R8 - SUBQ AX,R9 - MOVQ SI,0(DI) - MOVQ DX,8(DI) - MOVQ CX,16(DI) - MOVQ R8,24(DI) - MOVQ R9,32(DI) - RET diff --git a/vendor/golang.org/x/crypto/curve25519/mul_amd64.s b/vendor/golang.org/x/crypto/curve25519/mul_amd64.s deleted file mode 100644 index 5ce80a2e56..0000000000 --- a/vendor/golang.org/x/crypto/curve25519/mul_amd64.s +++ /dev/null @@ -1,169 +0,0 @@ -// Copyright 2012 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// This code was translated into a form compatible with 6a from the public -// domain sources in SUPERCOP: https://bench.cr.yp.to/supercop.html - -// +build amd64,!gccgo,!appengine - -#include "const_amd64.h" - -// func mul(dest, a, b *[5]uint64) -TEXT ·mul(SB),0,$16-24 - MOVQ dest+0(FP), DI - MOVQ a+8(FP), SI - MOVQ b+16(FP), DX - - MOVQ DX,CX - MOVQ 24(SI),DX - IMUL3Q $19,DX,AX - MOVQ AX,0(SP) - MULQ 16(CX) - MOVQ AX,R8 - MOVQ DX,R9 - MOVQ 32(SI),DX - IMUL3Q $19,DX,AX - MOVQ AX,8(SP) - MULQ 8(CX) - ADDQ AX,R8 - ADCQ DX,R9 - MOVQ 0(SI),AX - MULQ 0(CX) - ADDQ AX,R8 - ADCQ DX,R9 - MOVQ 0(SI),AX - MULQ 8(CX) - MOVQ AX,R10 - MOVQ DX,R11 - MOVQ 0(SI),AX - MULQ 16(CX) - MOVQ AX,R12 - MOVQ DX,R13 - MOVQ 0(SI),AX - MULQ 24(CX) - MOVQ AX,R14 - MOVQ DX,R15 - MOVQ 0(SI),AX - MULQ 32(CX) - MOVQ AX,BX - MOVQ DX,BP - MOVQ 8(SI),AX - MULQ 0(CX) - ADDQ AX,R10 - ADCQ DX,R11 - MOVQ 8(SI),AX - MULQ 8(CX) - ADDQ AX,R12 - ADCQ DX,R13 - MOVQ 8(SI),AX - MULQ 16(CX) - ADDQ AX,R14 - ADCQ DX,R15 - MOVQ 8(SI),AX - MULQ 24(CX) - ADDQ AX,BX - ADCQ DX,BP - MOVQ 8(SI),DX - IMUL3Q $19,DX,AX - MULQ 32(CX) - ADDQ AX,R8 - ADCQ DX,R9 - MOVQ 16(SI),AX - MULQ 0(CX) - ADDQ AX,R12 - ADCQ DX,R13 - MOVQ 16(SI),AX - MULQ 8(CX) - ADDQ AX,R14 - ADCQ DX,R15 - MOVQ 16(SI),AX - MULQ 16(CX) - ADDQ AX,BX - ADCQ DX,BP - MOVQ 16(SI),DX - IMUL3Q $19,DX,AX - MULQ 24(CX) - ADDQ AX,R8 - ADCQ DX,R9 - MOVQ 16(SI),DX - IMUL3Q $19,DX,AX - MULQ 32(CX) - ADDQ AX,R10 - ADCQ DX,R11 - MOVQ 24(SI),AX - MULQ 0(CX) - ADDQ AX,R14 - ADCQ DX,R15 - MOVQ 24(SI),AX - MULQ 8(CX) - ADDQ AX,BX - ADCQ DX,BP - MOVQ 0(SP),AX - MULQ 24(CX) - ADDQ AX,R10 - ADCQ DX,R11 - MOVQ 0(SP),AX - MULQ 32(CX) - ADDQ AX,R12 - ADCQ DX,R13 - MOVQ 32(SI),AX - MULQ 0(CX) - ADDQ AX,BX - ADCQ DX,BP - MOVQ 8(SP),AX - MULQ 16(CX) - ADDQ AX,R10 - ADCQ DX,R11 - MOVQ 8(SP),AX - MULQ 24(CX) - ADDQ AX,R12 - ADCQ DX,R13 - MOVQ 8(SP),AX - MULQ 32(CX) - ADDQ AX,R14 - ADCQ DX,R15 - MOVQ $REDMASK51,SI - SHLQ $13,R9:R8 - ANDQ SI,R8 - SHLQ $13,R11:R10 - ANDQ SI,R10 - ADDQ R9,R10 - SHLQ $13,R13:R12 - ANDQ SI,R12 - ADDQ R11,R12 - SHLQ $13,R15:R14 - ANDQ SI,R14 - ADDQ R13,R14 - SHLQ $13,BP:BX - ANDQ SI,BX - ADDQ R15,BX - IMUL3Q $19,BP,DX - ADDQ DX,R8 - MOVQ R8,DX - SHRQ $51,DX - ADDQ R10,DX - MOVQ DX,CX - SHRQ $51,DX - ANDQ SI,R8 - ADDQ R12,DX - MOVQ DX,R9 - SHRQ $51,DX - ANDQ SI,CX - ADDQ R14,DX - MOVQ DX,AX - SHRQ $51,DX - ANDQ SI,R9 - ADDQ BX,DX - MOVQ DX,R10 - SHRQ $51,DX - ANDQ SI,AX - IMUL3Q $19,DX,DX - ADDQ DX,R8 - ANDQ SI,R10 - MOVQ R8,0(DI) - MOVQ CX,8(DI) - MOVQ R9,16(DI) - MOVQ AX,24(DI) - MOVQ R10,32(DI) - RET diff --git a/vendor/golang.org/x/crypto/curve25519/square_amd64.s b/vendor/golang.org/x/crypto/curve25519/square_amd64.s deleted file mode 100644 index 12f73734ff..0000000000 --- a/vendor/golang.org/x/crypto/curve25519/square_amd64.s +++ /dev/null @@ -1,132 +0,0 @@ -// Copyright 2012 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// This code was translated into a form compatible with 6a from the public -// domain sources in SUPERCOP: https://bench.cr.yp.to/supercop.html - -// +build amd64,!gccgo,!appengine - -#include "const_amd64.h" - -// func square(out, in *[5]uint64) -TEXT ·square(SB),7,$0-16 - MOVQ out+0(FP), DI - MOVQ in+8(FP), SI - - MOVQ 0(SI),AX - MULQ 0(SI) - MOVQ AX,CX - MOVQ DX,R8 - MOVQ 0(SI),AX - SHLQ $1,AX - MULQ 8(SI) - MOVQ AX,R9 - MOVQ DX,R10 - MOVQ 0(SI),AX - SHLQ $1,AX - MULQ 16(SI) - MOVQ AX,R11 - MOVQ DX,R12 - MOVQ 0(SI),AX - SHLQ $1,AX - MULQ 24(SI) - MOVQ AX,R13 - MOVQ DX,R14 - MOVQ 0(SI),AX - SHLQ $1,AX - MULQ 32(SI) - MOVQ AX,R15 - MOVQ DX,BX - MOVQ 8(SI),AX - MULQ 8(SI) - ADDQ AX,R11 - ADCQ DX,R12 - MOVQ 8(SI),AX - SHLQ $1,AX - MULQ 16(SI) - ADDQ AX,R13 - ADCQ DX,R14 - MOVQ 8(SI),AX - SHLQ $1,AX - MULQ 24(SI) - ADDQ AX,R15 - ADCQ DX,BX - MOVQ 8(SI),DX - IMUL3Q $38,DX,AX - MULQ 32(SI) - ADDQ AX,CX - ADCQ DX,R8 - MOVQ 16(SI),AX - MULQ 16(SI) - ADDQ AX,R15 - ADCQ DX,BX - MOVQ 16(SI),DX - IMUL3Q $38,DX,AX - MULQ 24(SI) - ADDQ AX,CX - ADCQ DX,R8 - MOVQ 16(SI),DX - IMUL3Q $38,DX,AX - MULQ 32(SI) - ADDQ AX,R9 - ADCQ DX,R10 - MOVQ 24(SI),DX - IMUL3Q $19,DX,AX - MULQ 24(SI) - ADDQ AX,R9 - ADCQ DX,R10 - MOVQ 24(SI),DX - IMUL3Q $38,DX,AX - MULQ 32(SI) - ADDQ AX,R11 - ADCQ DX,R12 - MOVQ 32(SI),DX - IMUL3Q $19,DX,AX - MULQ 32(SI) - ADDQ AX,R13 - ADCQ DX,R14 - MOVQ $REDMASK51,SI - SHLQ $13,R8:CX - ANDQ SI,CX - SHLQ $13,R10:R9 - ANDQ SI,R9 - ADDQ R8,R9 - SHLQ $13,R12:R11 - ANDQ SI,R11 - ADDQ R10,R11 - SHLQ $13,R14:R13 - ANDQ SI,R13 - ADDQ R12,R13 - SHLQ $13,BX:R15 - ANDQ SI,R15 - ADDQ R14,R15 - IMUL3Q $19,BX,DX - ADDQ DX,CX - MOVQ CX,DX - SHRQ $51,DX - ADDQ R9,DX - ANDQ SI,CX - MOVQ DX,R8 - SHRQ $51,DX - ADDQ R11,DX - ANDQ SI,R8 - MOVQ DX,R9 - SHRQ $51,DX - ADDQ R13,DX - ANDQ SI,R9 - MOVQ DX,AX - SHRQ $51,DX - ADDQ R15,DX - ANDQ SI,AX - MOVQ DX,R10 - SHRQ $51,DX - IMUL3Q $19,DX,DX - ADDQ DX,CX - ANDQ SI,R10 - MOVQ CX,0(DI) - MOVQ R8,8(DI) - MOVQ R9,16(DI) - MOVQ AX,24(DI) - MOVQ R10,32(DI) - RET diff --git a/vendor/golang.org/x/crypto/internal/chacha20/chacha_arm64.go b/vendor/golang.org/x/crypto/internal/chacha20/chacha_arm64.go deleted file mode 100644 index ad74e23aef..0000000000 --- a/vendor/golang.org/x/crypto/internal/chacha20/chacha_arm64.go +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright 2018 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build go1.11 -// +build !gccgo - -package chacha20 - -const ( - haveAsm = true - bufSize = 256 -) - -//go:noescape -func xorKeyStreamVX(dst, src []byte, key *[8]uint32, nonce *[3]uint32, counter *uint32) - -func (c *Cipher) xorKeyStreamAsm(dst, src []byte) { - - if len(src) >= bufSize { - xorKeyStreamVX(dst, src, &c.key, &c.nonce, &c.counter) - } - - if len(src)%bufSize != 0 { - i := len(src) - len(src)%bufSize - c.buf = [bufSize]byte{} - copy(c.buf[:], src[i:]) - xorKeyStreamVX(c.buf[:], c.buf[:], &c.key, &c.nonce, &c.counter) - c.len = bufSize - copy(dst[i:], c.buf[:len(src)%bufSize]) - } -} diff --git a/vendor/golang.org/x/crypto/internal/chacha20/chacha_generic.go b/vendor/golang.org/x/crypto/internal/chacha20/chacha_generic.go deleted file mode 100644 index 6570847f5e..0000000000 --- a/vendor/golang.org/x/crypto/internal/chacha20/chacha_generic.go +++ /dev/null @@ -1,264 +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 ChaCha20 implements the core ChaCha20 function as specified -// in https://tools.ietf.org/html/rfc7539#section-2.3. -package chacha20 - -import ( - "crypto/cipher" - "encoding/binary" - - "golang.org/x/crypto/internal/subtle" -) - -// assert that *Cipher implements cipher.Stream -var _ cipher.Stream = (*Cipher)(nil) - -// Cipher is a stateful instance of ChaCha20 using a particular key -// and nonce. A *Cipher implements the cipher.Stream interface. -type Cipher struct { - key [8]uint32 - counter uint32 // incremented after each block - nonce [3]uint32 - buf [bufSize]byte // buffer for unused keystream bytes - len int // number of unused keystream bytes at end of buf -} - -// New creates a new ChaCha20 stream cipher with the given key and nonce. -// The initial counter value is set to 0. -func New(key [8]uint32, nonce [3]uint32) *Cipher { - return &Cipher{key: key, nonce: nonce} -} - -// ChaCha20 constants spelling "expand 32-byte k" -const ( - j0 uint32 = 0x61707865 - j1 uint32 = 0x3320646e - j2 uint32 = 0x79622d32 - j3 uint32 = 0x6b206574 -) - -func quarterRound(a, b, c, d uint32) (uint32, uint32, uint32, uint32) { - a += b - d ^= a - d = (d << 16) | (d >> 16) - c += d - b ^= c - b = (b << 12) | (b >> 20) - a += b - d ^= a - d = (d << 8) | (d >> 24) - c += d - b ^= c - b = (b << 7) | (b >> 25) - return a, b, c, d -} - -// XORKeyStream XORs each byte in the given slice with a byte from the -// cipher's key stream. Dst and src must overlap entirely or not at all. -// -// If len(dst) < len(src), XORKeyStream will panic. It is acceptable -// to pass a dst bigger than src, and in that case, XORKeyStream will -// only update dst[:len(src)] and will not touch the rest of dst. -// -// Multiple calls to XORKeyStream behave as if the concatenation of -// the src buffers was passed in a single run. That is, Cipher -// maintains state and does not reset at each XORKeyStream call. -func (s *Cipher) XORKeyStream(dst, src []byte) { - if len(dst) < len(src) { - panic("chacha20: output smaller than input") - } - if subtle.InexactOverlap(dst[:len(src)], src) { - panic("chacha20: invalid buffer overlap") - } - - // xor src with buffered keystream first - if s.len != 0 { - buf := s.buf[len(s.buf)-s.len:] - if len(src) < len(buf) { - buf = buf[:len(src)] - } - td, ts := dst[:len(buf)], src[:len(buf)] // BCE hint - for i, b := range buf { - td[i] = ts[i] ^ b - } - s.len -= len(buf) - if s.len != 0 { - return - } - s.buf = [len(s.buf)]byte{} // zero the empty buffer - src = src[len(buf):] - dst = dst[len(buf):] - } - - if len(src) == 0 { - return - } - if haveAsm { - if uint64(len(src))+uint64(s.counter)*64 > (1<<38)-64 { - panic("chacha20: counter overflow") - } - s.xorKeyStreamAsm(dst, src) - return - } - - // set up a 64-byte buffer to pad out the final block if needed - // (hoisted out of the main loop to avoid spills) - rem := len(src) % 64 // length of final block - fin := len(src) - rem // index of final block - if rem > 0 { - copy(s.buf[len(s.buf)-64:], src[fin:]) - } - - // pre-calculate most of the first round - s1, s5, s9, s13 := quarterRound(j1, s.key[1], s.key[5], s.nonce[0]) - s2, s6, s10, s14 := quarterRound(j2, s.key[2], s.key[6], s.nonce[1]) - s3, s7, s11, s15 := quarterRound(j3, s.key[3], s.key[7], s.nonce[2]) - - n := len(src) - src, dst = src[:n:n], dst[:n:n] // BCE hint - for i := 0; i < n; i += 64 { - // calculate the remainder of the first round - s0, s4, s8, s12 := quarterRound(j0, s.key[0], s.key[4], s.counter) - - // execute the second round - x0, x5, x10, x15 := quarterRound(s0, s5, s10, s15) - x1, x6, x11, x12 := quarterRound(s1, s6, s11, s12) - x2, x7, x8, x13 := quarterRound(s2, s7, s8, s13) - x3, x4, x9, x14 := quarterRound(s3, s4, s9, s14) - - // execute the remaining 18 rounds - for i := 0; i < 9; i++ { - x0, x4, x8, x12 = quarterRound(x0, x4, x8, x12) - x1, x5, x9, x13 = quarterRound(x1, x5, x9, x13) - x2, x6, x10, x14 = quarterRound(x2, x6, x10, x14) - x3, x7, x11, x15 = quarterRound(x3, x7, x11, x15) - - x0, x5, x10, x15 = quarterRound(x0, x5, x10, x15) - x1, x6, x11, x12 = quarterRound(x1, x6, x11, x12) - x2, x7, x8, x13 = quarterRound(x2, x7, x8, x13) - x3, x4, x9, x14 = quarterRound(x3, x4, x9, x14) - } - - x0 += j0 - x1 += j1 - x2 += j2 - x3 += j3 - - x4 += s.key[0] - x5 += s.key[1] - x6 += s.key[2] - x7 += s.key[3] - x8 += s.key[4] - x9 += s.key[5] - x10 += s.key[6] - x11 += s.key[7] - - x12 += s.counter - x13 += s.nonce[0] - x14 += s.nonce[1] - x15 += s.nonce[2] - - // increment the counter - s.counter += 1 - if s.counter == 0 { - panic("chacha20: counter overflow") - } - - // pad to 64 bytes if needed - in, out := src[i:], dst[i:] - if i == fin { - // src[fin:] has already been copied into s.buf before - // the main loop - in, out = s.buf[len(s.buf)-64:], s.buf[len(s.buf)-64:] - } - in, out = in[:64], out[:64] // BCE hint - - // XOR the key stream with the source and write out the result - xor(out[0:], in[0:], x0) - xor(out[4:], in[4:], x1) - xor(out[8:], in[8:], x2) - xor(out[12:], in[12:], x3) - xor(out[16:], in[16:], x4) - xor(out[20:], in[20:], x5) - xor(out[24:], in[24:], x6) - xor(out[28:], in[28:], x7) - xor(out[32:], in[32:], x8) - xor(out[36:], in[36:], x9) - xor(out[40:], in[40:], x10) - xor(out[44:], in[44:], x11) - xor(out[48:], in[48:], x12) - xor(out[52:], in[52:], x13) - xor(out[56:], in[56:], x14) - xor(out[60:], in[60:], x15) - } - // copy any trailing bytes out of the buffer and into dst - if rem != 0 { - s.len = 64 - rem - copy(dst[fin:], s.buf[len(s.buf)-64:]) - } -} - -// Advance discards bytes in the key stream until the next 64 byte block -// boundary is reached and updates the counter accordingly. If the key -// stream is already at a block boundary no bytes will be discarded and -// the counter will be unchanged. -func (s *Cipher) Advance() { - s.len -= s.len % 64 - if s.len == 0 { - s.buf = [len(s.buf)]byte{} - } -} - -// XORKeyStream crypts bytes from in to out using the given key and counters. -// In and out must overlap entirely or not at all. Counter contains the raw -// ChaCha20 counter bytes (i.e. block counter followed by nonce). -func XORKeyStream(out, in []byte, counter *[16]byte, key *[32]byte) { - s := Cipher{ - key: [8]uint32{ - binary.LittleEndian.Uint32(key[0:4]), - binary.LittleEndian.Uint32(key[4:8]), - binary.LittleEndian.Uint32(key[8:12]), - binary.LittleEndian.Uint32(key[12:16]), - binary.LittleEndian.Uint32(key[16:20]), - binary.LittleEndian.Uint32(key[20:24]), - binary.LittleEndian.Uint32(key[24:28]), - binary.LittleEndian.Uint32(key[28:32]), - }, - nonce: [3]uint32{ - binary.LittleEndian.Uint32(counter[4:8]), - binary.LittleEndian.Uint32(counter[8:12]), - binary.LittleEndian.Uint32(counter[12:16]), - }, - counter: binary.LittleEndian.Uint32(counter[0:4]), - } - s.XORKeyStream(out, in) -} - -// HChaCha20 uses the ChaCha20 core to generate a derived key from a key and a -// nonce. It should only be used as part of the XChaCha20 construction. -func HChaCha20(key *[8]uint32, nonce *[4]uint32) [8]uint32 { - x0, x1, x2, x3 := j0, j1, j2, j3 - x4, x5, x6, x7 := key[0], key[1], key[2], key[3] - x8, x9, x10, x11 := key[4], key[5], key[6], key[7] - x12, x13, x14, x15 := nonce[0], nonce[1], nonce[2], nonce[3] - - for i := 0; i < 10; i++ { - x0, x4, x8, x12 = quarterRound(x0, x4, x8, x12) - x1, x5, x9, x13 = quarterRound(x1, x5, x9, x13) - x2, x6, x10, x14 = quarterRound(x2, x6, x10, x14) - x3, x7, x11, x15 = quarterRound(x3, x7, x11, x15) - - x0, x5, x10, x15 = quarterRound(x0, x5, x10, x15) - x1, x6, x11, x12 = quarterRound(x1, x6, x11, x12) - x2, x7, x8, x13 = quarterRound(x2, x7, x8, x13) - x3, x4, x9, x14 = quarterRound(x3, x4, x9, x14) - } - - var out [8]uint32 - out[0], out[1], out[2], out[3] = x0, x1, x2, x3 - out[4], out[5], out[6], out[7] = x12, x13, x14, x15 - return out -} diff --git a/vendor/golang.org/x/crypto/internal/chacha20/chacha_s390x.go b/vendor/golang.org/x/crypto/internal/chacha20/chacha_s390x.go deleted file mode 100644 index aad645b447..0000000000 --- a/vendor/golang.org/x/crypto/internal/chacha20/chacha_s390x.go +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright 2018 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build s390x,!gccgo,!appengine - -package chacha20 - -import ( - "golang.org/x/sys/cpu" -) - -var haveAsm = cpu.S390X.HasVX - -const bufSize = 256 - -// xorKeyStreamVX is an assembly implementation of XORKeyStream. It must only -// be called when the vector facility is available. -// Implementation in asm_s390x.s. -//go:noescape -func xorKeyStreamVX(dst, src []byte, key *[8]uint32, nonce *[3]uint32, counter *uint32, buf *[256]byte, len *int) - -func (c *Cipher) xorKeyStreamAsm(dst, src []byte) { - xorKeyStreamVX(dst, src, &c.key, &c.nonce, &c.counter, &c.buf, &c.len) -} - -// EXRL targets, DO NOT CALL! -func mvcSrcToBuf() -func mvcBufToDst() diff --git a/vendor/golang.org/x/crypto/poly1305/sum_arm.go b/vendor/golang.org/x/crypto/poly1305/sum_arm.go deleted file mode 100644 index 5dc321c2f3..0000000000 --- a/vendor/golang.org/x/crypto/poly1305/sum_arm.go +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright 2015 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build arm,!gccgo,!appengine,!nacl - -package poly1305 - -// This function is implemented in sum_arm.s -//go:noescape -func poly1305_auth_armv6(out *[16]byte, m *byte, mlen uint32, key *[32]byte) - -// Sum generates an authenticator for m using a one-time key and puts the -// 16-byte result into out. Authenticating two different messages with the same -// key allows an attacker to forge messages at will. -func Sum(out *[16]byte, m []byte, key *[32]byte) { - var mPtr *byte - if len(m) > 0 { - mPtr = &m[0] - } - poly1305_auth_armv6(out, mPtr, uint32(len(m)), key) -} diff --git a/vendor/golang.org/x/crypto/poly1305/sum_arm.s b/vendor/golang.org/x/crypto/poly1305/sum_arm.s deleted file mode 100644 index f70b4ac484..0000000000 --- a/vendor/golang.org/x/crypto/poly1305/sum_arm.s +++ /dev/null @@ -1,427 +0,0 @@ -// Copyright 2015 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build arm,!gccgo,!appengine,!nacl - -#include "textflag.h" - -// This code was translated into a form compatible with 5a from the public -// domain source by Andrew Moon: github.com/floodyberry/poly1305-opt/blob/master/app/extensions/poly1305. - -DATA ·poly1305_init_constants_armv6<>+0x00(SB)/4, $0x3ffffff -DATA ·poly1305_init_constants_armv6<>+0x04(SB)/4, $0x3ffff03 -DATA ·poly1305_init_constants_armv6<>+0x08(SB)/4, $0x3ffc0ff -DATA ·poly1305_init_constants_armv6<>+0x0c(SB)/4, $0x3f03fff -DATA ·poly1305_init_constants_armv6<>+0x10(SB)/4, $0x00fffff -GLOBL ·poly1305_init_constants_armv6<>(SB), 8, $20 - -// Warning: the linker may use R11 to synthesize certain instructions. Please -// take care and verify that no synthetic instructions use it. - -TEXT poly1305_init_ext_armv6<>(SB), NOSPLIT, $0 - // Needs 16 bytes of stack and 64 bytes of space pointed to by R0. (It - // might look like it's only 60 bytes of space but the final four bytes - // will be written by another function.) We need to skip over four - // bytes of stack because that's saving the value of 'g'. - ADD $4, R13, R8 - MOVM.IB [R4-R7], (R8) - MOVM.IA.W (R1), [R2-R5] - MOVW $·poly1305_init_constants_armv6<>(SB), R7 - MOVW R2, R8 - MOVW R2>>26, R9 - MOVW R3>>20, g - MOVW R4>>14, R11 - MOVW R5>>8, R12 - ORR R3<<6, R9, R9 - ORR R4<<12, g, g - ORR R5<<18, R11, R11 - MOVM.IA (R7), [R2-R6] - AND R8, R2, R2 - AND R9, R3, R3 - AND g, R4, R4 - AND R11, R5, R5 - AND R12, R6, R6 - MOVM.IA.W [R2-R6], (R0) - EOR R2, R2, R2 - EOR R3, R3, R3 - EOR R4, R4, R4 - EOR R5, R5, R5 - EOR R6, R6, R6 - MOVM.IA.W [R2-R6], (R0) - MOVM.IA.W (R1), [R2-R5] - MOVM.IA [R2-R6], (R0) - ADD $20, R13, R0 - MOVM.DA (R0), [R4-R7] - RET - -#define MOVW_UNALIGNED(Rsrc, Rdst, Rtmp, offset) \ - MOVBU (offset+0)(Rsrc), Rtmp; \ - MOVBU Rtmp, (offset+0)(Rdst); \ - MOVBU (offset+1)(Rsrc), Rtmp; \ - MOVBU Rtmp, (offset+1)(Rdst); \ - MOVBU (offset+2)(Rsrc), Rtmp; \ - MOVBU Rtmp, (offset+2)(Rdst); \ - MOVBU (offset+3)(Rsrc), Rtmp; \ - MOVBU Rtmp, (offset+3)(Rdst) - -TEXT poly1305_blocks_armv6<>(SB), NOSPLIT, $0 - // Needs 24 bytes of stack for saved registers and then 88 bytes of - // scratch space after that. We assume that 24 bytes at (R13) have - // already been used: four bytes for the link register saved in the - // prelude of poly1305_auth_armv6, four bytes for saving the value of g - // in that function and 16 bytes of scratch space used around - // poly1305_finish_ext_armv6_skip1. - ADD $24, R13, R12 - MOVM.IB [R4-R8, R14], (R12) - MOVW R0, 88(R13) - MOVW R1, 92(R13) - MOVW R2, 96(R13) - MOVW R1, R14 - MOVW R2, R12 - MOVW 56(R0), R8 - WORD $0xe1180008 // TST R8, R8 not working see issue 5921 - EOR R6, R6, R6 - MOVW.EQ $(1<<24), R6 - MOVW R6, 84(R13) - ADD $116, R13, g - MOVM.IA (R0), [R0-R9] - MOVM.IA [R0-R4], (g) - CMP $16, R12 - BLO poly1305_blocks_armv6_done - -poly1305_blocks_armv6_mainloop: - WORD $0xe31e0003 // TST R14, #3 not working see issue 5921 - BEQ poly1305_blocks_armv6_mainloop_aligned - ADD $100, R13, g - MOVW_UNALIGNED(R14, g, R0, 0) - MOVW_UNALIGNED(R14, g, R0, 4) - MOVW_UNALIGNED(R14, g, R0, 8) - MOVW_UNALIGNED(R14, g, R0, 12) - MOVM.IA (g), [R0-R3] - ADD $16, R14 - B poly1305_blocks_armv6_mainloop_loaded - -poly1305_blocks_armv6_mainloop_aligned: - MOVM.IA.W (R14), [R0-R3] - -poly1305_blocks_armv6_mainloop_loaded: - MOVW R0>>26, g - MOVW R1>>20, R11 - MOVW R2>>14, R12 - MOVW R14, 92(R13) - MOVW R3>>8, R4 - ORR R1<<6, g, g - ORR R2<<12, R11, R11 - ORR R3<<18, R12, R12 - BIC $0xfc000000, R0, R0 - BIC $0xfc000000, g, g - MOVW 84(R13), R3 - BIC $0xfc000000, R11, R11 - BIC $0xfc000000, R12, R12 - ADD R0, R5, R5 - ADD g, R6, R6 - ORR R3, R4, R4 - ADD R11, R7, R7 - ADD $116, R13, R14 - ADD R12, R8, R8 - ADD R4, R9, R9 - MOVM.IA (R14), [R0-R4] - MULLU R4, R5, (R11, g) - MULLU R3, R5, (R14, R12) - MULALU R3, R6, (R11, g) - MULALU R2, R6, (R14, R12) - MULALU R2, R7, (R11, g) - MULALU R1, R7, (R14, R12) - ADD R4<<2, R4, R4 - ADD R3<<2, R3, R3 - MULALU R1, R8, (R11, g) - MULALU R0, R8, (R14, R12) - MULALU R0, R9, (R11, g) - MULALU R4, R9, (R14, R12) - MOVW g, 76(R13) - MOVW R11, 80(R13) - MOVW R12, 68(R13) - MOVW R14, 72(R13) - MULLU R2, R5, (R11, g) - MULLU R1, R5, (R14, R12) - MULALU R1, R6, (R11, g) - MULALU R0, R6, (R14, R12) - MULALU R0, R7, (R11, g) - MULALU R4, R7, (R14, R12) - ADD R2<<2, R2, R2 - ADD R1<<2, R1, R1 - MULALU R4, R8, (R11, g) - MULALU R3, R8, (R14, R12) - MULALU R3, R9, (R11, g) - MULALU R2, R9, (R14, R12) - MOVW g, 60(R13) - MOVW R11, 64(R13) - MOVW R12, 52(R13) - MOVW R14, 56(R13) - MULLU R0, R5, (R11, g) - MULALU R4, R6, (R11, g) - MULALU R3, R7, (R11, g) - MULALU R2, R8, (R11, g) - MULALU R1, R9, (R11, g) - ADD $52, R13, R0 - MOVM.IA (R0), [R0-R7] - MOVW g>>26, R12 - MOVW R4>>26, R14 - ORR R11<<6, R12, R12 - ORR R5<<6, R14, R14 - BIC $0xfc000000, g, g - BIC $0xfc000000, R4, R4 - ADD.S R12, R0, R0 - ADC $0, R1, R1 - ADD.S R14, R6, R6 - ADC $0, R7, R7 - MOVW R0>>26, R12 - MOVW R6>>26, R14 - ORR R1<<6, R12, R12 - ORR R7<<6, R14, R14 - BIC $0xfc000000, R0, R0 - BIC $0xfc000000, R6, R6 - ADD R14<<2, R14, R14 - ADD.S R12, R2, R2 - ADC $0, R3, R3 - ADD R14, g, g - MOVW R2>>26, R12 - MOVW g>>26, R14 - ORR R3<<6, R12, R12 - BIC $0xfc000000, g, R5 - BIC $0xfc000000, R2, R7 - ADD R12, R4, R4 - ADD R14, R0, R0 - MOVW R4>>26, R12 - BIC $0xfc000000, R4, R8 - ADD R12, R6, R9 - MOVW 96(R13), R12 - MOVW 92(R13), R14 - MOVW R0, R6 - CMP $32, R12 - SUB $16, R12, R12 - MOVW R12, 96(R13) - BHS poly1305_blocks_armv6_mainloop - -poly1305_blocks_armv6_done: - MOVW 88(R13), R12 - MOVW R5, 20(R12) - MOVW R6, 24(R12) - MOVW R7, 28(R12) - MOVW R8, 32(R12) - MOVW R9, 36(R12) - ADD $48, R13, R0 - MOVM.DA (R0), [R4-R8, R14] - RET - -#define MOVHUP_UNALIGNED(Rsrc, Rdst, Rtmp) \ - MOVBU.P 1(Rsrc), Rtmp; \ - MOVBU.P Rtmp, 1(Rdst); \ - MOVBU.P 1(Rsrc), Rtmp; \ - MOVBU.P Rtmp, 1(Rdst) - -#define MOVWP_UNALIGNED(Rsrc, Rdst, Rtmp) \ - MOVHUP_UNALIGNED(Rsrc, Rdst, Rtmp); \ - MOVHUP_UNALIGNED(Rsrc, Rdst, Rtmp) - -// func poly1305_auth_armv6(out *[16]byte, m *byte, mlen uint32, key *[32]key) -TEXT ·poly1305_auth_armv6(SB), $196-16 - // The value 196, just above, is the sum of 64 (the size of the context - // structure) and 132 (the amount of stack needed). - // - // At this point, the stack pointer (R13) has been moved down. It - // points to the saved link register and there's 196 bytes of free - // space above it. - // - // The stack for this function looks like: - // - // +--------------------- - // | - // | 64 bytes of context structure - // | - // +--------------------- - // | - // | 112 bytes for poly1305_blocks_armv6 - // | - // +--------------------- - // | 16 bytes of final block, constructed at - // | poly1305_finish_ext_armv6_skip8 - // +--------------------- - // | four bytes of saved 'g' - // +--------------------- - // | lr, saved by prelude <- R13 points here - // +--------------------- - MOVW g, 4(R13) - - MOVW out+0(FP), R4 - MOVW m+4(FP), R5 - MOVW mlen+8(FP), R6 - MOVW key+12(FP), R7 - - ADD $136, R13, R0 // 136 = 4 + 4 + 16 + 112 - MOVW R7, R1 - - // poly1305_init_ext_armv6 will write to the stack from R13+4, but - // that's ok because none of the other values have been written yet. - BL poly1305_init_ext_armv6<>(SB) - BIC.S $15, R6, R2 - BEQ poly1305_auth_armv6_noblocks - ADD $136, R13, R0 - MOVW R5, R1 - ADD R2, R5, R5 - SUB R2, R6, R6 - BL poly1305_blocks_armv6<>(SB) - -poly1305_auth_armv6_noblocks: - ADD $136, R13, R0 - MOVW R5, R1 - MOVW R6, R2 - MOVW R4, R3 - - MOVW R0, R5 - MOVW R1, R6 - MOVW R2, R7 - MOVW R3, R8 - AND.S R2, R2, R2 - BEQ poly1305_finish_ext_armv6_noremaining - EOR R0, R0 - ADD $8, R13, R9 // 8 = offset to 16 byte scratch space - MOVW R0, (R9) - MOVW R0, 4(R9) - MOVW R0, 8(R9) - MOVW R0, 12(R9) - WORD $0xe3110003 // TST R1, #3 not working see issue 5921 - BEQ poly1305_finish_ext_armv6_aligned - WORD $0xe3120008 // TST R2, #8 not working see issue 5921 - BEQ poly1305_finish_ext_armv6_skip8 - MOVWP_UNALIGNED(R1, R9, g) - MOVWP_UNALIGNED(R1, R9, g) - -poly1305_finish_ext_armv6_skip8: - WORD $0xe3120004 // TST $4, R2 not working see issue 5921 - BEQ poly1305_finish_ext_armv6_skip4 - MOVWP_UNALIGNED(R1, R9, g) - -poly1305_finish_ext_armv6_skip4: - WORD $0xe3120002 // TST $2, R2 not working see issue 5921 - BEQ poly1305_finish_ext_armv6_skip2 - MOVHUP_UNALIGNED(R1, R9, g) - B poly1305_finish_ext_armv6_skip2 - -poly1305_finish_ext_armv6_aligned: - WORD $0xe3120008 // TST R2, #8 not working see issue 5921 - BEQ poly1305_finish_ext_armv6_skip8_aligned - MOVM.IA.W (R1), [g-R11] - MOVM.IA.W [g-R11], (R9) - -poly1305_finish_ext_armv6_skip8_aligned: - WORD $0xe3120004 // TST $4, R2 not working see issue 5921 - BEQ poly1305_finish_ext_armv6_skip4_aligned - MOVW.P 4(R1), g - MOVW.P g, 4(R9) - -poly1305_finish_ext_armv6_skip4_aligned: - WORD $0xe3120002 // TST $2, R2 not working see issue 5921 - BEQ poly1305_finish_ext_armv6_skip2 - MOVHU.P 2(R1), g - MOVH.P g, 2(R9) - -poly1305_finish_ext_armv6_skip2: - WORD $0xe3120001 // TST $1, R2 not working see issue 5921 - BEQ poly1305_finish_ext_armv6_skip1 - MOVBU.P 1(R1), g - MOVBU.P g, 1(R9) - -poly1305_finish_ext_armv6_skip1: - MOVW $1, R11 - MOVBU R11, 0(R9) - MOVW R11, 56(R5) - MOVW R5, R0 - ADD $8, R13, R1 - MOVW $16, R2 - BL poly1305_blocks_armv6<>(SB) - -poly1305_finish_ext_armv6_noremaining: - MOVW 20(R5), R0 - MOVW 24(R5), R1 - MOVW 28(R5), R2 - MOVW 32(R5), R3 - MOVW 36(R5), R4 - MOVW R4>>26, R12 - BIC $0xfc000000, R4, R4 - ADD R12<<2, R12, R12 - ADD R12, R0, R0 - MOVW R0>>26, R12 - BIC $0xfc000000, R0, R0 - ADD R12, R1, R1 - MOVW R1>>26, R12 - BIC $0xfc000000, R1, R1 - ADD R12, R2, R2 - MOVW R2>>26, R12 - BIC $0xfc000000, R2, R2 - ADD R12, R3, R3 - MOVW R3>>26, R12 - BIC $0xfc000000, R3, R3 - ADD R12, R4, R4 - ADD $5, R0, R6 - MOVW R6>>26, R12 - BIC $0xfc000000, R6, R6 - ADD R12, R1, R7 - MOVW R7>>26, R12 - BIC $0xfc000000, R7, R7 - ADD R12, R2, g - MOVW g>>26, R12 - BIC $0xfc000000, g, g - ADD R12, R3, R11 - MOVW $-(1<<26), R12 - ADD R11>>26, R12, R12 - BIC $0xfc000000, R11, R11 - ADD R12, R4, R9 - MOVW R9>>31, R12 - SUB $1, R12 - AND R12, R6, R6 - AND R12, R7, R7 - AND R12, g, g - AND R12, R11, R11 - AND R12, R9, R9 - MVN R12, R12 - AND R12, R0, R0 - AND R12, R1, R1 - AND R12, R2, R2 - AND R12, R3, R3 - AND R12, R4, R4 - ORR R6, R0, R0 - ORR R7, R1, R1 - ORR g, R2, R2 - ORR R11, R3, R3 - ORR R9, R4, R4 - ORR R1<<26, R0, R0 - MOVW R1>>6, R1 - ORR R2<<20, R1, R1 - MOVW R2>>12, R2 - ORR R3<<14, R2, R2 - MOVW R3>>18, R3 - ORR R4<<8, R3, R3 - MOVW 40(R5), R6 - MOVW 44(R5), R7 - MOVW 48(R5), g - MOVW 52(R5), R11 - ADD.S R6, R0, R0 - ADC.S R7, R1, R1 - ADC.S g, R2, R2 - ADC.S R11, R3, R3 - MOVM.IA [R0-R3], (R8) - MOVW R5, R12 - EOR R0, R0, R0 - EOR R1, R1, R1 - EOR R2, R2, R2 - EOR R3, R3, R3 - EOR R4, R4, R4 - EOR R5, R5, R5 - EOR R6, R6, R6 - EOR R7, R7, R7 - MOVM.IA.W [R0-R7], (R12) - MOVM.IA [R0-R7], (R12) - MOVW 4(R13), g - RET diff --git a/vendor/golang.org/x/crypto/poly1305/sum_noasm.go b/vendor/golang.org/x/crypto/poly1305/sum_noasm.go deleted file mode 100644 index fcdef46ab6..0000000000 --- a/vendor/golang.org/x/crypto/poly1305/sum_noasm.go +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright 2018 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build s390x,!go1.11 !arm,!amd64,!s390x gccgo appengine nacl - -package poly1305 - -// Sum generates an authenticator for msg using a one-time key and puts the -// 16-byte result into out. Authenticating two different messages with the same -// key allows an attacker to forge messages at will. -func Sum(out *[TagSize]byte, msg []byte, key *[32]byte) { - h := newMAC(key) - h.Write(msg) - h.Sum(out) -} diff --git a/vendor/golang.org/x/crypto/poly1305/sum_vmsl_s390x.s b/vendor/golang.org/x/crypto/poly1305/sum_vmsl_s390x.s deleted file mode 100644 index e60bbc1d7f..0000000000 --- a/vendor/golang.org/x/crypto/poly1305/sum_vmsl_s390x.s +++ /dev/null @@ -1,909 +0,0 @@ -// Copyright 2018 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build s390x,go1.11,!gccgo,!appengine - -#include "textflag.h" - -// Implementation of Poly1305 using the vector facility (vx) and the VMSL instruction. - -// constants -#define EX0 V1 -#define EX1 V2 -#define EX2 V3 - -// temporaries -#define T_0 V4 -#define T_1 V5 -#define T_2 V6 -#define T_3 V7 -#define T_4 V8 -#define T_5 V9 -#define T_6 V10 -#define T_7 V11 -#define T_8 V12 -#define T_9 V13 -#define T_10 V14 - -// r**2 & r**4 -#define R_0 V15 -#define R_1 V16 -#define R_2 V17 -#define R5_1 V18 -#define R5_2 V19 -// key (r) -#define RSAVE_0 R7 -#define RSAVE_1 R8 -#define RSAVE_2 R9 -#define R5SAVE_1 R10 -#define R5SAVE_2 R11 - -// message block -#define M0 V20 -#define M1 V21 -#define M2 V22 -#define M3 V23 -#define M4 V24 -#define M5 V25 - -// accumulator -#define H0_0 V26 -#define H1_0 V27 -#define H2_0 V28 -#define H0_1 V29 -#define H1_1 V30 -#define H2_1 V31 - -GLOBL ·keyMask<>(SB), RODATA, $16 -DATA ·keyMask<>+0(SB)/8, $0xffffff0ffcffff0f -DATA ·keyMask<>+8(SB)/8, $0xfcffff0ffcffff0f - -GLOBL ·bswapMask<>(SB), RODATA, $16 -DATA ·bswapMask<>+0(SB)/8, $0x0f0e0d0c0b0a0908 -DATA ·bswapMask<>+8(SB)/8, $0x0706050403020100 - -GLOBL ·constants<>(SB), RODATA, $48 -// EX0 -DATA ·constants<>+0(SB)/8, $0x18191a1b1c1d1e1f -DATA ·constants<>+8(SB)/8, $0x0000050403020100 -// EX1 -DATA ·constants<>+16(SB)/8, $0x18191a1b1c1d1e1f -DATA ·constants<>+24(SB)/8, $0x00000a0908070605 -// EX2 -DATA ·constants<>+32(SB)/8, $0x18191a1b1c1d1e1f -DATA ·constants<>+40(SB)/8, $0x0000000f0e0d0c0b - -GLOBL ·c<>(SB), RODATA, $48 -// EX0 -DATA ·c<>+0(SB)/8, $0x0000050403020100 -DATA ·c<>+8(SB)/8, $0x0000151413121110 -// EX1 -DATA ·c<>+16(SB)/8, $0x00000a0908070605 -DATA ·c<>+24(SB)/8, $0x00001a1918171615 -// EX2 -DATA ·c<>+32(SB)/8, $0x0000000f0e0d0c0b -DATA ·c<>+40(SB)/8, $0x0000001f1e1d1c1b - -GLOBL ·reduce<>(SB), RODATA, $32 -// 44 bit -DATA ·reduce<>+0(SB)/8, $0x0 -DATA ·reduce<>+8(SB)/8, $0xfffffffffff -// 42 bit -DATA ·reduce<>+16(SB)/8, $0x0 -DATA ·reduce<>+24(SB)/8, $0x3ffffffffff - -// h = (f*g) % (2**130-5) [partial reduction] -// uses T_0...T_9 temporary registers -// input: m02_0, m02_1, m02_2, m13_0, m13_1, m13_2, r_0, r_1, r_2, r5_1, r5_2, m4_0, m4_1, m4_2, m5_0, m5_1, m5_2 -// temp: t0, t1, t2, t3, t4, t5, t6, t7, t8, t9 -// output: m02_0, m02_1, m02_2, m13_0, m13_1, m13_2 -#define MULTIPLY(m02_0, m02_1, m02_2, m13_0, m13_1, m13_2, r_0, r_1, r_2, r5_1, r5_2, m4_0, m4_1, m4_2, m5_0, m5_1, m5_2, t0, t1, t2, t3, t4, t5, t6, t7, t8, t9) \ - \ // Eliminate the dependency for the last 2 VMSLs - VMSLG m02_0, r_2, m4_2, m4_2 \ - VMSLG m13_0, r_2, m5_2, m5_2 \ // 8 VMSLs pipelined - VMSLG m02_0, r_0, m4_0, m4_0 \ - VMSLG m02_1, r5_2, V0, T_0 \ - VMSLG m02_0, r_1, m4_1, m4_1 \ - VMSLG m02_1, r_0, V0, T_1 \ - VMSLG m02_1, r_1, V0, T_2 \ - VMSLG m02_2, r5_1, V0, T_3 \ - VMSLG m02_2, r5_2, V0, T_4 \ - VMSLG m13_0, r_0, m5_0, m5_0 \ - VMSLG m13_1, r5_2, V0, T_5 \ - VMSLG m13_0, r_1, m5_1, m5_1 \ - VMSLG m13_1, r_0, V0, T_6 \ - VMSLG m13_1, r_1, V0, T_7 \ - VMSLG m13_2, r5_1, V0, T_8 \ - VMSLG m13_2, r5_2, V0, T_9 \ - VMSLG m02_2, r_0, m4_2, m4_2 \ - VMSLG m13_2, r_0, m5_2, m5_2 \ - VAQ m4_0, T_0, m02_0 \ - VAQ m4_1, T_1, m02_1 \ - VAQ m5_0, T_5, m13_0 \ - VAQ m5_1, T_6, m13_1 \ - VAQ m02_0, T_3, m02_0 \ - VAQ m02_1, T_4, m02_1 \ - VAQ m13_0, T_8, m13_0 \ - VAQ m13_1, T_9, m13_1 \ - VAQ m4_2, T_2, m02_2 \ - VAQ m5_2, T_7, m13_2 \ - -// SQUARE uses three limbs of r and r_2*5 to output square of r -// uses T_1, T_5 and T_7 temporary registers -// input: r_0, r_1, r_2, r5_2 -// temp: TEMP0, TEMP1, TEMP2 -// output: p0, p1, p2 -#define SQUARE(r_0, r_1, r_2, r5_2, p0, p1, p2, TEMP0, TEMP1, TEMP2) \ - VMSLG r_0, r_0, p0, p0 \ - VMSLG r_1, r5_2, V0, TEMP0 \ - VMSLG r_2, r5_2, p1, p1 \ - VMSLG r_0, r_1, V0, TEMP1 \ - VMSLG r_1, r_1, p2, p2 \ - VMSLG r_0, r_2, V0, TEMP2 \ - VAQ TEMP0, p0, p0 \ - VAQ TEMP1, p1, p1 \ - VAQ TEMP2, p2, p2 \ - VAQ TEMP0, p0, p0 \ - VAQ TEMP1, p1, p1 \ - VAQ TEMP2, p2, p2 \ - -// carry h0->h1->h2->h0 || h3->h4->h5->h3 -// uses T_2, T_4, T_5, T_7, T_8, T_9 -// t6, t7, t8, t9, t10, t11 -// input: h0, h1, h2, h3, h4, h5 -// temp: t0, t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11 -// output: h0, h1, h2, h3, h4, h5 -#define REDUCE(h0, h1, h2, h3, h4, h5, t0, t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11) \ - VLM (R12), t6, t7 \ // 44 and 42 bit clear mask - VLEIB $7, $0x28, t10 \ // 5 byte shift mask - VREPIB $4, t8 \ // 4 bit shift mask - VREPIB $2, t11 \ // 2 bit shift mask - VSRLB t10, h0, t0 \ // h0 byte shift - VSRLB t10, h1, t1 \ // h1 byte shift - VSRLB t10, h2, t2 \ // h2 byte shift - VSRLB t10, h3, t3 \ // h3 byte shift - VSRLB t10, h4, t4 \ // h4 byte shift - VSRLB t10, h5, t5 \ // h5 byte shift - VSRL t8, t0, t0 \ // h0 bit shift - VSRL t8, t1, t1 \ // h2 bit shift - VSRL t11, t2, t2 \ // h2 bit shift - VSRL t8, t3, t3 \ // h3 bit shift - VSRL t8, t4, t4 \ // h4 bit shift - VESLG $2, t2, t9 \ // h2 carry x5 - VSRL t11, t5, t5 \ // h5 bit shift - VN t6, h0, h0 \ // h0 clear carry - VAQ t2, t9, t2 \ // h2 carry x5 - VESLG $2, t5, t9 \ // h5 carry x5 - VN t6, h1, h1 \ // h1 clear carry - VN t7, h2, h2 \ // h2 clear carry - VAQ t5, t9, t5 \ // h5 carry x5 - VN t6, h3, h3 \ // h3 clear carry - VN t6, h4, h4 \ // h4 clear carry - VN t7, h5, h5 \ // h5 clear carry - VAQ t0, h1, h1 \ // h0->h1 - VAQ t3, h4, h4 \ // h3->h4 - VAQ t1, h2, h2 \ // h1->h2 - VAQ t4, h5, h5 \ // h4->h5 - VAQ t2, h0, h0 \ // h2->h0 - VAQ t5, h3, h3 \ // h5->h3 - VREPG $1, t6, t6 \ // 44 and 42 bit masks across both halves - VREPG $1, t7, t7 \ - VSLDB $8, h0, h0, h0 \ // set up [h0/1/2, h3/4/5] - VSLDB $8, h1, h1, h1 \ - VSLDB $8, h2, h2, h2 \ - VO h0, h3, h3 \ - VO h1, h4, h4 \ - VO h2, h5, h5 \ - VESRLG $44, h3, t0 \ // 44 bit shift right - VESRLG $44, h4, t1 \ - VESRLG $42, h5, t2 \ - VN t6, h3, h3 \ // clear carry bits - VN t6, h4, h4 \ - VN t7, h5, h5 \ - VESLG $2, t2, t9 \ // multiply carry by 5 - VAQ t9, t2, t2 \ - VAQ t0, h4, h4 \ - VAQ t1, h5, h5 \ - VAQ t2, h3, h3 \ - -// carry h0->h1->h2->h0 -// input: h0, h1, h2 -// temp: t0, t1, t2, t3, t4, t5, t6, t7, t8 -// output: h0, h1, h2 -#define REDUCE2(h0, h1, h2, t0, t1, t2, t3, t4, t5, t6, t7, t8) \ - VLEIB $7, $0x28, t3 \ // 5 byte shift mask - VREPIB $4, t4 \ // 4 bit shift mask - VREPIB $2, t7 \ // 2 bit shift mask - VGBM $0x003F, t5 \ // mask to clear carry bits - VSRLB t3, h0, t0 \ - VSRLB t3, h1, t1 \ - VSRLB t3, h2, t2 \ - VESRLG $4, t5, t5 \ // 44 bit clear mask - VSRL t4, t0, t0 \ - VSRL t4, t1, t1 \ - VSRL t7, t2, t2 \ - VESRLG $2, t5, t6 \ // 42 bit clear mask - VESLG $2, t2, t8 \ - VAQ t8, t2, t2 \ - VN t5, h0, h0 \ - VN t5, h1, h1 \ - VN t6, h2, h2 \ - VAQ t0, h1, h1 \ - VAQ t1, h2, h2 \ - VAQ t2, h0, h0 \ - VSRLB t3, h0, t0 \ - VSRLB t3, h1, t1 \ - VSRLB t3, h2, t2 \ - VSRL t4, t0, t0 \ - VSRL t4, t1, t1 \ - VSRL t7, t2, t2 \ - VN t5, h0, h0 \ - VN t5, h1, h1 \ - VESLG $2, t2, t8 \ - VN t6, h2, h2 \ - VAQ t0, h1, h1 \ - VAQ t8, t2, t2 \ - VAQ t1, h2, h2 \ - VAQ t2, h0, h0 \ - -// expands two message blocks into the lower halfs of the d registers -// moves the contents of the d registers into upper halfs -// input: in1, in2, d0, d1, d2, d3, d4, d5 -// temp: TEMP0, TEMP1, TEMP2, TEMP3 -// output: d0, d1, d2, d3, d4, d5 -#define EXPACC(in1, in2, d0, d1, d2, d3, d4, d5, TEMP0, TEMP1, TEMP2, TEMP3) \ - VGBM $0xff3f, TEMP0 \ - VGBM $0xff1f, TEMP1 \ - VESLG $4, d1, TEMP2 \ - VESLG $4, d4, TEMP3 \ - VESRLG $4, TEMP0, TEMP0 \ - VPERM in1, d0, EX0, d0 \ - VPERM in2, d3, EX0, d3 \ - VPERM in1, d2, EX2, d2 \ - VPERM in2, d5, EX2, d5 \ - VPERM in1, TEMP2, EX1, d1 \ - VPERM in2, TEMP3, EX1, d4 \ - VN TEMP0, d0, d0 \ - VN TEMP0, d3, d3 \ - VESRLG $4, d1, d1 \ - VESRLG $4, d4, d4 \ - VN TEMP1, d2, d2 \ - VN TEMP1, d5, d5 \ - VN TEMP0, d1, d1 \ - VN TEMP0, d4, d4 \ - -// expands one message block into the lower halfs of the d registers -// moves the contents of the d registers into upper halfs -// input: in, d0, d1, d2 -// temp: TEMP0, TEMP1, TEMP2 -// output: d0, d1, d2 -#define EXPACC2(in, d0, d1, d2, TEMP0, TEMP1, TEMP2) \ - VGBM $0xff3f, TEMP0 \ - VESLG $4, d1, TEMP2 \ - VGBM $0xff1f, TEMP1 \ - VPERM in, d0, EX0, d0 \ - VESRLG $4, TEMP0, TEMP0 \ - VPERM in, d2, EX2, d2 \ - VPERM in, TEMP2, EX1, d1 \ - VN TEMP0, d0, d0 \ - VN TEMP1, d2, d2 \ - VESRLG $4, d1, d1 \ - VN TEMP0, d1, d1 \ - -// pack h2:h0 into h1:h0 (no carry) -// input: h0, h1, h2 -// output: h0, h1, h2 -#define PACK(h0, h1, h2) \ - VMRLG h1, h2, h2 \ // copy h1 to upper half h2 - VESLG $44, h1, h1 \ // shift limb 1 44 bits, leaving 20 - VO h0, h1, h0 \ // combine h0 with 20 bits from limb 1 - VESRLG $20, h2, h1 \ // put top 24 bits of limb 1 into h1 - VLEIG $1, $0, h1 \ // clear h2 stuff from lower half of h1 - VO h0, h1, h0 \ // h0 now has 88 bits (limb 0 and 1) - VLEIG $0, $0, h2 \ // clear upper half of h2 - VESRLG $40, h2, h1 \ // h1 now has upper two bits of result - VLEIB $7, $88, h1 \ // for byte shift (11 bytes) - VSLB h1, h2, h2 \ // shift h2 11 bytes to the left - VO h0, h2, h0 \ // combine h0 with 20 bits from limb 1 - VLEIG $0, $0, h1 \ // clear upper half of h1 - -// if h > 2**130-5 then h -= 2**130-5 -// input: h0, h1 -// temp: t0, t1, t2 -// output: h0 -#define MOD(h0, h1, t0, t1, t2) \ - VZERO t0 \ - VLEIG $1, $5, t0 \ - VACCQ h0, t0, t1 \ - VAQ h0, t0, t0 \ - VONE t2 \ - VLEIG $1, $-4, t2 \ - VAQ t2, t1, t1 \ - VACCQ h1, t1, t1 \ - VONE t2 \ - VAQ t2, t1, t1 \ - VN h0, t1, t2 \ - VNC t0, t1, t1 \ - VO t1, t2, h0 \ - -// func poly1305vmsl(out *[16]byte, m *byte, mlen uint64, key *[32]key) -TEXT ·poly1305vmsl(SB), $0-32 - // This code processes 6 + up to 4 blocks (32 bytes) per iteration - // using the algorithm described in: - // NEON crypto, Daniel J. Bernstein & Peter Schwabe - // https://cryptojedi.org/papers/neoncrypto-20120320.pdf - // And as moddified for VMSL as described in - // Accelerating Poly1305 Cryptographic Message Authentication on the z14 - // O'Farrell et al, CASCON 2017, p48-55 - // https://ibm.ent.box.com/s/jf9gedj0e9d2vjctfyh186shaztavnht - - LMG out+0(FP), R1, R4 // R1=out, R2=m, R3=mlen, R4=key - VZERO V0 // c - - // load EX0, EX1 and EX2 - MOVD $·constants<>(SB), R5 - VLM (R5), EX0, EX2 // c - - // setup r - VL (R4), T_0 - MOVD $·keyMask<>(SB), R6 - VL (R6), T_1 - VN T_0, T_1, T_0 - VZERO T_2 // limbs for r - VZERO T_3 - VZERO T_4 - EXPACC2(T_0, T_2, T_3, T_4, T_1, T_5, T_7) - - // T_2, T_3, T_4: [0, r] - - // setup r*20 - VLEIG $0, $0, T_0 - VLEIG $1, $20, T_0 // T_0: [0, 20] - VZERO T_5 - VZERO T_6 - VMSLG T_0, T_3, T_5, T_5 - VMSLG T_0, T_4, T_6, T_6 - - // store r for final block in GR - VLGVG $1, T_2, RSAVE_0 // c - VLGVG $1, T_3, RSAVE_1 // c - VLGVG $1, T_4, RSAVE_2 // c - VLGVG $1, T_5, R5SAVE_1 // c - VLGVG $1, T_6, R5SAVE_2 // c - - // initialize h - VZERO H0_0 - VZERO H1_0 - VZERO H2_0 - VZERO H0_1 - VZERO H1_1 - VZERO H2_1 - - // initialize pointer for reduce constants - MOVD $·reduce<>(SB), R12 - - // calculate r**2 and 20*(r**2) - VZERO R_0 - VZERO R_1 - VZERO R_2 - SQUARE(T_2, T_3, T_4, T_6, R_0, R_1, R_2, T_1, T_5, T_7) - REDUCE2(R_0, R_1, R_2, M0, M1, M2, M3, M4, R5_1, R5_2, M5, T_1) - VZERO R5_1 - VZERO R5_2 - VMSLG T_0, R_1, R5_1, R5_1 - VMSLG T_0, R_2, R5_2, R5_2 - - // skip r**4 calculation if 3 blocks or less - CMPBLE R3, $48, b4 - - // calculate r**4 and 20*(r**4) - VZERO T_8 - VZERO T_9 - VZERO T_10 - SQUARE(R_0, R_1, R_2, R5_2, T_8, T_9, T_10, T_1, T_5, T_7) - REDUCE2(T_8, T_9, T_10, M0, M1, M2, M3, M4, T_2, T_3, M5, T_1) - VZERO T_2 - VZERO T_3 - VMSLG T_0, T_9, T_2, T_2 - VMSLG T_0, T_10, T_3, T_3 - - // put r**2 to the right and r**4 to the left of R_0, R_1, R_2 - VSLDB $8, T_8, T_8, T_8 - VSLDB $8, T_9, T_9, T_9 - VSLDB $8, T_10, T_10, T_10 - VSLDB $8, T_2, T_2, T_2 - VSLDB $8, T_3, T_3, T_3 - - VO T_8, R_0, R_0 - VO T_9, R_1, R_1 - VO T_10, R_2, R_2 - VO T_2, R5_1, R5_1 - VO T_3, R5_2, R5_2 - - CMPBLE R3, $80, load // less than or equal to 5 blocks in message - - // 6(or 5+1) blocks - SUB $81, R3 - VLM (R2), M0, M4 - VLL R3, 80(R2), M5 - ADD $1, R3 - MOVBZ $1, R0 - CMPBGE R3, $16, 2(PC) - VLVGB R3, R0, M5 - MOVD $96(R2), R2 - EXPACC(M0, M1, H0_0, H1_0, H2_0, H0_1, H1_1, H2_1, T_0, T_1, T_2, T_3) - EXPACC(M2, M3, H0_0, H1_0, H2_0, H0_1, H1_1, H2_1, T_0, T_1, T_2, T_3) - VLEIB $2, $1, H2_0 - VLEIB $2, $1, H2_1 - VLEIB $10, $1, H2_0 - VLEIB $10, $1, H2_1 - - VZERO M0 - VZERO M1 - VZERO M2 - VZERO M3 - VZERO T_4 - VZERO T_10 - EXPACC(M4, M5, M0, M1, M2, M3, T_4, T_10, T_0, T_1, T_2, T_3) - VLR T_4, M4 - VLEIB $10, $1, M2 - CMPBLT R3, $16, 2(PC) - VLEIB $10, $1, T_10 - MULTIPLY(H0_0, H1_0, H2_0, H0_1, H1_1, H2_1, R_0, R_1, R_2, R5_1, R5_2, M0, M1, M2, M3, M4, T_10, T_0, T_1, T_2, T_3, T_4, T_5, T_6, T_7, T_8, T_9) - REDUCE(H0_0, H1_0, H2_0, H0_1, H1_1, H2_1, T_10, M0, M1, M2, M3, M4, T_4, T_5, T_2, T_7, T_8, T_9) - VMRHG V0, H0_1, H0_0 - VMRHG V0, H1_1, H1_0 - VMRHG V0, H2_1, H2_0 - VMRLG V0, H0_1, H0_1 - VMRLG V0, H1_1, H1_1 - VMRLG V0, H2_1, H2_1 - - SUB $16, R3 - CMPBLE R3, $0, square - -load: - // load EX0, EX1 and EX2 - MOVD $·c<>(SB), R5 - VLM (R5), EX0, EX2 - -loop: - CMPBLE R3, $64, add // b4 // last 4 or less blocks left - - // next 4 full blocks - VLM (R2), M2, M5 - SUB $64, R3 - MOVD $64(R2), R2 - REDUCE(H0_0, H1_0, H2_0, H0_1, H1_1, H2_1, T_10, M0, M1, T_0, T_1, T_3, T_4, T_5, T_2, T_7, T_8, T_9) - - // expacc in-lined to create [m2, m3] limbs - VGBM $0x3f3f, T_0 // 44 bit clear mask - VGBM $0x1f1f, T_1 // 40 bit clear mask - VPERM M2, M3, EX0, T_3 - VESRLG $4, T_0, T_0 // 44 bit clear mask ready - VPERM M2, M3, EX1, T_4 - VPERM M2, M3, EX2, T_5 - VN T_0, T_3, T_3 - VESRLG $4, T_4, T_4 - VN T_1, T_5, T_5 - VN T_0, T_4, T_4 - VMRHG H0_1, T_3, H0_0 - VMRHG H1_1, T_4, H1_0 - VMRHG H2_1, T_5, H2_0 - VMRLG H0_1, T_3, H0_1 - VMRLG H1_1, T_4, H1_1 - VMRLG H2_1, T_5, H2_1 - VLEIB $10, $1, H2_0 - VLEIB $10, $1, H2_1 - VPERM M4, M5, EX0, T_3 - VPERM M4, M5, EX1, T_4 - VPERM M4, M5, EX2, T_5 - VN T_0, T_3, T_3 - VESRLG $4, T_4, T_4 - VN T_1, T_5, T_5 - VN T_0, T_4, T_4 - VMRHG V0, T_3, M0 - VMRHG V0, T_4, M1 - VMRHG V0, T_5, M2 - VMRLG V0, T_3, M3 - VMRLG V0, T_4, M4 - VMRLG V0, T_5, M5 - VLEIB $10, $1, M2 - VLEIB $10, $1, M5 - - MULTIPLY(H0_0, H1_0, H2_0, H0_1, H1_1, H2_1, R_0, R_1, R_2, R5_1, R5_2, M0, M1, M2, M3, M4, M5, T_0, T_1, T_2, T_3, T_4, T_5, T_6, T_7, T_8, T_9) - CMPBNE R3, $0, loop - REDUCE(H0_0, H1_0, H2_0, H0_1, H1_1, H2_1, T_10, M0, M1, M3, M4, M5, T_4, T_5, T_2, T_7, T_8, T_9) - VMRHG V0, H0_1, H0_0 - VMRHG V0, H1_1, H1_0 - VMRHG V0, H2_1, H2_0 - VMRLG V0, H0_1, H0_1 - VMRLG V0, H1_1, H1_1 - VMRLG V0, H2_1, H2_1 - - // load EX0, EX1, EX2 - MOVD $·constants<>(SB), R5 - VLM (R5), EX0, EX2 - - // sum vectors - VAQ H0_0, H0_1, H0_0 - VAQ H1_0, H1_1, H1_0 - VAQ H2_0, H2_1, H2_0 - - // h may be >= 2*(2**130-5) so we need to reduce it again - // M0...M4 are used as temps here - REDUCE2(H0_0, H1_0, H2_0, M0, M1, M2, M3, M4, T_9, T_10, H0_1, M5) - -next: // carry h1->h2 - VLEIB $7, $0x28, T_1 - VREPIB $4, T_2 - VGBM $0x003F, T_3 - VESRLG $4, T_3 - - // byte shift - VSRLB T_1, H1_0, T_4 - - // bit shift - VSRL T_2, T_4, T_4 - - // clear h1 carry bits - VN T_3, H1_0, H1_0 - - // add carry - VAQ T_4, H2_0, H2_0 - - // h is now < 2*(2**130-5) - // pack h into h1 (hi) and h0 (lo) - PACK(H0_0, H1_0, H2_0) - - // if h > 2**130-5 then h -= 2**130-5 - MOD(H0_0, H1_0, T_0, T_1, T_2) - - // h += s - MOVD $·bswapMask<>(SB), R5 - VL (R5), T_1 - VL 16(R4), T_0 - VPERM T_0, T_0, T_1, T_0 // reverse bytes (to big) - VAQ T_0, H0_0, H0_0 - VPERM H0_0, H0_0, T_1, H0_0 // reverse bytes (to little) - VST H0_0, (R1) - RET - -add: - // load EX0, EX1, EX2 - MOVD $·constants<>(SB), R5 - VLM (R5), EX0, EX2 - - REDUCE(H0_0, H1_0, H2_0, H0_1, H1_1, H2_1, T_10, M0, M1, M3, M4, M5, T_4, T_5, T_2, T_7, T_8, T_9) - VMRHG V0, H0_1, H0_0 - VMRHG V0, H1_1, H1_0 - VMRHG V0, H2_1, H2_0 - VMRLG V0, H0_1, H0_1 - VMRLG V0, H1_1, H1_1 - VMRLG V0, H2_1, H2_1 - CMPBLE R3, $64, b4 - -b4: - CMPBLE R3, $48, b3 // 3 blocks or less - - // 4(3+1) blocks remaining - SUB $49, R3 - VLM (R2), M0, M2 - VLL R3, 48(R2), M3 - ADD $1, R3 - MOVBZ $1, R0 - CMPBEQ R3, $16, 2(PC) - VLVGB R3, R0, M3 - MOVD $64(R2), R2 - EXPACC(M0, M1, H0_0, H1_0, H2_0, H0_1, H1_1, H2_1, T_0, T_1, T_2, T_3) - VLEIB $10, $1, H2_0 - VLEIB $10, $1, H2_1 - VZERO M0 - VZERO M1 - VZERO M4 - VZERO M5 - VZERO T_4 - VZERO T_10 - EXPACC(M2, M3, M0, M1, M4, M5, T_4, T_10, T_0, T_1, T_2, T_3) - VLR T_4, M2 - VLEIB $10, $1, M4 - CMPBNE R3, $16, 2(PC) - VLEIB $10, $1, T_10 - MULTIPLY(H0_0, H1_0, H2_0, H0_1, H1_1, H2_1, R_0, R_1, R_2, R5_1, R5_2, M0, M1, M4, M5, M2, T_10, T_0, T_1, T_2, T_3, T_4, T_5, T_6, T_7, T_8, T_9) - REDUCE(H0_0, H1_0, H2_0, H0_1, H1_1, H2_1, T_10, M0, M1, M3, M4, M5, T_4, T_5, T_2, T_7, T_8, T_9) - VMRHG V0, H0_1, H0_0 - VMRHG V0, H1_1, H1_0 - VMRHG V0, H2_1, H2_0 - VMRLG V0, H0_1, H0_1 - VMRLG V0, H1_1, H1_1 - VMRLG V0, H2_1, H2_1 - SUB $16, R3 - CMPBLE R3, $0, square // this condition must always hold true! - -b3: - CMPBLE R3, $32, b2 - - // 3 blocks remaining - - // setup [r²,r] - VSLDB $8, R_0, R_0, R_0 - VSLDB $8, R_1, R_1, R_1 - VSLDB $8, R_2, R_2, R_2 - VSLDB $8, R5_1, R5_1, R5_1 - VSLDB $8, R5_2, R5_2, R5_2 - - VLVGG $1, RSAVE_0, R_0 - VLVGG $1, RSAVE_1, R_1 - VLVGG $1, RSAVE_2, R_2 - VLVGG $1, R5SAVE_1, R5_1 - VLVGG $1, R5SAVE_2, R5_2 - - // setup [h0, h1] - VSLDB $8, H0_0, H0_0, H0_0 - VSLDB $8, H1_0, H1_0, H1_0 - VSLDB $8, H2_0, H2_0, H2_0 - VO H0_1, H0_0, H0_0 - VO H1_1, H1_0, H1_0 - VO H2_1, H2_0, H2_0 - VZERO H0_1 - VZERO H1_1 - VZERO H2_1 - - VZERO M0 - VZERO M1 - VZERO M2 - VZERO M3 - VZERO M4 - VZERO M5 - - // H*[r**2, r] - MULTIPLY(H0_0, H1_0, H2_0, H0_1, H1_1, H2_1, R_0, R_1, R_2, R5_1, R5_2, M0, M1, M2, M3, M4, M5, T_0, T_1, T_2, T_3, T_4, T_5, T_6, T_7, T_8, T_9) - REDUCE2(H0_0, H1_0, H2_0, M0, M1, M2, M3, M4, H0_1, H1_1, T_10, M5) - - SUB $33, R3 - VLM (R2), M0, M1 - VLL R3, 32(R2), M2 - ADD $1, R3 - MOVBZ $1, R0 - CMPBEQ R3, $16, 2(PC) - VLVGB R3, R0, M2 - - // H += m0 - VZERO T_1 - VZERO T_2 - VZERO T_3 - EXPACC2(M0, T_1, T_2, T_3, T_4, T_5, T_6) - VLEIB $10, $1, T_3 - VAG H0_0, T_1, H0_0 - VAG H1_0, T_2, H1_0 - VAG H2_0, T_3, H2_0 - - VZERO M0 - VZERO M3 - VZERO M4 - VZERO M5 - VZERO T_10 - - // (H+m0)*r - MULTIPLY(H0_0, H1_0, H2_0, H0_1, H1_1, H2_1, R_0, R_1, R_2, R5_1, R5_2, M0, M3, M4, M5, V0, T_10, T_0, T_1, T_2, T_3, T_4, T_5, T_6, T_7, T_8, T_9) - REDUCE2(H0_0, H1_0, H2_0, M0, M3, M4, M5, T_10, H0_1, H1_1, H2_1, T_9) - - // H += m1 - VZERO V0 - VZERO T_1 - VZERO T_2 - VZERO T_3 - EXPACC2(M1, T_1, T_2, T_3, T_4, T_5, T_6) - VLEIB $10, $1, T_3 - VAQ H0_0, T_1, H0_0 - VAQ H1_0, T_2, H1_0 - VAQ H2_0, T_3, H2_0 - REDUCE2(H0_0, H1_0, H2_0, M0, M3, M4, M5, T_9, H0_1, H1_1, H2_1, T_10) - - // [H, m2] * [r**2, r] - EXPACC2(M2, H0_0, H1_0, H2_0, T_1, T_2, T_3) - CMPBNE R3, $16, 2(PC) - VLEIB $10, $1, H2_0 - VZERO M0 - VZERO M1 - VZERO M2 - VZERO M3 - VZERO M4 - VZERO M5 - MULTIPLY(H0_0, H1_0, H2_0, H0_1, H1_1, H2_1, R_0, R_1, R_2, R5_1, R5_2, M0, M1, M2, M3, M4, M5, T_0, T_1, T_2, T_3, T_4, T_5, T_6, T_7, T_8, T_9) - REDUCE2(H0_0, H1_0, H2_0, M0, M1, M2, M3, M4, H0_1, H1_1, M5, T_10) - SUB $16, R3 - CMPBLE R3, $0, next // this condition must always hold true! - -b2: - CMPBLE R3, $16, b1 - - // 2 blocks remaining - - // setup [r²,r] - VSLDB $8, R_0, R_0, R_0 - VSLDB $8, R_1, R_1, R_1 - VSLDB $8, R_2, R_2, R_2 - VSLDB $8, R5_1, R5_1, R5_1 - VSLDB $8, R5_2, R5_2, R5_2 - - VLVGG $1, RSAVE_0, R_0 - VLVGG $1, RSAVE_1, R_1 - VLVGG $1, RSAVE_2, R_2 - VLVGG $1, R5SAVE_1, R5_1 - VLVGG $1, R5SAVE_2, R5_2 - - // setup [h0, h1] - VSLDB $8, H0_0, H0_0, H0_0 - VSLDB $8, H1_0, H1_0, H1_0 - VSLDB $8, H2_0, H2_0, H2_0 - VO H0_1, H0_0, H0_0 - VO H1_1, H1_0, H1_0 - VO H2_1, H2_0, H2_0 - VZERO H0_1 - VZERO H1_1 - VZERO H2_1 - - VZERO M0 - VZERO M1 - VZERO M2 - VZERO M3 - VZERO M4 - VZERO M5 - - // H*[r**2, r] - MULTIPLY(H0_0, H1_0, H2_0, H0_1, H1_1, H2_1, R_0, R_1, R_2, R5_1, R5_2, M0, M1, M2, M3, M4, M5, T_0, T_1, T_2, T_3, T_4, T_5, T_6, T_7, T_8, T_9) - REDUCE(H0_0, H1_0, H2_0, H0_1, H1_1, H2_1, T_10, M0, M1, M2, M3, M4, T_4, T_5, T_2, T_7, T_8, T_9) - VMRHG V0, H0_1, H0_0 - VMRHG V0, H1_1, H1_0 - VMRHG V0, H2_1, H2_0 - VMRLG V0, H0_1, H0_1 - VMRLG V0, H1_1, H1_1 - VMRLG V0, H2_1, H2_1 - - // move h to the left and 0s at the right - VSLDB $8, H0_0, H0_0, H0_0 - VSLDB $8, H1_0, H1_0, H1_0 - VSLDB $8, H2_0, H2_0, H2_0 - - // get message blocks and append 1 to start - SUB $17, R3 - VL (R2), M0 - VLL R3, 16(R2), M1 - ADD $1, R3 - MOVBZ $1, R0 - CMPBEQ R3, $16, 2(PC) - VLVGB R3, R0, M1 - VZERO T_6 - VZERO T_7 - VZERO T_8 - EXPACC2(M0, T_6, T_7, T_8, T_1, T_2, T_3) - EXPACC2(M1, T_6, T_7, T_8, T_1, T_2, T_3) - VLEIB $2, $1, T_8 - CMPBNE R3, $16, 2(PC) - VLEIB $10, $1, T_8 - - // add [m0, m1] to h - VAG H0_0, T_6, H0_0 - VAG H1_0, T_7, H1_0 - VAG H2_0, T_8, H2_0 - - VZERO M2 - VZERO M3 - VZERO M4 - VZERO M5 - VZERO T_10 - VZERO M0 - - // at this point R_0 .. R5_2 look like [r**2, r] - MULTIPLY(H0_0, H1_0, H2_0, H0_1, H1_1, H2_1, R_0, R_1, R_2, R5_1, R5_2, M2, M3, M4, M5, T_10, M0, T_0, T_1, T_2, T_3, T_4, T_5, T_6, T_7, T_8, T_9) - REDUCE2(H0_0, H1_0, H2_0, M2, M3, M4, M5, T_9, H0_1, H1_1, H2_1, T_10) - SUB $16, R3, R3 - CMPBLE R3, $0, next - -b1: - CMPBLE R3, $0, next - - // 1 block remaining - - // setup [r²,r] - VSLDB $8, R_0, R_0, R_0 - VSLDB $8, R_1, R_1, R_1 - VSLDB $8, R_2, R_2, R_2 - VSLDB $8, R5_1, R5_1, R5_1 - VSLDB $8, R5_2, R5_2, R5_2 - - VLVGG $1, RSAVE_0, R_0 - VLVGG $1, RSAVE_1, R_1 - VLVGG $1, RSAVE_2, R_2 - VLVGG $1, R5SAVE_1, R5_1 - VLVGG $1, R5SAVE_2, R5_2 - - // setup [h0, h1] - VSLDB $8, H0_0, H0_0, H0_0 - VSLDB $8, H1_0, H1_0, H1_0 - VSLDB $8, H2_0, H2_0, H2_0 - VO H0_1, H0_0, H0_0 - VO H1_1, H1_0, H1_0 - VO H2_1, H2_0, H2_0 - VZERO H0_1 - VZERO H1_1 - VZERO H2_1 - - VZERO M0 - VZERO M1 - VZERO M2 - VZERO M3 - VZERO M4 - VZERO M5 - - // H*[r**2, r] - MULTIPLY(H0_0, H1_0, H2_0, H0_1, H1_1, H2_1, R_0, R_1, R_2, R5_1, R5_2, M0, M1, M2, M3, M4, M5, T_0, T_1, T_2, T_3, T_4, T_5, T_6, T_7, T_8, T_9) - REDUCE2(H0_0, H1_0, H2_0, M0, M1, M2, M3, M4, T_9, T_10, H0_1, M5) - - // set up [0, m0] limbs - SUB $1, R3 - VLL R3, (R2), M0 - ADD $1, R3 - MOVBZ $1, R0 - CMPBEQ R3, $16, 2(PC) - VLVGB R3, R0, M0 - VZERO T_1 - VZERO T_2 - VZERO T_3 - EXPACC2(M0, T_1, T_2, T_3, T_4, T_5, T_6)// limbs: [0, m] - CMPBNE R3, $16, 2(PC) - VLEIB $10, $1, T_3 - - // h+m0 - VAQ H0_0, T_1, H0_0 - VAQ H1_0, T_2, H1_0 - VAQ H2_0, T_3, H2_0 - - VZERO M0 - VZERO M1 - VZERO M2 - VZERO M3 - VZERO M4 - VZERO M5 - MULTIPLY(H0_0, H1_0, H2_0, H0_1, H1_1, H2_1, R_0, R_1, R_2, R5_1, R5_2, M0, M1, M2, M3, M4, M5, T_0, T_1, T_2, T_3, T_4, T_5, T_6, T_7, T_8, T_9) - REDUCE2(H0_0, H1_0, H2_0, M0, M1, M2, M3, M4, T_9, T_10, H0_1, M5) - - BR next - -square: - // setup [r²,r] - VSLDB $8, R_0, R_0, R_0 - VSLDB $8, R_1, R_1, R_1 - VSLDB $8, R_2, R_2, R_2 - VSLDB $8, R5_1, R5_1, R5_1 - VSLDB $8, R5_2, R5_2, R5_2 - - VLVGG $1, RSAVE_0, R_0 - VLVGG $1, RSAVE_1, R_1 - VLVGG $1, RSAVE_2, R_2 - VLVGG $1, R5SAVE_1, R5_1 - VLVGG $1, R5SAVE_2, R5_2 - - // setup [h0, h1] - VSLDB $8, H0_0, H0_0, H0_0 - VSLDB $8, H1_0, H1_0, H1_0 - VSLDB $8, H2_0, H2_0, H2_0 - VO H0_1, H0_0, H0_0 - VO H1_1, H1_0, H1_0 - VO H2_1, H2_0, H2_0 - VZERO H0_1 - VZERO H1_1 - VZERO H2_1 - - VZERO M0 - VZERO M1 - VZERO M2 - VZERO M3 - VZERO M4 - VZERO M5 - - // (h0*r**2) + (h1*r) - MULTIPLY(H0_0, H1_0, H2_0, H0_1, H1_1, H2_1, R_0, R_1, R_2, R5_1, R5_2, M0, M1, M2, M3, M4, M5, T_0, T_1, T_2, T_3, T_4, T_5, T_6, T_7, T_8, T_9) - REDUCE2(H0_0, H1_0, H2_0, M0, M1, M2, M3, M4, T_9, T_10, H0_1, M5) - BR next diff --git a/vendor/google.golang.org/genproto/googleapis/api/annotations/annotations.pb.go b/vendor/google.golang.org/genproto/googleapis/api/annotations/annotations.pb.go deleted file mode 100644 index 4f3526e1db..0000000000 --- a/vendor/google.golang.org/genproto/googleapis/api/annotations/annotations.pb.go +++ /dev/null @@ -1,57 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// source: google/api/annotations.proto - -package annotations - -import ( - fmt "fmt" - math "math" - - proto "github.com/golang/protobuf/proto" - descriptor "github.com/golang/protobuf/protoc-gen-go/descriptor" -) - -// 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 - -var E_Http = &proto.ExtensionDesc{ - ExtendedType: (*descriptor.MethodOptions)(nil), - ExtensionType: (*HttpRule)(nil), - Field: 72295728, - Name: "google.api.http", - Tag: "bytes,72295728,opt,name=http", - Filename: "google/api/annotations.proto", -} - -func init() { - proto.RegisterExtension(E_Http) -} - -func init() { - proto.RegisterFile("google/api/annotations.proto", fileDescriptor_c591c5aa9fb79aab) -} - -var fileDescriptor_c591c5aa9fb79aab = []byte{ - // 208 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x49, 0xcf, 0xcf, 0x4f, - 0xcf, 0x49, 0xd5, 0x4f, 0x2c, 0xc8, 0xd4, 0x4f, 0xcc, 0xcb, 0xcb, 0x2f, 0x49, 0x2c, 0xc9, 0xcc, - 0xcf, 0x2b, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x82, 0xc8, 0xea, 0x25, 0x16, 0x64, - 0x4a, 0x89, 0x22, 0xa9, 0xcc, 0x28, 0x29, 0x29, 0x80, 0x28, 0x91, 0x52, 0x80, 0x0a, 0x83, 0x79, - 0x49, 0xa5, 0x69, 0xfa, 0x29, 0xa9, 0xc5, 0xc9, 0x45, 0x99, 0x05, 0x25, 0xf9, 0x45, 0x10, 0x15, - 0x56, 0xde, 0x5c, 0x2c, 0x20, 0xf5, 0x42, 0x72, 0x7a, 0x50, 0xd3, 0x60, 0x4a, 0xf5, 0x7c, 0x53, - 0x4b, 0x32, 0xf2, 0x53, 0xfc, 0x0b, 0xc0, 0x56, 0x4a, 0x6c, 0x38, 0xb5, 0x47, 0x49, 0x81, 0x51, - 0x83, 0xdb, 0x48, 0x44, 0x0f, 0x61, 0xad, 0x9e, 0x47, 0x49, 0x49, 0x41, 0x50, 0x69, 0x4e, 0x6a, - 0x10, 0xd8, 0x10, 0xa7, 0x3c, 0x2e, 0xbe, 0xe4, 0xfc, 0x5c, 0x24, 0x05, 0x4e, 0x02, 0x8e, 0x08, - 0x67, 0x07, 0x80, 0x4c, 0x0e, 0x60, 0x8c, 0x72, 0x84, 0xca, 0xa7, 0xe7, 0xe7, 0x24, 0xe6, 0xa5, - 0xeb, 0xe5, 0x17, 0xa5, 0xeb, 0xa7, 0xa7, 0xe6, 0x81, 0xed, 0xd5, 0x87, 0x48, 0x25, 0x16, 0x64, - 0x16, 0xa3, 0x7b, 0xda, 0x1a, 0x89, 0xbd, 0x88, 0x89, 0xc5, 0xdd, 0x31, 0xc0, 0x33, 0x89, 0x0d, - 0xac, 0xc9, 0x18, 0x10, 0x00, 0x00, 0xff, 0xff, 0xe3, 0x29, 0x19, 0x62, 0x28, 0x01, 0x00, 0x00, -} diff --git a/vendor/google.golang.org/genproto/googleapis/api/annotations/client.pb.go b/vendor/google.golang.org/genproto/googleapis/api/annotations/client.pb.go deleted file mode 100644 index 9757593e92..0000000000 --- a/vendor/google.golang.org/genproto/googleapis/api/annotations/client.pb.go +++ /dev/null @@ -1,81 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// source: google/api/client.proto - -package annotations - -import ( - fmt "fmt" - math "math" - - proto "github.com/golang/protobuf/proto" - descriptor "github.com/golang/protobuf/protoc-gen-go/descriptor" -) - -// 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 - -var E_MethodSignature = &proto.ExtensionDesc{ - ExtendedType: (*descriptor.MethodOptions)(nil), - ExtensionType: ([]string)(nil), - Field: 1051, - Name: "google.api.method_signature", - Tag: "bytes,1051,rep,name=method_signature", - Filename: "google/api/client.proto", -} - -var E_DefaultHost = &proto.ExtensionDesc{ - ExtendedType: (*descriptor.ServiceOptions)(nil), - ExtensionType: (*string)(nil), - Field: 1049, - Name: "google.api.default_host", - Tag: "bytes,1049,opt,name=default_host", - Filename: "google/api/client.proto", -} - -var E_OauthScopes = &proto.ExtensionDesc{ - ExtendedType: (*descriptor.ServiceOptions)(nil), - ExtensionType: (*string)(nil), - Field: 1050, - Name: "google.api.oauth_scopes", - Tag: "bytes,1050,opt,name=oauth_scopes", - Filename: "google/api/client.proto", -} - -func init() { - proto.RegisterExtension(E_MethodSignature) - proto.RegisterExtension(E_DefaultHost) - proto.RegisterExtension(E_OauthScopes) -} - -func init() { - proto.RegisterFile("google/api/client.proto", fileDescriptor_78f2c6f7c3a942c1) -} - -var fileDescriptor_78f2c6f7c3a942c1 = []byte{ - // 262 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x90, 0x3f, 0x4f, 0xc3, 0x30, - 0x10, 0xc5, 0x55, 0x40, 0xa8, 0x75, 0x11, 0xa0, 0x2c, 0x20, 0x06, 0xc8, 0xd8, 0xc9, 0x1e, 0xd8, - 0xca, 0xd4, 0x76, 0xe0, 0x8f, 0x84, 0x88, 0x9a, 0x8d, 0x25, 0x72, 0x9d, 0xab, 0x63, 0x29, 0xf5, - 0x59, 0xf6, 0x85, 0xef, 0x02, 0x6c, 0x7c, 0x52, 0x54, 0xc7, 0x11, 0x48, 0x0c, 0x6c, 0x27, 0xbd, - 0xf7, 0xfb, 0x9d, 0xf4, 0xd8, 0x85, 0x46, 0xd4, 0x2d, 0x08, 0xe9, 0x8c, 0x50, 0xad, 0x01, 0x4b, - 0xdc, 0x79, 0x24, 0xcc, 0x58, 0x1f, 0x70, 0xe9, 0xcc, 0x55, 0x9e, 0x4a, 0x31, 0xd9, 0x74, 0x5b, - 0x51, 0x43, 0x50, 0xde, 0x38, 0x42, 0xdf, 0xb7, 0xe7, 0x4f, 0xec, 0x7c, 0x07, 0xd4, 0x60, 0x5d, - 0x05, 0xa3, 0xad, 0xa4, 0xce, 0x43, 0x76, 0xcd, 0x93, 0x62, 0xc0, 0xf8, 0x73, 0xac, 0xbc, 0x38, - 0x32, 0x68, 0xc3, 0xe5, 0xe7, 0x38, 0x3f, 0x9c, 0x4d, 0xd6, 0x67, 0x3d, 0x58, 0x0e, 0xdc, 0x7c, - 0xc5, 0x4e, 0x6a, 0xd8, 0xca, 0xae, 0xa5, 0xaa, 0xc1, 0x40, 0xd9, 0xcd, 0x1f, 0x4f, 0x09, 0xfe, - 0xcd, 0x28, 0x18, 0x44, 0xef, 0xe3, 0x7c, 0x34, 0x9b, 0xac, 0xa7, 0x89, 0x7a, 0xc0, 0x40, 0x7b, - 0x09, 0xca, 0x8e, 0x9a, 0x2a, 0x28, 0x74, 0x10, 0xfe, 0x97, 0x7c, 0x24, 0x49, 0xa4, 0xca, 0x08, - 0x2d, 0x0d, 0x3b, 0x55, 0xb8, 0xe3, 0x3f, 0x4b, 0x2c, 0xa7, 0xab, 0xb8, 0x51, 0xb1, 0x97, 0x14, - 0xa3, 0xd7, 0x45, 0x8a, 0x34, 0xb6, 0xd2, 0x6a, 0x8e, 0x5e, 0x0b, 0x0d, 0x36, 0xbe, 0x10, 0x7d, - 0x24, 0x9d, 0x09, 0x71, 0x5c, 0x69, 0x2d, 0x92, 0x8c, 0xbf, 0xee, 0x7e, 0xdd, 0x5f, 0x07, 0x47, - 0xf7, 0x8b, 0xe2, 0x71, 0x73, 0x1c, 0xa1, 0xdb, 0xef, 0x00, 0x00, 0x00, 0xff, 0xff, 0xcc, 0xc2, - 0xcf, 0x71, 0x90, 0x01, 0x00, 0x00, -} diff --git a/vendor/google.golang.org/genproto/googleapis/api/annotations/field_behavior.pb.go b/vendor/google.golang.org/genproto/googleapis/api/annotations/field_behavior.pb.go deleted file mode 100644 index 6e67a93feb..0000000000 --- a/vendor/google.golang.org/genproto/googleapis/api/annotations/field_behavior.pb.go +++ /dev/null @@ -1,124 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// source: google/api/field_behavior.proto - -package annotations - -import ( - fmt "fmt" - math "math" - - proto "github.com/golang/protobuf/proto" - descriptor "github.com/golang/protobuf/protoc-gen-go/descriptor" -) - -// 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 - -// An indicator of the behavior of a given field (for example, that a field -// is required in requests, or given as output but ignored as input). -// This **does not** change the behavior in protocol buffers itself; it only -// denotes the behavior and may affect how API tooling handles the field. -// -// Note: This enum **may** receive new values in the future. -type FieldBehavior int32 - -const ( - // Conventional default for enums. Do not use this. - FieldBehavior_FIELD_BEHAVIOR_UNSPECIFIED FieldBehavior = 0 - // Specifically denotes a field as optional. - // While all fields in protocol buffers are optional, this may be specified - // for emphasis if appropriate. - FieldBehavior_OPTIONAL FieldBehavior = 1 - // Denotes a field as required. - // This indicates that the field **must** be provided as part of the request, - // and failure to do so will cause an error (usually `INVALID_ARGUMENT`). - FieldBehavior_REQUIRED FieldBehavior = 2 - // Denotes a field as output only. - // This indicates that the field is provided in responses, but including the - // field in a request does nothing (the server *must* ignore it and - // *must not* throw an error as a result of the field's presence). - FieldBehavior_OUTPUT_ONLY FieldBehavior = 3 - // Denotes a field as input only. - // This indicates that the field is provided in requests, and the - // corresponding field is not included in output. - FieldBehavior_INPUT_ONLY FieldBehavior = 4 - // Denotes a field as immutable. - // This indicates that the field may be set once in a request to create a - // resource, but may not be changed thereafter. - FieldBehavior_IMMUTABLE FieldBehavior = 5 -) - -var FieldBehavior_name = map[int32]string{ - 0: "FIELD_BEHAVIOR_UNSPECIFIED", - 1: "OPTIONAL", - 2: "REQUIRED", - 3: "OUTPUT_ONLY", - 4: "INPUT_ONLY", - 5: "IMMUTABLE", -} - -var FieldBehavior_value = map[string]int32{ - "FIELD_BEHAVIOR_UNSPECIFIED": 0, - "OPTIONAL": 1, - "REQUIRED": 2, - "OUTPUT_ONLY": 3, - "INPUT_ONLY": 4, - "IMMUTABLE": 5, -} - -func (x FieldBehavior) String() string { - return proto.EnumName(FieldBehavior_name, int32(x)) -} - -func (FieldBehavior) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_4648f18fd5079967, []int{0} -} - -var E_FieldBehavior = &proto.ExtensionDesc{ - ExtendedType: (*descriptor.FieldOptions)(nil), - ExtensionType: ([]FieldBehavior)(nil), - Field: 1052, - Name: "google.api.field_behavior", - Tag: "varint,1052,rep,name=field_behavior,enum=google.api.FieldBehavior", - Filename: "google/api/field_behavior.proto", -} - -func init() { - proto.RegisterEnum("google.api.FieldBehavior", FieldBehavior_name, FieldBehavior_value) - proto.RegisterExtension(E_FieldBehavior) -} - -func init() { - proto.RegisterFile("google/api/field_behavior.proto", fileDescriptor_4648f18fd5079967) -} - -var fileDescriptor_4648f18fd5079967 = []byte{ - // 303 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x54, 0x90, 0x4f, 0x4f, 0xb3, 0x30, - 0x1c, 0xc7, 0x9f, 0xfd, 0x79, 0xcc, 0xac, 0x0e, 0x49, 0x4f, 0xba, 0x44, 0xdd, 0xd1, 0x78, 0x28, - 0x89, 0xde, 0xf4, 0x04, 0xae, 0xd3, 0x26, 0x8c, 0x56, 0x04, 0x13, 0xbd, 0x60, 0xb7, 0xb1, 0xda, - 0x64, 0xd2, 0x06, 0xd0, 0x8b, 0x6f, 0xc5, 0x93, 0xaf, 0xd4, 0xd0, 0x31, 0x85, 0x5b, 0xbf, 0xf9, - 0x7d, 0xfa, 0xeb, 0xe7, 0x5b, 0x70, 0x2a, 0x94, 0x12, 0xeb, 0xd4, 0xe1, 0x5a, 0x3a, 0x2b, 0x99, - 0xae, 0x97, 0xc9, 0x3c, 0x7d, 0xe5, 0x1f, 0x52, 0xe5, 0x48, 0xe7, 0xaa, 0x54, 0x10, 0x6c, 0x00, - 0xc4, 0xb5, 0x1c, 0x8d, 0x6b, 0xd8, 0x4c, 0xe6, 0xef, 0x2b, 0x67, 0x99, 0x16, 0x8b, 0x5c, 0xea, - 0x72, 0x4b, 0x9f, 0x7f, 0x82, 0xe1, 0xb4, 0xda, 0xe2, 0xd5, 0x4b, 0xe0, 0x09, 0x18, 0x4d, 0x09, - 0xf6, 0x27, 0x89, 0x87, 0xef, 0xdc, 0x47, 0x42, 0xc3, 0x24, 0x0e, 0x1e, 0x18, 0xbe, 0x21, 0x53, - 0x82, 0x27, 0xf6, 0x3f, 0xb8, 0x0f, 0x06, 0x94, 0x45, 0x84, 0x06, 0xae, 0x6f, 0x77, 0xaa, 0x14, - 0xe2, 0xfb, 0x98, 0x84, 0x78, 0x62, 0x77, 0xe1, 0x01, 0xd8, 0xa3, 0x71, 0xc4, 0xe2, 0x28, 0xa1, - 0x81, 0xff, 0x64, 0xf7, 0xa0, 0x05, 0x00, 0x09, 0x7e, 0x73, 0x1f, 0x0e, 0xc1, 0x2e, 0x99, 0xcd, - 0xe2, 0xc8, 0xf5, 0x7c, 0x6c, 0xff, 0xbf, 0x7a, 0x01, 0x56, 0xbb, 0x02, 0x3c, 0x46, 0xb5, 0xfd, - 0xd6, 0x18, 0x19, 0x3b, 0xaa, 0x4b, 0xa9, 0xb2, 0xe2, 0xf0, 0x6b, 0x30, 0xee, 0x9d, 0x59, 0x17, - 0x47, 0xe8, 0xaf, 0x23, 0x6a, 0xe9, 0x87, 0xc3, 0x55, 0x33, 0x7a, 0x1a, 0x58, 0x0b, 0xf5, 0xd6, - 0xc0, 0x3d, 0xd8, 0xe2, 0x59, 0xf5, 0x0c, 0xeb, 0x3c, 0xbb, 0x35, 0x21, 0xd4, 0x9a, 0x67, 0x02, - 0xa9, 0x5c, 0x38, 0x22, 0xcd, 0x8c, 0x84, 0xb3, 0x19, 0x71, 0x2d, 0x0b, 0xf3, 0xe9, 0x3c, 0xcb, - 0x54, 0xc9, 0x8d, 0xcf, 0x75, 0xe3, 0xfc, 0xdd, 0xed, 0xdf, 0xba, 0x8c, 0xcc, 0x77, 0xcc, 0xa5, - 0xcb, 0x9f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xfc, 0x94, 0x57, 0x94, 0xa8, 0x01, 0x00, 0x00, -} diff --git a/vendor/google.golang.org/genproto/googleapis/api/annotations/http.pb.go b/vendor/google.golang.org/genproto/googleapis/api/annotations/http.pb.go deleted file mode 100644 index 6ed6f3c917..0000000000 --- a/vendor/google.golang.org/genproto/googleapis/api/annotations/http.pb.go +++ /dev/null @@ -1,635 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// source: google/api/http.proto - -package annotations - -import ( - fmt "fmt" - math "math" - - proto "github.com/golang/protobuf/proto" -) - -// 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 - -// Defines the HTTP configuration for an API service. It contains a list of -// [HttpRule][google.api.HttpRule], each specifying the mapping of an RPC method -// to one or more HTTP REST API methods. -type Http struct { - // A list of HTTP configuration rules that apply to individual API methods. - // - // **NOTE:** All service configuration rules follow "last one wins" order. - Rules []*HttpRule `protobuf:"bytes,1,rep,name=rules,proto3" json:"rules,omitempty"` - // When set to true, URL path parameters will be fully URI-decoded except in - // cases of single segment matches in reserved expansion, where "%2F" will be - // left encoded. - // - // The default behavior is to not decode RFC 6570 reserved characters in multi - // segment matches. - FullyDecodeReservedExpansion bool `protobuf:"varint,2,opt,name=fully_decode_reserved_expansion,json=fullyDecodeReservedExpansion,proto3" json:"fully_decode_reserved_expansion,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Http) Reset() { *m = Http{} } -func (m *Http) String() string { return proto.CompactTextString(m) } -func (*Http) ProtoMessage() {} -func (*Http) Descriptor() ([]byte, []int) { - return fileDescriptor_ff9994be407cdcc9, []int{0} -} - -func (m *Http) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Http.Unmarshal(m, b) -} -func (m *Http) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Http.Marshal(b, m, deterministic) -} -func (m *Http) XXX_Merge(src proto.Message) { - xxx_messageInfo_Http.Merge(m, src) -} -func (m *Http) XXX_Size() int { - return xxx_messageInfo_Http.Size(m) -} -func (m *Http) XXX_DiscardUnknown() { - xxx_messageInfo_Http.DiscardUnknown(m) -} - -var xxx_messageInfo_Http proto.InternalMessageInfo - -func (m *Http) GetRules() []*HttpRule { - if m != nil { - return m.Rules - } - return nil -} - -func (m *Http) GetFullyDecodeReservedExpansion() bool { - if m != nil { - return m.FullyDecodeReservedExpansion - } - return false -} - -// # gRPC Transcoding -// -// gRPC Transcoding is a feature for mapping between a gRPC method and one or -// more HTTP REST endpoints. It allows developers to build a single API service -// that supports both gRPC APIs and REST APIs. Many systems, including [Google -// APIs](https://github.com/googleapis/googleapis), -// [Cloud Endpoints](https://cloud.google.com/endpoints), [gRPC -// Gateway](https://github.com/grpc-ecosystem/grpc-gateway), -// and [Envoy](https://github.com/envoyproxy/envoy) proxy support this feature -// and use it for large scale production services. -// -// `HttpRule` defines the schema of the gRPC/REST mapping. The mapping specifies -// how different portions of the gRPC request message are mapped to the URL -// path, URL query parameters, and HTTP request body. It also controls how the -// gRPC response message is mapped to the HTTP response body. `HttpRule` is -// typically specified as an `google.api.http` annotation on the gRPC method. -// -// Each mapping specifies a URL path template and an HTTP method. The path -// template may refer to one or more fields in the gRPC request message, as long -// as each field is a non-repeated field with a primitive (non-message) type. -// The path template controls how fields of the request message are mapped to -// the URL path. -// -// Example: -// -// service Messaging { -// rpc GetMessage(GetMessageRequest) returns (Message) { -// option (google.api.http) = { -// get: "/v1/{name=messages/*}" -// }; -// } -// } -// message GetMessageRequest { -// string name = 1; // Mapped to URL path. -// } -// message Message { -// string text = 1; // The resource content. -// } -// -// This enables an HTTP REST to gRPC mapping as below: -// -// HTTP | gRPC -// -----|----- -// `GET /v1/messages/123456` | `GetMessage(name: "messages/123456")` -// -// Any fields in the request message which are not bound by the path template -// automatically become HTTP query parameters if there is no HTTP request body. -// For example: -// -// service Messaging { -// rpc GetMessage(GetMessageRequest) returns (Message) { -// option (google.api.http) = { -// get:"/v1/messages/{message_id}" -// }; -// } -// } -// message GetMessageRequest { -// message SubMessage { -// string subfield = 1; -// } -// string message_id = 1; // Mapped to URL path. -// int64 revision = 2; // Mapped to URL query parameter `revision`. -// SubMessage sub = 3; // Mapped to URL query parameter `sub.subfield`. -// } -// -// This enables a HTTP JSON to RPC mapping as below: -// -// HTTP | gRPC -// -----|----- -// `GET /v1/messages/123456?revision=2&sub.subfield=foo` | -// `GetMessage(message_id: "123456" revision: 2 sub: SubMessage(subfield: -// "foo"))` -// -// Note that fields which are mapped to URL query parameters must have a -// primitive type or a repeated primitive type or a non-repeated message type. -// In the case of a repeated type, the parameter can be repeated in the URL -// as `...?param=A¶m=B`. In the case of a message type, each field of the -// message is mapped to a separate parameter, such as -// `...?foo.a=A&foo.b=B&foo.c=C`. -// -// For HTTP methods that allow a request body, the `body` field -// specifies the mapping. Consider a REST update method on the -// message resource collection: -// -// service Messaging { -// rpc UpdateMessage(UpdateMessageRequest) returns (Message) { -// option (google.api.http) = { -// patch: "/v1/messages/{message_id}" -// body: "message" -// }; -// } -// } -// message UpdateMessageRequest { -// string message_id = 1; // mapped to the URL -// Message message = 2; // mapped to the body -// } -// -// The following HTTP JSON to RPC mapping is enabled, where the -// representation of the JSON in the request body is determined by -// protos JSON encoding: -// -// HTTP | gRPC -// -----|----- -// `PATCH /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id: -// "123456" message { text: "Hi!" })` -// -// The special name `*` can be used in the body mapping to define that -// every field not bound by the path template should be mapped to the -// request body. This enables the following alternative definition of -// the update method: -// -// service Messaging { -// rpc UpdateMessage(Message) returns (Message) { -// option (google.api.http) = { -// patch: "/v1/messages/{message_id}" -// body: "*" -// }; -// } -// } -// message Message { -// string message_id = 1; -// string text = 2; -// } -// -// -// The following HTTP JSON to RPC mapping is enabled: -// -// HTTP | gRPC -// -----|----- -// `PATCH /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id: -// "123456" text: "Hi!")` -// -// Note that when using `*` in the body mapping, it is not possible to -// have HTTP parameters, as all fields not bound by the path end in -// the body. This makes this option more rarely used in practice when -// defining REST APIs. The common usage of `*` is in custom methods -// which don't use the URL at all for transferring data. -// -// It is possible to define multiple HTTP methods for one RPC by using -// the `additional_bindings` option. Example: -// -// service Messaging { -// rpc GetMessage(GetMessageRequest) returns (Message) { -// option (google.api.http) = { -// get: "/v1/messages/{message_id}" -// additional_bindings { -// get: "/v1/users/{user_id}/messages/{message_id}" -// } -// }; -// } -// } -// message GetMessageRequest { -// string message_id = 1; -// string user_id = 2; -// } -// -// This enables the following two alternative HTTP JSON to RPC mappings: -// -// HTTP | gRPC -// -----|----- -// `GET /v1/messages/123456` | `GetMessage(message_id: "123456")` -// `GET /v1/users/me/messages/123456` | `GetMessage(user_id: "me" message_id: -// "123456")` -// -// ## Rules for HTTP mapping -// -// 1. Leaf request fields (recursive expansion nested messages in the request -// message) are classified into three categories: -// - Fields referred by the path template. They are passed via the URL path. -// - Fields referred by the [HttpRule.body][google.api.HttpRule.body]. They are passed via the HTTP -// request body. -// - All other fields are passed via the URL query parameters, and the -// parameter name is the field path in the request message. A repeated -// field can be represented as multiple query parameters under the same -// name. -// 2. If [HttpRule.body][google.api.HttpRule.body] is "*", there is no URL query parameter, all fields -// are passed via URL path and HTTP request body. -// 3. If [HttpRule.body][google.api.HttpRule.body] is omitted, there is no HTTP request body, all -// fields are passed via URL path and URL query parameters. -// -// ### Path template syntax -// -// Template = "/" Segments [ Verb ] ; -// Segments = Segment { "/" Segment } ; -// Segment = "*" | "**" | LITERAL | Variable ; -// Variable = "{" FieldPath [ "=" Segments ] "}" ; -// FieldPath = IDENT { "." IDENT } ; -// Verb = ":" LITERAL ; -// -// The syntax `*` matches a single URL path segment. The syntax `**` matches -// zero or more URL path segments, which must be the last part of the URL path -// except the `Verb`. -// -// The syntax `Variable` matches part of the URL path as specified by its -// template. A variable template must not contain other variables. If a variable -// matches a single path segment, its template may be omitted, e.g. `{var}` -// is equivalent to `{var=*}`. -// -// The syntax `LITERAL` matches literal text in the URL path. If the `LITERAL` -// contains any reserved character, such characters should be percent-encoded -// before the matching. -// -// If a variable contains exactly one path segment, such as `"{var}"` or -// `"{var=*}"`, when such a variable is expanded into a URL path on the client -// side, all characters except `[-_.~0-9a-zA-Z]` are percent-encoded. The -// server side does the reverse decoding. Such variables show up in the -// [Discovery -// Document](https://developers.google.com/discovery/v1/reference/apis) as -// `{var}`. -// -// If a variable contains multiple path segments, such as `"{var=foo/*}"` -// or `"{var=**}"`, when such a variable is expanded into a URL path on the -// client side, all characters except `[-_.~/0-9a-zA-Z]` are percent-encoded. -// The server side does the reverse decoding, except "%2F" and "%2f" are left -// unchanged. Such variables show up in the -// [Discovery -// Document](https://developers.google.com/discovery/v1/reference/apis) as -// `{+var}`. -// -// ## Using gRPC API Service Configuration -// -// gRPC API Service Configuration (service config) is a configuration language -// for configuring a gRPC service to become a user-facing product. The -// service config is simply the YAML representation of the `google.api.Service` -// proto message. -// -// As an alternative to annotating your proto file, you can configure gRPC -// transcoding in your service config YAML files. You do this by specifying a -// `HttpRule` that maps the gRPC method to a REST endpoint, achieving the same -// effect as the proto annotation. This can be particularly useful if you -// have a proto that is reused in multiple services. Note that any transcoding -// specified in the service config will override any matching transcoding -// configuration in the proto. -// -// Example: -// -// http: -// rules: -// # Selects a gRPC method and applies HttpRule to it. -// - selector: example.v1.Messaging.GetMessage -// get: /v1/messages/{message_id}/{sub.subfield} -// -// ## Special notes -// -// When gRPC Transcoding is used to map a gRPC to JSON REST endpoints, the -// proto to JSON conversion must follow the [proto3 -// specification](https://developers.google.com/protocol-buffers/docs/proto3#json). -// -// While the single segment variable follows the semantics of -// [RFC 6570](https://tools.ietf.org/html/rfc6570) Section 3.2.2 Simple String -// Expansion, the multi segment variable **does not** follow RFC 6570 Section -// 3.2.3 Reserved Expansion. The reason is that the Reserved Expansion -// does not expand special characters like `?` and `#`, which would lead -// to invalid URLs. As the result, gRPC Transcoding uses a custom encoding -// for multi segment variables. -// -// The path variables **must not** refer to any repeated or mapped field, -// because client libraries are not capable of handling such variable expansion. -// -// The path variables **must not** capture the leading "/" character. The reason -// is that the most common use case "{var}" does not capture the leading "/" -// character. For consistency, all path variables must share the same behavior. -// -// Repeated message fields must not be mapped to URL query parameters, because -// no client library can support such complicated mapping. -// -// If an API needs to use a JSON array for request or response body, it can map -// the request or response body to a repeated field. However, some gRPC -// Transcoding implementations may not support this feature. -type HttpRule struct { - // Selects a method to which this rule applies. - // - // Refer to [selector][google.api.DocumentationRule.selector] for syntax details. - Selector string `protobuf:"bytes,1,opt,name=selector,proto3" json:"selector,omitempty"` - // Determines the URL pattern is matched by this rules. This pattern can be - // used with any of the {get|put|post|delete|patch} methods. A custom method - // can be defined using the 'custom' field. - // - // Types that are valid to be assigned to Pattern: - // *HttpRule_Get - // *HttpRule_Put - // *HttpRule_Post - // *HttpRule_Delete - // *HttpRule_Patch - // *HttpRule_Custom - Pattern isHttpRule_Pattern `protobuf_oneof:"pattern"` - // The name of the request field whose value is mapped to the HTTP request - // body, or `*` for mapping all request fields not captured by the path - // pattern to the HTTP body, or omitted for not having any HTTP request body. - // - // NOTE: the referred field must be present at the top-level of the request - // message type. - Body string `protobuf:"bytes,7,opt,name=body,proto3" json:"body,omitempty"` - // Optional. The name of the response field whose value is mapped to the HTTP - // response body. When omitted, the entire response message will be used - // as the HTTP response body. - // - // NOTE: The referred field must be present at the top-level of the response - // message type. - ResponseBody string `protobuf:"bytes,12,opt,name=response_body,json=responseBody,proto3" json:"response_body,omitempty"` - // Additional HTTP bindings for the selector. Nested bindings must - // not contain an `additional_bindings` field themselves (that is, - // the nesting may only be one level deep). - AdditionalBindings []*HttpRule `protobuf:"bytes,11,rep,name=additional_bindings,json=additionalBindings,proto3" json:"additional_bindings,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *HttpRule) Reset() { *m = HttpRule{} } -func (m *HttpRule) String() string { return proto.CompactTextString(m) } -func (*HttpRule) ProtoMessage() {} -func (*HttpRule) Descriptor() ([]byte, []int) { - return fileDescriptor_ff9994be407cdcc9, []int{1} -} - -func (m *HttpRule) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_HttpRule.Unmarshal(m, b) -} -func (m *HttpRule) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_HttpRule.Marshal(b, m, deterministic) -} -func (m *HttpRule) XXX_Merge(src proto.Message) { - xxx_messageInfo_HttpRule.Merge(m, src) -} -func (m *HttpRule) XXX_Size() int { - return xxx_messageInfo_HttpRule.Size(m) -} -func (m *HttpRule) XXX_DiscardUnknown() { - xxx_messageInfo_HttpRule.DiscardUnknown(m) -} - -var xxx_messageInfo_HttpRule proto.InternalMessageInfo - -func (m *HttpRule) GetSelector() string { - if m != nil { - return m.Selector - } - return "" -} - -type isHttpRule_Pattern interface { - isHttpRule_Pattern() -} - -type HttpRule_Get struct { - Get string `protobuf:"bytes,2,opt,name=get,proto3,oneof"` -} - -type HttpRule_Put struct { - Put string `protobuf:"bytes,3,opt,name=put,proto3,oneof"` -} - -type HttpRule_Post struct { - Post string `protobuf:"bytes,4,opt,name=post,proto3,oneof"` -} - -type HttpRule_Delete struct { - Delete string `protobuf:"bytes,5,opt,name=delete,proto3,oneof"` -} - -type HttpRule_Patch struct { - Patch string `protobuf:"bytes,6,opt,name=patch,proto3,oneof"` -} - -type HttpRule_Custom struct { - Custom *CustomHttpPattern `protobuf:"bytes,8,opt,name=custom,proto3,oneof"` -} - -func (*HttpRule_Get) isHttpRule_Pattern() {} - -func (*HttpRule_Put) isHttpRule_Pattern() {} - -func (*HttpRule_Post) isHttpRule_Pattern() {} - -func (*HttpRule_Delete) isHttpRule_Pattern() {} - -func (*HttpRule_Patch) isHttpRule_Pattern() {} - -func (*HttpRule_Custom) isHttpRule_Pattern() {} - -func (m *HttpRule) GetPattern() isHttpRule_Pattern { - if m != nil { - return m.Pattern - } - return nil -} - -func (m *HttpRule) GetGet() string { - if x, ok := m.GetPattern().(*HttpRule_Get); ok { - return x.Get - } - return "" -} - -func (m *HttpRule) GetPut() string { - if x, ok := m.GetPattern().(*HttpRule_Put); ok { - return x.Put - } - return "" -} - -func (m *HttpRule) GetPost() string { - if x, ok := m.GetPattern().(*HttpRule_Post); ok { - return x.Post - } - return "" -} - -func (m *HttpRule) GetDelete() string { - if x, ok := m.GetPattern().(*HttpRule_Delete); ok { - return x.Delete - } - return "" -} - -func (m *HttpRule) GetPatch() string { - if x, ok := m.GetPattern().(*HttpRule_Patch); ok { - return x.Patch - } - return "" -} - -func (m *HttpRule) GetCustom() *CustomHttpPattern { - if x, ok := m.GetPattern().(*HttpRule_Custom); ok { - return x.Custom - } - return nil -} - -func (m *HttpRule) GetBody() string { - if m != nil { - return m.Body - } - return "" -} - -func (m *HttpRule) GetResponseBody() string { - if m != nil { - return m.ResponseBody - } - return "" -} - -func (m *HttpRule) GetAdditionalBindings() []*HttpRule { - if m != nil { - return m.AdditionalBindings - } - return nil -} - -// XXX_OneofWrappers is for the internal use of the proto package. -func (*HttpRule) XXX_OneofWrappers() []interface{} { - return []interface{}{ - (*HttpRule_Get)(nil), - (*HttpRule_Put)(nil), - (*HttpRule_Post)(nil), - (*HttpRule_Delete)(nil), - (*HttpRule_Patch)(nil), - (*HttpRule_Custom)(nil), - } -} - -// A custom pattern is used for defining custom HTTP verb. -type CustomHttpPattern struct { - // The name of this custom HTTP verb. - Kind string `protobuf:"bytes,1,opt,name=kind,proto3" json:"kind,omitempty"` - // The path matched by this custom verb. - Path string `protobuf:"bytes,2,opt,name=path,proto3" json:"path,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *CustomHttpPattern) Reset() { *m = CustomHttpPattern{} } -func (m *CustomHttpPattern) String() string { return proto.CompactTextString(m) } -func (*CustomHttpPattern) ProtoMessage() {} -func (*CustomHttpPattern) Descriptor() ([]byte, []int) { - return fileDescriptor_ff9994be407cdcc9, []int{2} -} - -func (m *CustomHttpPattern) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_CustomHttpPattern.Unmarshal(m, b) -} -func (m *CustomHttpPattern) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_CustomHttpPattern.Marshal(b, m, deterministic) -} -func (m *CustomHttpPattern) XXX_Merge(src proto.Message) { - xxx_messageInfo_CustomHttpPattern.Merge(m, src) -} -func (m *CustomHttpPattern) XXX_Size() int { - return xxx_messageInfo_CustomHttpPattern.Size(m) -} -func (m *CustomHttpPattern) XXX_DiscardUnknown() { - xxx_messageInfo_CustomHttpPattern.DiscardUnknown(m) -} - -var xxx_messageInfo_CustomHttpPattern proto.InternalMessageInfo - -func (m *CustomHttpPattern) GetKind() string { - if m != nil { - return m.Kind - } - return "" -} - -func (m *CustomHttpPattern) GetPath() string { - if m != nil { - return m.Path - } - return "" -} - -func init() { - proto.RegisterType((*Http)(nil), "google.api.Http") - proto.RegisterType((*HttpRule)(nil), "google.api.HttpRule") - proto.RegisterType((*CustomHttpPattern)(nil), "google.api.CustomHttpPattern") -} - -func init() { - proto.RegisterFile("google/api/http.proto", fileDescriptor_ff9994be407cdcc9) -} - -var fileDescriptor_ff9994be407cdcc9 = []byte{ - // 419 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x92, 0xc1, 0x8e, 0xd3, 0x30, - 0x10, 0x86, 0x49, 0x9b, 0x76, 0xdb, 0xe9, 0x82, 0x84, 0x59, 0x90, 0x85, 0x40, 0x54, 0xe5, 0x52, - 0x71, 0x48, 0xa5, 0xe5, 0xc0, 0x61, 0x4f, 0x1b, 0xa8, 0x58, 0x6e, 0x55, 0x8e, 0x5c, 0x22, 0x37, - 0x1e, 0x52, 0x83, 0xd7, 0xb6, 0xe2, 0x09, 0xa2, 0xaf, 0xc3, 0x63, 0xf1, 0x24, 0x1c, 0x91, 0x9d, - 0x84, 0x56, 0x42, 0xe2, 0x36, 0xf3, 0xff, 0x9f, 0xa7, 0x7f, 0x27, 0x03, 0x4f, 0x6b, 0x6b, 0x6b, - 0x8d, 0x1b, 0xe1, 0xd4, 0xe6, 0x40, 0xe4, 0x32, 0xd7, 0x58, 0xb2, 0x0c, 0x3a, 0x39, 0x13, 0x4e, - 0xad, 0x8e, 0x90, 0xde, 0x11, 0x39, 0xf6, 0x06, 0x26, 0x4d, 0xab, 0xd1, 0xf3, 0x64, 0x39, 0x5e, - 0x2f, 0xae, 0xaf, 0xb2, 0x13, 0x93, 0x05, 0xa0, 0x68, 0x35, 0x16, 0x1d, 0xc2, 0xb6, 0xf0, 0xea, - 0x4b, 0xab, 0xf5, 0xb1, 0x94, 0x58, 0x59, 0x89, 0x65, 0x83, 0x1e, 0x9b, 0xef, 0x28, 0x4b, 0xfc, - 0xe1, 0x84, 0xf1, 0xca, 0x1a, 0x3e, 0x5a, 0x26, 0xeb, 0x59, 0xf1, 0x22, 0x62, 0x1f, 0x22, 0x55, - 0xf4, 0xd0, 0x76, 0x60, 0x56, 0xbf, 0x46, 0x30, 0x1b, 0x46, 0xb3, 0xe7, 0x30, 0xf3, 0xa8, 0xb1, - 0x22, 0xdb, 0xf0, 0x64, 0x99, 0xac, 0xe7, 0xc5, 0xdf, 0x9e, 0x31, 0x18, 0xd7, 0x48, 0x71, 0xe6, - 0xfc, 0xee, 0x41, 0x11, 0x9a, 0xa0, 0xb9, 0x96, 0xf8, 0x78, 0xd0, 0x5c, 0x4b, 0xec, 0x0a, 0x52, - 0x67, 0x3d, 0xf1, 0xb4, 0x17, 0x63, 0xc7, 0x38, 0x4c, 0x25, 0x6a, 0x24, 0xe4, 0x93, 0x5e, 0xef, - 0x7b, 0xf6, 0x0c, 0x26, 0x4e, 0x50, 0x75, 0xe0, 0xd3, 0xde, 0xe8, 0x5a, 0xf6, 0x0e, 0xa6, 0x55, - 0xeb, 0xc9, 0xde, 0xf3, 0xd9, 0x32, 0x59, 0x2f, 0xae, 0x5f, 0x9e, 0x2f, 0xe3, 0x7d, 0x74, 0x42, - 0xee, 0x9d, 0x20, 0xc2, 0xc6, 0x84, 0x81, 0x1d, 0xce, 0x18, 0xa4, 0x7b, 0x2b, 0x8f, 0xfc, 0x22, - 0xfe, 0x81, 0x58, 0xb3, 0xd7, 0xf0, 0xb0, 0x41, 0xef, 0xac, 0xf1, 0x58, 0x46, 0xf3, 0x32, 0x9a, - 0x97, 0x83, 0x98, 0x07, 0x68, 0x0b, 0x4f, 0x84, 0x94, 0x8a, 0x94, 0x35, 0x42, 0x97, 0x7b, 0x65, - 0xa4, 0x32, 0xb5, 0xe7, 0x8b, 0xff, 0x7c, 0x0b, 0x76, 0x7a, 0x90, 0xf7, 0x7c, 0x3e, 0x87, 0x0b, - 0xd7, 0x85, 0x5a, 0xdd, 0xc0, 0xe3, 0x7f, 0x92, 0x86, 0x7c, 0xdf, 0x94, 0x91, 0xfd, 0x82, 0x63, - 0x1d, 0x34, 0x27, 0xe8, 0xd0, 0x6d, 0xb7, 0x88, 0x75, 0xfe, 0x15, 0x1e, 0x55, 0xf6, 0xfe, 0xec, - 0x67, 0xf3, 0x79, 0x1c, 0x13, 0xae, 0x67, 0x97, 0x7c, 0xbe, 0xed, 0x8d, 0xda, 0x6a, 0x61, 0xea, - 0xcc, 0x36, 0xf5, 0xa6, 0x46, 0x13, 0x6f, 0x6b, 0xd3, 0x59, 0xc2, 0x29, 0x1f, 0xaf, 0x4e, 0x18, - 0x63, 0x49, 0x84, 0x98, 0xfe, 0xe6, 0xac, 0xfe, 0x9d, 0x24, 0x3f, 0x47, 0xe9, 0xc7, 0xdb, 0xdd, - 0xa7, 0xfd, 0x34, 0xbe, 0x7b, 0xfb, 0x27, 0x00, 0x00, 0xff, 0xff, 0xae, 0xde, 0xa1, 0xd0, 0xac, - 0x02, 0x00, 0x00, -} diff --git a/vendor/google.golang.org/genproto/googleapis/api/annotations/resource.pb.go b/vendor/google.golang.org/genproto/googleapis/api/annotations/resource.pb.go deleted file mode 100644 index 17048707d9..0000000000 --- a/vendor/google.golang.org/genproto/googleapis/api/annotations/resource.pb.go +++ /dev/null @@ -1,443 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// source: google/api/resource.proto - -package annotations - -import ( - fmt "fmt" - math "math" - - proto "github.com/golang/protobuf/proto" - descriptor "github.com/golang/protobuf/protoc-gen-go/descriptor" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package - -// A description of the historical or future-looking state of the -// resource pattern. -type ResourceDescriptor_History int32 - -const ( - // The "unset" value. - ResourceDescriptor_HISTORY_UNSPECIFIED ResourceDescriptor_History = 0 - // The resource originally had one pattern and launched as such, and - // additional patterns were added later. - ResourceDescriptor_ORIGINALLY_SINGLE_PATTERN ResourceDescriptor_History = 1 - // The resource has one pattern, but the API owner expects to add more - // later. (This is the inverse of ORIGINALLY_SINGLE_PATTERN, and prevents - // that from being necessary once there are multiple patterns.) - ResourceDescriptor_FUTURE_MULTI_PATTERN ResourceDescriptor_History = 2 -) - -var ResourceDescriptor_History_name = map[int32]string{ - 0: "HISTORY_UNSPECIFIED", - 1: "ORIGINALLY_SINGLE_PATTERN", - 2: "FUTURE_MULTI_PATTERN", -} - -var ResourceDescriptor_History_value = map[string]int32{ - "HISTORY_UNSPECIFIED": 0, - "ORIGINALLY_SINGLE_PATTERN": 1, - "FUTURE_MULTI_PATTERN": 2, -} - -func (x ResourceDescriptor_History) String() string { - return proto.EnumName(ResourceDescriptor_History_name, int32(x)) -} - -func (ResourceDescriptor_History) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_465e9122405d1bb5, []int{0, 0} -} - -// A simple descriptor of a resource type. -// -// ResourceDescriptor annotates a resource message (either by means of a -// protobuf annotation or use in the service config), and associates the -// resource's schema, the resource type, and the pattern of the resource name. -// -// Example: -// -// message Topic { -// // Indicates this message defines a resource schema. -// // Declares the resource type in the format of {service}/{kind}. -// // For Kubernetes resources, the format is {api group}/{kind}. -// option (google.api.resource) = { -// type: "pubsub.googleapis.com/Topic" -// name_descriptor: { -// pattern: "projects/{project}/topics/{topic}" -// parent_type: "cloudresourcemanager.googleapis.com/Project" -// parent_name_extractor: "projects/{project}" -// } -// }; -// } -// -// The ResourceDescriptor Yaml config will look like: -// -// resources: -// - type: "pubsub.googleapis.com/Topic" -// name_descriptor: -// - pattern: "projects/{project}/topics/{topic}" -// parent_type: "cloudresourcemanager.googleapis.com/Project" -// parent_name_extractor: "projects/{project}" -// -// Sometimes, resources have multiple patterns, typically because they can -// live under multiple parents. -// -// Example: -// -// message LogEntry { -// option (google.api.resource) = { -// type: "logging.googleapis.com/LogEntry" -// name_descriptor: { -// pattern: "projects/{project}/logs/{log}" -// parent_type: "cloudresourcemanager.googleapis.com/Project" -// parent_name_extractor: "projects/{project}" -// } -// name_descriptor: { -// pattern: "folders/{folder}/logs/{log}" -// parent_type: "cloudresourcemanager.googleapis.com/Folder" -// parent_name_extractor: "folders/{folder}" -// } -// name_descriptor: { -// pattern: "organizations/{organization}/logs/{log}" -// parent_type: "cloudresourcemanager.googleapis.com/Organization" -// parent_name_extractor: "organizations/{organization}" -// } -// name_descriptor: { -// pattern: "billingAccounts/{billing_account}/logs/{log}" -// parent_type: "billing.googleapis.com/BillingAccount" -// parent_name_extractor: "billingAccounts/{billing_account}" -// } -// }; -// } -// -// The ResourceDescriptor Yaml config will look like: -// -// resources: -// - type: 'logging.googleapis.com/LogEntry' -// name_descriptor: -// - pattern: "projects/{project}/logs/{log}" -// parent_type: "cloudresourcemanager.googleapis.com/Project" -// parent_name_extractor: "projects/{project}" -// - pattern: "folders/{folder}/logs/{log}" -// parent_type: "cloudresourcemanager.googleapis.com/Folder" -// parent_name_extractor: "folders/{folder}" -// - pattern: "organizations/{organization}/logs/{log}" -// parent_type: "cloudresourcemanager.googleapis.com/Organization" -// parent_name_extractor: "organizations/{organization}" -// - pattern: "billingAccounts/{billing_account}/logs/{log}" -// parent_type: "billing.googleapis.com/BillingAccount" -// parent_name_extractor: "billingAccounts/{billing_account}" -// -// For flexible resources, the resource name doesn't contain parent names, but -// the resource itself has parents for policy evaluation. -// -// Example: -// -// message Shelf { -// option (google.api.resource) = { -// type: "library.googleapis.com/Shelf" -// name_descriptor: { -// pattern: "shelves/{shelf}" -// parent_type: "cloudresourcemanager.googleapis.com/Project" -// } -// name_descriptor: { -// pattern: "shelves/{shelf}" -// parent_type: "cloudresourcemanager.googleapis.com/Folder" -// } -// }; -// } -// -// The ResourceDescriptor Yaml config will look like: -// -// resources: -// - type: 'library.googleapis.com/Shelf' -// name_descriptor: -// - pattern: "shelves/{shelf}" -// parent_type: "cloudresourcemanager.googleapis.com/Project" -// - pattern: "shelves/{shelf}" -// parent_type: "cloudresourcemanager.googleapis.com/Folder" -type ResourceDescriptor struct { - // The resource type. It must be in the format of - // {service_name}/{resource_type_kind}. The `resource_type_kind` must be - // singular and must not include version numbers. - // - // Example: `storage.googleapis.com/Bucket` - // - // The value of the resource_type_kind must follow the regular expression - // /[A-Za-z][a-zA-Z0-9]+/. It should start with an upper case character and - // should use PascalCase (UpperCamelCase). The maximum number of - // characters allowed for the `resource_type_kind` is 100. - Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` - // Optional. The relative resource name pattern associated with this resource - // type. The DNS prefix of the full resource name shouldn't be specified here. - // - // The path pattern must follow the syntax, which aligns with HTTP binding - // syntax: - // - // Template = Segment { "/" Segment } ; - // Segment = LITERAL | Variable ; - // Variable = "{" LITERAL "}" ; - // - // Examples: - // - // - "projects/{project}/topics/{topic}" - // - "projects/{project}/knowledgeBases/{knowledge_base}" - // - // The components in braces correspond to the IDs for each resource in the - // hierarchy. It is expected that, if multiple patterns are provided, - // the same component name (e.g. "project") refers to IDs of the same - // type of resource. - Pattern []string `protobuf:"bytes,2,rep,name=pattern,proto3" json:"pattern,omitempty"` - // Optional. The field on the resource that designates the resource name - // field. If omitted, this is assumed to be "name". - NameField string `protobuf:"bytes,3,opt,name=name_field,json=nameField,proto3" json:"name_field,omitempty"` - // Optional. The historical or future-looking state of the resource pattern. - // - // Example: - // - // // The InspectTemplate message originally only supported resource - // // names with organization, and project was added later. - // message InspectTemplate { - // option (google.api.resource) = { - // type: "dlp.googleapis.com/InspectTemplate" - // pattern: - // "organizations/{organization}/inspectTemplates/{inspect_template}" - // pattern: "projects/{project}/inspectTemplates/{inspect_template}" - // history: ORIGINALLY_SINGLE_PATTERN - // }; - // } - History ResourceDescriptor_History `protobuf:"varint,4,opt,name=history,proto3,enum=google.api.ResourceDescriptor_History" json:"history,omitempty"` - // The plural name used in the resource name, such as 'projects' for - // the name of 'projects/{project}'. It is the same concept of the `plural` - // field in k8s CRD spec - // https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/ - Plural string `protobuf:"bytes,5,opt,name=plural,proto3" json:"plural,omitempty"` - // The same concept of the `singular` field in k8s CRD spec - // https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/ - // Such as "project" for the `resourcemanager.googleapis.com/Project` type. - Singular string `protobuf:"bytes,6,opt,name=singular,proto3" json:"singular,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ResourceDescriptor) Reset() { *m = ResourceDescriptor{} } -func (m *ResourceDescriptor) String() string { return proto.CompactTextString(m) } -func (*ResourceDescriptor) ProtoMessage() {} -func (*ResourceDescriptor) Descriptor() ([]byte, []int) { - return fileDescriptor_465e9122405d1bb5, []int{0} -} - -func (m *ResourceDescriptor) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ResourceDescriptor.Unmarshal(m, b) -} -func (m *ResourceDescriptor) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ResourceDescriptor.Marshal(b, m, deterministic) -} -func (m *ResourceDescriptor) XXX_Merge(src proto.Message) { - xxx_messageInfo_ResourceDescriptor.Merge(m, src) -} -func (m *ResourceDescriptor) XXX_Size() int { - return xxx_messageInfo_ResourceDescriptor.Size(m) -} -func (m *ResourceDescriptor) XXX_DiscardUnknown() { - xxx_messageInfo_ResourceDescriptor.DiscardUnknown(m) -} - -var xxx_messageInfo_ResourceDescriptor proto.InternalMessageInfo - -func (m *ResourceDescriptor) GetType() string { - if m != nil { - return m.Type - } - return "" -} - -func (m *ResourceDescriptor) GetPattern() []string { - if m != nil { - return m.Pattern - } - return nil -} - -func (m *ResourceDescriptor) GetNameField() string { - if m != nil { - return m.NameField - } - return "" -} - -func (m *ResourceDescriptor) GetHistory() ResourceDescriptor_History { - if m != nil { - return m.History - } - return ResourceDescriptor_HISTORY_UNSPECIFIED -} - -func (m *ResourceDescriptor) GetPlural() string { - if m != nil { - return m.Plural - } - return "" -} - -func (m *ResourceDescriptor) GetSingular() string { - if m != nil { - return m.Singular - } - return "" -} - -// Defines a proto annotation that describes a string field that refers to -// an API resource. -type ResourceReference struct { - // The resource type that the annotated field references. - // - // Example: - // - // message Subscription { - // string topic = 2 [(google.api.resource_reference) = { - // type: "pubsub.googleapis.com/Topic" - // }]; - // } - Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` - // The resource type of a child collection that the annotated field - // references. This is useful for annotating the `parent` field that - // doesn't have a fixed resource type. - // - // Example: - // - // message ListLogEntriesRequest { - // string parent = 1 [(google.api.resource_reference) = { - // child_type: "logging.googleapis.com/LogEntry" - // }; - // } - ChildType string `protobuf:"bytes,2,opt,name=child_type,json=childType,proto3" json:"child_type,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ResourceReference) Reset() { *m = ResourceReference{} } -func (m *ResourceReference) String() string { return proto.CompactTextString(m) } -func (*ResourceReference) ProtoMessage() {} -func (*ResourceReference) Descriptor() ([]byte, []int) { - return fileDescriptor_465e9122405d1bb5, []int{1} -} - -func (m *ResourceReference) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ResourceReference.Unmarshal(m, b) -} -func (m *ResourceReference) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ResourceReference.Marshal(b, m, deterministic) -} -func (m *ResourceReference) XXX_Merge(src proto.Message) { - xxx_messageInfo_ResourceReference.Merge(m, src) -} -func (m *ResourceReference) XXX_Size() int { - return xxx_messageInfo_ResourceReference.Size(m) -} -func (m *ResourceReference) XXX_DiscardUnknown() { - xxx_messageInfo_ResourceReference.DiscardUnknown(m) -} - -var xxx_messageInfo_ResourceReference proto.InternalMessageInfo - -func (m *ResourceReference) GetType() string { - if m != nil { - return m.Type - } - return "" -} - -func (m *ResourceReference) GetChildType() string { - if m != nil { - return m.ChildType - } - return "" -} - -var E_ResourceReference = &proto.ExtensionDesc{ - ExtendedType: (*descriptor.FieldOptions)(nil), - ExtensionType: (*ResourceReference)(nil), - Field: 1055, - Name: "google.api.resource_reference", - Tag: "bytes,1055,opt,name=resource_reference", - Filename: "google/api/resource.proto", -} - -var E_ResourceDefinition = &proto.ExtensionDesc{ - ExtendedType: (*descriptor.FileOptions)(nil), - ExtensionType: ([]*ResourceDescriptor)(nil), - Field: 1053, - Name: "google.api.resource_definition", - Tag: "bytes,1053,rep,name=resource_definition", - Filename: "google/api/resource.proto", -} - -var E_Resource = &proto.ExtensionDesc{ - ExtendedType: (*descriptor.MessageOptions)(nil), - ExtensionType: (*ResourceDescriptor)(nil), - Field: 1053, - Name: "google.api.resource", - Tag: "bytes,1053,opt,name=resource", - Filename: "google/api/resource.proto", -} - -func init() { - proto.RegisterEnum("google.api.ResourceDescriptor_History", ResourceDescriptor_History_name, ResourceDescriptor_History_value) - proto.RegisterType((*ResourceDescriptor)(nil), "google.api.ResourceDescriptor") - proto.RegisterType((*ResourceReference)(nil), "google.api.ResourceReference") - proto.RegisterExtension(E_ResourceReference) - proto.RegisterExtension(E_ResourceDefinition) - proto.RegisterExtension(E_Resource) -} - -func init() { - proto.RegisterFile("google/api/resource.proto", fileDescriptor_465e9122405d1bb5) -} - -var fileDescriptor_465e9122405d1bb5 = []byte{ - // 490 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x53, 0xcd, 0x6e, 0xd3, 0x4c, - 0x14, 0xfd, 0x9c, 0xe4, 0xcb, 0xcf, 0xad, 0xa8, 0xda, 0x29, 0x02, 0xb7, 0x22, 0x60, 0x65, 0x81, - 0xb2, 0xb2, 0xa5, 0xb0, 0x0b, 0x1b, 0x52, 0xe2, 0xa4, 0x96, 0xd2, 0xc4, 0x9a, 0x38, 0x8b, 0x02, - 0x92, 0x35, 0x75, 0x26, 0xee, 0x48, 0xee, 0xcc, 0x68, 0xec, 0x2c, 0xf2, 0x30, 0x08, 0x89, 0x67, - 0xe0, 0xe1, 0x58, 0xa2, 0x8c, 0x7f, 0x88, 0x68, 0x84, 0xd8, 0xcd, 0xbd, 0xe7, 0xde, 0x73, 0x8e, - 0xcf, 0x95, 0xe1, 0x32, 0x16, 0x22, 0x4e, 0xa8, 0x43, 0x24, 0x73, 0x14, 0x4d, 0xc5, 0x56, 0x45, - 0xd4, 0x96, 0x4a, 0x64, 0x02, 0x41, 0x0e, 0xd9, 0x44, 0xb2, 0x2b, 0xab, 0x18, 0xd3, 0xc8, 0xfd, - 0x76, 0xe3, 0xac, 0x69, 0x1a, 0x29, 0x26, 0x33, 0xa1, 0xf2, 0xe9, 0xde, 0x8f, 0x1a, 0x20, 0x5c, - 0x10, 0x8c, 0x2b, 0x10, 0x21, 0x68, 0x64, 0x3b, 0x49, 0x4d, 0xc3, 0x32, 0xfa, 0x1d, 0xac, 0xdf, - 0xc8, 0x84, 0x96, 0x24, 0x59, 0x46, 0x15, 0x37, 0x6b, 0x56, 0xbd, 0xdf, 0xc1, 0x65, 0x89, 0xba, - 0x00, 0x9c, 0x3c, 0xd2, 0x70, 0xc3, 0x68, 0xb2, 0x36, 0xeb, 0x7a, 0xa7, 0xb3, 0xef, 0x4c, 0xf6, - 0x0d, 0xf4, 0x01, 0x5a, 0x0f, 0x2c, 0xcd, 0x84, 0xda, 0x99, 0x0d, 0xcb, 0xe8, 0x9f, 0x0e, 0xde, - 0xda, 0xbf, 0x3d, 0xda, 0x4f, 0xd5, 0xed, 0x9b, 0x7c, 0x1a, 0x97, 0x6b, 0xe8, 0x05, 0x34, 0x65, - 0xb2, 0x55, 0x24, 0x31, 0xff, 0xd7, 0xe4, 0x45, 0x85, 0xae, 0xa0, 0x9d, 0x32, 0x1e, 0x6f, 0x13, - 0xa2, 0xcc, 0xa6, 0x46, 0xaa, 0xba, 0xf7, 0x19, 0x5a, 0x05, 0x0f, 0x7a, 0x09, 0x17, 0x37, 0xde, - 0x32, 0x58, 0xe0, 0xbb, 0x70, 0x35, 0x5f, 0xfa, 0xee, 0x47, 0x6f, 0xe2, 0xb9, 0xe3, 0xb3, 0xff, - 0x50, 0x17, 0x2e, 0x17, 0xd8, 0x9b, 0x7a, 0xf3, 0xd1, 0x6c, 0x76, 0x17, 0x2e, 0xbd, 0xf9, 0x74, - 0xe6, 0x86, 0xfe, 0x28, 0x08, 0x5c, 0x3c, 0x3f, 0x33, 0x90, 0x09, 0xcf, 0x27, 0xab, 0x60, 0x85, - 0xdd, 0xf0, 0x76, 0x35, 0x0b, 0xbc, 0x0a, 0xa9, 0xf5, 0x26, 0x70, 0x5e, 0xfa, 0xc6, 0x74, 0x43, - 0x15, 0xe5, 0x11, 0x3d, 0x1a, 0x5a, 0x17, 0x20, 0x7a, 0x60, 0xc9, 0x3a, 0xd4, 0x48, 0x2d, 0x8f, - 0x46, 0x77, 0x82, 0x9d, 0xa4, 0xc3, 0x04, 0x50, 0x79, 0xbe, 0x50, 0x55, 0x44, 0xdd, 0x32, 0x9f, - 0xf2, 0x6e, 0xb6, 0x0e, 0x72, 0x21, 0x33, 0x26, 0x78, 0x6a, 0x7e, 0x6b, 0x5b, 0x46, 0xff, 0x64, - 0xd0, 0x3d, 0x96, 0x62, 0xe5, 0x06, 0x9f, 0xab, 0x3f, 0x5b, 0x43, 0x0e, 0x17, 0x95, 0xda, 0x9a, - 0x6e, 0x18, 0x67, 0x7b, 0x42, 0xf4, 0xea, 0x88, 0x5c, 0x42, 0x4b, 0xb5, 0xaf, 0x6d, 0xab, 0xde, - 0x3f, 0x19, 0xbc, 0xfe, 0xfb, 0xcd, 0x70, 0xf5, 0x1d, 0xe3, 0x8a, 0x78, 0xf8, 0x05, 0xda, 0x65, - 0x17, 0xbd, 0x79, 0x22, 0x72, 0x4b, 0xd3, 0x94, 0xc4, 0x87, 0x3a, 0xc6, 0x3f, 0xe8, 0x54, 0x8c, - 0xd7, 0x1c, 0x4e, 0x23, 0xf1, 0x78, 0x30, 0x7e, 0xfd, 0xac, 0x9c, 0xf7, 0xf7, 0x1a, 0xbe, 0xf1, - 0x69, 0x54, 0x80, 0xb1, 0x48, 0x08, 0x8f, 0x6d, 0xa1, 0x62, 0x27, 0xa6, 0x5c, 0x3b, 0x70, 0x72, - 0x88, 0x48, 0x96, 0xea, 0xbf, 0x88, 0x70, 0x2e, 0x32, 0xa2, 0xad, 0xbc, 0x3f, 0x78, 0xff, 0x34, - 0x8c, 0xef, 0xb5, 0xc6, 0x74, 0xe4, 0x7b, 0xf7, 0x4d, 0xbd, 0xf7, 0xee, 0x57, 0x00, 0x00, 0x00, - 0xff, 0xff, 0x75, 0x12, 0x53, 0xef, 0x7c, 0x03, 0x00, 0x00, -} diff --git a/vendor/google.golang.org/genproto/googleapis/api/httpbody/httpbody.pb.go b/vendor/google.golang.org/genproto/googleapis/api/httpbody/httpbody.pb.go deleted file mode 100644 index 425dea4a10..0000000000 --- a/vendor/google.golang.org/genproto/googleapis/api/httpbody/httpbody.pb.go +++ /dev/null @@ -1,148 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// source: google/api/httpbody.proto - -package httpbody - -import ( - fmt "fmt" - math "math" - - proto "github.com/golang/protobuf/proto" - any "github.com/golang/protobuf/ptypes/any" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package - -// Message that represents an arbitrary HTTP body. It should only be used for -// payload formats that can't be represented as JSON, such as raw binary or -// an HTML page. -// -// -// This message can be used both in streaming and non-streaming API methods in -// the request as well as the response. -// -// It can be used as a top-level request field, which is convenient if one -// wants to extract parameters from either the URL or HTTP template into the -// request fields and also want access to the raw HTTP body. -// -// Example: -// -// message GetResourceRequest { -// // A unique request id. -// string request_id = 1; -// -// // The raw HTTP body is bound to this field. -// google.api.HttpBody http_body = 2; -// } -// -// service ResourceService { -// rpc GetResource(GetResourceRequest) returns (google.api.HttpBody); -// rpc UpdateResource(google.api.HttpBody) returns -// (google.protobuf.Empty); -// } -// -// Example with streaming methods: -// -// service CaldavService { -// rpc GetCalendar(stream google.api.HttpBody) -// returns (stream google.api.HttpBody); -// rpc UpdateCalendar(stream google.api.HttpBody) -// returns (stream google.api.HttpBody); -// } -// -// Use of this type only changes how the request and response bodies are -// handled, all other features will continue to work unchanged. -type HttpBody struct { - // The HTTP Content-Type header value specifying the content type of the body. - ContentType string `protobuf:"bytes,1,opt,name=content_type,json=contentType,proto3" json:"content_type,omitempty"` - // The HTTP request/response body as raw binary. - Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` - // Application specific response metadata. Must be set in the first response - // for streaming APIs. - Extensions []*any.Any `protobuf:"bytes,3,rep,name=extensions,proto3" json:"extensions,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *HttpBody) Reset() { *m = HttpBody{} } -func (m *HttpBody) String() string { return proto.CompactTextString(m) } -func (*HttpBody) ProtoMessage() {} -func (*HttpBody) Descriptor() ([]byte, []int) { - return fileDescriptor_09ea2ecaa32a0070, []int{0} -} - -func (m *HttpBody) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_HttpBody.Unmarshal(m, b) -} -func (m *HttpBody) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_HttpBody.Marshal(b, m, deterministic) -} -func (m *HttpBody) XXX_Merge(src proto.Message) { - xxx_messageInfo_HttpBody.Merge(m, src) -} -func (m *HttpBody) XXX_Size() int { - return xxx_messageInfo_HttpBody.Size(m) -} -func (m *HttpBody) XXX_DiscardUnknown() { - xxx_messageInfo_HttpBody.DiscardUnknown(m) -} - -var xxx_messageInfo_HttpBody proto.InternalMessageInfo - -func (m *HttpBody) GetContentType() string { - if m != nil { - return m.ContentType - } - return "" -} - -func (m *HttpBody) GetData() []byte { - if m != nil { - return m.Data - } - return nil -} - -func (m *HttpBody) GetExtensions() []*any.Any { - if m != nil { - return m.Extensions - } - return nil -} - -func init() { - proto.RegisterType((*HttpBody)(nil), "google.api.HttpBody") -} - -func init() { - proto.RegisterFile("google/api/httpbody.proto", fileDescriptor_09ea2ecaa32a0070) -} - -var fileDescriptor_09ea2ecaa32a0070 = []byte{ - // 229 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x54, 0x8f, 0x31, 0x4f, 0xc3, 0x30, - 0x10, 0x85, 0xe5, 0xb6, 0x42, 0x70, 0x2d, 0x0c, 0x16, 0x43, 0x60, 0x0a, 0x4c, 0x99, 0x6c, 0x09, - 0xd8, 0x3a, 0x35, 0x0b, 0xb0, 0x45, 0x11, 0x13, 0x0b, 0x72, 0x1a, 0xe3, 0x46, 0x2a, 0x77, 0xa7, - 0xe6, 0x10, 0xf8, 0xef, 0xf0, 0x2b, 0x19, 0x11, 0x69, 0x2c, 0xe8, 0xf6, 0xe4, 0xef, 0x3d, 0xbf, - 0x77, 0x70, 0x11, 0x88, 0xc2, 0xd6, 0x5b, 0xc7, 0x9d, 0xdd, 0x88, 0x70, 0x43, 0x6d, 0x34, 0xbc, - 0x23, 0x21, 0x0d, 0x7b, 0x64, 0x1c, 0x77, 0x97, 0xc9, 0x36, 0x90, 0xe6, 0xfd, 0xd5, 0x3a, 0x1c, - 0x6d, 0xd7, 0x1f, 0x70, 0xfc, 0x20, 0xc2, 0x25, 0xb5, 0x51, 0x5f, 0xc1, 0x62, 0x4d, 0x28, 0x1e, - 0xe5, 0x45, 0x22, 0xfb, 0x4c, 0xe5, 0xaa, 0x38, 0xa9, 0xe7, 0xe3, 0xdb, 0x53, 0x64, 0xaf, 0x35, - 0xcc, 0x5a, 0x27, 0x2e, 0x9b, 0xe4, 0xaa, 0x58, 0xd4, 0x83, 0xd6, 0x77, 0x00, 0xfe, 0x53, 0x3c, - 0xf6, 0x1d, 0x61, 0x9f, 0x4d, 0xf3, 0x69, 0x31, 0xbf, 0x39, 0x37, 0x63, 0x7d, 0xaa, 0x34, 0x2b, - 0x8c, 0xf5, 0x3f, 0x5f, 0xb9, 0x81, 0xb3, 0x35, 0xbd, 0x99, 0xbf, 0x95, 0xe5, 0x69, 0x1a, 0x52, - 0xfd, 0x66, 0x2a, 0xf5, 0xbc, 0x1c, 0x61, 0xa0, 0xad, 0xc3, 0x60, 0x68, 0x17, 0x6c, 0xf0, 0x38, - 0xfc, 0x68, 0xf7, 0xc8, 0x71, 0xd7, 0x1f, 0x1c, 0xbf, 0x4c, 0xe2, 0x5b, 0xa9, 0xaf, 0xc9, 0xec, - 0x7e, 0x55, 0x3d, 0x36, 0x47, 0x43, 0xe2, 0xf6, 0x27, 0x00, 0x00, 0xff, 0xff, 0x78, 0xb9, 0x16, - 0x2b, 0x2d, 0x01, 0x00, 0x00, -} diff --git a/vendor/google.golang.org/genproto/protobuf/field_mask/field_mask.pb.go b/vendor/google.golang.org/genproto/protobuf/field_mask/field_mask.pb.go deleted file mode 100644 index 44fb5e6303..0000000000 --- a/vendor/google.golang.org/genproto/protobuf/field_mask/field_mask.pb.go +++ /dev/null @@ -1,284 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// source: google/protobuf/field_mask.proto - -package field_mask - -import ( - fmt "fmt" - math "math" - - proto "github.com/golang/protobuf/proto" -) - -// 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 - -// `FieldMask` represents a set of symbolic field paths, for example: -// -// paths: "f.a" -// paths: "f.b.d" -// -// Here `f` represents a field in some root message, `a` and `b` -// fields in the message found in `f`, and `d` a field found in the -// message in `f.b`. -// -// Field masks are used to specify a subset of fields that should be -// returned by a get operation or modified by an update operation. -// Field masks also have a custom JSON encoding (see below). -// -// # Field Masks in Projections -// -// When used in the context of a projection, a response message or -// sub-message is filtered by the API to only contain those fields as -// specified in the mask. For example, if the mask in the previous -// example is applied to a response message as follows: -// -// f { -// a : 22 -// b { -// d : 1 -// x : 2 -// } -// y : 13 -// } -// z: 8 -// -// The result will not contain specific values for fields x,y and z -// (their value will be set to the default, and omitted in proto text -// output): -// -// -// f { -// a : 22 -// b { -// d : 1 -// } -// } -// -// A repeated field is not allowed except at the last position of a -// paths string. -// -// If a FieldMask object is not present in a get operation, the -// operation applies to all fields (as if a FieldMask of all fields -// had been specified). -// -// Note that a field mask does not necessarily apply to the -// top-level response message. In case of a REST get operation, the -// field mask applies directly to the response, but in case of a REST -// list operation, the mask instead applies to each individual message -// in the returned resource list. In case of a REST custom method, -// other definitions may be used. Where the mask applies will be -// clearly documented together with its declaration in the API. In -// any case, the effect on the returned resource/resources is required -// behavior for APIs. -// -// # Field Masks in Update Operations -// -// A field mask in update operations specifies which fields of the -// targeted resource are going to be updated. The API is required -// to only change the values of the fields as specified in the mask -// and leave the others untouched. If a resource is passed in to -// describe the updated values, the API ignores the values of all -// fields not covered by the mask. -// -// If a repeated field is specified for an update operation, new values will -// be appended to the existing repeated field in the target resource. Note that -// a repeated field is only allowed in the last position of a `paths` string. -// -// If a sub-message is specified in the last position of the field mask for an -// update operation, then new value will be merged into the existing sub-message -// in the target resource. -// -// For example, given the target message: -// -// f { -// b { -// d: 1 -// x: 2 -// } -// c: [1] -// } -// -// And an update message: -// -// f { -// b { -// d: 10 -// } -// c: [2] -// } -// -// then if the field mask is: -// -// paths: ["f.b", "f.c"] -// -// then the result will be: -// -// f { -// b { -// d: 10 -// x: 2 -// } -// c: [1, 2] -// } -// -// An implementation may provide options to override this default behavior for -// repeated and message fields. -// -// In order to reset a field's value to the default, the field must -// be in the mask and set to the default value in the provided resource. -// Hence, in order to reset all fields of a resource, provide a default -// instance of the resource and set all fields in the mask, or do -// not provide a mask as described below. -// -// If a field mask is not present on update, the operation applies to -// all fields (as if a field mask of all fields has been specified). -// Note that in the presence of schema evolution, this may mean that -// fields the client does not know and has therefore not filled into -// the request will be reset to their default. If this is unwanted -// behavior, a specific service may require a client to always specify -// a field mask, producing an error if not. -// -// As with get operations, the location of the resource which -// describes the updated values in the request message depends on the -// operation kind. In any case, the effect of the field mask is -// required to be honored by the API. -// -// ## Considerations for HTTP REST -// -// The HTTP kind of an update operation which uses a field mask must -// be set to PATCH instead of PUT in order to satisfy HTTP semantics -// (PUT must only be used for full updates). -// -// # JSON Encoding of Field Masks -// -// In JSON, a field mask is encoded as a single string where paths are -// separated by a comma. Fields name in each path are converted -// to/from lower-camel naming conventions. -// -// As an example, consider the following message declarations: -// -// message Profile { -// User user = 1; -// Photo photo = 2; -// } -// message User { -// string display_name = 1; -// string address = 2; -// } -// -// In proto a field mask for `Profile` may look as such: -// -// mask { -// paths: "user.display_name" -// paths: "photo" -// } -// -// In JSON, the same mask is represented as below: -// -// { -// mask: "user.displayName,photo" -// } -// -// # Field Masks and Oneof Fields -// -// Field masks treat fields in oneofs just as regular fields. Consider the -// following message: -// -// message SampleMessage { -// oneof test_oneof { -// string name = 4; -// SubMessage sub_message = 9; -// } -// } -// -// The field mask can be: -// -// mask { -// paths: "name" -// } -// -// Or: -// -// mask { -// paths: "sub_message" -// } -// -// Note that oneof type names ("test_oneof" in this case) cannot be used in -// paths. -// -// ## Field Mask Verification -// -// The implementation of any API method which has a FieldMask type field in the -// request should verify the included field paths, and return an -// `INVALID_ARGUMENT` error if any path is unmappable. -type FieldMask struct { - // The set of field mask paths. - Paths []string `protobuf:"bytes,1,rep,name=paths,proto3" json:"paths,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *FieldMask) Reset() { *m = FieldMask{} } -func (m *FieldMask) String() string { return proto.CompactTextString(m) } -func (*FieldMask) ProtoMessage() {} -func (*FieldMask) Descriptor() ([]byte, []int) { - return fileDescriptor_5158202634f0da48, []int{0} -} - -func (m *FieldMask) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_FieldMask.Unmarshal(m, b) -} -func (m *FieldMask) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_FieldMask.Marshal(b, m, deterministic) -} -func (m *FieldMask) XXX_Merge(src proto.Message) { - xxx_messageInfo_FieldMask.Merge(m, src) -} -func (m *FieldMask) XXX_Size() int { - return xxx_messageInfo_FieldMask.Size(m) -} -func (m *FieldMask) XXX_DiscardUnknown() { - xxx_messageInfo_FieldMask.DiscardUnknown(m) -} - -var xxx_messageInfo_FieldMask proto.InternalMessageInfo - -func (m *FieldMask) GetPaths() []string { - if m != nil { - return m.Paths - } - return nil -} - -func init() { - proto.RegisterType((*FieldMask)(nil), "google.protobuf.FieldMask") -} - -func init() { - proto.RegisterFile("google/protobuf/field_mask.proto", fileDescriptor_5158202634f0da48) -} - -var fileDescriptor_5158202634f0da48 = []byte{ - // 175 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x48, 0xcf, 0xcf, 0x4f, - 0xcf, 0x49, 0xd5, 0x2f, 0x28, 0xca, 0x2f, 0xc9, 0x4f, 0x2a, 0x4d, 0xd3, 0x4f, 0xcb, 0x4c, 0xcd, - 0x49, 0x89, 0xcf, 0x4d, 0x2c, 0xce, 0xd6, 0x03, 0x8b, 0x09, 0xf1, 0x43, 0x54, 0xe8, 0xc1, 0x54, - 0x28, 0x29, 0x72, 0x71, 0xba, 0x81, 0x14, 0xf9, 0x26, 0x16, 0x67, 0x0b, 0x89, 0x70, 0xb1, 0x16, - 0x24, 0x96, 0x64, 0x14, 0x4b, 0x30, 0x2a, 0x30, 0x6b, 0x70, 0x06, 0x41, 0x38, 0x4e, 0x3d, 0x8c, - 0x5c, 0xc2, 0xc9, 0xf9, 0xb9, 0x7a, 0x68, 0x5a, 0x9d, 0xf8, 0xe0, 0x1a, 0x03, 0x40, 0x42, 0x01, - 0x8c, 0x51, 0x96, 0x50, 0x25, 0xe9, 0xf9, 0x39, 0x89, 0x79, 0xe9, 0x7a, 0xf9, 0x45, 0xe9, 0xfa, - 0xe9, 0xa9, 0x79, 0x60, 0x0d, 0xd8, 0xdc, 0x64, 0x8d, 0x60, 0xfe, 0x60, 0x64, 0x5c, 0xc4, 0xc4, - 0xec, 0x1e, 0xe0, 0xb4, 0x8a, 0x49, 0xce, 0x1d, 0x62, 0x48, 0x00, 0x54, 0x83, 0x5e, 0x78, 0x6a, - 0x4e, 0x8e, 0x77, 0x5e, 0x7e, 0x79, 0x5e, 0x48, 0x65, 0x41, 0x6a, 0x71, 0x12, 0x1b, 0xd8, 0x24, - 0x63, 0x40, 0x00, 0x00, 0x00, 0xff, 0xff, 0xfd, 0xda, 0xb7, 0xa8, 0xed, 0x00, 0x00, 0x00, -} diff --git a/vendor/google.golang.org/grpc/reflection/README.md b/vendor/google.golang.org/grpc/reflection/README.md deleted file mode 100644 index 04b6371afc..0000000000 --- a/vendor/google.golang.org/grpc/reflection/README.md +++ /dev/null @@ -1,18 +0,0 @@ -# Reflection - -Package reflection implements server reflection service. - -The service implemented is defined in: https://github.com/grpc/grpc/blob/master/src/proto/grpc/reflection/v1alpha/reflection.proto. - -To register server reflection on a gRPC server: -```go -import "google.golang.org/grpc/reflection" - -s := grpc.NewServer() -pb.RegisterYourOwnServer(s, &server{}) - -// Register reflection service on gRPC server. -reflection.Register(s) - -s.Serve(lis) -``` diff --git a/vendor/google.golang.org/grpc/reflection/grpc_reflection_v1alpha/reflection.pb.go b/vendor/google.golang.org/grpc/reflection/grpc_reflection_v1alpha/reflection.pb.go deleted file mode 100644 index 0a12ad2232..0000000000 --- a/vendor/google.golang.org/grpc/reflection/grpc_reflection_v1alpha/reflection.pb.go +++ /dev/null @@ -1,750 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// source: grpc_reflection_v1alpha/reflection.proto - -package grpc_reflection_v1alpha - -import ( - context "context" - fmt "fmt" - proto "github.com/golang/protobuf/proto" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" - math "math" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package - -// The message sent by the client when calling ServerReflectionInfo method. -type ServerReflectionRequest struct { - Host string `protobuf:"bytes,1,opt,name=host,proto3" json:"host,omitempty"` - // To use reflection service, the client should set one of the following - // fields in message_request. The server distinguishes requests by their - // defined field and then handles them using corresponding methods. - // - // Types that are valid to be assigned to MessageRequest: - // *ServerReflectionRequest_FileByFilename - // *ServerReflectionRequest_FileContainingSymbol - // *ServerReflectionRequest_FileContainingExtension - // *ServerReflectionRequest_AllExtensionNumbersOfType - // *ServerReflectionRequest_ListServices - MessageRequest isServerReflectionRequest_MessageRequest `protobuf_oneof:"message_request"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ServerReflectionRequest) Reset() { *m = ServerReflectionRequest{} } -func (m *ServerReflectionRequest) String() string { return proto.CompactTextString(m) } -func (*ServerReflectionRequest) ProtoMessage() {} -func (*ServerReflectionRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_42a8ac412db3cb03, []int{0} -} - -func (m *ServerReflectionRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ServerReflectionRequest.Unmarshal(m, b) -} -func (m *ServerReflectionRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ServerReflectionRequest.Marshal(b, m, deterministic) -} -func (m *ServerReflectionRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_ServerReflectionRequest.Merge(m, src) -} -func (m *ServerReflectionRequest) XXX_Size() int { - return xxx_messageInfo_ServerReflectionRequest.Size(m) -} -func (m *ServerReflectionRequest) XXX_DiscardUnknown() { - xxx_messageInfo_ServerReflectionRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_ServerReflectionRequest proto.InternalMessageInfo - -func (m *ServerReflectionRequest) GetHost() string { - if m != nil { - return m.Host - } - return "" -} - -type isServerReflectionRequest_MessageRequest interface { - isServerReflectionRequest_MessageRequest() -} - -type ServerReflectionRequest_FileByFilename struct { - FileByFilename string `protobuf:"bytes,3,opt,name=file_by_filename,json=fileByFilename,proto3,oneof"` -} - -type ServerReflectionRequest_FileContainingSymbol struct { - FileContainingSymbol string `protobuf:"bytes,4,opt,name=file_containing_symbol,json=fileContainingSymbol,proto3,oneof"` -} - -type ServerReflectionRequest_FileContainingExtension struct { - FileContainingExtension *ExtensionRequest `protobuf:"bytes,5,opt,name=file_containing_extension,json=fileContainingExtension,proto3,oneof"` -} - -type ServerReflectionRequest_AllExtensionNumbersOfType struct { - AllExtensionNumbersOfType string `protobuf:"bytes,6,opt,name=all_extension_numbers_of_type,json=allExtensionNumbersOfType,proto3,oneof"` -} - -type ServerReflectionRequest_ListServices struct { - ListServices string `protobuf:"bytes,7,opt,name=list_services,json=listServices,proto3,oneof"` -} - -func (*ServerReflectionRequest_FileByFilename) isServerReflectionRequest_MessageRequest() {} - -func (*ServerReflectionRequest_FileContainingSymbol) isServerReflectionRequest_MessageRequest() {} - -func (*ServerReflectionRequest_FileContainingExtension) isServerReflectionRequest_MessageRequest() {} - -func (*ServerReflectionRequest_AllExtensionNumbersOfType) isServerReflectionRequest_MessageRequest() {} - -func (*ServerReflectionRequest_ListServices) isServerReflectionRequest_MessageRequest() {} - -func (m *ServerReflectionRequest) GetMessageRequest() isServerReflectionRequest_MessageRequest { - if m != nil { - return m.MessageRequest - } - return nil -} - -func (m *ServerReflectionRequest) GetFileByFilename() string { - if x, ok := m.GetMessageRequest().(*ServerReflectionRequest_FileByFilename); ok { - return x.FileByFilename - } - return "" -} - -func (m *ServerReflectionRequest) GetFileContainingSymbol() string { - if x, ok := m.GetMessageRequest().(*ServerReflectionRequest_FileContainingSymbol); ok { - return x.FileContainingSymbol - } - return "" -} - -func (m *ServerReflectionRequest) GetFileContainingExtension() *ExtensionRequest { - if x, ok := m.GetMessageRequest().(*ServerReflectionRequest_FileContainingExtension); ok { - return x.FileContainingExtension - } - return nil -} - -func (m *ServerReflectionRequest) GetAllExtensionNumbersOfType() string { - if x, ok := m.GetMessageRequest().(*ServerReflectionRequest_AllExtensionNumbersOfType); ok { - return x.AllExtensionNumbersOfType - } - return "" -} - -func (m *ServerReflectionRequest) GetListServices() string { - if x, ok := m.GetMessageRequest().(*ServerReflectionRequest_ListServices); ok { - return x.ListServices - } - return "" -} - -// XXX_OneofWrappers is for the internal use of the proto package. -func (*ServerReflectionRequest) XXX_OneofWrappers() []interface{} { - return []interface{}{ - (*ServerReflectionRequest_FileByFilename)(nil), - (*ServerReflectionRequest_FileContainingSymbol)(nil), - (*ServerReflectionRequest_FileContainingExtension)(nil), - (*ServerReflectionRequest_AllExtensionNumbersOfType)(nil), - (*ServerReflectionRequest_ListServices)(nil), - } -} - -// The type name and extension number sent by the client when requesting -// file_containing_extension. -type ExtensionRequest struct { - // Fully-qualified type name. The format should be . - ContainingType string `protobuf:"bytes,1,opt,name=containing_type,json=containingType,proto3" json:"containing_type,omitempty"` - ExtensionNumber int32 `protobuf:"varint,2,opt,name=extension_number,json=extensionNumber,proto3" json:"extension_number,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ExtensionRequest) Reset() { *m = ExtensionRequest{} } -func (m *ExtensionRequest) String() string { return proto.CompactTextString(m) } -func (*ExtensionRequest) ProtoMessage() {} -func (*ExtensionRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_42a8ac412db3cb03, []int{1} -} - -func (m *ExtensionRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ExtensionRequest.Unmarshal(m, b) -} -func (m *ExtensionRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ExtensionRequest.Marshal(b, m, deterministic) -} -func (m *ExtensionRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_ExtensionRequest.Merge(m, src) -} -func (m *ExtensionRequest) XXX_Size() int { - return xxx_messageInfo_ExtensionRequest.Size(m) -} -func (m *ExtensionRequest) XXX_DiscardUnknown() { - xxx_messageInfo_ExtensionRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_ExtensionRequest proto.InternalMessageInfo - -func (m *ExtensionRequest) GetContainingType() string { - if m != nil { - return m.ContainingType - } - return "" -} - -func (m *ExtensionRequest) GetExtensionNumber() int32 { - if m != nil { - return m.ExtensionNumber - } - return 0 -} - -// The message sent by the server to answer ServerReflectionInfo method. -type ServerReflectionResponse struct { - ValidHost string `protobuf:"bytes,1,opt,name=valid_host,json=validHost,proto3" json:"valid_host,omitempty"` - OriginalRequest *ServerReflectionRequest `protobuf:"bytes,2,opt,name=original_request,json=originalRequest,proto3" json:"original_request,omitempty"` - // The server sets one of the following fields according to the - // message_request in the request. - // - // Types that are valid to be assigned to MessageResponse: - // *ServerReflectionResponse_FileDescriptorResponse - // *ServerReflectionResponse_AllExtensionNumbersResponse - // *ServerReflectionResponse_ListServicesResponse - // *ServerReflectionResponse_ErrorResponse - MessageResponse isServerReflectionResponse_MessageResponse `protobuf_oneof:"message_response"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ServerReflectionResponse) Reset() { *m = ServerReflectionResponse{} } -func (m *ServerReflectionResponse) String() string { return proto.CompactTextString(m) } -func (*ServerReflectionResponse) ProtoMessage() {} -func (*ServerReflectionResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_42a8ac412db3cb03, []int{2} -} - -func (m *ServerReflectionResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ServerReflectionResponse.Unmarshal(m, b) -} -func (m *ServerReflectionResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ServerReflectionResponse.Marshal(b, m, deterministic) -} -func (m *ServerReflectionResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_ServerReflectionResponse.Merge(m, src) -} -func (m *ServerReflectionResponse) XXX_Size() int { - return xxx_messageInfo_ServerReflectionResponse.Size(m) -} -func (m *ServerReflectionResponse) XXX_DiscardUnknown() { - xxx_messageInfo_ServerReflectionResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_ServerReflectionResponse proto.InternalMessageInfo - -func (m *ServerReflectionResponse) GetValidHost() string { - if m != nil { - return m.ValidHost - } - return "" -} - -func (m *ServerReflectionResponse) GetOriginalRequest() *ServerReflectionRequest { - if m != nil { - return m.OriginalRequest - } - return nil -} - -type isServerReflectionResponse_MessageResponse interface { - isServerReflectionResponse_MessageResponse() -} - -type ServerReflectionResponse_FileDescriptorResponse struct { - FileDescriptorResponse *FileDescriptorResponse `protobuf:"bytes,4,opt,name=file_descriptor_response,json=fileDescriptorResponse,proto3,oneof"` -} - -type ServerReflectionResponse_AllExtensionNumbersResponse struct { - AllExtensionNumbersResponse *ExtensionNumberResponse `protobuf:"bytes,5,opt,name=all_extension_numbers_response,json=allExtensionNumbersResponse,proto3,oneof"` -} - -type ServerReflectionResponse_ListServicesResponse struct { - ListServicesResponse *ListServiceResponse `protobuf:"bytes,6,opt,name=list_services_response,json=listServicesResponse,proto3,oneof"` -} - -type ServerReflectionResponse_ErrorResponse struct { - ErrorResponse *ErrorResponse `protobuf:"bytes,7,opt,name=error_response,json=errorResponse,proto3,oneof"` -} - -func (*ServerReflectionResponse_FileDescriptorResponse) isServerReflectionResponse_MessageResponse() {} - -func (*ServerReflectionResponse_AllExtensionNumbersResponse) isServerReflectionResponse_MessageResponse() { -} - -func (*ServerReflectionResponse_ListServicesResponse) isServerReflectionResponse_MessageResponse() {} - -func (*ServerReflectionResponse_ErrorResponse) isServerReflectionResponse_MessageResponse() {} - -func (m *ServerReflectionResponse) GetMessageResponse() isServerReflectionResponse_MessageResponse { - if m != nil { - return m.MessageResponse - } - return nil -} - -func (m *ServerReflectionResponse) GetFileDescriptorResponse() *FileDescriptorResponse { - if x, ok := m.GetMessageResponse().(*ServerReflectionResponse_FileDescriptorResponse); ok { - return x.FileDescriptorResponse - } - return nil -} - -func (m *ServerReflectionResponse) GetAllExtensionNumbersResponse() *ExtensionNumberResponse { - if x, ok := m.GetMessageResponse().(*ServerReflectionResponse_AllExtensionNumbersResponse); ok { - return x.AllExtensionNumbersResponse - } - return nil -} - -func (m *ServerReflectionResponse) GetListServicesResponse() *ListServiceResponse { - if x, ok := m.GetMessageResponse().(*ServerReflectionResponse_ListServicesResponse); ok { - return x.ListServicesResponse - } - return nil -} - -func (m *ServerReflectionResponse) GetErrorResponse() *ErrorResponse { - if x, ok := m.GetMessageResponse().(*ServerReflectionResponse_ErrorResponse); ok { - return x.ErrorResponse - } - return nil -} - -// XXX_OneofWrappers is for the internal use of the proto package. -func (*ServerReflectionResponse) XXX_OneofWrappers() []interface{} { - return []interface{}{ - (*ServerReflectionResponse_FileDescriptorResponse)(nil), - (*ServerReflectionResponse_AllExtensionNumbersResponse)(nil), - (*ServerReflectionResponse_ListServicesResponse)(nil), - (*ServerReflectionResponse_ErrorResponse)(nil), - } -} - -// Serialized FileDescriptorProto messages sent by the server answering -// a file_by_filename, file_containing_symbol, or file_containing_extension -// request. -type FileDescriptorResponse struct { - // Serialized FileDescriptorProto messages. We avoid taking a dependency on - // descriptor.proto, which uses proto2 only features, by making them opaque - // bytes instead. - FileDescriptorProto [][]byte `protobuf:"bytes,1,rep,name=file_descriptor_proto,json=fileDescriptorProto,proto3" json:"file_descriptor_proto,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *FileDescriptorResponse) Reset() { *m = FileDescriptorResponse{} } -func (m *FileDescriptorResponse) String() string { return proto.CompactTextString(m) } -func (*FileDescriptorResponse) ProtoMessage() {} -func (*FileDescriptorResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_42a8ac412db3cb03, []int{3} -} - -func (m *FileDescriptorResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_FileDescriptorResponse.Unmarshal(m, b) -} -func (m *FileDescriptorResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_FileDescriptorResponse.Marshal(b, m, deterministic) -} -func (m *FileDescriptorResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_FileDescriptorResponse.Merge(m, src) -} -func (m *FileDescriptorResponse) XXX_Size() int { - return xxx_messageInfo_FileDescriptorResponse.Size(m) -} -func (m *FileDescriptorResponse) XXX_DiscardUnknown() { - xxx_messageInfo_FileDescriptorResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_FileDescriptorResponse proto.InternalMessageInfo - -func (m *FileDescriptorResponse) GetFileDescriptorProto() [][]byte { - if m != nil { - return m.FileDescriptorProto - } - return nil -} - -// A list of extension numbers sent by the server answering -// all_extension_numbers_of_type request. -type ExtensionNumberResponse struct { - // Full name of the base type, including the package name. The format - // is . - BaseTypeName string `protobuf:"bytes,1,opt,name=base_type_name,json=baseTypeName,proto3" json:"base_type_name,omitempty"` - ExtensionNumber []int32 `protobuf:"varint,2,rep,packed,name=extension_number,json=extensionNumber,proto3" json:"extension_number,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ExtensionNumberResponse) Reset() { *m = ExtensionNumberResponse{} } -func (m *ExtensionNumberResponse) String() string { return proto.CompactTextString(m) } -func (*ExtensionNumberResponse) ProtoMessage() {} -func (*ExtensionNumberResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_42a8ac412db3cb03, []int{4} -} - -func (m *ExtensionNumberResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ExtensionNumberResponse.Unmarshal(m, b) -} -func (m *ExtensionNumberResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ExtensionNumberResponse.Marshal(b, m, deterministic) -} -func (m *ExtensionNumberResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_ExtensionNumberResponse.Merge(m, src) -} -func (m *ExtensionNumberResponse) XXX_Size() int { - return xxx_messageInfo_ExtensionNumberResponse.Size(m) -} -func (m *ExtensionNumberResponse) XXX_DiscardUnknown() { - xxx_messageInfo_ExtensionNumberResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_ExtensionNumberResponse proto.InternalMessageInfo - -func (m *ExtensionNumberResponse) GetBaseTypeName() string { - if m != nil { - return m.BaseTypeName - } - return "" -} - -func (m *ExtensionNumberResponse) GetExtensionNumber() []int32 { - if m != nil { - return m.ExtensionNumber - } - return nil -} - -// A list of ServiceResponse sent by the server answering list_services request. -type ListServiceResponse struct { - // The information of each service may be expanded in the future, so we use - // ServiceResponse message to encapsulate it. - Service []*ServiceResponse `protobuf:"bytes,1,rep,name=service,proto3" json:"service,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ListServiceResponse) Reset() { *m = ListServiceResponse{} } -func (m *ListServiceResponse) String() string { return proto.CompactTextString(m) } -func (*ListServiceResponse) ProtoMessage() {} -func (*ListServiceResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_42a8ac412db3cb03, []int{5} -} - -func (m *ListServiceResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ListServiceResponse.Unmarshal(m, b) -} -func (m *ListServiceResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ListServiceResponse.Marshal(b, m, deterministic) -} -func (m *ListServiceResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_ListServiceResponse.Merge(m, src) -} -func (m *ListServiceResponse) XXX_Size() int { - return xxx_messageInfo_ListServiceResponse.Size(m) -} -func (m *ListServiceResponse) XXX_DiscardUnknown() { - xxx_messageInfo_ListServiceResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_ListServiceResponse proto.InternalMessageInfo - -func (m *ListServiceResponse) GetService() []*ServiceResponse { - if m != nil { - return m.Service - } - return nil -} - -// The information of a single service used by ListServiceResponse to answer -// list_services request. -type ServiceResponse struct { - // Full name of a registered service, including its package name. The format - // is . - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ServiceResponse) Reset() { *m = ServiceResponse{} } -func (m *ServiceResponse) String() string { return proto.CompactTextString(m) } -func (*ServiceResponse) ProtoMessage() {} -func (*ServiceResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_42a8ac412db3cb03, []int{6} -} - -func (m *ServiceResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ServiceResponse.Unmarshal(m, b) -} -func (m *ServiceResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ServiceResponse.Marshal(b, m, deterministic) -} -func (m *ServiceResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_ServiceResponse.Merge(m, src) -} -func (m *ServiceResponse) XXX_Size() int { - return xxx_messageInfo_ServiceResponse.Size(m) -} -func (m *ServiceResponse) XXX_DiscardUnknown() { - xxx_messageInfo_ServiceResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_ServiceResponse proto.InternalMessageInfo - -func (m *ServiceResponse) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -// The error code and error message sent by the server when an error occurs. -type ErrorResponse struct { - // This field uses the error codes defined in grpc::StatusCode. - ErrorCode int32 `protobuf:"varint,1,opt,name=error_code,json=errorCode,proto3" json:"error_code,omitempty"` - ErrorMessage string `protobuf:"bytes,2,opt,name=error_message,json=errorMessage,proto3" json:"error_message,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ErrorResponse) Reset() { *m = ErrorResponse{} } -func (m *ErrorResponse) String() string { return proto.CompactTextString(m) } -func (*ErrorResponse) ProtoMessage() {} -func (*ErrorResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_42a8ac412db3cb03, []int{7} -} - -func (m *ErrorResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ErrorResponse.Unmarshal(m, b) -} -func (m *ErrorResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ErrorResponse.Marshal(b, m, deterministic) -} -func (m *ErrorResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_ErrorResponse.Merge(m, src) -} -func (m *ErrorResponse) XXX_Size() int { - return xxx_messageInfo_ErrorResponse.Size(m) -} -func (m *ErrorResponse) XXX_DiscardUnknown() { - xxx_messageInfo_ErrorResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_ErrorResponse proto.InternalMessageInfo - -func (m *ErrorResponse) GetErrorCode() int32 { - if m != nil { - return m.ErrorCode - } - return 0 -} - -func (m *ErrorResponse) GetErrorMessage() string { - if m != nil { - return m.ErrorMessage - } - return "" -} - -func init() { - proto.RegisterType((*ServerReflectionRequest)(nil), "grpc.reflection.v1alpha.ServerReflectionRequest") - proto.RegisterType((*ExtensionRequest)(nil), "grpc.reflection.v1alpha.ExtensionRequest") - proto.RegisterType((*ServerReflectionResponse)(nil), "grpc.reflection.v1alpha.ServerReflectionResponse") - proto.RegisterType((*FileDescriptorResponse)(nil), "grpc.reflection.v1alpha.FileDescriptorResponse") - proto.RegisterType((*ExtensionNumberResponse)(nil), "grpc.reflection.v1alpha.ExtensionNumberResponse") - proto.RegisterType((*ListServiceResponse)(nil), "grpc.reflection.v1alpha.ListServiceResponse") - proto.RegisterType((*ServiceResponse)(nil), "grpc.reflection.v1alpha.ServiceResponse") - proto.RegisterType((*ErrorResponse)(nil), "grpc.reflection.v1alpha.ErrorResponse") -} - -func init() { - proto.RegisterFile("grpc_reflection_v1alpha/reflection.proto", fileDescriptor_42a8ac412db3cb03) -} - -var fileDescriptor_42a8ac412db3cb03 = []byte{ - // 656 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x54, 0x51, 0x73, 0xd2, 0x40, - 0x10, 0x6e, 0x5a, 0x68, 0x87, 0x85, 0x02, 0x5e, 0x2b, 0xa4, 0x3a, 0x75, 0x98, 0x68, 0x35, 0x75, - 0x1c, 0xda, 0xe2, 0x8c, 0x3f, 0x80, 0xaa, 0x83, 0x33, 0xb5, 0x75, 0x0e, 0x5f, 0x1c, 0x1f, 0x6e, - 0x02, 0x2c, 0x34, 0x1a, 0x72, 0xf1, 0x2e, 0x45, 0x79, 0xf2, 0x47, 0xf8, 0xa3, 0xfc, 0x4b, 0x3e, - 0x3a, 0x77, 0x09, 0x21, 0xa4, 0x44, 0xa7, 0x4f, 0x30, 0xdf, 0xee, 0xde, 0xb7, 0xbb, 0xdf, 0xb7, - 0x01, 0x7b, 0x22, 0x82, 0x21, 0x13, 0x38, 0xf6, 0x70, 0x18, 0xba, 0xdc, 0x67, 0xb3, 0x33, 0xc7, - 0x0b, 0xae, 0x9d, 0x93, 0x25, 0xd4, 0x0e, 0x04, 0x0f, 0x39, 0x69, 0xaa, 0xcc, 0x76, 0x0a, 0x8e, - 0x33, 0xad, 0x3f, 0x9b, 0xd0, 0xec, 0xa3, 0x98, 0xa1, 0xa0, 0x49, 0x90, 0xe2, 0xb7, 0x1b, 0x94, - 0x21, 0x21, 0x50, 0xb8, 0xe6, 0x32, 0x34, 0x8d, 0x96, 0x61, 0x97, 0xa8, 0xfe, 0x4f, 0x9e, 0x43, - 0x7d, 0xec, 0x7a, 0xc8, 0x06, 0x73, 0xa6, 0x7e, 0x7d, 0x67, 0x8a, 0xe6, 0x96, 0x8a, 0xf7, 0x36, - 0x68, 0x55, 0x21, 0xdd, 0xf9, 0xdb, 0x18, 0x27, 0xaf, 0xa0, 0xa1, 0x73, 0x87, 0xdc, 0x0f, 0x1d, - 0xd7, 0x77, 0xfd, 0x09, 0x93, 0xf3, 0xe9, 0x80, 0x7b, 0x66, 0x21, 0xae, 0xd8, 0x57, 0xf1, 0xf3, - 0x24, 0xdc, 0xd7, 0x51, 0x32, 0x81, 0x83, 0x6c, 0x1d, 0xfe, 0x08, 0xd1, 0x97, 0x2e, 0xf7, 0xcd, - 0x62, 0xcb, 0xb0, 0xcb, 0x9d, 0xe3, 0x76, 0xce, 0x40, 0xed, 0x37, 0x8b, 0xcc, 0x78, 0x8a, 0xde, - 0x06, 0x6d, 0xae, 0xb2, 0x24, 0x19, 0xa4, 0x0b, 0x87, 0x8e, 0xe7, 0x2d, 0x1f, 0x67, 0xfe, 0xcd, - 0x74, 0x80, 0x42, 0x32, 0x3e, 0x66, 0xe1, 0x3c, 0x40, 0x73, 0x3b, 0xee, 0xf3, 0xc0, 0xf1, 0xbc, - 0xa4, 0xec, 0x32, 0x4a, 0xba, 0x1a, 0x7f, 0x9c, 0x07, 0x48, 0x8e, 0x60, 0xd7, 0x73, 0x65, 0xc8, - 0x24, 0x8a, 0x99, 0x3b, 0x44, 0x69, 0xee, 0xc4, 0x35, 0x15, 0x05, 0xf7, 0x63, 0xb4, 0x7b, 0x0f, - 0x6a, 0x53, 0x94, 0xd2, 0x99, 0x20, 0x13, 0x51, 0x63, 0xd6, 0x18, 0xea, 0xd9, 0x66, 0xc9, 0x33, - 0xa8, 0xa5, 0xa6, 0xd6, 0x3d, 0x44, 0xdb, 0xaf, 0x2e, 0x61, 0x4d, 0x7b, 0x0c, 0xf5, 0x6c, 0xdb, - 0xe6, 0x66, 0xcb, 0xb0, 0x8b, 0xb4, 0x86, 0xab, 0x8d, 0x5a, 0xbf, 0x0b, 0x60, 0xde, 0x96, 0x58, - 0x06, 0xdc, 0x97, 0x48, 0x0e, 0x01, 0x66, 0x8e, 0xe7, 0x8e, 0x58, 0x4a, 0xe9, 0x92, 0x46, 0x7a, - 0x4a, 0xee, 0xcf, 0x50, 0xe7, 0xc2, 0x9d, 0xb8, 0xbe, 0xe3, 0x2d, 0xfa, 0xd6, 0x34, 0xe5, 0xce, - 0x69, 0xae, 0x02, 0x39, 0x76, 0xa2, 0xb5, 0xc5, 0x4b, 0x8b, 0x61, 0xbf, 0x82, 0xa9, 0x75, 0x1e, - 0xa1, 0x1c, 0x0a, 0x37, 0x08, 0xb9, 0x60, 0x22, 0xee, 0x4b, 0x3b, 0xa4, 0xdc, 0x39, 0xc9, 0x25, - 0x51, 0x26, 0x7b, 0x9d, 0xd4, 0x2d, 0xc6, 0xe9, 0x6d, 0x50, 0x6d, 0xb9, 0xdb, 0x11, 0xf2, 0x1d, - 0x1e, 0xad, 0xd7, 0x3a, 0xa1, 0x2c, 0xfe, 0x67, 0xae, 0x8c, 0x01, 0x52, 0x9c, 0x0f, 0xd7, 0xd8, - 0x23, 0x21, 0x1e, 0x41, 0x63, 0xc5, 0x20, 0x4b, 0xc2, 0x6d, 0x4d, 0xf8, 0x22, 0x97, 0xf0, 0x62, - 0x69, 0xa0, 0x14, 0xd9, 0x7e, 0xda, 0x57, 0x09, 0xcb, 0x15, 0x54, 0x51, 0x88, 0xf4, 0x06, 0x77, - 0xf4, 0xeb, 0x4f, 0xf3, 0xc7, 0x51, 0xe9, 0xa9, 0x77, 0x77, 0x31, 0x0d, 0x74, 0x09, 0xd4, 0x97, - 0x86, 0x8d, 0x30, 0xeb, 0x02, 0x1a, 0xeb, 0xf7, 0x4e, 0x3a, 0x70, 0x3f, 0x2b, 0xa5, 0xfe, 0xf0, - 0x98, 0x46, 0x6b, 0xcb, 0xae, 0xd0, 0xbd, 0x55, 0x51, 0x3e, 0xa8, 0x90, 0xf5, 0x05, 0x9a, 0x39, - 0x2b, 0x25, 0x4f, 0xa0, 0x3a, 0x70, 0x24, 0xea, 0x03, 0x60, 0xfa, 0x1b, 0x13, 0x39, 0xb3, 0xa2, - 0x50, 0xe5, 0xff, 0x4b, 0xf5, 0x7d, 0x59, 0x7f, 0x03, 0x5b, 0xeb, 0x6e, 0xe0, 0x13, 0xec, 0xad, - 0xd9, 0x26, 0xe9, 0xc2, 0x4e, 0x2c, 0x8b, 0x6e, 0xb4, 0xdc, 0xb1, 0xff, 0xe9, 0xea, 0x54, 0x29, - 0x5d, 0x14, 0x5a, 0x47, 0x50, 0xcb, 0x3e, 0x4b, 0xa0, 0x90, 0x6a, 0x5a, 0xff, 0xb7, 0xfa, 0xb0, - 0xbb, 0xb2, 0x71, 0x75, 0x79, 0x91, 0x62, 0x43, 0x3e, 0x8a, 0x52, 0x8b, 0xb4, 0xa4, 0x91, 0x73, - 0x3e, 0x42, 0xf2, 0x18, 0x22, 0x41, 0x58, 0xac, 0x82, 0x3e, 0xbb, 0x12, 0xad, 0x68, 0xf0, 0x7d, - 0x84, 0x75, 0x7e, 0x19, 0x50, 0xcf, 0x9e, 0x1b, 0xf9, 0x09, 0xfb, 0x59, 0xec, 0x9d, 0x3f, 0xe6, - 0xe4, 0xce, 0x17, 0xfb, 0xe0, 0xec, 0x0e, 0x15, 0xd1, 0x54, 0xb6, 0x71, 0x6a, 0x0c, 0xb6, 0xb5, - 0xf4, 0x2f, 0xff, 0x06, 0x00, 0x00, 0xff, 0xff, 0x85, 0x02, 0x09, 0x9d, 0x9f, 0x06, 0x00, 0x00, -} - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConn - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion4 - -// ServerReflectionClient is the client API for ServerReflection service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type ServerReflectionClient interface { - // The reflection service is structured as a bidirectional stream, ensuring - // all related requests go to a single server. - ServerReflectionInfo(ctx context.Context, opts ...grpc.CallOption) (ServerReflection_ServerReflectionInfoClient, error) -} - -type serverReflectionClient struct { - cc *grpc.ClientConn -} - -func NewServerReflectionClient(cc *grpc.ClientConn) ServerReflectionClient { - return &serverReflectionClient{cc} -} - -func (c *serverReflectionClient) ServerReflectionInfo(ctx context.Context, opts ...grpc.CallOption) (ServerReflection_ServerReflectionInfoClient, error) { - stream, err := c.cc.NewStream(ctx, &_ServerReflection_serviceDesc.Streams[0], "/grpc.reflection.v1alpha.ServerReflection/ServerReflectionInfo", opts...) - if err != nil { - return nil, err - } - x := &serverReflectionServerReflectionInfoClient{stream} - return x, nil -} - -type ServerReflection_ServerReflectionInfoClient interface { - Send(*ServerReflectionRequest) error - Recv() (*ServerReflectionResponse, error) - grpc.ClientStream -} - -type serverReflectionServerReflectionInfoClient struct { - grpc.ClientStream -} - -func (x *serverReflectionServerReflectionInfoClient) Send(m *ServerReflectionRequest) error { - return x.ClientStream.SendMsg(m) -} - -func (x *serverReflectionServerReflectionInfoClient) Recv() (*ServerReflectionResponse, error) { - m := new(ServerReflectionResponse) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -// ServerReflectionServer is the server API for ServerReflection service. -type ServerReflectionServer interface { - // The reflection service is structured as a bidirectional stream, ensuring - // all related requests go to a single server. - ServerReflectionInfo(ServerReflection_ServerReflectionInfoServer) error -} - -// UnimplementedServerReflectionServer can be embedded to have forward compatible implementations. -type UnimplementedServerReflectionServer struct { -} - -func (*UnimplementedServerReflectionServer) ServerReflectionInfo(srv ServerReflection_ServerReflectionInfoServer) error { - return status.Errorf(codes.Unimplemented, "method ServerReflectionInfo not implemented") -} - -func RegisterServerReflectionServer(s *grpc.Server, srv ServerReflectionServer) { - s.RegisterService(&_ServerReflection_serviceDesc, srv) -} - -func _ServerReflection_ServerReflectionInfo_Handler(srv interface{}, stream grpc.ServerStream) error { - return srv.(ServerReflectionServer).ServerReflectionInfo(&serverReflectionServerReflectionInfoServer{stream}) -} - -type ServerReflection_ServerReflectionInfoServer interface { - Send(*ServerReflectionResponse) error - Recv() (*ServerReflectionRequest, error) - grpc.ServerStream -} - -type serverReflectionServerReflectionInfoServer struct { - grpc.ServerStream -} - -func (x *serverReflectionServerReflectionInfoServer) Send(m *ServerReflectionResponse) error { - return x.ServerStream.SendMsg(m) -} - -func (x *serverReflectionServerReflectionInfoServer) Recv() (*ServerReflectionRequest, error) { - m := new(ServerReflectionRequest) - if err := x.ServerStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -var _ServerReflection_serviceDesc = grpc.ServiceDesc{ - ServiceName: "grpc.reflection.v1alpha.ServerReflection", - HandlerType: (*ServerReflectionServer)(nil), - Methods: []grpc.MethodDesc{}, - Streams: []grpc.StreamDesc{ - { - StreamName: "ServerReflectionInfo", - Handler: _ServerReflection_ServerReflectionInfo_Handler, - ServerStreams: true, - ClientStreams: true, - }, - }, - Metadata: "grpc_reflection_v1alpha/reflection.proto", -} diff --git a/vendor/google.golang.org/grpc/reflection/grpc_reflection_v1alpha/reflection.proto b/vendor/google.golang.org/grpc/reflection/grpc_reflection_v1alpha/reflection.proto deleted file mode 100644 index 99b00df0a2..0000000000 --- a/vendor/google.golang.org/grpc/reflection/grpc_reflection_v1alpha/reflection.proto +++ /dev/null @@ -1,136 +0,0 @@ -// Copyright 2016 gRPC authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Service exported by server reflection - -syntax = "proto3"; - -package grpc.reflection.v1alpha; - -service ServerReflection { - // The reflection service is structured as a bidirectional stream, ensuring - // all related requests go to a single server. - rpc ServerReflectionInfo(stream ServerReflectionRequest) - returns (stream ServerReflectionResponse); -} - -// The message sent by the client when calling ServerReflectionInfo method. -message ServerReflectionRequest { - string host = 1; - // To use reflection service, the client should set one of the following - // fields in message_request. The server distinguishes requests by their - // defined field and then handles them using corresponding methods. - oneof message_request { - // Find a proto file by the file name. - string file_by_filename = 3; - - // Find the proto file that declares the given fully-qualified symbol name. - // This field should be a fully-qualified symbol name - // (e.g. .[.] or .). - string file_containing_symbol = 4; - - // Find the proto file which defines an extension extending the given - // message type with the given field number. - ExtensionRequest file_containing_extension = 5; - - // Finds the tag numbers used by all known extensions of extendee_type, and - // appends them to ExtensionNumberResponse in an undefined order. - // Its corresponding method is best-effort: it's not guaranteed that the - // reflection service will implement this method, and it's not guaranteed - // that this method will provide all extensions. Returns - // StatusCode::UNIMPLEMENTED if it's not implemented. - // This field should be a fully-qualified type name. The format is - // . - string all_extension_numbers_of_type = 6; - - // List the full names of registered services. The content will not be - // checked. - string list_services = 7; - } -} - -// The type name and extension number sent by the client when requesting -// file_containing_extension. -message ExtensionRequest { - // Fully-qualified type name. The format should be . - string containing_type = 1; - int32 extension_number = 2; -} - -// The message sent by the server to answer ServerReflectionInfo method. -message ServerReflectionResponse { - string valid_host = 1; - ServerReflectionRequest original_request = 2; - // The server sets one of the following fields according to the - // message_request in the request. - oneof message_response { - // This message is used to answer file_by_filename, file_containing_symbol, - // file_containing_extension requests with transitive dependencies. - // As the repeated label is not allowed in oneof fields, we use a - // FileDescriptorResponse message to encapsulate the repeated fields. - // The reflection service is allowed to avoid sending FileDescriptorProtos - // that were previously sent in response to earlier requests in the stream. - FileDescriptorResponse file_descriptor_response = 4; - - // This message is used to answer all_extension_numbers_of_type requests. - ExtensionNumberResponse all_extension_numbers_response = 5; - - // This message is used to answer list_services requests. - ListServiceResponse list_services_response = 6; - - // This message is used when an error occurs. - ErrorResponse error_response = 7; - } -} - -// Serialized FileDescriptorProto messages sent by the server answering -// a file_by_filename, file_containing_symbol, or file_containing_extension -// request. -message FileDescriptorResponse { - // Serialized FileDescriptorProto messages. We avoid taking a dependency on - // descriptor.proto, which uses proto2 only features, by making them opaque - // bytes instead. - repeated bytes file_descriptor_proto = 1; -} - -// A list of extension numbers sent by the server answering -// all_extension_numbers_of_type request. -message ExtensionNumberResponse { - // Full name of the base type, including the package name. The format - // is . - string base_type_name = 1; - repeated int32 extension_number = 2; -} - -// A list of ServiceResponse sent by the server answering list_services request. -message ListServiceResponse { - // The information of each service may be expanded in the future, so we use - // ServiceResponse message to encapsulate it. - repeated ServiceResponse service = 1; -} - -// The information of a single service used by ListServiceResponse to answer -// list_services request. -message ServiceResponse { - // Full name of a registered service, including its package name. The format - // is . - string name = 1; -} - -// The error code and error message sent by the server when an error occurs. -message ErrorResponse { - // This field uses the error codes defined in grpc::StatusCode. - int32 error_code = 1; - string error_message = 2; -} diff --git a/vendor/google.golang.org/grpc/reflection/serverreflection.go b/vendor/google.golang.org/grpc/reflection/serverreflection.go deleted file mode 100644 index dd22a2da78..0000000000 --- a/vendor/google.golang.org/grpc/reflection/serverreflection.go +++ /dev/null @@ -1,454 +0,0 @@ -/* - * - * Copyright 2016 gRPC authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT 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:generate protoc --go_out=plugins=grpc:. grpc_reflection_v1alpha/reflection.proto - -/* -Package reflection implements server reflection service. - -The service implemented is defined in: -https://github.com/grpc/grpc/blob/master/src/proto/grpc/reflection/v1alpha/reflection.proto. - -To register server reflection on a gRPC server: - import "google.golang.org/grpc/reflection" - - s := grpc.NewServer() - pb.RegisterYourOwnServer(s, &server{}) - - // Register reflection service on gRPC server. - reflection.Register(s) - - s.Serve(lis) - -*/ -package reflection // import "google.golang.org/grpc/reflection" - -import ( - "bytes" - "compress/gzip" - "fmt" - "io" - "io/ioutil" - "reflect" - "sort" - "sync" - - "github.com/golang/protobuf/proto" - dpb "github.com/golang/protobuf/protoc-gen-go/descriptor" - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - rpb "google.golang.org/grpc/reflection/grpc_reflection_v1alpha" - "google.golang.org/grpc/status" -) - -type serverReflectionServer struct { - s *grpc.Server - - initSymbols sync.Once - serviceNames []string - symbols map[string]*dpb.FileDescriptorProto // map of fully-qualified names to files -} - -// Register registers the server reflection service on the given gRPC server. -func Register(s *grpc.Server) { - rpb.RegisterServerReflectionServer(s, &serverReflectionServer{ - s: s, - }) -} - -// protoMessage is used for type assertion on proto messages. -// Generated proto message implements function Descriptor(), but Descriptor() -// is not part of interface proto.Message. This interface is needed to -// call Descriptor(). -type protoMessage interface { - Descriptor() ([]byte, []int) -} - -func (s *serverReflectionServer) getSymbols() (svcNames []string, symbolIndex map[string]*dpb.FileDescriptorProto) { - s.initSymbols.Do(func() { - serviceInfo := s.s.GetServiceInfo() - - s.symbols = map[string]*dpb.FileDescriptorProto{} - s.serviceNames = make([]string, 0, len(serviceInfo)) - processed := map[string]struct{}{} - for svc, info := range serviceInfo { - s.serviceNames = append(s.serviceNames, svc) - fdenc, ok := parseMetadata(info.Metadata) - if !ok { - continue - } - fd, err := decodeFileDesc(fdenc) - if err != nil { - continue - } - s.processFile(fd, processed) - } - sort.Strings(s.serviceNames) - }) - - return s.serviceNames, s.symbols -} - -func (s *serverReflectionServer) processFile(fd *dpb.FileDescriptorProto, processed map[string]struct{}) { - filename := fd.GetName() - if _, ok := processed[filename]; ok { - return - } - processed[filename] = struct{}{} - - prefix := fd.GetPackage() - - for _, msg := range fd.MessageType { - s.processMessage(fd, prefix, msg) - } - for _, en := range fd.EnumType { - s.processEnum(fd, prefix, en) - } - for _, ext := range fd.Extension { - s.processField(fd, prefix, ext) - } - for _, svc := range fd.Service { - svcName := fqn(prefix, svc.GetName()) - s.symbols[svcName] = fd - for _, meth := range svc.Method { - name := fqn(svcName, meth.GetName()) - s.symbols[name] = fd - } - } - - for _, dep := range fd.Dependency { - fdenc := proto.FileDescriptor(dep) - fdDep, err := decodeFileDesc(fdenc) - if err != nil { - continue - } - s.processFile(fdDep, processed) - } -} - -func (s *serverReflectionServer) processMessage(fd *dpb.FileDescriptorProto, prefix string, msg *dpb.DescriptorProto) { - msgName := fqn(prefix, msg.GetName()) - s.symbols[msgName] = fd - - for _, nested := range msg.NestedType { - s.processMessage(fd, msgName, nested) - } - for _, en := range msg.EnumType { - s.processEnum(fd, msgName, en) - } - for _, ext := range msg.Extension { - s.processField(fd, msgName, ext) - } - for _, fld := range msg.Field { - s.processField(fd, msgName, fld) - } - for _, oneof := range msg.OneofDecl { - oneofName := fqn(msgName, oneof.GetName()) - s.symbols[oneofName] = fd - } -} - -func (s *serverReflectionServer) processEnum(fd *dpb.FileDescriptorProto, prefix string, en *dpb.EnumDescriptorProto) { - enName := fqn(prefix, en.GetName()) - s.symbols[enName] = fd - - for _, val := range en.Value { - valName := fqn(enName, val.GetName()) - s.symbols[valName] = fd - } -} - -func (s *serverReflectionServer) processField(fd *dpb.FileDescriptorProto, prefix string, fld *dpb.FieldDescriptorProto) { - fldName := fqn(prefix, fld.GetName()) - s.symbols[fldName] = fd -} - -func fqn(prefix, name string) string { - if prefix == "" { - return name - } - return prefix + "." + name -} - -// fileDescForType gets the file descriptor for the given type. -// The given type should be a proto message. -func (s *serverReflectionServer) fileDescForType(st reflect.Type) (*dpb.FileDescriptorProto, error) { - m, ok := reflect.Zero(reflect.PtrTo(st)).Interface().(protoMessage) - if !ok { - return nil, fmt.Errorf("failed to create message from type: %v", st) - } - enc, _ := m.Descriptor() - - return decodeFileDesc(enc) -} - -// decodeFileDesc does decompression and unmarshalling on the given -// file descriptor byte slice. -func decodeFileDesc(enc []byte) (*dpb.FileDescriptorProto, error) { - raw, err := decompress(enc) - if err != nil { - return nil, fmt.Errorf("failed to decompress enc: %v", err) - } - - fd := new(dpb.FileDescriptorProto) - if err := proto.Unmarshal(raw, fd); err != nil { - return nil, fmt.Errorf("bad descriptor: %v", err) - } - return fd, nil -} - -// decompress does gzip decompression. -func decompress(b []byte) ([]byte, error) { - r, err := gzip.NewReader(bytes.NewReader(b)) - if err != nil { - return nil, fmt.Errorf("bad gzipped descriptor: %v", err) - } - out, err := ioutil.ReadAll(r) - if err != nil { - return nil, fmt.Errorf("bad gzipped descriptor: %v", err) - } - return out, nil -} - -func typeForName(name string) (reflect.Type, error) { - pt := proto.MessageType(name) - if pt == nil { - return nil, fmt.Errorf("unknown type: %q", name) - } - st := pt.Elem() - - return st, nil -} - -func fileDescContainingExtension(st reflect.Type, ext int32) (*dpb.FileDescriptorProto, error) { - m, ok := reflect.Zero(reflect.PtrTo(st)).Interface().(proto.Message) - if !ok { - return nil, fmt.Errorf("failed to create message from type: %v", st) - } - - var extDesc *proto.ExtensionDesc - for id, desc := range proto.RegisteredExtensions(m) { - if id == ext { - extDesc = desc - break - } - } - - if extDesc == nil { - return nil, fmt.Errorf("failed to find registered extension for extension number %v", ext) - } - - return decodeFileDesc(proto.FileDescriptor(extDesc.Filename)) -} - -func (s *serverReflectionServer) allExtensionNumbersForType(st reflect.Type) ([]int32, error) { - m, ok := reflect.Zero(reflect.PtrTo(st)).Interface().(proto.Message) - if !ok { - return nil, fmt.Errorf("failed to create message from type: %v", st) - } - - exts := proto.RegisteredExtensions(m) - out := make([]int32, 0, len(exts)) - for id := range exts { - out = append(out, id) - } - return out, nil -} - -// fileDescEncodingByFilename finds the file descriptor for given filename, -// does marshalling on it and returns the marshalled result. -func (s *serverReflectionServer) fileDescEncodingByFilename(name string) ([]byte, error) { - enc := proto.FileDescriptor(name) - if enc == nil { - return nil, fmt.Errorf("unknown file: %v", name) - } - fd, err := decodeFileDesc(enc) - if err != nil { - return nil, err - } - return proto.Marshal(fd) -} - -// parseMetadata finds the file descriptor bytes specified meta. -// For SupportPackageIsVersion4, m is the name of the proto file, we -// call proto.FileDescriptor to get the byte slice. -// For SupportPackageIsVersion3, m is a byte slice itself. -func parseMetadata(meta interface{}) ([]byte, bool) { - // Check if meta is the file name. - if fileNameForMeta, ok := meta.(string); ok { - return proto.FileDescriptor(fileNameForMeta), true - } - - // Check if meta is the byte slice. - if enc, ok := meta.([]byte); ok { - return enc, true - } - - return nil, false -} - -// fileDescEncodingContainingSymbol finds the file descriptor containing the given symbol, -// does marshalling on it and returns the marshalled result. -// The given symbol can be a type, a service or a method. -func (s *serverReflectionServer) fileDescEncodingContainingSymbol(name string) ([]byte, error) { - _, symbols := s.getSymbols() - fd := symbols[name] - if fd == nil { - // Check if it's a type name that was not present in the - // transitive dependencies of the registered services. - if st, err := typeForName(name); err == nil { - fd, err = s.fileDescForType(st) - if err != nil { - return nil, err - } - } - } - - if fd == nil { - return nil, fmt.Errorf("unknown symbol: %v", name) - } - - return proto.Marshal(fd) -} - -// fileDescEncodingContainingExtension finds the file descriptor containing given extension, -// does marshalling on it and returns the marshalled result. -func (s *serverReflectionServer) fileDescEncodingContainingExtension(typeName string, extNum int32) ([]byte, error) { - st, err := typeForName(typeName) - if err != nil { - return nil, err - } - fd, err := fileDescContainingExtension(st, extNum) - if err != nil { - return nil, err - } - return proto.Marshal(fd) -} - -// allExtensionNumbersForTypeName returns all extension numbers for the given type. -func (s *serverReflectionServer) allExtensionNumbersForTypeName(name string) ([]int32, error) { - st, err := typeForName(name) - if err != nil { - return nil, err - } - extNums, err := s.allExtensionNumbersForType(st) - if err != nil { - return nil, err - } - return extNums, nil -} - -// ServerReflectionInfo is the reflection service handler. -func (s *serverReflectionServer) ServerReflectionInfo(stream rpb.ServerReflection_ServerReflectionInfoServer) error { - for { - in, err := stream.Recv() - if err == io.EOF { - return nil - } - if err != nil { - return err - } - - out := &rpb.ServerReflectionResponse{ - ValidHost: in.Host, - OriginalRequest: in, - } - switch req := in.MessageRequest.(type) { - case *rpb.ServerReflectionRequest_FileByFilename: - b, err := s.fileDescEncodingByFilename(req.FileByFilename) - if err != nil { - out.MessageResponse = &rpb.ServerReflectionResponse_ErrorResponse{ - ErrorResponse: &rpb.ErrorResponse{ - ErrorCode: int32(codes.NotFound), - ErrorMessage: err.Error(), - }, - } - } else { - out.MessageResponse = &rpb.ServerReflectionResponse_FileDescriptorResponse{ - FileDescriptorResponse: &rpb.FileDescriptorResponse{FileDescriptorProto: [][]byte{b}}, - } - } - case *rpb.ServerReflectionRequest_FileContainingSymbol: - b, err := s.fileDescEncodingContainingSymbol(req.FileContainingSymbol) - if err != nil { - out.MessageResponse = &rpb.ServerReflectionResponse_ErrorResponse{ - ErrorResponse: &rpb.ErrorResponse{ - ErrorCode: int32(codes.NotFound), - ErrorMessage: err.Error(), - }, - } - } else { - out.MessageResponse = &rpb.ServerReflectionResponse_FileDescriptorResponse{ - FileDescriptorResponse: &rpb.FileDescriptorResponse{FileDescriptorProto: [][]byte{b}}, - } - } - case *rpb.ServerReflectionRequest_FileContainingExtension: - typeName := req.FileContainingExtension.ContainingType - extNum := req.FileContainingExtension.ExtensionNumber - b, err := s.fileDescEncodingContainingExtension(typeName, extNum) - if err != nil { - out.MessageResponse = &rpb.ServerReflectionResponse_ErrorResponse{ - ErrorResponse: &rpb.ErrorResponse{ - ErrorCode: int32(codes.NotFound), - ErrorMessage: err.Error(), - }, - } - } else { - out.MessageResponse = &rpb.ServerReflectionResponse_FileDescriptorResponse{ - FileDescriptorResponse: &rpb.FileDescriptorResponse{FileDescriptorProto: [][]byte{b}}, - } - } - case *rpb.ServerReflectionRequest_AllExtensionNumbersOfType: - extNums, err := s.allExtensionNumbersForTypeName(req.AllExtensionNumbersOfType) - if err != nil { - out.MessageResponse = &rpb.ServerReflectionResponse_ErrorResponse{ - ErrorResponse: &rpb.ErrorResponse{ - ErrorCode: int32(codes.NotFound), - ErrorMessage: err.Error(), - }, - } - } else { - out.MessageResponse = &rpb.ServerReflectionResponse_AllExtensionNumbersResponse{ - AllExtensionNumbersResponse: &rpb.ExtensionNumberResponse{ - BaseTypeName: req.AllExtensionNumbersOfType, - ExtensionNumber: extNums, - }, - } - } - case *rpb.ServerReflectionRequest_ListServices: - svcNames, _ := s.getSymbols() - serviceResponses := make([]*rpb.ServiceResponse, len(svcNames)) - for i, n := range svcNames { - serviceResponses[i] = &rpb.ServiceResponse{ - Name: n, - } - } - out.MessageResponse = &rpb.ServerReflectionResponse_ListServicesResponse{ - ListServicesResponse: &rpb.ListServiceResponse{ - Service: serviceResponses, - }, - } - default: - return status.Errorf(codes.InvalidArgument, "invalid MessageRequest: %v", in.MessageRequest) - } - - if err := stream.Send(out); err != nil { - return err - } - } -} diff --git a/vendor/google.golang.org/protobuf/encoding/protojson/decode.go b/vendor/google.golang.org/protobuf/encoding/protojson/decode.go deleted file mode 100644 index 71c755c155..0000000000 --- a/vendor/google.golang.org/protobuf/encoding/protojson/decode.go +++ /dev/null @@ -1,683 +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 protojson - -import ( - "encoding/base64" - "fmt" - "math" - "strconv" - "strings" - - "google.golang.org/protobuf/internal/encoding/json" - "google.golang.org/protobuf/internal/encoding/messageset" - "google.golang.org/protobuf/internal/errors" - "google.golang.org/protobuf/internal/flags" - "google.golang.org/protobuf/internal/pragma" - "google.golang.org/protobuf/internal/set" - "google.golang.org/protobuf/proto" - pref "google.golang.org/protobuf/reflect/protoreflect" - "google.golang.org/protobuf/reflect/protoregistry" -) - -// Unmarshal reads the given []byte into the given proto.Message. -func Unmarshal(b []byte, m proto.Message) error { - return UnmarshalOptions{}.Unmarshal(b, m) -} - -// UnmarshalOptions is a configurable JSON format parser. -type UnmarshalOptions struct { - pragma.NoUnkeyedLiterals - - // If AllowPartial is set, input for messages that will result in missing - // required fields will not return an error. - AllowPartial bool - - // If DiscardUnknown is set, unknown fields are ignored. - DiscardUnknown bool - - // Resolver is used for looking up types when unmarshaling - // google.protobuf.Any messages or extension fields. - // If nil, this defaults to using protoregistry.GlobalTypes. - Resolver interface { - protoregistry.MessageTypeResolver - protoregistry.ExtensionTypeResolver - } -} - -// Unmarshal reads the given []byte and populates the given proto.Message using -// options in UnmarshalOptions object. It will clear the message first before -// setting the fields. If it returns an error, the given message may be -// partially set. -func (o UnmarshalOptions) Unmarshal(b []byte, m proto.Message) error { - proto.Reset(m) - - if o.Resolver == nil { - o.Resolver = protoregistry.GlobalTypes - } - - dec := decoder{json.NewDecoder(b), o} - if err := dec.unmarshalMessage(m.ProtoReflect(), false); err != nil { - return err - } - - // Check for EOF. - tok, err := dec.Read() - if err != nil { - return err - } - if tok.Kind() != json.EOF { - return dec.unexpectedTokenError(tok) - } - - if o.AllowPartial { - return nil - } - return proto.CheckInitialized(m) -} - -type decoder struct { - *json.Decoder - opts UnmarshalOptions -} - -// newError returns an error object with position info. -func (d decoder) newError(pos int, f string, x ...interface{}) error { - line, column := d.Position(pos) - head := fmt.Sprintf("(line %d:%d): ", line, column) - return errors.New(head+f, x...) -} - -// unexpectedTokenError returns a syntax error for the given unexpected token. -func (d decoder) unexpectedTokenError(tok json.Token) error { - return d.syntaxError(tok.Pos(), "unexpected token %s", tok.RawString()) -} - -// syntaxError returns a syntax error for given position. -func (d decoder) syntaxError(pos int, f string, x ...interface{}) error { - line, column := d.Position(pos) - head := fmt.Sprintf("syntax error (line %d:%d): ", line, column) - return errors.New(head+f, x...) -} - -// unmarshalMessage unmarshals a message into the given protoreflect.Message. -func (d decoder) unmarshalMessage(m pref.Message, skipTypeURL bool) error { - if isCustomType(m.Descriptor().FullName()) { - return d.unmarshalCustomType(m) - } - - tok, err := d.Read() - if err != nil { - return err - } - if tok.Kind() != json.ObjectOpen { - return d.unexpectedTokenError(tok) - } - - if err := d.unmarshalFields(m, skipTypeURL); err != nil { - return err - } - - return nil -} - -// unmarshalFields unmarshals the fields into the given protoreflect.Message. -func (d decoder) unmarshalFields(m pref.Message, skipTypeURL bool) error { - messageDesc := m.Descriptor() - if !flags.ProtoLegacy && messageset.IsMessageSet(messageDesc) { - return errors.New("no support for proto1 MessageSets") - } - - var seenNums set.Ints - var seenOneofs set.Ints - fieldDescs := messageDesc.Fields() - for { - // Read field name. - tok, err := d.Read() - if err != nil { - return err - } - switch tok.Kind() { - default: - return d.unexpectedTokenError(tok) - case json.ObjectClose: - return nil - case json.Name: - // Continue below. - } - - name := tok.Name() - // Unmarshaling a non-custom embedded message in Any will contain the - // JSON field "@type" which should be skipped because it is not a field - // of the embedded message, but simply an artifact of the Any format. - if skipTypeURL && name == "@type" { - d.Read() - continue - } - - // Get the FieldDescriptor. - var fd pref.FieldDescriptor - if strings.HasPrefix(name, "[") && strings.HasSuffix(name, "]") { - // Only extension names are in [name] format. - extName := pref.FullName(name[1 : len(name)-1]) - extType, err := d.findExtension(extName) - if err != nil && err != protoregistry.NotFound { - return d.newError(tok.Pos(), "unable to resolve %s: %v", tok.RawString(), err) - } - if extType != nil { - fd = extType.TypeDescriptor() - if !messageDesc.ExtensionRanges().Has(fd.Number()) || fd.ContainingMessage().FullName() != messageDesc.FullName() { - return d.newError(tok.Pos(), "message %v cannot be extended by %v", messageDesc.FullName(), fd.FullName()) - } - } - } else { - // The name can either be the JSON name or the proto field name. - fd = fieldDescs.ByJSONName(name) - if fd == nil { - fd = fieldDescs.ByName(pref.Name(name)) - if fd == nil { - // The proto name of a group field is in all lowercase, - // while the textual field name is the group message name. - gd := fieldDescs.ByName(pref.Name(strings.ToLower(name))) - if gd != nil && gd.Kind() == pref.GroupKind && gd.Message().Name() == pref.Name(name) { - fd = gd - } - } else if fd.Kind() == pref.GroupKind && fd.Message().Name() != pref.Name(name) { - fd = nil // reset since field name is actually the message name - } - } - } - if flags.ProtoLegacy { - if fd != nil && fd.IsWeak() && fd.Message().IsPlaceholder() { - fd = nil // reset since the weak reference is not linked in - } - } - - if fd == nil { - // Field is unknown. - if d.opts.DiscardUnknown { - if err := d.skipJSONValue(); err != nil { - return err - } - continue - } - return d.newError(tok.Pos(), "unknown field %v", tok.RawString()) - } - - // Do not allow duplicate fields. - num := uint64(fd.Number()) - if seenNums.Has(num) { - return d.newError(tok.Pos(), "duplicate field %v", tok.RawString()) - } - seenNums.Set(num) - - // No need to set values for JSON null unless the field type is - // google.protobuf.Value or google.protobuf.NullValue. - if tok, _ := d.Peek(); tok.Kind() == json.Null && !isKnownValue(fd) && !isNullValue(fd) { - d.Read() - continue - } - - switch { - case fd.IsList(): - list := m.Mutable(fd).List() - if err := d.unmarshalList(list, fd); err != nil { - return err - } - case fd.IsMap(): - mmap := m.Mutable(fd).Map() - if err := d.unmarshalMap(mmap, fd); err != nil { - return err - } - default: - // If field is a oneof, check if it has already been set. - if od := fd.ContainingOneof(); od != nil { - idx := uint64(od.Index()) - if seenOneofs.Has(idx) { - return d.newError(tok.Pos(), "error parsing %s, oneof %v is already set", tok.RawString(), od.FullName()) - } - seenOneofs.Set(idx) - } - - // Required or optional fields. - if err := d.unmarshalSingular(m, fd); err != nil { - return err - } - } - } -} - -// findExtension returns protoreflect.ExtensionType from the resolver if found. -func (d decoder) findExtension(xtName pref.FullName) (pref.ExtensionType, error) { - xt, err := d.opts.Resolver.FindExtensionByName(xtName) - if err == nil { - return xt, nil - } - return messageset.FindMessageSetExtension(d.opts.Resolver, xtName) -} - -func isKnownValue(fd pref.FieldDescriptor) bool { - md := fd.Message() - return md != nil && md.FullName() == "google.protobuf.Value" -} - -func isNullValue(fd pref.FieldDescriptor) bool { - ed := fd.Enum() - return ed != nil && ed.FullName() == "google.protobuf.NullValue" -} - -// unmarshalSingular unmarshals to the non-repeated field specified -// by the given FieldDescriptor. -func (d decoder) unmarshalSingular(m pref.Message, fd pref.FieldDescriptor) error { - var val pref.Value - var err error - switch fd.Kind() { - case pref.MessageKind, pref.GroupKind: - val = m.NewField(fd) - err = d.unmarshalMessage(val.Message(), false) - default: - val, err = d.unmarshalScalar(fd) - } - - if err != nil { - return err - } - m.Set(fd, val) - return nil -} - -// unmarshalScalar unmarshals to a scalar/enum protoreflect.Value specified by -// the given FieldDescriptor. -func (d decoder) unmarshalScalar(fd pref.FieldDescriptor) (pref.Value, error) { - const b32 int = 32 - const b64 int = 64 - - tok, err := d.Read() - if err != nil { - return pref.Value{}, err - } - - kind := fd.Kind() - switch kind { - case pref.BoolKind: - if tok.Kind() == json.Bool { - return pref.ValueOfBool(tok.Bool()), nil - } - - case pref.Int32Kind, pref.Sint32Kind, pref.Sfixed32Kind: - if v, ok := unmarshalInt(tok, b32); ok { - return v, nil - } - - case pref.Int64Kind, pref.Sint64Kind, pref.Sfixed64Kind: - if v, ok := unmarshalInt(tok, b64); ok { - return v, nil - } - - case pref.Uint32Kind, pref.Fixed32Kind: - if v, ok := unmarshalUint(tok, b32); ok { - return v, nil - } - - case pref.Uint64Kind, pref.Fixed64Kind: - if v, ok := unmarshalUint(tok, b64); ok { - return v, nil - } - - case pref.FloatKind: - if v, ok := unmarshalFloat(tok, b32); ok { - return v, nil - } - - case pref.DoubleKind: - if v, ok := unmarshalFloat(tok, b64); ok { - return v, nil - } - - case pref.StringKind: - if tok.Kind() == json.String { - return pref.ValueOfString(tok.ParsedString()), nil - } - - case pref.BytesKind: - if v, ok := unmarshalBytes(tok); ok { - return v, nil - } - - case pref.EnumKind: - if v, ok := unmarshalEnum(tok, fd); ok { - return v, nil - } - - default: - panic(fmt.Sprintf("unmarshalScalar: invalid scalar kind %v", kind)) - } - - return pref.Value{}, d.newError(tok.Pos(), "invalid value for %v type: %v", kind, tok.RawString()) -} - -func unmarshalInt(tok json.Token, bitSize int) (pref.Value, bool) { - switch tok.Kind() { - case json.Number: - return getInt(tok, bitSize) - - case json.String: - // Decode number from string. - s := strings.TrimSpace(tok.ParsedString()) - if len(s) != len(tok.ParsedString()) { - return pref.Value{}, false - } - dec := json.NewDecoder([]byte(s)) - tok, err := dec.Read() - if err != nil { - return pref.Value{}, false - } - return getInt(tok, bitSize) - } - return pref.Value{}, false -} - -func getInt(tok json.Token, bitSize int) (pref.Value, bool) { - n, ok := tok.Int(bitSize) - if !ok { - return pref.Value{}, false - } - if bitSize == 32 { - return pref.ValueOfInt32(int32(n)), true - } - return pref.ValueOfInt64(n), true -} - -func unmarshalUint(tok json.Token, bitSize int) (pref.Value, bool) { - switch tok.Kind() { - case json.Number: - return getUint(tok, bitSize) - - case json.String: - // Decode number from string. - s := strings.TrimSpace(tok.ParsedString()) - if len(s) != len(tok.ParsedString()) { - return pref.Value{}, false - } - dec := json.NewDecoder([]byte(s)) - tok, err := dec.Read() - if err != nil { - return pref.Value{}, false - } - return getUint(tok, bitSize) - } - return pref.Value{}, false -} - -func getUint(tok json.Token, bitSize int) (pref.Value, bool) { - n, ok := tok.Uint(bitSize) - if !ok { - return pref.Value{}, false - } - if bitSize == 32 { - return pref.ValueOfUint32(uint32(n)), true - } - return pref.ValueOfUint64(n), true -} - -func unmarshalFloat(tok json.Token, bitSize int) (pref.Value, bool) { - switch tok.Kind() { - case json.Number: - return getFloat(tok, bitSize) - - case json.String: - s := tok.ParsedString() - switch s { - case "NaN": - if bitSize == 32 { - return pref.ValueOfFloat32(float32(math.NaN())), true - } - return pref.ValueOfFloat64(math.NaN()), true - case "Infinity": - if bitSize == 32 { - return pref.ValueOfFloat32(float32(math.Inf(+1))), true - } - return pref.ValueOfFloat64(math.Inf(+1)), true - case "-Infinity": - if bitSize == 32 { - return pref.ValueOfFloat32(float32(math.Inf(-1))), true - } - return pref.ValueOfFloat64(math.Inf(-1)), true - } - - // Decode number from string. - if len(s) != len(strings.TrimSpace(s)) { - return pref.Value{}, false - } - dec := json.NewDecoder([]byte(s)) - tok, err := dec.Read() - if err != nil { - return pref.Value{}, false - } - return getFloat(tok, bitSize) - } - return pref.Value{}, false -} - -func getFloat(tok json.Token, bitSize int) (pref.Value, bool) { - n, ok := tok.Float(bitSize) - if !ok { - return pref.Value{}, false - } - if bitSize == 32 { - return pref.ValueOfFloat32(float32(n)), true - } - return pref.ValueOfFloat64(n), true -} - -func unmarshalBytes(tok json.Token) (pref.Value, bool) { - if tok.Kind() != json.String { - return pref.Value{}, false - } - - s := tok.ParsedString() - enc := base64.StdEncoding - if strings.ContainsAny(s, "-_") { - enc = base64.URLEncoding - } - if len(s)%4 != 0 { - enc = enc.WithPadding(base64.NoPadding) - } - b, err := enc.DecodeString(s) - if err != nil { - return pref.Value{}, false - } - return pref.ValueOfBytes(b), true -} - -func unmarshalEnum(tok json.Token, fd pref.FieldDescriptor) (pref.Value, bool) { - switch tok.Kind() { - case json.String: - // Lookup EnumNumber based on name. - s := tok.ParsedString() - if enumVal := fd.Enum().Values().ByName(pref.Name(s)); enumVal != nil { - return pref.ValueOfEnum(enumVal.Number()), true - } - - case json.Number: - if n, ok := tok.Int(32); ok { - return pref.ValueOfEnum(pref.EnumNumber(n)), true - } - - case json.Null: - // This is only valid for google.protobuf.NullValue. - if isNullValue(fd) { - return pref.ValueOfEnum(0), true - } - } - - return pref.Value{}, false -} - -func (d decoder) unmarshalList(list pref.List, fd pref.FieldDescriptor) error { - tok, err := d.Read() - if err != nil { - return err - } - if tok.Kind() != json.ArrayOpen { - return d.unexpectedTokenError(tok) - } - - switch fd.Kind() { - case pref.MessageKind, pref.GroupKind: - for { - tok, err := d.Peek() - if err != nil { - return err - } - - if tok.Kind() == json.ArrayClose { - d.Read() - return nil - } - - val := list.NewElement() - if err := d.unmarshalMessage(val.Message(), false); err != nil { - return err - } - list.Append(val) - } - default: - for { - tok, err := d.Peek() - if err != nil { - return err - } - - if tok.Kind() == json.ArrayClose { - d.Read() - return nil - } - - val, err := d.unmarshalScalar(fd) - if err != nil { - return err - } - list.Append(val) - } - } - - return nil -} - -func (d decoder) unmarshalMap(mmap pref.Map, fd pref.FieldDescriptor) error { - tok, err := d.Read() - if err != nil { - return err - } - if tok.Kind() != json.ObjectOpen { - return d.unexpectedTokenError(tok) - } - - // Determine ahead whether map entry is a scalar type or a message type in - // order to call the appropriate unmarshalMapValue func inside the for loop - // below. - var unmarshalMapValue func() (pref.Value, error) - switch fd.MapValue().Kind() { - case pref.MessageKind, pref.GroupKind: - unmarshalMapValue = func() (pref.Value, error) { - val := mmap.NewValue() - if err := d.unmarshalMessage(val.Message(), false); err != nil { - return pref.Value{}, err - } - return val, nil - } - default: - unmarshalMapValue = func() (pref.Value, error) { - return d.unmarshalScalar(fd.MapValue()) - } - } - -Loop: - for { - // Read field name. - tok, err := d.Read() - if err != nil { - return err - } - switch tok.Kind() { - default: - return d.unexpectedTokenError(tok) - case json.ObjectClose: - break Loop - case json.Name: - // Continue. - } - - // Unmarshal field name. - pkey, err := d.unmarshalMapKey(tok, fd.MapKey()) - if err != nil { - return err - } - - // Check for duplicate field name. - if mmap.Has(pkey) { - return d.newError(tok.Pos(), "duplicate map key %v", tok.RawString()) - } - - // Read and unmarshal field value. - pval, err := unmarshalMapValue() - if err != nil { - return err - } - - mmap.Set(pkey, pval) - } - - return nil -} - -// unmarshalMapKey converts given token of Name kind into a protoreflect.MapKey. -// A map key type is any integral or string type. -func (d decoder) unmarshalMapKey(tok json.Token, fd pref.FieldDescriptor) (pref.MapKey, error) { - const b32 = 32 - const b64 = 64 - const base10 = 10 - - name := tok.Name() - kind := fd.Kind() - switch kind { - case pref.StringKind: - return pref.ValueOfString(name).MapKey(), nil - - case pref.BoolKind: - switch name { - case "true": - return pref.ValueOfBool(true).MapKey(), nil - case "false": - return pref.ValueOfBool(false).MapKey(), nil - } - - case pref.Int32Kind, pref.Sint32Kind, pref.Sfixed32Kind: - if n, err := strconv.ParseInt(name, base10, b32); err == nil { - return pref.ValueOfInt32(int32(n)).MapKey(), nil - } - - case pref.Int64Kind, pref.Sint64Kind, pref.Sfixed64Kind: - if n, err := strconv.ParseInt(name, base10, b64); err == nil { - return pref.ValueOfInt64(int64(n)).MapKey(), nil - } - - case pref.Uint32Kind, pref.Fixed32Kind: - if n, err := strconv.ParseUint(name, base10, b32); err == nil { - return pref.ValueOfUint32(uint32(n)).MapKey(), nil - } - - case pref.Uint64Kind, pref.Fixed64Kind: - if n, err := strconv.ParseUint(name, base10, b64); err == nil { - return pref.ValueOfUint64(uint64(n)).MapKey(), nil - } - - default: - panic(fmt.Sprintf("invalid kind for map key: %v", kind)) - } - - return pref.MapKey{}, d.newError(tok.Pos(), "invalid value for %v key: %s", kind, tok.RawString()) -} diff --git a/vendor/google.golang.org/protobuf/encoding/protojson/doc.go b/vendor/google.golang.org/protobuf/encoding/protojson/doc.go deleted file mode 100644 index 00ea2fecfb..0000000000 --- a/vendor/google.golang.org/protobuf/encoding/protojson/doc.go +++ /dev/null @@ -1,11 +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 protojson marshals and unmarshals protocol buffer messages as JSON -// format. It follows the guide at -// https://developers.google.com/protocol-buffers/docs/proto3#json. -// -// This package produces a different output than the standard "encoding/json" -// package, which does not operate correctly on protocol buffer messages. -package protojson diff --git a/vendor/google.golang.org/protobuf/encoding/protojson/encode.go b/vendor/google.golang.org/protobuf/encoding/protojson/encode.go deleted file mode 100644 index e545feb536..0000000000 --- a/vendor/google.golang.org/protobuf/encoding/protojson/encode.go +++ /dev/null @@ -1,394 +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 protojson - -import ( - "encoding/base64" - "fmt" - "sort" - - "google.golang.org/protobuf/internal/encoding/json" - "google.golang.org/protobuf/internal/encoding/messageset" - "google.golang.org/protobuf/internal/errors" - "google.golang.org/protobuf/internal/flags" - "google.golang.org/protobuf/internal/pragma" - "google.golang.org/protobuf/proto" - pref "google.golang.org/protobuf/reflect/protoreflect" - "google.golang.org/protobuf/reflect/protoregistry" -) - -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. -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. -func Marshal(m proto.Message) ([]byte, error) { - return MarshalOptions{}.Marshal(m) -} - -// MarshalOptions is a configurable JSON format marshaler. -type MarshalOptions struct { - pragma.NoUnkeyedLiterals - - // Multiline specifies whether the marshaler should format the output in - // indented-form with every textual element on a new line. - // If Indent is an empty string, then an arbitrary indent is chosen. - Multiline bool - - // Indent specifies the set of indentation characters to use in a multiline - // formatted output such that every entry is preceded by Indent and - // terminated by a newline. If non-empty, then Multiline is treated as true. - // Indent can only be composed of space or tab characters. - Indent string - - // AllowPartial allows messages that have missing required fields to marshal - // without returning an error. If AllowPartial is false (the default), - // Marshal will return error if there are any missing required fields. - AllowPartial bool - - // UseProtoNames uses proto field name instead of lowerCamelCase name in JSON - // field names. - UseProtoNames bool - - // UseEnumNumbers emits enum values as numbers. - UseEnumNumbers bool - - // EmitUnpopulated specifies whether to emit unpopulated fields. It does not - // emit unpopulated oneof fields or unpopulated extension fields. - // The JSON value emitted for unpopulated fields are as follows: - // ╔═══════╤════════════════════════════╗ - // ║ JSON │ Protobuf field ║ - // ╠═══════╪════════════════════════════╣ - // ║ false │ proto3 boolean fields ║ - // ║ 0 │ proto3 numeric fields ║ - // ║ "" │ proto3 string/bytes fields ║ - // ║ null │ proto2 scalar fields ║ - // ║ null │ message fields ║ - // ║ [] │ list fields ║ - // ║ {} │ map fields ║ - // ╚═══════╧════════════════════════════╝ - EmitUnpopulated bool - - // Resolver is used for looking up types when expanding google.protobuf.Any - // messages. If nil, this defaults to using protoregistry.GlobalTypes. - Resolver interface { - protoregistry.ExtensionTypeResolver - protoregistry.MessageTypeResolver - } -} - -// 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. -func (o MarshalOptions) Format(m proto.Message) string { - if m == nil || !m.ProtoReflect().IsValid() { - return "" // invalid syntax, but okay since this is for debugging - } - o.AllowPartial = true - b, _ := o.Marshal(m) - return string(b) -} - -// 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. -func (o MarshalOptions) Marshal(m proto.Message) ([]byte, error) { - if o.Multiline && o.Indent == "" { - o.Indent = defaultIndent - } - if o.Resolver == nil { - o.Resolver = protoregistry.GlobalTypes - } - - internalEnc, err := json.NewEncoder(o.Indent) - if err != nil { - return nil, err - } - - // Treat nil message interface as an empty message, - // in which case the output in an empty JSON object. - if m == nil { - return []byte("{}"), nil - } - - enc := encoder{internalEnc, o} - if err := enc.marshalMessage(m.ProtoReflect()); err != nil { - return nil, err - } - if o.AllowPartial { - return enc.Bytes(), nil - } - return enc.Bytes(), proto.CheckInitialized(m) -} - -type encoder struct { - *json.Encoder - opts MarshalOptions -} - -// marshalMessage marshals the given protoreflect.Message. -func (e encoder) marshalMessage(m pref.Message) error { - if isCustomType(m.Descriptor().FullName()) { - return e.marshalCustomType(m) - } - - e.StartObject() - defer e.EndObject() - if err := e.marshalFields(m); err != nil { - return err - } - - return nil -} - -// marshalFields marshals the fields in the given protoreflect.Message. -func (e encoder) marshalFields(m pref.Message) error { - messageDesc := m.Descriptor() - if !flags.ProtoLegacy && messageset.IsMessageSet(messageDesc) { - return errors.New("no support for proto1 MessageSets") - } - - // Marshal out known fields. - fieldDescs := messageDesc.Fields() - for i := 0; i < fieldDescs.Len(); { - fd := fieldDescs.Get(i) - if od := fd.ContainingOneof(); od != nil { - fd = m.WhichOneof(od) - i += od.Fields().Len() - if fd == nil { - continue // unpopulated oneofs are not affected by EmitUnpopulated - } - } else { - i++ - } - - val := m.Get(fd) - if !m.Has(fd) { - if !e.opts.EmitUnpopulated { - continue - } - isProto2Scalar := fd.Syntax() == pref.Proto2 && fd.Default().IsValid() - isSingularMessage := fd.Cardinality() != pref.Repeated && fd.Message() != nil - if isProto2Scalar || isSingularMessage { - // Use invalid value to emit null. - val = pref.Value{} - } - } - - name := fd.JSONName() - if e.opts.UseProtoNames { - name = string(fd.Name()) - // Use type name for group field name. - if fd.Kind() == pref.GroupKind { - name = string(fd.Message().Name()) - } - } - if err := e.WriteName(name); err != nil { - return err - } - if err := e.marshalValue(val, fd); err != nil { - return err - } - } - - // Marshal out extensions. - if err := e.marshalExtensions(m); err != nil { - return err - } - return nil -} - -// marshalValue marshals the given protoreflect.Value. -func (e encoder) marshalValue(val pref.Value, fd pref.FieldDescriptor) error { - switch { - case fd.IsList(): - return e.marshalList(val.List(), fd) - case fd.IsMap(): - return e.marshalMap(val.Map(), fd) - default: - return e.marshalSingular(val, fd) - } -} - -// marshalSingular marshals the given non-repeated field value. This includes -// all scalar types, enums, messages, and groups. -func (e encoder) marshalSingular(val pref.Value, fd pref.FieldDescriptor) error { - if !val.IsValid() { - e.WriteNull() - return nil - } - - switch kind := fd.Kind(); kind { - case pref.BoolKind: - e.WriteBool(val.Bool()) - - case pref.StringKind: - if e.WriteString(val.String()) != nil { - return errors.InvalidUTF8(string(fd.FullName())) - } - - case pref.Int32Kind, pref.Sint32Kind, pref.Sfixed32Kind: - e.WriteInt(val.Int()) - - case pref.Uint32Kind, pref.Fixed32Kind: - e.WriteUint(val.Uint()) - - case pref.Int64Kind, pref.Sint64Kind, pref.Uint64Kind, - pref.Sfixed64Kind, pref.Fixed64Kind: - // 64-bit integers are written out as JSON string. - e.WriteString(val.String()) - - case pref.FloatKind: - // Encoder.WriteFloat handles the special numbers NaN and infinites. - e.WriteFloat(val.Float(), 32) - - case pref.DoubleKind: - // Encoder.WriteFloat handles the special numbers NaN and infinites. - e.WriteFloat(val.Float(), 64) - - case pref.BytesKind: - e.WriteString(base64.StdEncoding.EncodeToString(val.Bytes())) - - case pref.EnumKind: - if fd.Enum().FullName() == "google.protobuf.NullValue" { - e.WriteNull() - } else { - desc := fd.Enum().Values().ByNumber(val.Enum()) - if e.opts.UseEnumNumbers || desc == nil { - e.WriteInt(int64(val.Enum())) - } else { - e.WriteString(string(desc.Name())) - } - } - - case pref.MessageKind, pref.GroupKind: - if err := e.marshalMessage(val.Message()); err != nil { - return err - } - - default: - panic(fmt.Sprintf("%v has unknown kind: %v", fd.FullName(), kind)) - } - return nil -} - -// marshalList marshals the given protoreflect.List. -func (e encoder) marshalList(list pref.List, fd pref.FieldDescriptor) error { - e.StartArray() - defer e.EndArray() - - for i := 0; i < list.Len(); i++ { - item := list.Get(i) - if err := e.marshalSingular(item, fd); err != nil { - return err - } - } - return nil -} - -type mapEntry struct { - key pref.MapKey - value pref.Value -} - -// marshalMap marshals given protoreflect.Map. -func (e encoder) marshalMap(mmap pref.Map, fd pref.FieldDescriptor) error { - e.StartObject() - defer e.EndObject() - - // Get a sorted list based on keyType first. - entries := make([]mapEntry, 0, mmap.Len()) - mmap.Range(func(key pref.MapKey, val pref.Value) bool { - entries = append(entries, mapEntry{key: key, value: val}) - return true - }) - sortMap(fd.MapKey().Kind(), entries) - - // Write out sorted list. - for _, entry := range entries { - if err := e.WriteName(entry.key.String()); err != nil { - return err - } - if err := e.marshalSingular(entry.value, fd.MapValue()); err != nil { - return err - } - } - return nil -} - -// sortMap orders list based on value of key field for deterministic ordering. -func sortMap(keyKind pref.Kind, values []mapEntry) { - sort.Slice(values, func(i, j int) bool { - switch keyKind { - case pref.Int32Kind, pref.Sint32Kind, pref.Sfixed32Kind, - pref.Int64Kind, pref.Sint64Kind, pref.Sfixed64Kind: - return values[i].key.Int() < values[j].key.Int() - - case pref.Uint32Kind, pref.Fixed32Kind, - pref.Uint64Kind, pref.Fixed64Kind: - return values[i].key.Uint() < values[j].key.Uint() - } - return values[i].key.String() < values[j].key.String() - }) -} - -// marshalExtensions marshals extension fields. -func (e encoder) marshalExtensions(m pref.Message) error { - type entry struct { - key string - value pref.Value - desc pref.FieldDescriptor - } - - // Get a sorted list based on field key first. - var entries []entry - m.Range(func(fd pref.FieldDescriptor, v pref.Value) bool { - if !fd.IsExtension() { - return true - } - - // For MessageSet extensions, the name used is the parent message. - name := fd.FullName() - if messageset.IsMessageSetExtension(fd) { - name = name.Parent() - } - - // Use [name] format for JSON field name. - entries = append(entries, entry{ - key: string(name), - value: v, - desc: fd, - }) - return true - }) - - // Sort extensions lexicographically. - sort.Slice(entries, func(i, j int) bool { - return entries[i].key < entries[j].key - }) - - // Write out sorted list. - for _, entry := range entries { - // JSON field name is the proto field name enclosed in [], similar to - // textproto. This is consistent with Go v1 lib. C++ lib v3.7.0 does not - // marshal out extension fields. - if err := e.WriteName("[" + entry.key + "]"); err != nil { - return err - } - if err := e.marshalValue(entry.value, entry.desc); err != nil { - return err - } - } - return nil -} diff --git a/vendor/google.golang.org/protobuf/encoding/protojson/well_known_types.go b/vendor/google.golang.org/protobuf/encoding/protojson/well_known_types.go deleted file mode 100644 index 3c3ef14da3..0000000000 --- a/vendor/google.golang.org/protobuf/encoding/protojson/well_known_types.go +++ /dev/null @@ -1,903 +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 protojson - -import ( - "bytes" - "fmt" - "strconv" - "strings" - "time" - - "google.golang.org/protobuf/internal/detectknown" - "google.golang.org/protobuf/internal/encoding/json" - "google.golang.org/protobuf/internal/errors" - "google.golang.org/protobuf/internal/fieldnum" - "google.golang.org/protobuf/internal/strs" - "google.golang.org/protobuf/proto" - pref "google.golang.org/protobuf/reflect/protoreflect" -) - -// isCustomType returns true if type name has special JSON conversion rules. -// The list of custom types here has to match the ones in marshalCustomType and -// unmarshalCustomType. -func isCustomType(name pref.FullName) bool { - switch detectknown.Which(name) { - case detectknown.AnyProto: - case detectknown.TimestampProto: - case detectknown.DurationProto: - case detectknown.WrappersProto: - case detectknown.StructProto: - case detectknown.FieldMaskProto: - case detectknown.EmptyProto: - default: - return false - } - return true -} - -// marshalCustomType marshals given well-known type message that have special -// JSON conversion rules. It needs to be a message type where isCustomType -// returns true, else it will panic. -func (e encoder) marshalCustomType(m pref.Message) error { - name := m.Descriptor().FullName() - switch detectknown.Which(name) { - case detectknown.AnyProto: - return e.marshalAny(m) - case detectknown.TimestampProto: - return e.marshalTimestamp(m) - case detectknown.DurationProto: - return e.marshalDuration(m) - case detectknown.WrappersProto: - return e.marshalWrapperType(m) - case detectknown.StructProto: - return e.marshalStructType(m) - case detectknown.FieldMaskProto: - return e.marshalFieldMask(m) - case detectknown.EmptyProto: - return e.marshalEmpty(m) - default: - panic(fmt.Sprintf("%s does not have a custom marshaler", name)) - } -} - -// unmarshalCustomType unmarshals given well-known type message that have -// special JSON conversion rules. It needs to be a message type where -// isCustomType returns true, else it will panic. -func (d decoder) unmarshalCustomType(m pref.Message) error { - name := m.Descriptor().FullName() - switch detectknown.Which(name) { - case detectknown.AnyProto: - return d.unmarshalAny(m) - case detectknown.TimestampProto: - return d.unmarshalTimestamp(m) - case detectknown.DurationProto: - return d.unmarshalDuration(m) - case detectknown.WrappersProto: - return d.unmarshalWrapperType(m) - case detectknown.StructProto: - return d.unmarshalStructType(m) - case detectknown.FieldMaskProto: - return d.unmarshalFieldMask(m) - case detectknown.EmptyProto: - return d.unmarshalEmpty(m) - default: - panic(fmt.Sprintf("%s does not have a custom unmarshaler", name)) - } -} - -// The JSON representation of an Any message uses the regular representation of -// the deserialized, embedded message, with an additional field `@type` which -// contains the type URL. If the embedded message type is well-known and has a -// custom JSON representation, that representation will be embedded adding a -// field `value` which holds the custom JSON in addition to the `@type` field. - -func (e encoder) marshalAny(m pref.Message) error { - fds := m.Descriptor().Fields() - fdType := fds.ByNumber(fieldnum.Any_TypeUrl) - fdValue := fds.ByNumber(fieldnum.Any_Value) - - // Start writing the JSON object. - e.StartObject() - defer e.EndObject() - - if !m.Has(fdType) { - if !m.Has(fdValue) { - // If message is empty, marshal out empty JSON object. - return nil - } else { - // Return error if type_url field is not set, but value is set. - return errors.New("%s: type_url is not set", m.Descriptor().FullName()) - } - } - - typeVal := m.Get(fdType) - valueVal := m.Get(fdValue) - - // Marshal out @type field. - typeURL := typeVal.String() - e.WriteName("@type") - if err := e.WriteString(typeURL); err != nil { - return err - } - - // Resolve the type in order to unmarshal value field. - emt, err := e.opts.Resolver.FindMessageByURL(typeURL) - if err != nil { - return errors.New("%s: unable to resolve %q: %v", m.Descriptor().FullName(), typeURL, err) - } - - em := emt.New() - err = proto.UnmarshalOptions{ - AllowPartial: true, // never check required fields inside an Any - Resolver: e.opts.Resolver, - }.Unmarshal(valueVal.Bytes(), em.Interface()) - if err != nil { - return errors.New("%s: unable to unmarshal %q: %v", m.Descriptor().FullName(), typeURL, err) - } - - // If type of value has custom JSON encoding, marshal out a field "value" - // with corresponding custom JSON encoding of the embedded message as a - // field. - if isCustomType(emt.Descriptor().FullName()) { - e.WriteName("value") - return e.marshalCustomType(em) - } - - // Else, marshal out the embedded message's fields in this Any object. - if err := e.marshalFields(em); err != nil { - return err - } - - return nil -} - -func (d decoder) unmarshalAny(m pref.Message) error { - // Peek to check for json.ObjectOpen to avoid advancing a read. - start, err := d.Peek() - if err != nil { - return err - } - if start.Kind() != json.ObjectOpen { - return d.unexpectedTokenError(start) - } - - // Use another decoder to parse the unread bytes for @type field. This - // avoids advancing a read from current decoder because the current JSON - // object may contain the fields of the embedded type. - dec := decoder{d.Clone(), UnmarshalOptions{}} - tok, err := findTypeURL(dec) - switch err { - case errEmptyObject: - // An empty JSON object translates to an empty Any message. - d.Read() // Read json.ObjectOpen. - d.Read() // Read json.ObjectClose. - return nil - - case errMissingType: - if d.opts.DiscardUnknown { - // Treat all fields as unknowns, similar to an empty object. - return d.skipJSONValue() - } - // Use start.Pos() for line position. - return d.newError(start.Pos(), err.Error()) - - default: - if err != nil { - return err - } - } - - typeURL := tok.ParsedString() - emt, err := d.opts.Resolver.FindMessageByURL(typeURL) - if err != nil { - return d.newError(tok.Pos(), "unable to resolve %v: %q", tok.RawString(), err) - } - - // Create new message for the embedded message type and unmarshal into it. - em := emt.New() - if isCustomType(emt.Descriptor().FullName()) { - // If embedded message is a custom type, - // unmarshal the JSON "value" field into it. - if err := d.unmarshalAnyValue(em); err != nil { - return err - } - } else { - // Else unmarshal the current JSON object into it. - if err := d.unmarshalMessage(em, true); err != nil { - return err - } - } - // Serialize the embedded message and assign the resulting bytes to the - // proto value field. - b, err := proto.MarshalOptions{ - AllowPartial: true, // No need to check required fields inside an Any. - Deterministic: true, - }.Marshal(em.Interface()) - if err != nil { - return d.newError(start.Pos(), "error in marshaling Any.value field: %v", err) - } - - fds := m.Descriptor().Fields() - fdType := fds.ByNumber(fieldnum.Any_TypeUrl) - fdValue := fds.ByNumber(fieldnum.Any_Value) - - m.Set(fdType, pref.ValueOfString(typeURL)) - m.Set(fdValue, pref.ValueOfBytes(b)) - return nil -} - -var errEmptyObject = fmt.Errorf(`empty object`) -var errMissingType = fmt.Errorf(`missing "@type" field`) - -// findTypeURL returns the token for the "@type" field value from the given -// JSON bytes. It is expected that the given bytes start with json.ObjectOpen. -// It returns errEmptyObject if the JSON object is empty or errMissingType if -// @type field does not exist. It returns other error if the @type field is not -// valid or other decoding issues. -func findTypeURL(d decoder) (json.Token, error) { - var typeURL string - var typeTok json.Token - numFields := 0 - // Skip start object. - d.Read() - -Loop: - for { - tok, err := d.Read() - if err != nil { - return json.Token{}, err - } - - switch tok.Kind() { - case json.ObjectClose: - if typeURL == "" { - // Did not find @type field. - if numFields > 0 { - return json.Token{}, errMissingType - } - return json.Token{}, errEmptyObject - } - break Loop - - case json.Name: - numFields++ - if tok.Name() != "@type" { - // Skip value. - if err := d.skipJSONValue(); err != nil { - return json.Token{}, err - } - continue - } - - // Return error if this was previously set already. - if typeURL != "" { - return json.Token{}, d.newError(tok.Pos(), `duplicate "@type" field`) - } - // Read field value. - tok, err := d.Read() - if err != nil { - return json.Token{}, err - } - if tok.Kind() != json.String { - return json.Token{}, d.newError(tok.Pos(), `@type field value is not a string: %v`, tok.RawString()) - } - typeURL = tok.ParsedString() - if typeURL == "" { - return json.Token{}, d.newError(tok.Pos(), `@type field contains empty value`) - } - typeTok = tok - } - } - - return typeTok, nil -} - -// skipJSONValue parses a JSON value (null, boolean, string, number, object and -// array) in order to advance the read to the next JSON value. It relies on -// the decoder returning an error if the types are not in valid sequence. -func (d decoder) skipJSONValue() error { - tok, err := d.Read() - if err != nil { - return err - } - // Only need to continue reading for objects and arrays. - switch tok.Kind() { - case json.ObjectOpen: - for { - tok, err := d.Read() - if err != nil { - return err - } - switch tok.Kind() { - case json.ObjectClose: - return nil - case json.Name: - // Skip object field value. - if err := d.skipJSONValue(); err != nil { - return err - } - } - } - - case json.ArrayOpen: - for { - tok, err := d.Peek() - if err != nil { - return err - } - switch tok.Kind() { - case json.ArrayClose: - d.Read() - return nil - default: - // Skip array item. - if err := d.skipJSONValue(); err != nil { - return err - } - } - } - } - return nil -} - -// unmarshalAnyValue unmarshals the given custom-type message from the JSON -// object's "value" field. -func (d decoder) unmarshalAnyValue(m pref.Message) error { - // Skip ObjectOpen, and start reading the fields. - d.Read() - - var found bool // Used for detecting duplicate "value". - for { - tok, err := d.Read() - if err != nil { - return err - } - switch tok.Kind() { - case json.ObjectClose: - if !found { - return d.newError(tok.Pos(), `missing "value" field`) - } - return nil - - case json.Name: - switch tok.Name() { - case "@type": - // Skip the value as this was previously parsed already. - d.Read() - - case "value": - if found { - return d.newError(tok.Pos(), `duplicate "value" field`) - } - // Unmarshal the field value into the given message. - if err := d.unmarshalCustomType(m); err != nil { - return err - } - found = true - - default: - if d.opts.DiscardUnknown { - if err := d.skipJSONValue(); err != nil { - return err - } - continue - } - return d.newError(tok.Pos(), "unknown field %v", tok.RawString()) - } - } - } -} - -// Wrapper types are encoded as JSON primitives like string, number or boolean. - -// The "value" field has the same field number for all wrapper types. -const wrapperFieldNumber = fieldnum.BoolValue_Value - -func (e encoder) marshalWrapperType(m pref.Message) error { - fd := m.Descriptor().Fields().ByNumber(wrapperFieldNumber) - val := m.Get(fd) - return e.marshalSingular(val, fd) -} - -func (d decoder) unmarshalWrapperType(m pref.Message) error { - fd := m.Descriptor().Fields().ByNumber(wrapperFieldNumber) - val, err := d.unmarshalScalar(fd) - if err != nil { - return err - } - m.Set(fd, val) - return nil -} - -// The JSON representation for Empty is an empty JSON object. - -func (e encoder) marshalEmpty(pref.Message) error { - e.StartObject() - e.EndObject() - return nil -} - -func (d decoder) unmarshalEmpty(pref.Message) error { - tok, err := d.Read() - if err != nil { - return err - } - if tok.Kind() != json.ObjectOpen { - return d.unexpectedTokenError(tok) - } - - for { - tok, err := d.Read() - if err != nil { - return err - } - switch tok.Kind() { - case json.ObjectClose: - return nil - - case json.Name: - if d.opts.DiscardUnknown { - if err := d.skipJSONValue(); err != nil { - return err - } - continue - } - return d.newError(tok.Pos(), "unknown field %v", tok.RawString()) - - default: - return d.unexpectedTokenError(tok) - } - } -} - -func (e encoder) marshalStructType(m pref.Message) error { - switch m.Descriptor().Name() { - case "Struct": - return e.marshalStruct(m) - case "ListValue": - return e.marshalListValue(m) - case "Value": - return e.marshalKnownValue(m) - default: - panic(fmt.Sprintf("invalid struct type: %v", m.Descriptor().FullName())) - } -} - -func (d decoder) unmarshalStructType(m pref.Message) error { - switch m.Descriptor().Name() { - case "Struct": - return d.unmarshalStruct(m) - case "ListValue": - return d.unmarshalListValue(m) - case "Value": - return d.unmarshalKnownValue(m) - default: - panic(fmt.Sprintf("invalid struct type: %v", m.Descriptor().FullName())) - } -} - -// The JSON representation for Struct is a JSON object that contains the encoded -// Struct.fields map and follows the serialization rules for a map. - -func (e encoder) marshalStruct(m pref.Message) error { - fd := m.Descriptor().Fields().ByNumber(fieldnum.Struct_Fields) - return e.marshalMap(m.Get(fd).Map(), fd) -} - -func (d decoder) unmarshalStruct(m pref.Message) error { - fd := m.Descriptor().Fields().ByNumber(fieldnum.Struct_Fields) - return d.unmarshalMap(m.Mutable(fd).Map(), fd) -} - -// The JSON representation for ListValue is JSON array that contains the encoded -// ListValue.values repeated field and follows the serialization rules for a -// repeated field. - -func (e encoder) marshalListValue(m pref.Message) error { - fd := m.Descriptor().Fields().ByNumber(fieldnum.ListValue_Values) - return e.marshalList(m.Get(fd).List(), fd) -} - -func (d decoder) unmarshalListValue(m pref.Message) error { - fd := m.Descriptor().Fields().ByNumber(fieldnum.ListValue_Values) - return d.unmarshalList(m.Mutable(fd).List(), fd) -} - -// The JSON representation for a Value is dependent on the oneof field that is -// set. Each of the field in the oneof has its own custom serialization rule. A -// Value message needs to be a oneof field set, else it is an error. - -func (e encoder) marshalKnownValue(m pref.Message) error { - od := m.Descriptor().Oneofs().ByName("kind") - fd := m.WhichOneof(od) - if fd == nil { - return errors.New("%s: none of the oneof fields is set", m.Descriptor().FullName()) - } - return e.marshalSingular(m.Get(fd), fd) -} - -func (d decoder) unmarshalKnownValue(m pref.Message) error { - tok, err := d.Peek() - if err != nil { - return err - } - - var fd pref.FieldDescriptor - var val pref.Value - switch tok.Kind() { - case json.Null: - d.Read() - fd = m.Descriptor().Fields().ByNumber(fieldnum.Value_NullValue) - val = pref.ValueOfEnum(0) - - case json.Bool: - tok, err := d.Read() - if err != nil { - return err - } - fd = m.Descriptor().Fields().ByNumber(fieldnum.Value_BoolValue) - val = pref.ValueOfBool(tok.Bool()) - - case json.Number: - tok, err := d.Read() - if err != nil { - return err - } - fd = m.Descriptor().Fields().ByNumber(fieldnum.Value_NumberValue) - var ok bool - val, ok = unmarshalFloat(tok, 64) - if !ok { - return d.newError(tok.Pos(), "invalid google.protobuf.Value: %v", tok.RawString()) - } - - case json.String: - // A JSON string may have been encoded from the number_value field, - // e.g. "NaN", "Infinity", etc. Parsing a proto double type also allows - // for it to be in JSON string form. Given this custom encoding spec, - // however, there is no way to identify that and hence a JSON string is - // always assigned to the string_value field, which means that certain - // encoding cannot be parsed back to the same field. - tok, err := d.Read() - if err != nil { - return err - } - fd = m.Descriptor().Fields().ByNumber(fieldnum.Value_StringValue) - val = pref.ValueOfString(tok.ParsedString()) - - case json.ObjectOpen: - fd = m.Descriptor().Fields().ByNumber(fieldnum.Value_StructValue) - val = m.NewField(fd) - if err := d.unmarshalStruct(val.Message()); err != nil { - return err - } - - case json.ArrayOpen: - fd = m.Descriptor().Fields().ByNumber(fieldnum.Value_ListValue) - val = m.NewField(fd) - if err := d.unmarshalListValue(val.Message()); err != nil { - return err - } - - default: - return d.newError(tok.Pos(), "invalid google.protobuf.Value: %v", tok.RawString()) - } - - m.Set(fd, val) - return nil -} - -// The JSON representation for a Duration is a JSON string that ends in the -// suffix "s" (indicating seconds) and is preceded by the number of seconds, -// with nanoseconds expressed as fractional seconds. -// -// Durations less than one second are represented with a 0 seconds field and a -// positive or negative nanos field. For durations of one second or more, a -// non-zero value for the nanos field must be of the same sign as the seconds -// field. -// -// Duration.seconds must be from -315,576,000,000 to +315,576,000,000 inclusive. -// Duration.nanos must be from -999,999,999 to +999,999,999 inclusive. - -const ( - secondsInNanos = 999999999 - maxSecondsInDuration = 315576000000 -) - -func (e encoder) marshalDuration(m pref.Message) error { - fds := m.Descriptor().Fields() - fdSeconds := fds.ByNumber(fieldnum.Duration_Seconds) - fdNanos := fds.ByNumber(fieldnum.Duration_Nanos) - - secsVal := m.Get(fdSeconds) - nanosVal := m.Get(fdNanos) - secs := secsVal.Int() - nanos := nanosVal.Int() - if secs < -maxSecondsInDuration || secs > maxSecondsInDuration { - return errors.New("%s: seconds out of range %v", m.Descriptor().FullName(), secs) - } - if nanos < -secondsInNanos || nanos > secondsInNanos { - return errors.New("%s: nanos out of range %v", m.Descriptor().FullName(), nanos) - } - if (secs > 0 && nanos < 0) || (secs < 0 && nanos > 0) { - return errors.New("%s: signs of seconds and nanos do not match", m.Descriptor().FullName()) - } - // Generated output always contains 0, 3, 6, or 9 fractional digits, - // depending on required precision, followed by the suffix "s". - f := "%d.%09d" - if nanos < 0 { - nanos = -nanos - if secs == 0 { - f = "-%d.%09d" - } - } - x := fmt.Sprintf(f, secs, nanos) - x = strings.TrimSuffix(x, "000") - x = strings.TrimSuffix(x, "000") - x = strings.TrimSuffix(x, ".000") - e.WriteString(x + "s") - return nil -} - -func (d decoder) unmarshalDuration(m pref.Message) error { - tok, err := d.Read() - if err != nil { - return err - } - if tok.Kind() != json.String { - return d.unexpectedTokenError(tok) - } - - secs, nanos, ok := parseDuration(tok.ParsedString()) - if !ok { - return d.newError(tok.Pos(), "invalid google.protobuf.Duration value %v", tok.RawString()) - } - // Validate seconds. No need to validate nanos because parseDuration would - // have covered that already. - if secs < -maxSecondsInDuration || secs > maxSecondsInDuration { - return d.newError(tok.Pos(), "google.protobuf.Duration value out of range: %v", tok.RawString()) - } - - fds := m.Descriptor().Fields() - fdSeconds := fds.ByNumber(fieldnum.Duration_Seconds) - fdNanos := fds.ByNumber(fieldnum.Duration_Nanos) - - m.Set(fdSeconds, pref.ValueOfInt64(secs)) - m.Set(fdNanos, pref.ValueOfInt32(nanos)) - return nil -} - -// parseDuration parses the given input string for seconds and nanoseconds value -// for the Duration JSON format. The format is a decimal number with a suffix -// 's'. It can have optional plus/minus sign. There needs to be at least an -// integer or fractional part. Fractional part is limited to 9 digits only for -// nanoseconds precision, regardless of whether there are trailing zero digits. -// Example values are 1s, 0.1s, 1.s, .1s, +1s, -1s, -.1s. -func parseDuration(input string) (int64, int32, bool) { - b := []byte(input) - size := len(b) - if size < 2 { - return 0, 0, false - } - if b[size-1] != 's' { - return 0, 0, false - } - b = b[:size-1] - - // Read optional plus/minus symbol. - var neg bool - switch b[0] { - case '-': - neg = true - b = b[1:] - case '+': - b = b[1:] - } - if len(b) == 0 { - return 0, 0, false - } - - // Read the integer part. - var intp []byte - switch { - case b[0] == '0': - b = b[1:] - - case '1' <= b[0] && b[0] <= '9': - intp = b[0:] - b = b[1:] - n := 1 - for len(b) > 0 && '0' <= b[0] && b[0] <= '9' { - n++ - b = b[1:] - } - intp = intp[:n] - - case b[0] == '.': - // Continue below. - - default: - return 0, 0, false - } - - hasFrac := false - var frac [9]byte - if len(b) > 0 { - if b[0] != '.' { - return 0, 0, false - } - // Read the fractional part. - b = b[1:] - n := 0 - for len(b) > 0 && n < 9 && '0' <= b[0] && b[0] <= '9' { - frac[n] = b[0] - n++ - b = b[1:] - } - // It is not valid if there are more bytes left. - if len(b) > 0 { - return 0, 0, false - } - // Pad fractional part with 0s. - for i := n; i < 9; i++ { - frac[i] = '0' - } - hasFrac = true - } - - var secs int64 - if len(intp) > 0 { - var err error - secs, err = strconv.ParseInt(string(intp), 10, 64) - if err != nil { - return 0, 0, false - } - } - - var nanos int64 - if hasFrac { - nanob := bytes.TrimLeft(frac[:], "0") - if len(nanob) > 0 { - var err error - nanos, err = strconv.ParseInt(string(nanob), 10, 32) - if err != nil { - return 0, 0, false - } - } - } - - if neg { - if secs > 0 { - secs = -secs - } - if nanos > 0 { - nanos = -nanos - } - } - return secs, int32(nanos), true -} - -// The JSON representation for a Timestamp is a JSON string in the RFC 3339 -// format, i.e. "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where -// {year} is always expressed using four digits while {month}, {day}, {hour}, -// {min}, and {sec} are zero-padded to two digits each. The fractional seconds, -// which can go up to 9 digits, up to 1 nanosecond resolution, is optional. The -// "Z" suffix indicates the timezone ("UTC"); the timezone is required. Encoding -// should always use UTC (as indicated by "Z") and a decoder should be able to -// accept both UTC and other timezones (as indicated by an offset). -// -// Timestamp.seconds must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z -// inclusive. -// Timestamp.nanos must be from 0 to 999,999,999 inclusive. - -const ( - maxTimestampSeconds = 253402300799 - minTimestampSeconds = -62135596800 -) - -func (e encoder) marshalTimestamp(m pref.Message) error { - fds := m.Descriptor().Fields() - fdSeconds := fds.ByNumber(fieldnum.Timestamp_Seconds) - fdNanos := fds.ByNumber(fieldnum.Timestamp_Nanos) - - secsVal := m.Get(fdSeconds) - nanosVal := m.Get(fdNanos) - secs := secsVal.Int() - nanos := nanosVal.Int() - if secs < minTimestampSeconds || secs > maxTimestampSeconds { - return errors.New("%s: seconds out of range %v", m.Descriptor().FullName(), secs) - } - if nanos < 0 || nanos > secondsInNanos { - return errors.New("%s: nanos out of range %v", m.Descriptor().FullName(), nanos) - } - // Uses RFC 3339, where generated output will be Z-normalized and uses 0, 3, - // 6 or 9 fractional digits. - t := time.Unix(secs, nanos).UTC() - x := t.Format("2006-01-02T15:04:05.000000000") - x = strings.TrimSuffix(x, "000") - x = strings.TrimSuffix(x, "000") - x = strings.TrimSuffix(x, ".000") - e.WriteString(x + "Z") - return nil -} - -func (d decoder) unmarshalTimestamp(m pref.Message) error { - tok, err := d.Read() - if err != nil { - return err - } - if tok.Kind() != json.String { - return d.unexpectedTokenError(tok) - } - - t, err := time.Parse(time.RFC3339Nano, tok.ParsedString()) - if err != nil { - return d.newError(tok.Pos(), "invalid google.protobuf.Timestamp value %v", tok.RawString()) - } - // Validate seconds. No need to validate nanos because time.Parse would have - // covered that already. - secs := t.Unix() - if secs < minTimestampSeconds || secs > maxTimestampSeconds { - return d.newError(tok.Pos(), "google.protobuf.Timestamp value out of range: %v", tok.RawString()) - } - - fds := m.Descriptor().Fields() - fdSeconds := fds.ByNumber(fieldnum.Timestamp_Seconds) - fdNanos := fds.ByNumber(fieldnum.Timestamp_Nanos) - - m.Set(fdSeconds, pref.ValueOfInt64(secs)) - m.Set(fdNanos, pref.ValueOfInt32(int32(t.Nanosecond()))) - return nil -} - -// The JSON representation for a FieldMask is a JSON string where paths are -// separated by a comma. Fields name in each path are converted to/from -// lower-camel naming conventions. Encoding should fail if the path name would -// end up differently after a round-trip. - -func (e encoder) marshalFieldMask(m pref.Message) error { - fd := m.Descriptor().Fields().ByNumber(fieldnum.FieldMask_Paths) - list := m.Get(fd).List() - paths := make([]string, 0, list.Len()) - - for i := 0; i < list.Len(); i++ { - s := list.Get(i).String() - // Return error if conversion to camelCase is not reversible. - cc := strs.JSONCamelCase(s) - if s != strs.JSONSnakeCase(cc) { - return errors.New("%s.paths contains irreversible value %q", m.Descriptor().FullName(), s) - } - paths = append(paths, cc) - } - - e.WriteString(strings.Join(paths, ",")) - return nil -} - -func (d decoder) unmarshalFieldMask(m pref.Message) error { - tok, err := d.Read() - if err != nil { - return err - } - if tok.Kind() != json.String { - return d.unexpectedTokenError(tok) - } - str := strings.TrimSpace(tok.ParsedString()) - if str == "" { - return nil - } - paths := strings.Split(str, ",") - - fd := m.Descriptor().Fields().ByNumber(fieldnum.FieldMask_Paths) - list := m.Mutable(fd).List() - - for _, s := range paths { - s = strings.TrimSpace(s) - // Convert to snake_case. Unlike encoding, no validation is done because - // it is not possible to know the original path names. - list.Append(pref.ValueOfString(strs.JSONSnakeCase(s))) - } - return nil -} diff --git a/vendor/google.golang.org/protobuf/internal/detectknown/detect.go b/vendor/google.golang.org/protobuf/internal/detectknown/detect.go deleted file mode 100644 index 091c4233d1..0000000000 --- a/vendor/google.golang.org/protobuf/internal/detectknown/detect.go +++ /dev/null @@ -1,47 +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 detectknown provides functionality for detecting well-known types -// and identifying them by name. -package detectknown - -import "google.golang.org/protobuf/reflect/protoreflect" - -type ProtoFile int - -const ( - Unknown ProtoFile = iota - AnyProto - TimestampProto - DurationProto - WrappersProto - StructProto - FieldMaskProto - EmptyProto -) - -var wellKnownTypes = map[protoreflect.FullName]ProtoFile{ - "google.protobuf.Any": AnyProto, - "google.protobuf.Timestamp": TimestampProto, - "google.protobuf.Duration": DurationProto, - "google.protobuf.BoolValue": WrappersProto, - "google.protobuf.Int32Value": WrappersProto, - "google.protobuf.Int64Value": WrappersProto, - "google.protobuf.UInt32Value": WrappersProto, - "google.protobuf.UInt64Value": WrappersProto, - "google.protobuf.FloatValue": WrappersProto, - "google.protobuf.DoubleValue": WrappersProto, - "google.protobuf.BytesValue": WrappersProto, - "google.protobuf.StringValue": WrappersProto, - "google.protobuf.Struct": StructProto, - "google.protobuf.ListValue": StructProto, - "google.protobuf.Value": StructProto, - "google.protobuf.FieldMask": FieldMaskProto, - "google.protobuf.Empty": EmptyProto, -} - -// Which identifies the proto file that a well-known type belongs to. -func Which(s protoreflect.FullName) ProtoFile { - return wellKnownTypes[s] -} diff --git a/vendor/google.golang.org/protobuf/internal/encoding/json/decode.go b/vendor/google.golang.org/protobuf/internal/encoding/json/decode.go deleted file mode 100644 index b13fd29e81..0000000000 --- a/vendor/google.golang.org/protobuf/internal/encoding/json/decode.go +++ /dev/null @@ -1,340 +0,0 @@ -// Copyright 2018 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package json - -import ( - "bytes" - "fmt" - "io" - "regexp" - "unicode/utf8" - - "google.golang.org/protobuf/internal/errors" -) - -// call specifies which Decoder method was invoked. -type call uint8 - -const ( - readCall call = iota - peekCall -) - -const unexpectedFmt = "unexpected token %s" - -// ErrUnexpectedEOF means that EOF was encountered in the middle of the input. -var ErrUnexpectedEOF = errors.New("%v", io.ErrUnexpectedEOF) - -// Decoder is a token-based JSON decoder. -type Decoder struct { - // lastCall is last method called, either readCall or peekCall. - // Initial value is readCall. - lastCall call - - // lastToken contains the last read token. - lastToken Token - - // lastErr contains the last read error. - lastErr error - - // openStack is a stack containing ObjectOpen and ArrayOpen values. The - // top of stack represents the object or the array the current value is - // directly located in. - openStack []Kind - - // orig is used in reporting line and column. - orig []byte - // in contains the unconsumed input. - in []byte -} - -// NewDecoder returns a Decoder to read the given []byte. -func NewDecoder(b []byte) *Decoder { - return &Decoder{orig: b, in: b} -} - -// Peek looks ahead and returns the next token kind without advancing a read. -func (d *Decoder) Peek() (Token, error) { - defer func() { d.lastCall = peekCall }() - if d.lastCall == readCall { - d.lastToken, d.lastErr = d.Read() - } - return d.lastToken, d.lastErr -} - -// Read returns the next JSON token. -// It will return an error if there is no valid token. -func (d *Decoder) Read() (Token, error) { - const scalar = Null | Bool | Number | String - - defer func() { d.lastCall = readCall }() - if d.lastCall == peekCall { - return d.lastToken, d.lastErr - } - - tok, err := d.parseNext() - if err != nil { - return Token{}, err - } - - switch tok.kind { - case EOF: - if len(d.openStack) != 0 || - d.lastToken.kind&scalar|ObjectClose|ArrayClose == 0 { - return Token{}, ErrUnexpectedEOF - } - - case Null: - if !d.isValueNext() { - return Token{}, d.newSyntaxError(tok.pos, unexpectedFmt, tok.RawString()) - } - - case Bool, Number: - if !d.isValueNext() { - return Token{}, d.newSyntaxError(tok.pos, unexpectedFmt, tok.RawString()) - } - - case String: - if d.isValueNext() { - break - } - // This string token should only be for a field name. - if d.lastToken.kind&(ObjectOpen|comma) == 0 { - return Token{}, d.newSyntaxError(tok.pos, unexpectedFmt, tok.RawString()) - } - if len(d.in) == 0 { - return Token{}, ErrUnexpectedEOF - } - if c := d.in[0]; c != ':' { - return Token{}, d.newSyntaxError(d.currPos(), `unexpected character %s, missing ":" after field name`, string(c)) - } - tok.kind = Name - d.consume(1) - - case ObjectOpen, ArrayOpen: - if !d.isValueNext() { - return Token{}, d.newSyntaxError(tok.pos, unexpectedFmt, tok.RawString()) - } - d.openStack = append(d.openStack, tok.kind) - - case ObjectClose: - if len(d.openStack) == 0 || - d.lastToken.kind == comma || - d.openStack[len(d.openStack)-1] != ObjectOpen { - return Token{}, d.newSyntaxError(tok.pos, unexpectedFmt, tok.RawString()) - } - d.openStack = d.openStack[:len(d.openStack)-1] - - case ArrayClose: - if len(d.openStack) == 0 || - d.lastToken.kind == comma || - d.openStack[len(d.openStack)-1] != ArrayOpen { - return Token{}, d.newSyntaxError(tok.pos, unexpectedFmt, tok.RawString()) - } - d.openStack = d.openStack[:len(d.openStack)-1] - - case comma: - if len(d.openStack) == 0 || - d.lastToken.kind&(scalar|ObjectClose|ArrayClose) == 0 { - return Token{}, d.newSyntaxError(tok.pos, unexpectedFmt, tok.RawString()) - } - } - - // Update d.lastToken only after validating token to be in the right sequence. - d.lastToken = tok - - if d.lastToken.kind == comma { - return d.Read() - } - return tok, nil -} - -// Any sequence that looks like a non-delimiter (for error reporting). -var errRegexp = regexp.MustCompile(`^([-+._a-zA-Z0-9]{1,32}|.)`) - -// parseNext parses for the next JSON token. It returns a Token object for -// different types, except for Name. It does not handle whether the next token -// is in a valid sequence or not. -func (d *Decoder) parseNext() (Token, error) { - // Trim leading spaces. - d.consume(0) - - in := d.in - if len(in) == 0 { - return d.consumeToken(EOF, 0), nil - } - - switch in[0] { - case 'n': - if n := matchWithDelim("null", in); n != 0 { - return d.consumeToken(Null, n), nil - } - - case 't': - if n := matchWithDelim("true", in); n != 0 { - return d.consumeBoolToken(true, n), nil - } - - case 'f': - if n := matchWithDelim("false", in); n != 0 { - return d.consumeBoolToken(false, n), nil - } - - case '-', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9': - if n, ok := parseNumber(in); ok { - return d.consumeToken(Number, n), nil - } - - case '"': - s, n, err := d.parseString(in) - if err != nil { - return Token{}, err - } - return d.consumeStringToken(s, n), nil - - case '{': - return d.consumeToken(ObjectOpen, 1), nil - - case '}': - return d.consumeToken(ObjectClose, 1), nil - - case '[': - return d.consumeToken(ArrayOpen, 1), nil - - case ']': - return d.consumeToken(ArrayClose, 1), nil - - case ',': - return d.consumeToken(comma, 1), nil - } - return Token{}, d.newSyntaxError(d.currPos(), "invalid value %s", errRegexp.Find(in)) -} - -// newSyntaxError returns an error with line and column information useful for -// syntax errors. -func (d *Decoder) newSyntaxError(pos int, f string, x ...interface{}) error { - e := errors.New(f, x...) - line, column := d.Position(pos) - return errors.New("syntax error (line %d:%d): %v", line, column, e) -} - -// Position returns line and column number of given index of the original input. -// It will panic if index is out of range. -func (d *Decoder) Position(idx int) (line int, column int) { - b := d.orig[:idx] - line = bytes.Count(b, []byte("\n")) + 1 - if i := bytes.LastIndexByte(b, '\n'); i >= 0 { - b = b[i+1:] - } - column = utf8.RuneCount(b) + 1 // ignore multi-rune characters - return line, column -} - -// currPos returns the current index position of d.in from d.orig. -func (d *Decoder) currPos() int { - return len(d.orig) - len(d.in) -} - -// matchWithDelim matches s with the input b and verifies that the match -// terminates with a delimiter of some form (e.g., r"[^-+_.a-zA-Z0-9]"). -// As a special case, EOF is considered a delimiter. It returns the length of s -// if there is a match, else 0. -func matchWithDelim(s string, b []byte) int { - if !bytes.HasPrefix(b, []byte(s)) { - return 0 - } - - n := len(s) - if n < len(b) && isNotDelim(b[n]) { - return 0 - } - return n -} - -// isNotDelim returns true if given byte is a not delimiter character. -func isNotDelim(c byte) bool { - return (c == '-' || c == '+' || c == '.' || c == '_' || - ('a' <= c && c <= 'z') || - ('A' <= c && c <= 'Z') || - ('0' <= c && c <= '9')) -} - -// consume consumes n bytes of input and any subsequent whitespace. -func (d *Decoder) consume(n int) { - d.in = d.in[n:] - for len(d.in) > 0 { - switch d.in[0] { - case ' ', '\n', '\r', '\t': - d.in = d.in[1:] - default: - return - } - } -} - -// isValueNext returns true if next type should be a JSON value: Null, -// Number, String or Bool. -func (d *Decoder) isValueNext() bool { - if len(d.openStack) == 0 { - return d.lastToken.kind == 0 - } - - start := d.openStack[len(d.openStack)-1] - switch start { - case ObjectOpen: - return d.lastToken.kind&Name != 0 - case ArrayOpen: - return d.lastToken.kind&(ArrayOpen|comma) != 0 - } - panic(fmt.Sprintf( - "unreachable logic in Decoder.isValueNext, lastToken.kind: %v, openStack: %v", - d.lastToken.kind, start)) -} - -// consumeToken constructs a Token for given Kind with raw value derived from -// current d.in and given size, and consumes the given size-lenght of it. -func (d *Decoder) consumeToken(kind Kind, size int) Token { - tok := Token{ - kind: kind, - raw: d.in[:size], - pos: len(d.orig) - len(d.in), - } - d.consume(size) - return tok -} - -// consumeBoolToken constructs a Token for a Bool kind with raw value derived from -// current d.in and given size. -func (d *Decoder) consumeBoolToken(b bool, size int) Token { - tok := Token{ - kind: Bool, - raw: d.in[:size], - pos: len(d.orig) - len(d.in), - boo: b, - } - d.consume(size) - return tok -} - -// consumeStringToken constructs a Token for a String kind with raw value derived -// from current d.in and given size. -func (d *Decoder) consumeStringToken(s string, size int) Token { - tok := Token{ - kind: String, - raw: d.in[:size], - pos: len(d.orig) - len(d.in), - str: s, - } - d.consume(size) - return tok -} - -// Clone returns a copy of the Decoder for use in reading ahead the next JSON -// object, array or other values without affecting current Decoder. -func (d *Decoder) Clone() *Decoder { - ret := *d - ret.openStack = append([]Kind(nil), ret.openStack...) - return &ret -} diff --git a/vendor/google.golang.org/protobuf/internal/encoding/json/decode_number.go b/vendor/google.golang.org/protobuf/internal/encoding/json/decode_number.go deleted file mode 100644 index 2999d71332..0000000000 --- a/vendor/google.golang.org/protobuf/internal/encoding/json/decode_number.go +++ /dev/null @@ -1,254 +0,0 @@ -// Copyright 2018 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package json - -import ( - "bytes" - "strconv" -) - -// parseNumber reads the given []byte for a valid JSON number. If it is valid, -// it returns the number of bytes. Parsing logic follows the definition in -// https://tools.ietf.org/html/rfc7159#section-6, and is based off -// encoding/json.isValidNumber function. -func parseNumber(input []byte) (int, bool) { - var n int - - s := input - if len(s) == 0 { - return 0, false - } - - // Optional - - if s[0] == '-' { - s = s[1:] - n++ - if len(s) == 0 { - return 0, false - } - } - - // Digits - switch { - case s[0] == '0': - s = s[1:] - n++ - - case '1' <= s[0] && s[0] <= '9': - s = s[1:] - n++ - for len(s) > 0 && '0' <= s[0] && s[0] <= '9' { - s = s[1:] - n++ - } - - default: - return 0, false - } - - // . followed by 1 or more digits. - if len(s) >= 2 && s[0] == '.' && '0' <= s[1] && s[1] <= '9' { - s = s[2:] - n += 2 - for len(s) > 0 && '0' <= s[0] && s[0] <= '9' { - s = s[1:] - n++ - } - } - - // e or E followed by an optional - or + and - // 1 or more digits. - if len(s) >= 2 && (s[0] == 'e' || s[0] == 'E') { - s = s[1:] - n++ - if s[0] == '+' || s[0] == '-' { - s = s[1:] - n++ - if len(s) == 0 { - return 0, false - } - } - for len(s) > 0 && '0' <= s[0] && s[0] <= '9' { - s = s[1:] - n++ - } - } - - // Check that next byte is a delimiter or it is at the end. - if n < len(input) && isNotDelim(input[n]) { - return 0, false - } - - return n, true -} - -// numberParts is the result of parsing out a valid JSON number. It contains -// the parts of a number. The parts are used for integer conversion. -type numberParts struct { - neg bool - intp []byte - frac []byte - exp []byte -} - -// parseNumber constructs numberParts from given []byte. The logic here is -// similar to consumeNumber above with the difference of having to construct -// numberParts. The slice fields in numberParts are subslices of the input. -func parseNumberParts(input []byte) (numberParts, bool) { - var neg bool - var intp []byte - var frac []byte - var exp []byte - - s := input - if len(s) == 0 { - return numberParts{}, false - } - - // Optional - - if s[0] == '-' { - neg = true - s = s[1:] - if len(s) == 0 { - return numberParts{}, false - } - } - - // Digits - switch { - case s[0] == '0': - // Skip first 0 and no need to store. - s = s[1:] - - case '1' <= s[0] && s[0] <= '9': - intp = s - n := 1 - s = s[1:] - for len(s) > 0 && '0' <= s[0] && s[0] <= '9' { - s = s[1:] - n++ - } - intp = intp[:n] - - default: - return numberParts{}, false - } - - // . followed by 1 or more digits. - if len(s) >= 2 && s[0] == '.' && '0' <= s[1] && s[1] <= '9' { - frac = s[1:] - n := 1 - s = s[2:] - for len(s) > 0 && '0' <= s[0] && s[0] <= '9' { - s = s[1:] - n++ - } - frac = frac[:n] - } - - // e or E followed by an optional - or + and - // 1 or more digits. - if len(s) >= 2 && (s[0] == 'e' || s[0] == 'E') { - s = s[1:] - exp = s - n := 0 - if s[0] == '+' || s[0] == '-' { - s = s[1:] - n++ - if len(s) == 0 { - return numberParts{}, false - } - } - for len(s) > 0 && '0' <= s[0] && s[0] <= '9' { - s = s[1:] - n++ - } - exp = exp[:n] - } - - return numberParts{ - neg: neg, - intp: intp, - frac: bytes.TrimRight(frac, "0"), // Remove unnecessary 0s to the right. - exp: exp, - }, true -} - -// normalizeToIntString returns an integer string in normal form without the -// E-notation for given numberParts. It will return false if it is not an -// integer or if the exponent exceeds than max/min int value. -func normalizeToIntString(n numberParts) (string, bool) { - intpSize := len(n.intp) - fracSize := len(n.frac) - - if intpSize == 0 && fracSize == 0 { - return "0", true - } - - var exp int - if len(n.exp) > 0 { - i, err := strconv.ParseInt(string(n.exp), 10, 32) - if err != nil { - return "", false - } - exp = int(i) - } - - var num []byte - if exp >= 0 { - // For positive E, shift fraction digits into integer part and also pad - // with zeroes as needed. - - // If there are more digits in fraction than the E value, then the - // number is not an integer. - if fracSize > exp { - return "", false - } - - // Make sure resulting digits are within max value limit to avoid - // unnecessarily constructing a large byte slice that may simply fail - // later on. - const maxDigits = 20 // Max uint64 value has 20 decimal digits. - if intpSize+exp > maxDigits { - return "", false - } - - // Set cap to make a copy of integer part when appended. - num = n.intp[:len(n.intp):len(n.intp)] - num = append(num, n.frac...) - for i := 0; i < exp-fracSize; i++ { - num = append(num, '0') - } - } else { - // For negative E, shift digits in integer part out. - - // If there are fractions, then the number is not an integer. - if fracSize > 0 { - return "", false - } - - // index is where the decimal point will be after adjusting for negative - // exponent. - index := intpSize + exp - if index < 0 { - return "", false - } - - num = n.intp - // If any of the digits being shifted to the right of the decimal point - // is non-zero, then the number is not an integer. - for i := index; i < intpSize; i++ { - if num[i] != '0' { - return "", false - } - } - num = num[:index] - } - - if n.neg { - return "-" + string(num), true - } - return string(num), true -} diff --git a/vendor/google.golang.org/protobuf/internal/encoding/json/decode_string.go b/vendor/google.golang.org/protobuf/internal/encoding/json/decode_string.go deleted file mode 100644 index f7fea7d8dd..0000000000 --- a/vendor/google.golang.org/protobuf/internal/encoding/json/decode_string.go +++ /dev/null @@ -1,91 +0,0 @@ -// Copyright 2018 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package json - -import ( - "strconv" - "unicode" - "unicode/utf16" - "unicode/utf8" - - "google.golang.org/protobuf/internal/strs" -) - -func (d *Decoder) parseString(in []byte) (string, int, error) { - in0 := in - if len(in) == 0 { - return "", 0, ErrUnexpectedEOF - } - if in[0] != '"' { - return "", 0, d.newSyntaxError(d.currPos(), "invalid character %q at start of string", in[0]) - } - in = in[1:] - i := indexNeedEscapeInBytes(in) - in, out := in[i:], in[:i:i] // set cap to prevent mutations - for len(in) > 0 { - switch r, n := utf8.DecodeRune(in); { - case r == utf8.RuneError && n == 1: - return "", 0, d.newSyntaxError(d.currPos(), "invalid UTF-8 in string") - case r < ' ': - return "", 0, d.newSyntaxError(d.currPos(), "invalid character %q in string", r) - case r == '"': - in = in[1:] - n := len(in0) - len(in) - return string(out), n, nil - case r == '\\': - if len(in) < 2 { - return "", 0, ErrUnexpectedEOF - } - switch r := in[1]; r { - case '"', '\\', '/': - in, out = in[2:], append(out, r) - case 'b': - in, out = in[2:], append(out, '\b') - case 'f': - in, out = in[2:], append(out, '\f') - case 'n': - in, out = in[2:], append(out, '\n') - case 'r': - in, out = in[2:], append(out, '\r') - case 't': - in, out = in[2:], append(out, '\t') - case 'u': - if len(in) < 6 { - return "", 0, ErrUnexpectedEOF - } - v, err := strconv.ParseUint(string(in[2:6]), 16, 16) - if err != nil { - return "", 0, d.newSyntaxError(d.currPos(), "invalid escape code %q in string", in[:6]) - } - in = in[6:] - - r := rune(v) - if utf16.IsSurrogate(r) { - if len(in) < 6 { - return "", 0, ErrUnexpectedEOF - } - v, err := strconv.ParseUint(string(in[2:6]), 16, 16) - r = utf16.DecodeRune(r, rune(v)) - if in[0] != '\\' || in[1] != 'u' || - r == unicode.ReplacementChar || err != nil { - return "", 0, d.newSyntaxError(d.currPos(), "invalid escape code %q in string", in[:6]) - } - in = in[6:] - } - out = append(out, string(r)...) - default: - return "", 0, d.newSyntaxError(d.currPos(), "invalid escape code %q in string", in[:2]) - } - default: - i := indexNeedEscapeInBytes(in[n:]) - in, out = in[n+i:], append(out, in[:n+i]...) - } - } - return "", 0, ErrUnexpectedEOF -} - -// indexNeedEscapeInBytes returns the index of the character that needs -// escaping. If no characters need escaping, this returns the input length. -func indexNeedEscapeInBytes(b []byte) int { return indexNeedEscapeInString(strs.UnsafeString(b)) } diff --git a/vendor/google.golang.org/protobuf/internal/encoding/json/decode_token.go b/vendor/google.golang.org/protobuf/internal/encoding/json/decode_token.go deleted file mode 100644 index 2eb7023b2f..0000000000 --- a/vendor/google.golang.org/protobuf/internal/encoding/json/decode_token.go +++ /dev/null @@ -1,193 +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 json - -import ( - "bytes" - "fmt" - "strconv" -) - -// Kind represents a token kind expressible in the JSON format. -type Kind uint16 - -const ( - Invalid Kind = (1 << iota) / 2 - EOF - Null - Bool - Number - String - Name - ObjectOpen - ObjectClose - ArrayOpen - ArrayClose - - // comma is only for parsing in between tokens and - // does not need to be exported. - comma -) - -func (k Kind) String() string { - switch k { - case EOF: - return "eof" - case Null: - return "null" - case Bool: - return "bool" - case Number: - return "number" - case String: - return "string" - case ObjectOpen: - return "{" - case ObjectClose: - return "}" - case Name: - return "name" - case ArrayOpen: - return "[" - case ArrayClose: - return "]" - case comma: - return "," - } - return "" -} - -// Token provides a parsed token kind and value. -// -// Values are provided by the difference accessor methods. The accessor methods -// Name, Bool, and ParsedString will panic if called on the wrong kind. There -// are different accessor methods for the Number kind for converting to the -// appropriate Go numeric type and those methods have the ok return value. -type Token struct { - // Token kind. - kind Kind - // pos provides the position of the token in the original input. - pos int - // raw bytes of the serialized token. - // This is a subslice into the original input. - raw []byte - // boo is parsed boolean value. - boo bool - // str is parsed string value. - str string -} - -// Kind returns the token kind. -func (t Token) Kind() Kind { - return t.kind -} - -// RawString returns the read value in string. -func (t Token) RawString() string { - return string(t.raw) -} - -// Pos returns the token position from the input. -func (t Token) Pos() int { - return t.pos -} - -// Name returns the object name if token is Name, else it will return an error. -func (t Token) Name() string { - if t.kind == Name { - return t.str - } - panic(fmt.Sprintf("Token is not a Name: %v", t.RawString())) -} - -// Bool returns the bool value if token kind is Bool, else it panics. -func (t Token) Bool() bool { - if t.kind == Bool { - return t.boo - } - panic(fmt.Sprintf("Token is not a Bool: %v", t.RawString())) -} - -// ParsedString returns the string value for a JSON string token or the read -// value in string if token is not a string. -func (t Token) ParsedString() string { - if t.kind == String { - return t.str - } - panic(fmt.Sprintf("Token is not a String: %v", t.RawString())) -} - -// Float returns the floating-point number if token kind is Number. -// -// The floating-point precision is specified by the bitSize parameter: 32 for -// float32 or 64 for float64. If bitSize=32, the result still has type float64, -// but it will be convertible to float32 without changing its value. It will -// return false if the number exceeds the floating point limits for given -// bitSize. -func (t Token) Float(bitSize int) (float64, bool) { - if t.kind != Number { - return 0, false - } - f, err := strconv.ParseFloat(t.RawString(), bitSize) - if err != nil { - return 0, false - } - return f, true -} - -// Int returns the signed integer number if token is Number. -// -// The given bitSize specifies the integer type that the result must fit into. -// It returns false if the number is not an integer value or if the result -// exceeds the limits for given bitSize. -func (t Token) Int(bitSize int) (int64, bool) { - s, ok := t.getIntStr() - if !ok { - return 0, false - } - n, err := strconv.ParseInt(s, 10, bitSize) - if err != nil { - return 0, false - } - return n, true -} - -// Uint returns the signed integer number if token is Number, else it will -// return an error. -// -// The given bitSize specifies the unsigned integer type that the result must -// fit into. It returns false if the number is not an unsigned integer value -// or if the result exceeds the limits for given bitSize. -func (t Token) Uint(bitSize int) (uint64, bool) { - s, ok := t.getIntStr() - if !ok { - return 0, false - } - n, err := strconv.ParseUint(s, 10, bitSize) - if err != nil { - return 0, false - } - return n, true -} - -func (t Token) getIntStr() (string, bool) { - if t.kind != Number { - return "", false - } - parts, ok := parseNumberParts(t.raw) - if !ok { - return "", false - } - return normalizeToIntString(parts) -} - -// TokenEquals returns true if given Tokens are equal, else false. -func TokenEquals(x, y Token) bool { - return x.kind == y.kind && - x.pos == y.pos && - bytes.Equal(x.raw, y.raw) && - x.boo == y.boo && - x.str == y.str -} diff --git a/vendor/google.golang.org/protobuf/internal/encoding/json/encode.go b/vendor/google.golang.org/protobuf/internal/encoding/json/encode.go deleted file mode 100644 index fbdf348734..0000000000 --- a/vendor/google.golang.org/protobuf/internal/encoding/json/encode.go +++ /dev/null @@ -1,276 +0,0 @@ -// Copyright 2018 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package json - -import ( - "math" - "math/bits" - "strconv" - "strings" - "unicode/utf8" - - "google.golang.org/protobuf/internal/detrand" - "google.golang.org/protobuf/internal/errors" -) - -// kind represents an encoding type. -type kind uint8 - -const ( - _ kind = (1 << iota) / 2 - name - scalar - objectOpen - objectClose - arrayOpen - arrayClose -) - -// Encoder provides methods to write out JSON constructs and values. The user is -// responsible for producing valid sequences of JSON constructs and values. -type Encoder struct { - indent string - lastKind kind - indents []byte - out []byte -} - -// NewEncoder returns an Encoder. -// -// If indent is a non-empty string, it causes every entry for an Array or Object -// to be preceded by the indent and trailed by a newline. -func NewEncoder(indent string) (*Encoder, error) { - e := &Encoder{} - if len(indent) > 0 { - if strings.Trim(indent, " \t") != "" { - return nil, errors.New("indent may only be composed of space or tab characters") - } - e.indent = indent - } - return e, nil -} - -// Bytes returns the content of the written bytes. -func (e *Encoder) Bytes() []byte { - return e.out -} - -// WriteNull writes out the null value. -func (e *Encoder) WriteNull() { - e.prepareNext(scalar) - e.out = append(e.out, "null"...) -} - -// WriteBool writes out the given boolean value. -func (e *Encoder) WriteBool(b bool) { - e.prepareNext(scalar) - if b { - e.out = append(e.out, "true"...) - } else { - e.out = append(e.out, "false"...) - } -} - -// WriteString writes out the given string in JSON string value. Returns error -// if input string contains invalid UTF-8. -func (e *Encoder) WriteString(s string) error { - e.prepareNext(scalar) - var err error - if e.out, err = appendString(e.out, s); err != nil { - return err - } - return nil -} - -// Sentinel error used for indicating invalid UTF-8. -var errInvalidUTF8 = errors.New("invalid UTF-8") - -func appendString(out []byte, in string) ([]byte, error) { - out = append(out, '"') - i := indexNeedEscapeInString(in) - in, out = in[i:], append(out, in[:i]...) - for len(in) > 0 { - switch r, n := utf8.DecodeRuneInString(in); { - case r == utf8.RuneError && n == 1: - return out, errInvalidUTF8 - case r < ' ' || r == '"' || r == '\\': - out = append(out, '\\') - switch r { - case '"', '\\': - out = append(out, byte(r)) - case '\b': - out = append(out, 'b') - case '\f': - out = append(out, 'f') - case '\n': - out = append(out, 'n') - case '\r': - out = append(out, 'r') - case '\t': - out = append(out, 't') - default: - out = append(out, 'u') - out = append(out, "0000"[1+(bits.Len32(uint32(r))-1)/4:]...) - out = strconv.AppendUint(out, uint64(r), 16) - } - in = in[n:] - default: - i := indexNeedEscapeInString(in[n:]) - in, out = in[n+i:], append(out, in[:n+i]...) - } - } - out = append(out, '"') - return out, nil -} - -// indexNeedEscapeInString returns the index of the character that needs -// escaping. If no characters need escaping, this returns the input length. -func indexNeedEscapeInString(s string) int { - for i, r := range s { - if r < ' ' || r == '\\' || r == '"' || r == utf8.RuneError { - return i - } - } - return len(s) -} - -// WriteFloat writes out the given float and bitSize in JSON number value. -func (e *Encoder) WriteFloat(n float64, bitSize int) { - e.prepareNext(scalar) - e.out = appendFloat(e.out, n, bitSize) -} - -// appendFloat formats given float in bitSize, and appends to the given []byte. -func appendFloat(out []byte, n float64, bitSize int) []byte { - switch { - case math.IsNaN(n): - return append(out, `"NaN"`...) - case math.IsInf(n, +1): - return append(out, `"Infinity"`...) - case math.IsInf(n, -1): - return append(out, `"-Infinity"`...) - } - - // JSON number formatting logic based on encoding/json. - // See floatEncoder.encode for reference. - fmt := byte('f') - if abs := math.Abs(n); abs != 0 { - if bitSize == 64 && (abs < 1e-6 || abs >= 1e21) || - bitSize == 32 && (float32(abs) < 1e-6 || float32(abs) >= 1e21) { - fmt = 'e' - } - } - out = strconv.AppendFloat(out, n, fmt, -1, bitSize) - if fmt == 'e' { - n := len(out) - if n >= 4 && out[n-4] == 'e' && out[n-3] == '-' && out[n-2] == '0' { - out[n-2] = out[n-1] - out = out[:n-1] - } - } - return out -} - -// WriteInt writes out the given signed integer in JSON number value. -func (e *Encoder) WriteInt(n int64) { - e.prepareNext(scalar) - e.out = append(e.out, strconv.FormatInt(n, 10)...) -} - -// WriteUint writes out the given unsigned integer in JSON number value. -func (e *Encoder) WriteUint(n uint64) { - e.prepareNext(scalar) - e.out = append(e.out, strconv.FormatUint(n, 10)...) -} - -// StartObject writes out the '{' symbol. -func (e *Encoder) StartObject() { - e.prepareNext(objectOpen) - e.out = append(e.out, '{') -} - -// EndObject writes out the '}' symbol. -func (e *Encoder) EndObject() { - e.prepareNext(objectClose) - e.out = append(e.out, '}') -} - -// WriteName writes out the given string in JSON string value and the name -// separator ':'. Returns error if input string contains invalid UTF-8, which -// should not be likely as protobuf field names should be valid. -func (e *Encoder) WriteName(s string) error { - e.prepareNext(name) - var err error - // Append to output regardless of error. - e.out, err = appendString(e.out, s) - e.out = append(e.out, ':') - return err -} - -// StartArray writes out the '[' symbol. -func (e *Encoder) StartArray() { - e.prepareNext(arrayOpen) - e.out = append(e.out, '[') -} - -// EndArray writes out the ']' symbol. -func (e *Encoder) EndArray() { - e.prepareNext(arrayClose) - e.out = append(e.out, ']') -} - -// prepareNext adds possible comma and indentation for the next value based -// on last type and indent option. It also updates lastKind to next. -func (e *Encoder) prepareNext(next kind) { - defer func() { - // Set lastKind to next. - e.lastKind = next - }() - - if len(e.indent) == 0 { - // Need to add comma on the following condition. - if e.lastKind&(scalar|objectClose|arrayClose) != 0 && - next&(name|scalar|objectOpen|arrayOpen) != 0 { - e.out = append(e.out, ',') - // For single-line output, add a random extra space after each - // comma to make output unstable. - if detrand.Bool() { - e.out = append(e.out, ' ') - } - } - return - } - - switch { - case e.lastKind&(objectOpen|arrayOpen) != 0: - // If next type is NOT closing, add indent and newline. - if next&(objectClose|arrayClose) == 0 { - e.indents = append(e.indents, e.indent...) - e.out = append(e.out, '\n') - e.out = append(e.out, e.indents...) - } - - case e.lastKind&(scalar|objectClose|arrayClose) != 0: - switch { - // If next type is either a value or name, add comma and newline. - case next&(name|scalar|objectOpen|arrayOpen) != 0: - e.out = append(e.out, ',', '\n') - - // If next type is a closing object or array, adjust indentation. - case next&(objectClose|arrayClose) != 0: - e.indents = e.indents[:len(e.indents)-len(e.indent)] - e.out = append(e.out, '\n') - } - e.out = append(e.out, e.indents...) - - case e.lastKind&name != 0: - e.out = append(e.out, ' ') - // For multi-line output, add a random extra space after key: to make - // output unstable. - if detrand.Bool() { - e.out = append(e.out, ' ') - } - } -} diff --git a/vendor/google.golang.org/protobuf/reflect/protodesc/desc.go b/vendor/google.golang.org/protobuf/reflect/protodesc/desc.go deleted file mode 100644 index 37f254d4c0..0000000000 --- a/vendor/google.golang.org/protobuf/reflect/protodesc/desc.go +++ /dev/null @@ -1,275 +0,0 @@ -// Copyright 2018 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package protodesc provides functionality for converting -// FileDescriptorProto messages to/from protoreflect.FileDescriptor values. -// -// The google.protobuf.FileDescriptorProto is a protobuf message that describes -// the type information for a .proto file in a form that is easily serializable. -// The protoreflect.FileDescriptor is a more structured representation of -// the FileDescriptorProto message where references and remote dependencies -// can be directly followed. -package protodesc - -import ( - "google.golang.org/protobuf/internal/errors" - "google.golang.org/protobuf/internal/filedesc" - "google.golang.org/protobuf/internal/pragma" - "google.golang.org/protobuf/internal/strs" - "google.golang.org/protobuf/proto" - "google.golang.org/protobuf/reflect/protoreflect" - "google.golang.org/protobuf/reflect/protoregistry" - - "google.golang.org/protobuf/types/descriptorpb" -) - -// Resolver is the resolver used by NewFile to resolve dependencies. -// The enums and messages provided must belong to some parent file, -// which is also registered. -// -// It is implemented by protoregistry.Files. -type Resolver interface { - FindFileByPath(string) (protoreflect.FileDescriptor, error) - FindDescriptorByName(protoreflect.FullName) (protoreflect.Descriptor, error) -} - -// FileOptions configures the construction of file descriptors. -type FileOptions struct { - pragma.NoUnkeyedLiterals - - // AllowUnresolvable configures New to permissively allow unresolvable - // file, enum, or message dependencies. Unresolved dependencies are replaced - // by placeholder equivalents. - // - // The following dependencies may be left unresolved: - // • Resolving an imported file. - // • Resolving the type for a message field or extension field. - // If the kind of the field is unknown, then a placeholder is used for both - // the Enum and Message accessors on the protoreflect.FieldDescriptor. - // • Resolving an enum value set as the default for an optional enum field. - // If unresolvable, the protoreflect.FieldDescriptor.Default is set to the - // first value in the associated enum (or zero if the also enum dependency - // is also unresolvable). The protoreflect.FieldDescriptor.DefaultEnumValue - // is populated with a placeholder. - // • Resolving the extended message type for an extension field. - // • Resolving the input or output message type for a service method. - // - // If the unresolved dependency uses a relative name, - // then the placeholder will contain an invalid FullName with a "*." prefix, - // indicating that the starting prefix of the full name is unknown. - AllowUnresolvable bool -} - -// NewFile creates a new protoreflect.FileDescriptor from the provided -// file descriptor message. See FileOptions.New for more information. -func NewFile(fd *descriptorpb.FileDescriptorProto, r Resolver) (protoreflect.FileDescriptor, error) { - return FileOptions{}.New(fd, r) -} - -// NewFiles creates a new protoregistry.Files from the provided -// FileDescriptorSet message. See FileOptions.NewFiles for more information. -func NewFiles(fd *descriptorpb.FileDescriptorSet) (*protoregistry.Files, error) { - return FileOptions{}.NewFiles(fd) -} - -// New creates a new protoreflect.FileDescriptor from the provided -// file descriptor message. The file must represent a valid proto file according -// to protobuf semantics. The returned descriptor is a deep copy of the input. -// -// Any imported files, enum types, or message types referenced in the file are -// resolved using the provided registry. When looking up an import file path, -// the path must be unique. The newly created file descriptor is not registered -// back into the provided file registry. -func (o FileOptions) New(fd *descriptorpb.FileDescriptorProto, r Resolver) (protoreflect.FileDescriptor, error) { - if r == nil { - r = (*protoregistry.Files)(nil) // empty resolver - } - - // Handle the file descriptor content. - f := &filedesc.File{L2: &filedesc.FileL2{}} - switch fd.GetSyntax() { - case "proto2", "": - f.L1.Syntax = protoreflect.Proto2 - case "proto3": - f.L1.Syntax = protoreflect.Proto3 - default: - return nil, errors.New("invalid syntax: %q", fd.GetSyntax()) - } - f.L1.Path = fd.GetName() - if f.L1.Path == "" { - return nil, errors.New("file path must be populated") - } - f.L1.Package = protoreflect.FullName(fd.GetPackage()) - if !f.L1.Package.IsValid() && f.L1.Package != "" { - return nil, errors.New("invalid package: %q", f.L1.Package) - } - if opts := fd.GetOptions(); opts != nil { - opts = proto.Clone(opts).(*descriptorpb.FileOptions) - f.L2.Options = func() protoreflect.ProtoMessage { return opts } - } - - f.L2.Imports = make(filedesc.FileImports, len(fd.GetDependency())) - for _, i := range fd.GetPublicDependency() { - if !(0 <= i && int(i) < len(f.L2.Imports)) || f.L2.Imports[i].IsPublic { - return nil, errors.New("invalid or duplicate public import index: %d", i) - } - f.L2.Imports[i].IsPublic = true - } - for _, i := range fd.GetWeakDependency() { - if !(0 <= i && int(i) < len(f.L2.Imports)) || f.L2.Imports[i].IsWeak { - return nil, errors.New("invalid or duplicate weak import index: %d", i) - } - f.L2.Imports[i].IsWeak = true - } - imps := importSet{f.Path(): true} - for i, path := range fd.GetDependency() { - imp := &f.L2.Imports[i] - f, err := r.FindFileByPath(path) - if err == protoregistry.NotFound && (o.AllowUnresolvable || imp.IsWeak) { - f = filedesc.PlaceholderFile(path) - } else if err != nil { - return nil, errors.New("could not resolve import %q: %v", path, err) - } - imp.FileDescriptor = f - - if imps[imp.Path()] { - return nil, errors.New("already imported %q", path) - } - imps[imp.Path()] = true - } - for i := range fd.GetDependency() { - imp := &f.L2.Imports[i] - imps.importPublic(imp.Imports()) - } - - // Handle source locations. - for _, loc := range fd.GetSourceCodeInfo().GetLocation() { - var l protoreflect.SourceLocation - // TODO: Validate that the path points to an actual declaration? - l.Path = protoreflect.SourcePath(loc.GetPath()) - s := loc.GetSpan() - switch len(s) { - case 3: - l.StartLine, l.StartColumn, l.EndLine, l.EndColumn = int(s[0]), int(s[1]), int(s[0]), int(s[2]) - case 4: - l.StartLine, l.StartColumn, l.EndLine, l.EndColumn = int(s[0]), int(s[1]), int(s[2]), int(s[3]) - default: - return nil, errors.New("invalid span: %v", s) - } - // TODO: Validate that the span information is sensible? - // See https://github.com/protocolbuffers/protobuf/issues/6378. - if false && (l.EndLine < l.StartLine || l.StartLine < 0 || l.StartColumn < 0 || l.EndColumn < 0 || - (l.StartLine == l.EndLine && l.EndColumn <= l.StartColumn)) { - return nil, errors.New("invalid span: %v", s) - } - l.LeadingDetachedComments = loc.GetLeadingDetachedComments() - l.LeadingComments = loc.GetLeadingComments() - l.TrailingComments = loc.GetTrailingComments() - f.L2.Locations.List = append(f.L2.Locations.List, l) - } - - // Step 1: Allocate and derive the names for all declarations. - // This copies all fields from the descriptor proto except: - // google.protobuf.FieldDescriptorProto.type_name - // google.protobuf.FieldDescriptorProto.default_value - // google.protobuf.FieldDescriptorProto.oneof_index - // google.protobuf.FieldDescriptorProto.extendee - // google.protobuf.MethodDescriptorProto.input - // google.protobuf.MethodDescriptorProto.output - var err error - sb := new(strs.Builder) - r1 := make(descsByName) - if f.L1.Enums.List, err = r1.initEnumDeclarations(fd.GetEnumType(), f, sb); err != nil { - return nil, err - } - if f.L1.Messages.List, err = r1.initMessagesDeclarations(fd.GetMessageType(), f, sb); err != nil { - return nil, err - } - if f.L1.Extensions.List, err = r1.initExtensionDeclarations(fd.GetExtension(), f, sb); err != nil { - return nil, err - } - if f.L1.Services.List, err = r1.initServiceDeclarations(fd.GetService(), f, sb); err != nil { - return nil, err - } - - // Step 2: Resolve every dependency reference not handled by step 1. - r2 := &resolver{local: r1, remote: r, imports: imps, allowUnresolvable: o.AllowUnresolvable} - if err := r2.resolveMessageDependencies(f.L1.Messages.List, fd.GetMessageType()); err != nil { - return nil, err - } - if err := r2.resolveExtensionDependencies(f.L1.Extensions.List, fd.GetExtension()); err != nil { - return nil, err - } - if err := r2.resolveServiceDependencies(f.L1.Services.List, fd.GetService()); err != nil { - return nil, err - } - - // Step 3: Validate every enum, message, and extension declaration. - 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 { - return nil, err - } - if err := validateExtensionDeclarations(f.L1.Extensions.List, fd.GetExtension()); err != nil { - return nil, err - } - - return f, nil -} - -type importSet map[string]bool - -func (is importSet) importPublic(imps protoreflect.FileImports) { - for i := 0; i < imps.Len(); i++ { - if imp := imps.Get(i); imp.IsPublic { - is[imp.Path()] = true - is.importPublic(imp.Imports()) - } - } -} - -// NewFiles creates a new protoregistry.Files from the provided -// FileDescriptorSet message. The descriptor set must include only -// valid files according to protobuf semantics. The returned descriptors -// are a deep copy of the input. -func (o FileOptions) NewFiles(fds *descriptorpb.FileDescriptorSet) (*protoregistry.Files, error) { - files := make(map[string]*descriptorpb.FileDescriptorProto) - for _, fd := range fds.File { - if _, ok := files[fd.GetName()]; ok { - return nil, errors.New("file appears multiple times: %q", fd.GetName()) - } - files[fd.GetName()] = fd - } - r := &protoregistry.Files{} - for _, fd := range files { - if err := o.addFileDeps(r, fd, files); err != nil { - return nil, err - } - } - return r, nil -} -func (o FileOptions) addFileDeps(r *protoregistry.Files, fd *descriptorpb.FileDescriptorProto, files map[string]*descriptorpb.FileDescriptorProto) error { - // Set the entry to nil while descending into a file's dependencies to detect cycles. - files[fd.GetName()] = nil - for _, dep := range fd.Dependency { - depfd, ok := files[dep] - if depfd == nil { - if ok { - return errors.New("import cycle in file: %q", dep) - } - continue - } - if err := o.addFileDeps(r, depfd, files); err != nil { - return err - } - } - // Delete the entry once dependencies are processed. - delete(files, fd.GetName()) - f, err := o.New(fd, r) - if err != nil { - return err - } - return r.RegisterFile(f) -} diff --git a/vendor/google.golang.org/protobuf/reflect/protodesc/desc_init.go b/vendor/google.golang.org/protobuf/reflect/protodesc/desc_init.go deleted file mode 100644 index 673a230e7a..0000000000 --- a/vendor/google.golang.org/protobuf/reflect/protodesc/desc_init.go +++ /dev/null @@ -1,248 +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 protodesc - -import ( - "google.golang.org/protobuf/internal/errors" - "google.golang.org/protobuf/internal/filedesc" - "google.golang.org/protobuf/internal/strs" - "google.golang.org/protobuf/proto" - "google.golang.org/protobuf/reflect/protoreflect" - - "google.golang.org/protobuf/types/descriptorpb" -) - -type descsByName map[protoreflect.FullName]protoreflect.Descriptor - -func (r descsByName) initEnumDeclarations(eds []*descriptorpb.EnumDescriptorProto, parent protoreflect.Descriptor, sb *strs.Builder) (es []filedesc.Enum, err error) { - es = make([]filedesc.Enum, len(eds)) // allocate up-front to ensure stable pointers - for i, ed := range eds { - e := &es[i] - e.L2 = new(filedesc.EnumL2) - if e.L0, err = r.makeBase(e, parent, ed.GetName(), i, sb); err != nil { - return nil, err - } - if opts := ed.GetOptions(); opts != nil { - opts = proto.Clone(opts).(*descriptorpb.EnumOptions) - e.L2.Options = func() protoreflect.ProtoMessage { return opts } - } - for _, s := range ed.GetReservedName() { - e.L2.ReservedNames.List = append(e.L2.ReservedNames.List, protoreflect.Name(s)) - } - for _, rr := range ed.GetReservedRange() { - e.L2.ReservedRanges.List = append(e.L2.ReservedRanges.List, [2]protoreflect.EnumNumber{ - protoreflect.EnumNumber(rr.GetStart()), - protoreflect.EnumNumber(rr.GetEnd()), - }) - } - if e.L2.Values.List, err = r.initEnumValuesFromDescriptorProto(ed.GetValue(), e, sb); err != nil { - return nil, err - } - } - return es, nil -} - -func (r descsByName) initEnumValuesFromDescriptorProto(vds []*descriptorpb.EnumValueDescriptorProto, parent protoreflect.Descriptor, sb *strs.Builder) (vs []filedesc.EnumValue, err error) { - vs = make([]filedesc.EnumValue, len(vds)) // allocate up-front to ensure stable pointers - for i, vd := range vds { - v := &vs[i] - if v.L0, err = r.makeBase(v, parent, vd.GetName(), i, sb); err != nil { - return nil, err - } - if opts := vd.GetOptions(); opts != nil { - opts = proto.Clone(opts).(*descriptorpb.EnumValueOptions) - v.L1.Options = func() protoreflect.ProtoMessage { return opts } - } - v.L1.Number = protoreflect.EnumNumber(vd.GetNumber()) - } - return vs, nil -} - -func (r descsByName) initMessagesDeclarations(mds []*descriptorpb.DescriptorProto, parent protoreflect.Descriptor, sb *strs.Builder) (ms []filedesc.Message, err error) { - ms = make([]filedesc.Message, len(mds)) // allocate up-front to ensure stable pointers - for i, md := range mds { - m := &ms[i] - m.L2 = new(filedesc.MessageL2) - if m.L0, err = r.makeBase(m, parent, md.GetName(), i, sb); err != nil { - return nil, err - } - if opts := md.GetOptions(); opts != nil { - opts = proto.Clone(opts).(*descriptorpb.MessageOptions) - m.L2.Options = func() protoreflect.ProtoMessage { return opts } - m.L1.IsMapEntry = opts.GetMapEntry() - m.L1.IsMessageSet = opts.GetMessageSetWireFormat() - } - for _, s := range md.GetReservedName() { - m.L2.ReservedNames.List = append(m.L2.ReservedNames.List, protoreflect.Name(s)) - } - for _, rr := range md.GetReservedRange() { - m.L2.ReservedRanges.List = append(m.L2.ReservedRanges.List, [2]protoreflect.FieldNumber{ - protoreflect.FieldNumber(rr.GetStart()), - protoreflect.FieldNumber(rr.GetEnd()), - }) - } - for _, xr := range md.GetExtensionRange() { - m.L2.ExtensionRanges.List = append(m.L2.ExtensionRanges.List, [2]protoreflect.FieldNumber{ - protoreflect.FieldNumber(xr.GetStart()), - protoreflect.FieldNumber(xr.GetEnd()), - }) - var optsFunc func() protoreflect.ProtoMessage - if opts := xr.GetOptions(); opts != nil { - opts = proto.Clone(opts).(*descriptorpb.ExtensionRangeOptions) - optsFunc = func() protoreflect.ProtoMessage { return opts } - } - m.L2.ExtensionRangeOptions = append(m.L2.ExtensionRangeOptions, optsFunc) - } - if m.L2.Fields.List, err = r.initFieldsFromDescriptorProto(md.GetField(), m, sb); err != nil { - return nil, err - } - if m.L2.Oneofs.List, err = r.initOneofsFromDescriptorProto(md.GetOneofDecl(), m, sb); err != nil { - return nil, err - } - if m.L1.Enums.List, err = r.initEnumDeclarations(md.GetEnumType(), m, sb); err != nil { - return nil, err - } - if m.L1.Messages.List, err = r.initMessagesDeclarations(md.GetNestedType(), m, sb); err != nil { - return nil, err - } - if m.L1.Extensions.List, err = r.initExtensionDeclarations(md.GetExtension(), m, sb); err != nil { - return nil, err - } - } - return ms, nil -} - -func (r descsByName) initFieldsFromDescriptorProto(fds []*descriptorpb.FieldDescriptorProto, parent protoreflect.Descriptor, sb *strs.Builder) (fs []filedesc.Field, err error) { - fs = make([]filedesc.Field, len(fds)) // allocate up-front to ensure stable pointers - for i, fd := range fds { - f := &fs[i] - if f.L0, err = r.makeBase(f, parent, fd.GetName(), i, sb); err != nil { - return nil, err - } - 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() - } - f.L1.Number = protoreflect.FieldNumber(fd.GetNumber()) - f.L1.Cardinality = protoreflect.Cardinality(fd.GetLabel()) - if fd.Type != nil { - f.L1.Kind = protoreflect.Kind(fd.GetType()) - } - if fd.JsonName != nil { - f.L1.JSONName.Init(fd.GetJsonName()) - } - } - return fs, nil -} - -func (r descsByName) initOneofsFromDescriptorProto(ods []*descriptorpb.OneofDescriptorProto, parent protoreflect.Descriptor, sb *strs.Builder) (os []filedesc.Oneof, err error) { - os = make([]filedesc.Oneof, len(ods)) // allocate up-front to ensure stable pointers - for i, od := range ods { - o := &os[i] - if o.L0, err = r.makeBase(o, parent, od.GetName(), i, sb); err != nil { - return nil, err - } - if opts := od.GetOptions(); opts != nil { - opts = proto.Clone(opts).(*descriptorpb.OneofOptions) - o.L1.Options = func() protoreflect.ProtoMessage { return opts } - } - } - return os, nil -} - -func (r descsByName) initExtensionDeclarations(xds []*descriptorpb.FieldDescriptorProto, parent protoreflect.Descriptor, sb *strs.Builder) (xs []filedesc.Extension, err error) { - xs = make([]filedesc.Extension, len(xds)) // allocate up-front to ensure stable pointers - for i, xd := range xds { - x := &xs[i] - x.L2 = new(filedesc.ExtensionL2) - if x.L0, err = r.makeBase(x, parent, xd.GetName(), i, sb); err != nil { - return nil, err - } - 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() - } - x.L1.Number = protoreflect.FieldNumber(xd.GetNumber()) - x.L1.Cardinality = protoreflect.Cardinality(xd.GetLabel()) - if xd.Type != nil { - x.L1.Kind = protoreflect.Kind(xd.GetType()) - } - if xd.JsonName != nil { - x.L2.JSONName.Init(xd.GetJsonName()) - } - } - return xs, nil -} - -func (r descsByName) initServiceDeclarations(sds []*descriptorpb.ServiceDescriptorProto, parent protoreflect.Descriptor, sb *strs.Builder) (ss []filedesc.Service, err error) { - ss = make([]filedesc.Service, len(sds)) // allocate up-front to ensure stable pointers - for i, sd := range sds { - s := &ss[i] - s.L2 = new(filedesc.ServiceL2) - if s.L0, err = r.makeBase(s, parent, sd.GetName(), i, sb); err != nil { - return nil, err - } - if opts := sd.GetOptions(); opts != nil { - opts = proto.Clone(opts).(*descriptorpb.ServiceOptions) - s.L2.Options = func() protoreflect.ProtoMessage { return opts } - } - if s.L2.Methods.List, err = r.initMethodsFromDescriptorProto(sd.GetMethod(), s, sb); err != nil { - return nil, err - } - } - return ss, nil -} - -func (r descsByName) initMethodsFromDescriptorProto(mds []*descriptorpb.MethodDescriptorProto, parent protoreflect.Descriptor, sb *strs.Builder) (ms []filedesc.Method, err error) { - ms = make([]filedesc.Method, len(mds)) // allocate up-front to ensure stable pointers - for i, md := range mds { - m := &ms[i] - if m.L0, err = r.makeBase(m, parent, md.GetName(), i, sb); err != nil { - return nil, err - } - if opts := md.GetOptions(); opts != nil { - opts = proto.Clone(opts).(*descriptorpb.MethodOptions) - m.L1.Options = func() protoreflect.ProtoMessage { return opts } - } - m.L1.IsStreamingClient = md.GetClientStreaming() - m.L1.IsStreamingServer = md.GetServerStreaming() - } - return ms, nil -} - -func (r descsByName) makeBase(child, parent protoreflect.Descriptor, name string, idx int, sb *strs.Builder) (filedesc.BaseL0, error) { - if !protoreflect.Name(name).IsValid() { - return filedesc.BaseL0{}, errors.New("descriptor %q has an invalid nested name: %q", parent.FullName(), name) - } - - // Derive the full name of the child. - // Note that enum values are a sibling to the enum parent in the namespace. - var fullName protoreflect.FullName - if _, ok := parent.(protoreflect.EnumDescriptor); ok { - fullName = sb.AppendFullName(parent.FullName().Parent(), protoreflect.Name(name)) - } else { - fullName = sb.AppendFullName(parent.FullName(), protoreflect.Name(name)) - } - if _, ok := r[fullName]; ok { - return filedesc.BaseL0{}, errors.New("descriptor %q already declared", fullName) - } - r[fullName] = child - - // TODO: Verify that the full name does not already exist in the resolver? - // This is not as critical since most usages of NewFile will register - // the created file back into the registry, which will perform this check. - - return filedesc.BaseL0{ - FullName: fullName, - ParentFile: parent.ParentFile().(*filedesc.File), - Parent: parent, - Index: idx, - }, nil -} diff --git a/vendor/google.golang.org/protobuf/reflect/protodesc/desc_resolve.go b/vendor/google.golang.org/protobuf/reflect/protodesc/desc_resolve.go deleted file mode 100644 index cebb36cdad..0000000000 --- a/vendor/google.golang.org/protobuf/reflect/protodesc/desc_resolve.go +++ /dev/null @@ -1,286 +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 protodesc - -import ( - "google.golang.org/protobuf/internal/encoding/defval" - "google.golang.org/protobuf/internal/errors" - "google.golang.org/protobuf/internal/filedesc" - "google.golang.org/protobuf/reflect/protoreflect" - "google.golang.org/protobuf/reflect/protoregistry" - - "google.golang.org/protobuf/types/descriptorpb" -) - -// resolver is a wrapper around a local registry of declarations within the file -// and the remote resolver. The remote resolver is restricted to only return -// descriptors that have been imported. -type resolver struct { - local descsByName - remote Resolver - imports importSet - - allowUnresolvable bool -} - -func (r *resolver) resolveMessageDependencies(ms []filedesc.Message, mds []*descriptorpb.DescriptorProto) (err error) { - for i, md := range mds { - m := &ms[i] - for j, fd := range md.GetField() { - f := &m.L2.Fields.List[j] - if f.L1.Cardinality == protoreflect.Required { - m.L2.RequiredNumbers.List = append(m.L2.RequiredNumbers.List, f.L1.Number) - } - if fd.OneofIndex != nil { - k := int(fd.GetOneofIndex()) - if !(0 <= k && k < len(md.GetOneofDecl())) { - return errors.New("message field %q has an invalid oneof index: %d", f.FullName(), k) - } - o := &m.L2.Oneofs.List[k] - f.L1.ContainingOneof = o - o.L1.Fields.List = append(o.L1.Fields.List, f) - } - - 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 fd.DefaultValue != nil { - v, ev, err := unmarshalDefault(fd.GetDefaultValue(), f, r.allowUnresolvable) - if err != nil { - return errors.New("message field %q has invalid default: %v", f.FullName(), err) - } - f.L1.Default = filedesc.DefaultValue(v, ev) - } - } - - if err := r.resolveMessageDependencies(m.L1.Messages.List, md.GetNestedType()); err != nil { - return err - } - if err := r.resolveExtensionDependencies(m.L1.Extensions.List, md.GetExtension()); err != nil { - return err - } - } - return nil -} - -func (r *resolver) resolveExtensionDependencies(xs []filedesc.Extension, xds []*descriptorpb.FieldDescriptorProto) (err error) { - for i, xd := range xds { - x := &xs[i] - if x.L1.Extendee, err = r.findMessageDescriptor(x.Parent().FullName(), partialName(xd.GetExtendee()), false); err != nil { - return errors.New("extension field %q cannot resolve extendee: %v", x.FullName(), err) - } - if x.L1.Kind, x.L2.Enum, x.L2.Message, err = r.findTarget(x.Kind(), x.Parent().FullName(), partialName(xd.GetTypeName()), false); err != nil { - return errors.New("extension field %q cannot resolve type: %v", x.FullName(), err) - } - if xd.DefaultValue != nil { - v, ev, err := unmarshalDefault(xd.GetDefaultValue(), x, r.allowUnresolvable) - if err != nil { - return errors.New("extension field %q has invalid default: %v", x.FullName(), err) - } - x.L2.Default = filedesc.DefaultValue(v, ev) - } - } - return nil -} - -func (r *resolver) resolveServiceDependencies(ss []filedesc.Service, sds []*descriptorpb.ServiceDescriptorProto) (err error) { - for i, sd := range sds { - s := &ss[i] - for j, md := range sd.GetMethod() { - m := &s.L2.Methods.List[j] - m.L1.Input, err = r.findMessageDescriptor(m.Parent().FullName(), partialName(md.GetInputType()), false) - if err != nil { - return errors.New("service method %q cannot resolve input: %v", m.FullName(), err) - } - m.L1.Output, err = r.findMessageDescriptor(s.FullName(), partialName(md.GetOutputType()), false) - if err != nil { - return errors.New("service method %q cannot resolve output: %v", m.FullName(), err) - } - } - } - return nil -} - -// findTarget finds an enum or message descriptor if k is an enum, message, -// group, or unknown. If unknown, and the name could be resolved, the kind -// returned kind is set based on the type of the resolved descriptor. -func (r *resolver) findTarget(k protoreflect.Kind, scope protoreflect.FullName, ref partialName, isWeak bool) (protoreflect.Kind, protoreflect.EnumDescriptor, protoreflect.MessageDescriptor, error) { - switch k { - case protoreflect.EnumKind: - ed, err := r.findEnumDescriptor(scope, ref, isWeak) - if err != nil { - return 0, nil, nil, err - } - return k, ed, nil, nil - case protoreflect.MessageKind, protoreflect.GroupKind: - md, err := r.findMessageDescriptor(scope, ref, isWeak) - if err != nil { - return 0, nil, nil, err - } - return k, nil, md, nil - case 0: - // Handle unspecified kinds (possible with parsers that operate - // on a per-file basis without knowledge of dependencies). - d, err := r.findDescriptor(scope, ref) - if err == protoregistry.NotFound && (r.allowUnresolvable || isWeak) { - return k, filedesc.PlaceholderEnum(ref.FullName()), filedesc.PlaceholderMessage(ref.FullName()), nil - } else if err == protoregistry.NotFound { - return 0, nil, nil, errors.New("%q not found", ref.FullName()) - } else if err != nil { - return 0, nil, nil, err - } - switch d := d.(type) { - case protoreflect.EnumDescriptor: - return protoreflect.EnumKind, d, nil, nil - case protoreflect.MessageDescriptor: - return protoreflect.MessageKind, nil, d, nil - default: - return 0, nil, nil, errors.New("unknown kind") - } - default: - if ref != "" { - return 0, nil, nil, errors.New("target name cannot be specified for %v", k) - } - if !k.IsValid() { - return 0, nil, nil, errors.New("invalid kind: %d", k) - } - return k, nil, nil, nil - } -} - -// findDescriptor finds the descriptor by name, -// which may be a relative name within some scope. -// -// Suppose the scope was "fizz.buzz" and the reference was "Foo.Bar", -// then the following full names are searched: -// * fizz.buzz.Foo.Bar -// * fizz.Foo.Bar -// * Foo.Bar -func (r *resolver) findDescriptor(scope protoreflect.FullName, ref partialName) (protoreflect.Descriptor, error) { - if !ref.IsValid() { - return nil, errors.New("invalid name reference: %q", ref) - } - if ref.IsFull() { - scope, ref = "", ref[1:] - } - var foundButNotImported protoreflect.Descriptor - for { - // Derive the full name to search. - s := protoreflect.FullName(ref) - if scope != "" { - s = scope + "." + s - } - - // Check the current file for the descriptor. - if d, ok := r.local[s]; ok { - return d, nil - } - - // Check the remote registry for the descriptor. - d, err := r.remote.FindDescriptorByName(s) - if err == nil { - // Only allow descriptors covered by one of the imports. - if r.imports[d.ParentFile().Path()] { - return d, nil - } - foundButNotImported = d - } else if err != protoregistry.NotFound { - return nil, errors.Wrap(err, "%q", s) - } - - // Continue on at a higher level of scoping. - if scope == "" { - if d := foundButNotImported; d != nil { - return nil, errors.New("resolved %q, but %q is not imported", d.FullName(), d.ParentFile().Path()) - } - return nil, protoregistry.NotFound - } - scope = scope.Parent() - } -} - -func (r *resolver) findEnumDescriptor(scope protoreflect.FullName, ref partialName, isWeak bool) (protoreflect.EnumDescriptor, error) { - d, err := r.findDescriptor(scope, ref) - if err == protoregistry.NotFound && (r.allowUnresolvable || isWeak) { - return filedesc.PlaceholderEnum(ref.FullName()), nil - } else if err == protoregistry.NotFound { - return nil, errors.New("%q not found", ref.FullName()) - } else if err != nil { - return nil, err - } - ed, ok := d.(protoreflect.EnumDescriptor) - if !ok { - return nil, errors.New("resolved %q, but it is not an enum", d.FullName()) - } - return ed, nil -} - -func (r *resolver) findMessageDescriptor(scope protoreflect.FullName, ref partialName, isWeak bool) (protoreflect.MessageDescriptor, error) { - d, err := r.findDescriptor(scope, ref) - if err == protoregistry.NotFound && (r.allowUnresolvable || isWeak) { - return filedesc.PlaceholderMessage(ref.FullName()), nil - } else if err == protoregistry.NotFound { - return nil, errors.New("%q not found", ref.FullName()) - } else if err != nil { - return nil, err - } - md, ok := d.(protoreflect.MessageDescriptor) - if !ok { - return nil, errors.New("resolved %q, but it is not an message", d.FullName()) - } - return md, nil -} - -// partialName is the partial name. A leading dot means that the name is full, -// otherwise the name is relative to some current scope. -// See google.protobuf.FieldDescriptorProto.type_name. -type partialName string - -func (s partialName) IsFull() bool { - return len(s) > 0 && s[0] == '.' -} - -func (s partialName) IsValid() bool { - if s.IsFull() { - return protoreflect.FullName(s[1:]).IsValid() - } - return protoreflect.FullName(s).IsValid() -} - -const unknownPrefix = "*." - -// FullName converts the partial name to a full name on a best-effort basis. -// If relative, it creates an invalid full name, using a "*." prefix -// to indicate that the start of the full name is unknown. -func (s partialName) FullName() protoreflect.FullName { - if s.IsFull() { - return protoreflect.FullName(s[1:]) - } - return protoreflect.FullName(unknownPrefix + s) -} - -func unmarshalDefault(s string, fd protoreflect.FieldDescriptor, allowUnresolvable bool) (protoreflect.Value, protoreflect.EnumValueDescriptor, error) { - var evs protoreflect.EnumValueDescriptors - if fd.Enum() != nil { - evs = fd.Enum().Values() - } - v, ev, err := defval.Unmarshal(s, fd.Kind(), evs, defval.Descriptor) - if err != nil && allowUnresolvable && evs != nil && protoreflect.Name(s).IsValid() { - v = protoreflect.ValueOfEnum(0) - if evs.Len() > 0 { - v = protoreflect.ValueOfEnum(evs.Get(0).Number()) - } - ev = filedesc.PlaceholderEnumValue(fd.Enum().FullName().Parent().Append(protoreflect.Name(s))) - } else if err != nil { - return v, ev, err - } - if fd.Syntax() == protoreflect.Proto3 { - return v, ev, errors.New("cannot be specified under proto3 semantics") - } - if fd.Kind() == protoreflect.MessageKind || fd.Kind() == protoreflect.GroupKind || fd.Cardinality() == protoreflect.Repeated { - return v, ev, errors.New("cannot be specified on composite types") - } - return v, ev, 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 deleted file mode 100644 index cf9641ab92..0000000000 --- a/vendor/google.golang.org/protobuf/reflect/protodesc/desc_validate.go +++ /dev/null @@ -1,370 +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 protodesc - -import ( - "strings" - "unicode" - - "google.golang.org/protobuf/encoding/protowire" - "google.golang.org/protobuf/internal/errors" - "google.golang.org/protobuf/internal/filedesc" - "google.golang.org/protobuf/internal/flags" - "google.golang.org/protobuf/internal/strs" - "google.golang.org/protobuf/reflect/protoreflect" - - "google.golang.org/protobuf/types/descriptorpb" -) - -func validateEnumDeclarations(es []filedesc.Enum, eds []*descriptorpb.EnumDescriptorProto) error { - for i, ed := range eds { - e := &es[i] - if err := e.L2.ReservedNames.CheckValid(); err != nil { - return errors.New("enum %q reserved names has %v", e.FullName(), err) - } - if err := e.L2.ReservedRanges.CheckValid(); err != nil { - return errors.New("enum %q reserved ranges has %v", e.FullName(), err) - } - if len(ed.GetValue()) == 0 { - return errors.New("enum %q must contain at least one value declaration", e.FullName()) - } - allowAlias := ed.GetOptions().GetAllowAlias() - foundAlias := false - for i := 0; i < e.Values().Len(); i++ { - v1 := e.Values().Get(i) - if v2 := e.Values().ByNumber(v1.Number()); v1 != v2 { - foundAlias = true - if !allowAlias { - return errors.New("enum %q has conflicting non-aliased values on number %d: %q with %q", e.FullName(), v1.Number(), v1.Name(), v2.Name()) - } - } - } - if allowAlias && !foundAlias { - return errors.New("enum %q allows aliases, but none were found", e.FullName()) - } - if e.Syntax() == protoreflect.Proto3 { - 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()) - } - // Verify that value names in proto3 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{} - prefix := strings.Replace(strings.ToLower(string(e.Name())), "_", "", -1) - for i := 0; i < e.Values().Len(); i++ { - 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()) - } - names[s] = v1 - } - } - - for j, vd := range ed.GetValue() { - v := &e.L2.Values.List[j] - if vd.Number == nil { - return errors.New("enum value %q must have a specified number", v.FullName()) - } - if e.L2.ReservedNames.Has(v.Name()) { - return errors.New("enum value %q must not use reserved name", v.FullName()) - } - if e.L2.ReservedRanges.Has(v.Number()) { - return errors.New("enum value %q must not use reserved number %d", v.FullName(), v.Number()) - } - } - } - return nil -} - -func validateMessageDeclarations(ms []filedesc.Message, mds []*descriptorpb.DescriptorProto) error { - for i, md := range mds { - m := &ms[i] - - // Handle the message descriptor itself. - isMessageSet := md.GetOptions().GetMessageSetWireFormat() - if err := m.L2.ReservedNames.CheckValid(); err != nil { - return errors.New("message %q reserved names has %v", m.FullName(), err) - } - if err := m.L2.ReservedRanges.CheckValid(isMessageSet); err != nil { - return errors.New("message %q reserved ranges has %v", m.FullName(), err) - } - if err := m.L2.ExtensionRanges.CheckValid(isMessageSet); err != nil { - return errors.New("message %q extension ranges has %v", m.FullName(), err) - } - if err := (*filedesc.FieldRanges).CheckOverlap(&m.L2.ReservedRanges, &m.L2.ExtensionRanges); err != nil { - return errors.New("message %q reserved and extension ranges has %v", m.FullName(), err) - } - for i := 0; i < m.Fields().Len(); i++ { - f1 := m.Fields().Get(i) - if f2 := m.Fields().ByNumber(f1.Number()); f1 != f2 { - return errors.New("message %q has conflicting fields: %q with %q", m.FullName(), f1.Name(), f2.Name()) - } - } - 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.Proto2 || 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 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() { - f := &m.L2.Fields.List[j] - if m.L2.ReservedNames.Has(f.Name()) { - return errors.New("message field %q must not use reserved name", f.FullName()) - } - if !f.Number().IsValid() { - return errors.New("message field %q has an invalid number: %d", f.FullName(), f.Number()) - } - if !f.Cardinality().IsValid() { - return errors.New("message field %q has an invalid cardinality: %d", f.FullName(), f.Cardinality()) - } - if m.L2.ReservedRanges.Has(f.Number()) { - return errors.New("message field %q must not use reserved number %d", f.FullName(), f.Number()) - } - if m.L2.ExtensionRanges.Has(f.Number()) { - return errors.New("message field %q with number %d in extension range", f.FullName(), f.Number()) - } - if fd.Extendee != nil { - return errors.New("message field %q may not have extendee: %q", f.FullName(), fd.GetExtendee()) - } - if f.L1.IsProto3Optional { - if f.Syntax() != protoreflect.Proto3 { - return errors.New("message field %q under proto3 optional semantics must be specified in the proto3 syntax", f.FullName()) - } - if f.Cardinality() != protoreflect.Optional { - return errors.New("message field %q under proto3 optional semantics must have optional cardinality", f.FullName()) - } - if f.ContainingOneof() != nil && f.ContainingOneof().Fields().Len() != 1 { - return errors.New("message field %q under proto3 optional semantics must be within a single element oneof", f.FullName()) - } - } - 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) { - 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 { - 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 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()) - } - } - } - seenSynthetic := false // synthetic oneofs for proto3 optional must come after real oneofs - for j := range md.GetOneofDecl() { - o := &m.L2.Oneofs.List[j] - if o.Fields().Len() == 0 { - return errors.New("message oneof %q must contain at least one field declaration", o.FullName()) - } - if n := o.Fields().Len(); n-1 != (o.Fields().Get(n-1).Index() - o.Fields().Get(0).Index()) { - return errors.New("message oneof %q must have consecutively declared fields", o.FullName()) - } - - if o.IsSynthetic() { - seenSynthetic = true - continue - } - if !o.IsSynthetic() && seenSynthetic { - return errors.New("message oneof %q must be declared before synthetic oneofs", o.FullName()) - } - - for i := 0; i < o.Fields().Len(); i++ { - f := o.Fields().Get(i) - if f.Cardinality() != protoreflect.Optional { - return errors.New("message field %q belongs in a oneof and must be optional", f.FullName()) - } - if f.IsWeak() { - return errors.New("message field %q belongs in a oneof and must not be a weak reference", f.FullName()) - } - } - } - - if err := validateEnumDeclarations(m.L1.Enums.List, md.GetEnumType()); err != nil { - return err - } - if err := validateMessageDeclarations(m.L1.Messages.List, md.GetNestedType()); err != nil { - return err - } - if err := validateExtensionDeclarations(m.L1.Extensions.List, md.GetExtension()); err != nil { - return err - } - } - return nil -} - -func validateExtensionDeclarations(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 - // may have a field number higher than normal. This check only verifies - // that the number is not negative or reserved. We check again later - // if we know that the extendee is definitely not a MessageSet. - if n := x.Number(); n < 0 || (protowire.FirstReservedNumber <= n && n <= protowire.LastReservedNumber) { - return errors.New("extension field %q has an invalid number: %d", x.FullName(), x.Number()) - } - if !x.Cardinality().IsValid() || x.Cardinality() == protoreflect.Required { - return errors.New("extension field %q has an invalid cardinality: %d", x.FullName(), x.Cardinality()) - } - if xd.JsonName != nil { - if xd.GetJsonName() != strs.JSONCamelCase(string(x.Name())) { - return errors.New("extension field %q may not have an explicitly set JSON name: %q", x.FullName(), xd.GetJsonName()) - } - } - if xd.OneofIndex != nil { - return errors.New("extension field %q may not be part of a oneof", x.FullName()) - } - if md := x.ContainingMessage(); !md.IsPlaceholder() { - if !md.ExtensionRanges().Has(x.Number()) { - return errors.New("extension field %q extends %q with non-extension field number: %d", x.FullName(), md.FullName(), x.Number()) - } - isMessageSet := md.Options().(*descriptorpb.MessageOptions).GetMessageSetWireFormat() - if isMessageSet && !isOptionalMessage(x) { - return errors.New("extension field %q extends MessageSet and must be an optional message", x.FullName()) - } - if !isMessageSet && !x.Number().IsValid() { - return errors.New("extension field %q has an invalid number: %d", x.FullName(), x.Number()) - } - } - if xd.GetOptions().GetWeak() { - return errors.New("extension field %q cannot be a weak reference", x.FullName()) - } - if x.IsPacked() && !isPackable(x) { - return errors.New("extension field %q is not packable", x.FullName()) - } - if err := checkValidGroup(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 { - switch x.ContainingMessage().FullName() { - case (*descriptorpb.FileOptions)(nil).ProtoReflect().Descriptor().FullName(): - case (*descriptorpb.EnumOptions)(nil).ProtoReflect().Descriptor().FullName(): - case (*descriptorpb.EnumValueOptions)(nil).ProtoReflect().Descriptor().FullName(): - case (*descriptorpb.MessageOptions)(nil).ProtoReflect().Descriptor().FullName(): - case (*descriptorpb.FieldOptions)(nil).ProtoReflect().Descriptor().FullName(): - case (*descriptorpb.OneofOptions)(nil).ProtoReflect().Descriptor().FullName(): - case (*descriptorpb.ExtensionRangeOptions)(nil).ProtoReflect().Descriptor().FullName(): - case (*descriptorpb.ServiceOptions)(nil).ProtoReflect().Descriptor().FullName(): - case (*descriptorpb.MethodOptions)(nil).ProtoReflect().Descriptor().FullName(): - default: - return errors.New("extension field %q cannot be declared in proto3 unless extended descriptor options", x.FullName()) - } - } - } - return nil -} - -// isOptionalMessage reports whether this is an optional message. -// If the kind is unknown, it is assumed to be a message. -func isOptionalMessage(fd protoreflect.FieldDescriptor) bool { - return (fd.Kind() == 0 || fd.Kind() == protoreflect.MessageKind) && fd.Cardinality() == protoreflect.Optional -} - -// isPackable checks whether the pack option can be specified. -func isPackable(fd protoreflect.FieldDescriptor) bool { - switch fd.Kind() { - case protoreflect.StringKind, protoreflect.BytesKind, protoreflect.MessageKind, protoreflect.GroupKind: - return false - } - return fd.IsList() -} - -// checkValidGroup reports whether fd is a valid group according to the same -// rules that protoc imposes. -func checkValidGroup(fd protoreflect.FieldDescriptor) error { - md := fd.Message() - switch { - case fd.Kind() != protoreflect.GroupKind: - return nil - case fd.Syntax() != protoreflect.Proto2: - return errors.New("invalid under proto2 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") - } - return nil -} - -// checkValidMap checks whether the field is a valid map according to the same -// rules that protoc imposes. -// See protoc v3.8.0: src/google/protobuf/descriptor.cc:6045-6115 -func checkValidMap(fd protoreflect.FieldDescriptor) error { - md := fd.Message() - switch { - case md == nil || !md.IsMapEntry(): - return nil - case fd.FullName().Parent() != md.FullName().Parent(): - return errors.New("message and field must be declared in the same scope") - case md.Name() != protoreflect.Name(strs.MapEntryName(string(fd.Name()))): - return errors.New("incorrect implicit map entry name") - case fd.Cardinality() != protoreflect.Repeated: - return errors.New("field must be repeated") - case md.Fields().Len() != 2: - return errors.New("message must have exactly two fields") - case md.ExtensionRanges().Len() > 0: - return errors.New("message must not have any extension ranges") - case md.Enums().Len()+md.Messages().Len()+md.Extensions().Len() > 0: - return errors.New("message must not have any nested declarations") - } - kf := md.Fields().Get(0) - vf := md.Fields().Get(1) - switch { - case kf.Name() != "key" || kf.Number() != 1 || kf.Cardinality() != protoreflect.Optional || kf.ContainingOneof() != nil || kf.HasDefault(): - return errors.New("invalid key field") - case vf.Name() != "value" || vf.Number() != 2 || vf.Cardinality() != protoreflect.Optional || vf.ContainingOneof() != nil || vf.HasDefault(): - return errors.New("invalid value field") - } - switch kf.Kind() { - case protoreflect.BoolKind: // bool - case protoreflect.Int32Kind, protoreflect.Sint32Kind, protoreflect.Sfixed32Kind: // int32 - case protoreflect.Int64Kind, protoreflect.Sint64Kind, protoreflect.Sfixed64Kind: // int64 - case protoreflect.Uint32Kind, protoreflect.Fixed32Kind: // uint32 - case protoreflect.Uint64Kind, protoreflect.Fixed64Kind: // uint64 - case protoreflect.StringKind: // string - default: - return errors.New("invalid key kind: %v", kf.Kind()) - } - if e := vf.Enum(); e != nil && e.Values().Len() > 0 && e.Values().Get(0).Number() != 0 { - return errors.New("map enum value must have zero number for the first value") - } - return nil -} diff --git a/vendor/google.golang.org/protobuf/reflect/protodesc/proto.go b/vendor/google.golang.org/protobuf/reflect/protodesc/proto.go deleted file mode 100644 index 00d35e02ee..0000000000 --- a/vendor/google.golang.org/protobuf/reflect/protodesc/proto.go +++ /dev/null @@ -1,242 +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 protodesc - -import ( - "fmt" - "strings" - - "google.golang.org/protobuf/internal/encoding/defval" - "google.golang.org/protobuf/proto" - "google.golang.org/protobuf/reflect/protoreflect" - - "google.golang.org/protobuf/types/descriptorpb" -) - -// ToFileDescriptorProto copies a protoreflect.FileDescriptor into a -// google.protobuf.FileDescriptorProto message. -func ToFileDescriptorProto(file protoreflect.FileDescriptor) *descriptorpb.FileDescriptorProto { - p := &descriptorpb.FileDescriptorProto{ - Name: proto.String(file.Path()), - Package: proto.String(string(file.Package())), - Options: proto.Clone(file.Options()).(*descriptorpb.FileOptions), - } - for i, imports := 0, file.Imports(); i < imports.Len(); i++ { - imp := imports.Get(i) - p.Dependency = append(p.Dependency, imp.Path()) - if imp.IsPublic { - p.PublicDependency = append(p.PublicDependency, int32(i)) - } - if imp.IsWeak { - p.WeakDependency = append(p.WeakDependency, int32(i)) - } - } - for i, locs := 0, file.SourceLocations(); i < locs.Len(); i++ { - loc := locs.Get(i) - l := &descriptorpb.SourceCodeInfo_Location{} - l.Path = append(l.Path, loc.Path...) - if loc.StartLine == loc.EndLine { - l.Span = []int32{int32(loc.StartLine), int32(loc.StartColumn), int32(loc.EndColumn)} - } else { - l.Span = []int32{int32(loc.StartLine), int32(loc.StartColumn), int32(loc.EndLine), int32(loc.EndColumn)} - } - l.LeadingDetachedComments = append([]string(nil), loc.LeadingDetachedComments...) - if loc.LeadingComments != "" { - l.LeadingComments = proto.String(loc.LeadingComments) - } - if loc.TrailingComments != "" { - l.TrailingComments = proto.String(loc.TrailingComments) - } - if p.SourceCodeInfo == nil { - p.SourceCodeInfo = &descriptorpb.SourceCodeInfo{} - } - p.SourceCodeInfo.Location = append(p.SourceCodeInfo.Location, l) - - } - for i, messages := 0, file.Messages(); i < messages.Len(); i++ { - p.MessageType = append(p.MessageType, ToDescriptorProto(messages.Get(i))) - } - for i, enums := 0, file.Enums(); i < enums.Len(); i++ { - p.EnumType = append(p.EnumType, ToEnumDescriptorProto(enums.Get(i))) - } - for i, services := 0, file.Services(); i < services.Len(); i++ { - p.Service = append(p.Service, ToServiceDescriptorProto(services.Get(i))) - } - for i, exts := 0, file.Extensions(); i < exts.Len(); i++ { - p.Extension = append(p.Extension, ToFieldDescriptorProto(exts.Get(i))) - } - if syntax := file.Syntax(); syntax != protoreflect.Proto2 { - p.Syntax = proto.String(file.Syntax().String()) - } - return p -} - -// ToDescriptorProto copies a protoreflect.MessageDescriptor into a -// google.protobuf.DescriptorProto message. -func ToDescriptorProto(message protoreflect.MessageDescriptor) *descriptorpb.DescriptorProto { - p := &descriptorpb.DescriptorProto{ - Name: proto.String(string(message.Name())), - Options: proto.Clone(message.Options()).(*descriptorpb.MessageOptions), - } - for i, fields := 0, message.Fields(); i < fields.Len(); i++ { - p.Field = append(p.Field, ToFieldDescriptorProto(fields.Get(i))) - } - for i, exts := 0, message.Extensions(); i < exts.Len(); i++ { - p.Extension = append(p.Extension, ToFieldDescriptorProto(exts.Get(i))) - } - for i, messages := 0, message.Messages(); i < messages.Len(); i++ { - p.NestedType = append(p.NestedType, ToDescriptorProto(messages.Get(i))) - } - for i, enums := 0, message.Enums(); i < enums.Len(); i++ { - p.EnumType = append(p.EnumType, ToEnumDescriptorProto(enums.Get(i))) - } - for i, xranges := 0, message.ExtensionRanges(); i < xranges.Len(); i++ { - xrange := xranges.Get(i) - p.ExtensionRange = append(p.ExtensionRange, &descriptorpb.DescriptorProto_ExtensionRange{ - Start: proto.Int32(int32(xrange[0])), - End: proto.Int32(int32(xrange[1])), - Options: proto.Clone(message.ExtensionRangeOptions(i)).(*descriptorpb.ExtensionRangeOptions), - }) - } - for i, oneofs := 0, message.Oneofs(); i < oneofs.Len(); i++ { - p.OneofDecl = append(p.OneofDecl, ToOneofDescriptorProto(oneofs.Get(i))) - } - for i, ranges := 0, message.ReservedRanges(); i < ranges.Len(); i++ { - rrange := ranges.Get(i) - p.ReservedRange = append(p.ReservedRange, &descriptorpb.DescriptorProto_ReservedRange{ - Start: proto.Int32(int32(rrange[0])), - End: proto.Int32(int32(rrange[1])), - }) - } - for i, names := 0, message.ReservedNames(); i < names.Len(); i++ { - p.ReservedName = append(p.ReservedName, string(names.Get(i))) - } - return p -} - -// ToFieldDescriptorProto copies a protoreflect.FieldDescriptor into a -// google.protobuf.FieldDescriptorProto message. -func ToFieldDescriptorProto(field protoreflect.FieldDescriptor) *descriptorpb.FieldDescriptorProto { - p := &descriptorpb.FieldDescriptorProto{ - Name: proto.String(string(field.Name())), - Number: proto.Int32(int32(field.Number())), - Label: descriptorpb.FieldDescriptorProto_Label(field.Cardinality()).Enum(), - Options: proto.Clone(field.Options()).(*descriptorpb.FieldOptions), - } - if field.IsExtension() { - p.Extendee = fullNameOf(field.ContainingMessage()) - } - if field.Kind().IsValid() { - p.Type = descriptorpb.FieldDescriptorProto_Type(field.Kind()).Enum() - } - if field.Enum() != nil { - p.TypeName = fullNameOf(field.Enum()) - } - if field.Message() != nil { - p.TypeName = fullNameOf(field.Message()) - } - if field.HasJSONName() { - p.JsonName = proto.String(field.JSONName()) - } - if field.Syntax() == protoreflect.Proto3 && field.HasOptionalKeyword() { - p.Proto3Optional = proto.Bool(true) - } - if field.HasDefault() { - def, err := defval.Marshal(field.Default(), field.DefaultEnumValue(), field.Kind(), defval.Descriptor) - if err != nil && field.DefaultEnumValue() != nil { - def = string(field.DefaultEnumValue().Name()) // occurs for unresolved enum values - } else if err != nil { - panic(fmt.Sprintf("%v: %v", field.FullName(), err)) - } - p.DefaultValue = proto.String(def) - } - if oneof := field.ContainingOneof(); oneof != nil { - p.OneofIndex = proto.Int32(int32(oneof.Index())) - } - return p -} - -// ToOneofDescriptorProto copies a protoreflect.OneofDescriptor into a -// google.protobuf.OneofDescriptorProto message. -func ToOneofDescriptorProto(oneof protoreflect.OneofDescriptor) *descriptorpb.OneofDescriptorProto { - return &descriptorpb.OneofDescriptorProto{ - Name: proto.String(string(oneof.Name())), - Options: proto.Clone(oneof.Options()).(*descriptorpb.OneofOptions), - } -} - -// ToEnumDescriptorProto copies a protoreflect.EnumDescriptor into a -// google.protobuf.EnumDescriptorProto message. -func ToEnumDescriptorProto(enum protoreflect.EnumDescriptor) *descriptorpb.EnumDescriptorProto { - p := &descriptorpb.EnumDescriptorProto{ - Name: proto.String(string(enum.Name())), - Options: proto.Clone(enum.Options()).(*descriptorpb.EnumOptions), - } - for i, values := 0, enum.Values(); i < values.Len(); i++ { - p.Value = append(p.Value, ToEnumValueDescriptorProto(values.Get(i))) - } - for i, ranges := 0, enum.ReservedRanges(); i < ranges.Len(); i++ { - rrange := ranges.Get(i) - p.ReservedRange = append(p.ReservedRange, &descriptorpb.EnumDescriptorProto_EnumReservedRange{ - Start: proto.Int32(int32(rrange[0])), - End: proto.Int32(int32(rrange[1])), - }) - } - for i, names := 0, enum.ReservedNames(); i < names.Len(); i++ { - p.ReservedName = append(p.ReservedName, string(names.Get(i))) - } - return p -} - -// ToEnumValueDescriptorProto copies a protoreflect.EnumValueDescriptor into a -// google.protobuf.EnumValueDescriptorProto message. -func ToEnumValueDescriptorProto(value protoreflect.EnumValueDescriptor) *descriptorpb.EnumValueDescriptorProto { - return &descriptorpb.EnumValueDescriptorProto{ - Name: proto.String(string(value.Name())), - Number: proto.Int32(int32(value.Number())), - Options: proto.Clone(value.Options()).(*descriptorpb.EnumValueOptions), - } -} - -// ToServiceDescriptorProto copies a protoreflect.ServiceDescriptor into a -// google.protobuf.ServiceDescriptorProto message. -func ToServiceDescriptorProto(service protoreflect.ServiceDescriptor) *descriptorpb.ServiceDescriptorProto { - p := &descriptorpb.ServiceDescriptorProto{ - Name: proto.String(string(service.Name())), - Options: proto.Clone(service.Options()).(*descriptorpb.ServiceOptions), - } - for i, methods := 0, service.Methods(); i < methods.Len(); i++ { - p.Method = append(p.Method, ToMethodDescriptorProto(methods.Get(i))) - } - return p -} - -// ToMethodDescriptorProto copies a protoreflect.MethodDescriptor into a -// google.protobuf.MethodDescriptorProto message. -func ToMethodDescriptorProto(method protoreflect.MethodDescriptor) *descriptorpb.MethodDescriptorProto { - p := &descriptorpb.MethodDescriptorProto{ - Name: proto.String(string(method.Name())), - InputType: fullNameOf(method.Input()), - OutputType: fullNameOf(method.Output()), - Options: proto.Clone(method.Options()).(*descriptorpb.MethodOptions), - } - if method.IsStreamingClient() { - p.ClientStreaming = proto.Bool(true) - } - if method.IsStreamingServer() { - p.ServerStreaming = proto.Bool(true) - } - return p -} - -func fullNameOf(d protoreflect.Descriptor) *string { - if d == nil { - return nil - } - if strings.HasPrefix(string(d.FullName()), unknownPrefix) { - return proto.String(string(d.FullName()[len(unknownPrefix):])) - } - return proto.String("." + string(d.FullName())) -} diff --git a/vendor/google.golang.org/protobuf/types/known/emptypb/empty.pb.go b/vendor/google.golang.org/protobuf/types/known/emptypb/empty.pb.go deleted file mode 100644 index 32a583df54..0000000000 --- a/vendor/google.golang.org/protobuf/types/known/emptypb/empty.pb.go +++ /dev/null @@ -1,168 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Code generated by protoc-gen-go. DO NOT EDIT. -// source: google/protobuf/empty.proto - -package emptypb - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -// A generic empty message that you can re-use to avoid defining duplicated -// empty messages in your APIs. A typical example is to use it as the request -// or the response type of an API method. For instance: -// -// service Foo { -// rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); -// } -// -// The JSON representation for `Empty` is empty JSON object `{}`. -type Empty struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *Empty) Reset() { - *x = Empty{} - if protoimpl.UnsafeEnabled { - mi := &file_google_protobuf_empty_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Empty) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Empty) ProtoMessage() {} - -func (x *Empty) ProtoReflect() protoreflect.Message { - mi := &file_google_protobuf_empty_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) -} - -// Deprecated: Use Empty.ProtoReflect.Descriptor instead. -func (*Empty) Descriptor() ([]byte, []int) { - return file_google_protobuf_empty_proto_rawDescGZIP(), []int{0} -} - -var File_google_protobuf_empty_proto protoreflect.FileDescriptor - -var file_google_protobuf_empty_proto_rawDesc = []byte{ - 0x0a, 0x1b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, - 0x66, 0x2f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0f, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x22, 0x07, - 0x0a, 0x05, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x42, 0x76, 0x0a, 0x13, 0x63, 0x6f, 0x6d, 0x2e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x42, 0x0a, - 0x45, 0x6d, 0x70, 0x74, 0x79, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x27, 0x67, 0x69, - 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x6f, 0x6c, 0x61, 0x6e, 0x67, 0x2f, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x70, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, - 0x65, 0x6d, 0x70, 0x74, 0x79, 0xf8, 0x01, 0x01, 0xa2, 0x02, 0x03, 0x47, 0x50, 0x42, 0xaa, 0x02, - 0x1e, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, - 0x2e, 0x57, 0x65, 0x6c, 0x6c, 0x4b, 0x6e, 0x6f, 0x77, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x73, 0x62, - 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_google_protobuf_empty_proto_rawDescOnce sync.Once - file_google_protobuf_empty_proto_rawDescData = file_google_protobuf_empty_proto_rawDesc -) - -func file_google_protobuf_empty_proto_rawDescGZIP() []byte { - file_google_protobuf_empty_proto_rawDescOnce.Do(func() { - file_google_protobuf_empty_proto_rawDescData = protoimpl.X.CompressGZIP(file_google_protobuf_empty_proto_rawDescData) - }) - return file_google_protobuf_empty_proto_rawDescData -} - -var file_google_protobuf_empty_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_google_protobuf_empty_proto_goTypes = []interface{}{ - (*Empty)(nil), // 0: google.protobuf.Empty -} -var file_google_protobuf_empty_proto_depIdxs = []int32{ - 0, // [0:0] is the sub-list for method output_type - 0, // [0:0] is the sub-list for method input_type - 0, // [0:0] is the sub-list for extension type_name - 0, // [0:0] is the sub-list for extension extendee - 0, // [0:0] is the sub-list for field type_name -} - -func init() { file_google_protobuf_empty_proto_init() } -func file_google_protobuf_empty_proto_init() { - if File_google_protobuf_empty_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_google_protobuf_empty_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Empty); 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_google_protobuf_empty_proto_rawDesc, - NumEnums: 0, - NumMessages: 1, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_google_protobuf_empty_proto_goTypes, - DependencyIndexes: file_google_protobuf_empty_proto_depIdxs, - MessageInfos: file_google_protobuf_empty_proto_msgTypes, - }.Build() - File_google_protobuf_empty_proto = out.File - file_google_protobuf_empty_proto_rawDesc = nil - file_google_protobuf_empty_proto_goTypes = nil - file_google_protobuf_empty_proto_depIdxs = nil -} diff --git a/vendor/google.golang.org/protobuf/types/known/structpb/struct.pb.go b/vendor/google.golang.org/protobuf/types/known/structpb/struct.pb.go deleted file mode 100644 index df098137b6..0000000000 --- a/vendor/google.golang.org/protobuf/types/known/structpb/struct.pb.go +++ /dev/null @@ -1,505 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Code generated by protoc-gen-go. DO NOT EDIT. -// source: google/protobuf/struct.proto - -package structpb - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -// `NullValue` is a singleton enumeration to represent the null value for the -// `Value` type union. -// -// The JSON representation for `NullValue` is JSON `null`. -type NullValue int32 - -const ( - // Null value. - NullValue_NULL_VALUE NullValue = 0 -) - -// Enum value maps for NullValue. -var ( - NullValue_name = map[int32]string{ - 0: "NULL_VALUE", - } - NullValue_value = map[string]int32{ - "NULL_VALUE": 0, - } -) - -func (x NullValue) Enum() *NullValue { - p := new(NullValue) - *p = x - return p -} - -func (x NullValue) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (NullValue) Descriptor() protoreflect.EnumDescriptor { - return file_google_protobuf_struct_proto_enumTypes[0].Descriptor() -} - -func (NullValue) Type() protoreflect.EnumType { - return &file_google_protobuf_struct_proto_enumTypes[0] -} - -func (x NullValue) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use NullValue.Descriptor instead. -func (NullValue) EnumDescriptor() ([]byte, []int) { - return file_google_protobuf_struct_proto_rawDescGZIP(), []int{0} -} - -// `Struct` represents a structured data value, consisting of fields -// which map to dynamically typed values. In some languages, `Struct` -// might be supported by a native representation. For example, in -// scripting languages like JS a struct is represented as an -// object. The details of that representation are described together -// with the proto support for the language. -// -// The JSON representation for `Struct` is JSON object. -type Struct struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Unordered map of dynamically typed values. - Fields map[string]*Value `protobuf:"bytes,1,rep,name=fields,proto3" json:"fields,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` -} - -func (x *Struct) Reset() { - *x = Struct{} - if protoimpl.UnsafeEnabled { - mi := &file_google_protobuf_struct_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Struct) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Struct) ProtoMessage() {} - -func (x *Struct) ProtoReflect() protoreflect.Message { - mi := &file_google_protobuf_struct_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) -} - -// Deprecated: Use Struct.ProtoReflect.Descriptor instead. -func (*Struct) Descriptor() ([]byte, []int) { - return file_google_protobuf_struct_proto_rawDescGZIP(), []int{0} -} - -func (x *Struct) GetFields() map[string]*Value { - if x != nil { - return x.Fields - } - return nil -} - -// `Value` represents a dynamically typed value which can be either -// null, a number, a string, a boolean, a recursive struct value, or a -// list of values. A producer of value is expected to set one of that -// variants, absence of any variant indicates an error. -// -// The JSON representation for `Value` is JSON value. -type Value struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The kind of value. - // - // Types that are assignable to Kind: - // *Value_NullValue - // *Value_NumberValue - // *Value_StringValue - // *Value_BoolValue - // *Value_StructValue - // *Value_ListValue - Kind isValue_Kind `protobuf_oneof:"kind"` -} - -func (x *Value) Reset() { - *x = Value{} - if protoimpl.UnsafeEnabled { - mi := &file_google_protobuf_struct_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Value) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Value) ProtoMessage() {} - -func (x *Value) ProtoReflect() protoreflect.Message { - mi := &file_google_protobuf_struct_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) -} - -// Deprecated: Use Value.ProtoReflect.Descriptor instead. -func (*Value) Descriptor() ([]byte, []int) { - return file_google_protobuf_struct_proto_rawDescGZIP(), []int{1} -} - -func (m *Value) GetKind() isValue_Kind { - if m != nil { - return m.Kind - } - return nil -} - -func (x *Value) GetNullValue() NullValue { - if x, ok := x.GetKind().(*Value_NullValue); ok { - return x.NullValue - } - return NullValue_NULL_VALUE -} - -func (x *Value) GetNumberValue() float64 { - if x, ok := x.GetKind().(*Value_NumberValue); ok { - return x.NumberValue - } - return 0 -} - -func (x *Value) GetStringValue() string { - if x, ok := x.GetKind().(*Value_StringValue); ok { - return x.StringValue - } - return "" -} - -func (x *Value) GetBoolValue() bool { - if x, ok := x.GetKind().(*Value_BoolValue); ok { - return x.BoolValue - } - return false -} - -func (x *Value) GetStructValue() *Struct { - if x, ok := x.GetKind().(*Value_StructValue); ok { - return x.StructValue - } - return nil -} - -func (x *Value) GetListValue() *ListValue { - if x, ok := x.GetKind().(*Value_ListValue); ok { - return x.ListValue - } - return nil -} - -type isValue_Kind interface { - isValue_Kind() -} - -type Value_NullValue struct { - // Represents a null value. - NullValue NullValue `protobuf:"varint,1,opt,name=null_value,json=nullValue,proto3,enum=google.protobuf.NullValue,oneof"` -} - -type Value_NumberValue struct { - // Represents a double value. - NumberValue float64 `protobuf:"fixed64,2,opt,name=number_value,json=numberValue,proto3,oneof"` -} - -type Value_StringValue struct { - // Represents a string value. - StringValue string `protobuf:"bytes,3,opt,name=string_value,json=stringValue,proto3,oneof"` -} - -type Value_BoolValue struct { - // Represents a boolean value. - BoolValue bool `protobuf:"varint,4,opt,name=bool_value,json=boolValue,proto3,oneof"` -} - -type Value_StructValue struct { - // Represents a structured value. - StructValue *Struct `protobuf:"bytes,5,opt,name=struct_value,json=structValue,proto3,oneof"` -} - -type Value_ListValue struct { - // Represents a repeated `Value`. - ListValue *ListValue `protobuf:"bytes,6,opt,name=list_value,json=listValue,proto3,oneof"` -} - -func (*Value_NullValue) isValue_Kind() {} - -func (*Value_NumberValue) isValue_Kind() {} - -func (*Value_StringValue) isValue_Kind() {} - -func (*Value_BoolValue) isValue_Kind() {} - -func (*Value_StructValue) isValue_Kind() {} - -func (*Value_ListValue) isValue_Kind() {} - -// `ListValue` is a wrapper around a repeated field of values. -// -// The JSON representation for `ListValue` is JSON array. -type ListValue struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Repeated field of dynamically typed values. - Values []*Value `protobuf:"bytes,1,rep,name=values,proto3" json:"values,omitempty"` -} - -func (x *ListValue) Reset() { - *x = ListValue{} - if protoimpl.UnsafeEnabled { - mi := &file_google_protobuf_struct_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListValue) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListValue) ProtoMessage() {} - -func (x *ListValue) ProtoReflect() protoreflect.Message { - mi := &file_google_protobuf_struct_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) -} - -// Deprecated: Use ListValue.ProtoReflect.Descriptor instead. -func (*ListValue) Descriptor() ([]byte, []int) { - return file_google_protobuf_struct_proto_rawDescGZIP(), []int{2} -} - -func (x *ListValue) GetValues() []*Value { - if x != nil { - return x.Values - } - return nil -} - -var File_google_protobuf_struct_proto protoreflect.FileDescriptor - -var file_google_protobuf_struct_proto_rawDesc = []byte{ - 0x0a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, - 0x66, 0x2f, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0f, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x22, - 0x98, 0x01, 0x0a, 0x06, 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x12, 0x3b, 0x0a, 0x06, 0x66, 0x69, - 0x65, 0x6c, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, - 0x75, 0x63, 0x74, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, - 0x06, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x1a, 0x51, 0x0a, 0x0b, 0x46, 0x69, 0x65, 0x6c, 0x64, - 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x2c, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, - 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, - 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0xb2, 0x02, 0x0a, 0x05, 0x56, - 0x61, 0x6c, 0x75, 0x65, 0x12, 0x3b, 0x0a, 0x0a, 0x6e, 0x75, 0x6c, 0x6c, 0x5f, 0x76, 0x61, 0x6c, - 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4e, 0x75, 0x6c, 0x6c, 0x56, - 0x61, 0x6c, 0x75, 0x65, 0x48, 0x00, 0x52, 0x09, 0x6e, 0x75, 0x6c, 0x6c, 0x56, 0x61, 0x6c, 0x75, - 0x65, 0x12, 0x23, 0x0a, 0x0c, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x5f, 0x76, 0x61, 0x6c, 0x75, - 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x01, 0x48, 0x00, 0x52, 0x0b, 0x6e, 0x75, 0x6d, 0x62, 0x65, - 0x72, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x23, 0x0a, 0x0c, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, - 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x0b, - 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x1f, 0x0a, 0x0a, 0x62, - 0x6f, 0x6f, 0x6c, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x48, - 0x00, 0x52, 0x09, 0x62, 0x6f, 0x6f, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x3c, 0x0a, 0x0c, - 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x05, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x48, 0x00, 0x52, 0x0b, 0x73, - 0x74, 0x72, 0x75, 0x63, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x3b, 0x0a, 0x0a, 0x6c, 0x69, - 0x73, 0x74, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, - 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, - 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x48, 0x00, 0x52, 0x09, 0x6c, 0x69, - 0x73, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x42, 0x06, 0x0a, 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x22, - 0x3b, 0x0a, 0x09, 0x4c, 0x69, 0x73, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x2e, 0x0a, 0x06, - 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x56, - 0x61, 0x6c, 0x75, 0x65, 0x52, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x2a, 0x1b, 0x0a, 0x09, - 0x4e, 0x75, 0x6c, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x0e, 0x0a, 0x0a, 0x4e, 0x55, 0x4c, - 0x4c, 0x5f, 0x56, 0x41, 0x4c, 0x55, 0x45, 0x10, 0x00, 0x42, 0x81, 0x01, 0x0a, 0x13, 0x63, 0x6f, - 0x6d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, - 0x66, 0x42, 0x0b, 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, - 0x5a, 0x31, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x6f, 0x6c, - 0x61, 0x6e, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x70, 0x74, 0x79, - 0x70, 0x65, 0x73, 0x2f, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x3b, 0x73, 0x74, 0x72, 0x75, 0x63, - 0x74, 0x70, 0x62, 0xf8, 0x01, 0x01, 0xa2, 0x02, 0x03, 0x47, 0x50, 0x42, 0xaa, 0x02, 0x1e, 0x47, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x57, - 0x65, 0x6c, 0x6c, 0x4b, 0x6e, 0x6f, 0x77, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x73, 0x62, 0x06, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_google_protobuf_struct_proto_rawDescOnce sync.Once - file_google_protobuf_struct_proto_rawDescData = file_google_protobuf_struct_proto_rawDesc -) - -func file_google_protobuf_struct_proto_rawDescGZIP() []byte { - file_google_protobuf_struct_proto_rawDescOnce.Do(func() { - file_google_protobuf_struct_proto_rawDescData = protoimpl.X.CompressGZIP(file_google_protobuf_struct_proto_rawDescData) - }) - return file_google_protobuf_struct_proto_rawDescData -} - -var file_google_protobuf_struct_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_google_protobuf_struct_proto_msgTypes = make([]protoimpl.MessageInfo, 4) -var file_google_protobuf_struct_proto_goTypes = []interface{}{ - (NullValue)(0), // 0: google.protobuf.NullValue - (*Struct)(nil), // 1: google.protobuf.Struct - (*Value)(nil), // 2: google.protobuf.Value - (*ListValue)(nil), // 3: google.protobuf.ListValue - nil, // 4: google.protobuf.Struct.FieldsEntry -} -var file_google_protobuf_struct_proto_depIdxs = []int32{ - 4, // 0: google.protobuf.Struct.fields:type_name -> google.protobuf.Struct.FieldsEntry - 0, // 1: google.protobuf.Value.null_value:type_name -> google.protobuf.NullValue - 1, // 2: google.protobuf.Value.struct_value:type_name -> google.protobuf.Struct - 3, // 3: google.protobuf.Value.list_value:type_name -> google.protobuf.ListValue - 2, // 4: google.protobuf.ListValue.values:type_name -> google.protobuf.Value - 2, // 5: google.protobuf.Struct.FieldsEntry.value:type_name -> google.protobuf.Value - 6, // [6:6] is the sub-list for method output_type - 6, // [6:6] is the sub-list for method input_type - 6, // [6:6] is the sub-list for extension type_name - 6, // [6:6] is the sub-list for extension extendee - 0, // [0:6] is the sub-list for field type_name -} - -func init() { file_google_protobuf_struct_proto_init() } -func file_google_protobuf_struct_proto_init() { - if File_google_protobuf_struct_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_google_protobuf_struct_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Struct); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_google_protobuf_struct_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Value); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_google_protobuf_struct_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListValue); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - file_google_protobuf_struct_proto_msgTypes[1].OneofWrappers = []interface{}{ - (*Value_NullValue)(nil), - (*Value_NumberValue)(nil), - (*Value_StringValue)(nil), - (*Value_BoolValue)(nil), - (*Value_StructValue)(nil), - (*Value_ListValue)(nil), - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_google_protobuf_struct_proto_rawDesc, - NumEnums: 1, - NumMessages: 4, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_google_protobuf_struct_proto_goTypes, - DependencyIndexes: file_google_protobuf_struct_proto_depIdxs, - EnumInfos: file_google_protobuf_struct_proto_enumTypes, - MessageInfos: file_google_protobuf_struct_proto_msgTypes, - }.Build() - File_google_protobuf_struct_proto = out.File - file_google_protobuf_struct_proto_rawDesc = nil - file_google_protobuf_struct_proto_goTypes = nil - file_google_protobuf_struct_proto_depIdxs = nil -} diff --git a/vendor/kubesphere.io/monitoring-dashboard/api/v1alpha1/dashboard_types.go b/vendor/kubesphere.io/monitoring-dashboard/api/v1alpha1/dashboard_types.go index 0d3603a1d1..f64da8708a 100644 --- a/vendor/kubesphere.io/monitoring-dashboard/api/v1alpha1/dashboard_types.go +++ b/vendor/kubesphere.io/monitoring-dashboard/api/v1alpha1/dashboard_types.go @@ -18,6 +18,7 @@ package v1alpha1 import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/util/json" "kubesphere.io/monitoring-dashboard/api/v1alpha1/panels" ) @@ -49,12 +50,60 @@ type Time struct { // Supported panel type type Panel struct { + // It can only be one of the following three types + // The panel row - Row panels.Row `json:",inline"` + Row *panels.Row `json:",inline"` // The panel graph - Graph panels.Graph `json:",inline"` + Graph *panels.Graph `json:",inline"` // The panel singlestat - SingleStat panels.SingleStat `json:",inline"` + SingleStat *panels.SingleStat `json:",inline"` +} + +type PanelType string + +const ( + PanelRow PanelType = "row" + PanelGraph PanelType = "graph" + PanelSingleStat PanelType = "singlestat" +) + +func (p *Panel) UnmarshalJSON(data []byte) error { + if len(data) == 0 { + return nil + } + + var t struct{ Type PanelType } + err := json.Unmarshal(data, &t) + if err != nil { + return err + } + + switch t.Type { + case PanelRow: + p.Row = &panels.Row{} + return json.Unmarshal(data, p.Row) + case PanelGraph: + p.Graph = &panels.Graph{} + return json.Unmarshal(data, p.Graph) + case PanelSingleStat: + p.SingleStat = &panels.SingleStat{} + return json.Unmarshal(data, p.SingleStat) + } + + return json.Unmarshal(data, p) +} + +func (p *Panel) MarshalJSON() (data []byte, err error) { + switch { + case p.Row != nil: + return json.Marshal(p.Row) + case p.Graph != nil: + return json.Marshal(p.Graph) + case p.SingleStat != nil: + return json.Marshal(p.SingleStat) + } + return json.Marshal(p) } // Templating defines a variable, which can be used as a placeholder in query diff --git a/vendor/kubesphere.io/monitoring-dashboard/api/v1alpha1/zz_generated.deepcopy.go b/vendor/kubesphere.io/monitoring-dashboard/api/v1alpha1/zz_generated.deepcopy.go index e8eb27975f..0968f3a8d3 100644 --- a/vendor/kubesphere.io/monitoring-dashboard/api/v1alpha1/zz_generated.deepcopy.go +++ b/vendor/kubesphere.io/monitoring-dashboard/api/v1alpha1/zz_generated.deepcopy.go @@ -22,6 +22,7 @@ package v1alpha1 import ( runtime "k8s.io/apimachinery/pkg/runtime" + "kubesphere.io/monitoring-dashboard/api/v1alpha1/panels" ) // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -171,9 +172,21 @@ func (in *DashboardSpec) DeepCopy() *DashboardSpec { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *Panel) DeepCopyInto(out *Panel) { *out = *in - out.Row = in.Row - in.Graph.DeepCopyInto(&out.Graph) - in.SingleStat.DeepCopyInto(&out.SingleStat) + if in.Row != nil { + in, out := &in.Row, &out.Row + *out = new(panels.Row) + **out = **in + } + if in.Graph != nil { + in, out := &in.Graph, &out.Graph + *out = new(panels.Graph) + (*in).DeepCopyInto(*out) + } + if in.SingleStat != nil { + in, out := &in.SingleStat, &out.SingleStat + *out = new(panels.SingleStat) + (*in).DeepCopyInto(*out) + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Panel. diff --git a/vendor/modules.txt b/vendor/modules.txt index ad5de11508..988722698b 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -1578,7 +1578,7 @@ k8s.io/utils/trace # kubesphere.io/client-go v0.0.0 => ./staging/src/kubesphere.io/client-go kubesphere.io/client-go/client kubesphere.io/client-go/client/generic -# kubesphere.io/monitoring-dashboard v0.1.1 +# kubesphere.io/monitoring-dashboard v0.1.2 kubesphere.io/monitoring-dashboard/api/v1alpha1 kubesphere.io/monitoring-dashboard/api/v1alpha1/panels # sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.7 => sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.7 diff --git a/vendor/sigs.k8s.io/controller-runtime/pkg/cache/informertest/fake_cache.go b/vendor/sigs.k8s.io/controller-runtime/pkg/cache/informertest/fake_cache.go deleted file mode 100644 index e686208296..0000000000 --- a/vendor/sigs.k8s.io/controller-runtime/pkg/cache/informertest/fake_cache.go +++ /dev/null @@ -1,141 +0,0 @@ -/* -Copyright 2018 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package informertest - -import ( - "context" - - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/client-go/kubernetes/scheme" - toolscache "k8s.io/client-go/tools/cache" - "sigs.k8s.io/controller-runtime/pkg/cache" - "sigs.k8s.io/controller-runtime/pkg/client" - "sigs.k8s.io/controller-runtime/pkg/controller/controllertest" -) - -var _ cache.Cache = &FakeInformers{} - -// FakeInformers is a fake implementation of Informers -type FakeInformers struct { - InformersByGVK map[schema.GroupVersionKind]toolscache.SharedIndexInformer - Scheme *runtime.Scheme - Error error - Synced *bool -} - -// GetInformerForKind implements Informers -func (c *FakeInformers) GetInformerForKind(ctx context.Context, gvk schema.GroupVersionKind) (cache.Informer, error) { - if c.Scheme == nil { - c.Scheme = scheme.Scheme - } - obj, err := c.Scheme.New(gvk) - if err != nil { - return nil, err - } - return c.informerFor(gvk, obj) -} - -// FakeInformerForKind implements Informers -func (c *FakeInformers) FakeInformerForKind(ctx context.Context, gvk schema.GroupVersionKind) (*controllertest.FakeInformer, error) { - if c.Scheme == nil { - c.Scheme = scheme.Scheme - } - obj, err := c.Scheme.New(gvk) - if err != nil { - return nil, err - } - i, err := c.informerFor(gvk, obj) - if err != nil { - return nil, err - } - return i.(*controllertest.FakeInformer), nil -} - -// GetInformer implements Informers -func (c *FakeInformers) GetInformer(ctx context.Context, obj runtime.Object) (cache.Informer, error) { - if c.Scheme == nil { - c.Scheme = scheme.Scheme - } - gvks, _, err := c.Scheme.ObjectKinds(obj) - if err != nil { - return nil, err - } - gvk := gvks[0] - return c.informerFor(gvk, obj) -} - -// WaitForCacheSync implements Informers -func (c *FakeInformers) WaitForCacheSync(stop <-chan struct{}) bool { - if c.Synced == nil { - return true - } - return *c.Synced -} - -// FakeInformerFor implements Informers -func (c *FakeInformers) FakeInformerFor(obj runtime.Object) (*controllertest.FakeInformer, error) { - if c.Scheme == nil { - c.Scheme = scheme.Scheme - } - gvks, _, err := c.Scheme.ObjectKinds(obj) - if err != nil { - return nil, err - } - gvk := gvks[0] - i, err := c.informerFor(gvk, obj) - if err != nil { - return nil, err - } - return i.(*controllertest.FakeInformer), nil -} - -func (c *FakeInformers) informerFor(gvk schema.GroupVersionKind, _ runtime.Object) (toolscache.SharedIndexInformer, error) { - if c.Error != nil { - return nil, c.Error - } - if c.InformersByGVK == nil { - c.InformersByGVK = map[schema.GroupVersionKind]toolscache.SharedIndexInformer{} - } - informer, ok := c.InformersByGVK[gvk] - if ok { - return informer, nil - } - - c.InformersByGVK[gvk] = &controllertest.FakeInformer{} - return c.InformersByGVK[gvk], nil -} - -// Start implements Informers -func (c *FakeInformers) Start(stopCh <-chan struct{}) error { - return c.Error -} - -// IndexField implements Cache -func (c *FakeInformers) IndexField(ctx context.Context, obj runtime.Object, field string, extractValue client.IndexerFunc) error { - return nil -} - -// Get implements Cache -func (c *FakeInformers) Get(ctx context.Context, key client.ObjectKey, obj runtime.Object) error { - return nil -} - -// List implements Cache -func (c *FakeInformers) List(ctx context.Context, list runtime.Object, opts ...client.ListOption) error { - return nil -} diff --git a/vendor/sigs.k8s.io/controller-runtime/pkg/client/fake/client.go b/vendor/sigs.k8s.io/controller-runtime/pkg/client/fake/client.go deleted file mode 100644 index e7d3c5c35b..0000000000 --- a/vendor/sigs.k8s.io/controller-runtime/pkg/client/fake/client.go +++ /dev/null @@ -1,409 +0,0 @@ -/* -Copyright 2018 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package fake - -import ( - "context" - "encoding/json" - "errors" - "fmt" - "strconv" - "strings" - - apierrors "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/api/meta" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" - utilrand "k8s.io/apimachinery/pkg/util/rand" - "k8s.io/apimachinery/pkg/util/validation/field" - "k8s.io/client-go/kubernetes/scheme" - "k8s.io/client-go/testing" - - "sigs.k8s.io/controller-runtime/pkg/client" - "sigs.k8s.io/controller-runtime/pkg/client/apiutil" - "sigs.k8s.io/controller-runtime/pkg/internal/objectutil" -) - -type versionedTracker struct { - testing.ObjectTracker -} - -type fakeClient struct { - tracker versionedTracker - scheme *runtime.Scheme -} - -var _ client.Client = &fakeClient{} - -const ( - maxNameLength = 63 - randomLength = 5 - maxGeneratedNameLength = maxNameLength - randomLength -) - -// NewFakeClient creates a new fake client for testing. -// You can choose to initialize it with a slice of runtime.Object. -// Deprecated: use NewFakeClientWithScheme. You should always be -// passing an explicit Scheme. -func NewFakeClient(initObjs ...runtime.Object) client.Client { - return NewFakeClientWithScheme(scheme.Scheme, initObjs...) -} - -// NewFakeClientWithScheme creates a new fake client with the given scheme -// for testing. -// You can choose to initialize it with a slice of runtime.Object. -func NewFakeClientWithScheme(clientScheme *runtime.Scheme, initObjs ...runtime.Object) client.Client { - tracker := testing.NewObjectTracker(clientScheme, scheme.Codecs.UniversalDecoder()) - for _, obj := range initObjs { - err := tracker.Add(obj) - if err != nil { - panic(fmt.Errorf("failed to add object %v to fake client: %w", obj, err)) - } - } - return &fakeClient{ - tracker: versionedTracker{tracker}, - scheme: clientScheme, - } -} - -func (t versionedTracker) Create(gvr schema.GroupVersionResource, obj runtime.Object, ns string) error { - accessor, err := meta.Accessor(obj) - if err != nil { - return err - } - if accessor.GetName() == "" { - return apierrors.NewInvalid( - obj.GetObjectKind().GroupVersionKind().GroupKind(), - accessor.GetName(), - field.ErrorList{field.Required(field.NewPath("metadata.name"), "name is required")}) - } - if accessor.GetResourceVersion() != "" { - return apierrors.NewBadRequest("resourceVersion can not be set for Create requests") - } - accessor.SetResourceVersion("1") - if err := t.ObjectTracker.Create(gvr, obj, ns); err != nil { - accessor.SetResourceVersion("") - return err - } - return nil -} - -func (t versionedTracker) Update(gvr schema.GroupVersionResource, obj runtime.Object, ns string) error { - accessor, err := meta.Accessor(obj) - if err != nil { - return fmt.Errorf("failed to get accessor for object: %v", err) - } - if accessor.GetName() == "" { - return apierrors.NewInvalid( - obj.GetObjectKind().GroupVersionKind().GroupKind(), - accessor.GetName(), - field.ErrorList{field.Required(field.NewPath("metadata.name"), "name is required")}) - } - oldObject, err := t.ObjectTracker.Get(gvr, ns, accessor.GetName()) - if err != nil { - return err - } - oldAccessor, err := meta.Accessor(oldObject) - if err != nil { - return err - } - if accessor.GetResourceVersion() != oldAccessor.GetResourceVersion() { - return apierrors.NewConflict(gvr.GroupResource(), accessor.GetName(), errors.New("object was modified")) - } - if oldAccessor.GetResourceVersion() == "" { - oldAccessor.SetResourceVersion("0") - } - intResourceVersion, err := strconv.ParseUint(oldAccessor.GetResourceVersion(), 10, 64) - if err != nil { - return fmt.Errorf("can not convert resourceVersion %q to int: %v", oldAccessor.GetResourceVersion(), err) - } - intResourceVersion++ - accessor.SetResourceVersion(strconv.FormatUint(intResourceVersion, 10)) - return t.ObjectTracker.Update(gvr, obj, ns) -} - -func (c *fakeClient) Get(ctx context.Context, key client.ObjectKey, obj runtime.Object) error { - gvr, err := getGVRFromObject(obj, c.scheme) - if err != nil { - return err - } - o, err := c.tracker.Get(gvr, key.Namespace, key.Name) - if err != nil { - return err - } - - gvk, err := apiutil.GVKForObject(obj, c.scheme) - if err != nil { - return err - } - ta, err := meta.TypeAccessor(o) - if err != nil { - return err - } - ta.SetKind(gvk.Kind) - ta.SetAPIVersion(gvk.GroupVersion().String()) - - j, err := json.Marshal(o) - if err != nil { - return err - } - decoder := scheme.Codecs.UniversalDecoder() - _, _, err = decoder.Decode(j, nil, obj) - return err -} - -func (c *fakeClient) List(ctx context.Context, obj runtime.Object, opts ...client.ListOption) error { - gvk, err := apiutil.GVKForObject(obj, c.scheme) - if err != nil { - return err - } - - OriginalKind := gvk.Kind - - if !strings.HasSuffix(gvk.Kind, "List") { - return fmt.Errorf("non-list type %T (kind %q) passed as output", obj, gvk) - } - // we need the non-list GVK, so chop off the "List" from the end of the kind - gvk.Kind = gvk.Kind[:len(gvk.Kind)-4] - - listOpts := client.ListOptions{} - listOpts.ApplyOptions(opts) - - gvr, _ := meta.UnsafeGuessKindToResource(gvk) - o, err := c.tracker.List(gvr, gvk, listOpts.Namespace) - if err != nil { - return err - } - - ta, err := meta.TypeAccessor(o) - if err != nil { - return err - } - ta.SetKind(OriginalKind) - ta.SetAPIVersion(gvk.GroupVersion().String()) - - j, err := json.Marshal(o) - if err != nil { - return err - } - decoder := scheme.Codecs.UniversalDecoder() - _, _, err = decoder.Decode(j, nil, obj) - if err != nil { - return err - } - - if listOpts.LabelSelector != nil { - objs, err := meta.ExtractList(obj) - if err != nil { - return err - } - filteredObjs, err := objectutil.FilterWithLabels(objs, listOpts.LabelSelector) - if err != nil { - return err - } - err = meta.SetList(obj, filteredObjs) - if err != nil { - return err - } - } - return nil -} - -func (c *fakeClient) Create(ctx context.Context, obj runtime.Object, opts ...client.CreateOption) error { - createOptions := &client.CreateOptions{} - createOptions.ApplyOptions(opts) - - for _, dryRunOpt := range createOptions.DryRun { - if dryRunOpt == metav1.DryRunAll { - return nil - } - } - - gvr, err := getGVRFromObject(obj, c.scheme) - if err != nil { - return err - } - accessor, err := meta.Accessor(obj) - if err != nil { - return err - } - - if accessor.GetName() == "" && accessor.GetGenerateName() != "" { - base := accessor.GetGenerateName() - if len(base) > maxGeneratedNameLength { - base = base[:maxGeneratedNameLength] - } - accessor.SetName(fmt.Sprintf("%s%s", base, utilrand.String(randomLength))) - } - - return c.tracker.Create(gvr, obj, accessor.GetNamespace()) -} - -func (c *fakeClient) Delete(ctx context.Context, obj runtime.Object, opts ...client.DeleteOption) error { - gvr, err := getGVRFromObject(obj, c.scheme) - if err != nil { - return err - } - accessor, err := meta.Accessor(obj) - if err != nil { - return err - } - delOptions := client.DeleteOptions{} - delOptions.ApplyOptions(opts) - - //TODO: implement propagation - return c.tracker.Delete(gvr, accessor.GetNamespace(), accessor.GetName()) -} - -func (c *fakeClient) DeleteAllOf(ctx context.Context, obj runtime.Object, opts ...client.DeleteAllOfOption) error { - gvk, err := apiutil.GVKForObject(obj, c.scheme) - if err != nil { - return err - } - - dcOptions := client.DeleteAllOfOptions{} - dcOptions.ApplyOptions(opts) - - gvr, _ := meta.UnsafeGuessKindToResource(gvk) - o, err := c.tracker.List(gvr, gvk, dcOptions.Namespace) - if err != nil { - return err - } - - objs, err := meta.ExtractList(o) - if err != nil { - return err - } - filteredObjs, err := objectutil.FilterWithLabels(objs, dcOptions.LabelSelector) - if err != nil { - return err - } - for _, o := range filteredObjs { - accessor, err := meta.Accessor(o) - if err != nil { - return err - } - err = c.tracker.Delete(gvr, accessor.GetNamespace(), accessor.GetName()) - if err != nil { - return err - } - } - return nil -} - -func (c *fakeClient) Update(ctx context.Context, obj runtime.Object, opts ...client.UpdateOption) error { - updateOptions := &client.UpdateOptions{} - updateOptions.ApplyOptions(opts) - - for _, dryRunOpt := range updateOptions.DryRun { - if dryRunOpt == metav1.DryRunAll { - return nil - } - } - - gvr, err := getGVRFromObject(obj, c.scheme) - if err != nil { - return err - } - accessor, err := meta.Accessor(obj) - if err != nil { - return err - } - return c.tracker.Update(gvr, obj, accessor.GetNamespace()) -} - -func (c *fakeClient) Patch(ctx context.Context, obj runtime.Object, patch client.Patch, opts ...client.PatchOption) error { - patchOptions := &client.PatchOptions{} - patchOptions.ApplyOptions(opts) - - for _, dryRunOpt := range patchOptions.DryRun { - if dryRunOpt == metav1.DryRunAll { - return nil - } - } - - gvr, err := getGVRFromObject(obj, c.scheme) - if err != nil { - return err - } - accessor, err := meta.Accessor(obj) - if err != nil { - return err - } - data, err := patch.Data(obj) - if err != nil { - return err - } - - reaction := testing.ObjectReaction(c.tracker) - handled, o, err := reaction(testing.NewPatchAction(gvr, accessor.GetNamespace(), accessor.GetName(), patch.Type(), data)) - if err != nil { - return err - } - if !handled { - panic("tracker could not handle patch method") - } - - gvk, err := apiutil.GVKForObject(obj, c.scheme) - if err != nil { - return err - } - ta, err := meta.TypeAccessor(o) - if err != nil { - return err - } - ta.SetKind(gvk.Kind) - ta.SetAPIVersion(gvk.GroupVersion().String()) - - j, err := json.Marshal(o) - if err != nil { - return err - } - decoder := scheme.Codecs.UniversalDecoder() - _, _, err = decoder.Decode(j, nil, obj) - return err -} - -func (c *fakeClient) Status() client.StatusWriter { - return &fakeStatusWriter{client: c} -} - -func getGVRFromObject(obj runtime.Object, scheme *runtime.Scheme) (schema.GroupVersionResource, error) { - gvk, err := apiutil.GVKForObject(obj, scheme) - if err != nil { - return schema.GroupVersionResource{}, err - } - gvr, _ := meta.UnsafeGuessKindToResource(gvk) - return gvr, nil -} - -type fakeStatusWriter struct { - client *fakeClient -} - -func (sw *fakeStatusWriter) Update(ctx context.Context, obj runtime.Object, opts ...client.UpdateOption) error { - // TODO(droot): This results in full update of the obj (spec + status). Need - // a way to update status field only. - return sw.client.Update(ctx, obj, opts...) -} - -func (sw *fakeStatusWriter) Patch(ctx context.Context, obj runtime.Object, patch client.Patch, opts ...client.PatchOption) error { - // TODO(droot): This results in full update of the obj (spec + status). Need - // a way to update status field only. - return sw.client.Patch(ctx, obj, patch, opts...) -} diff --git a/vendor/sigs.k8s.io/controller-runtime/pkg/client/fake/doc.go b/vendor/sigs.k8s.io/controller-runtime/pkg/client/fake/doc.go deleted file mode 100644 index a45d703320..0000000000 --- a/vendor/sigs.k8s.io/controller-runtime/pkg/client/fake/doc.go +++ /dev/null @@ -1,33 +0,0 @@ -/* -Copyright 2018 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -/* -Package fake provides a fake client for testing. - -Deprecated: please use pkg/envtest for testing. This package will be dropped -before the v1.0.0 release. - -An fake client is backed by its simple object store indexed by GroupVersionResource. -You can create a fake client with optional objects. - - client := NewFakeClient(initObjs...) // initObjs is a slice of runtime.Object - -You can invoke the methods defined in the Client interface. - -When it doubt, it's almost always better not to use this package and instead use -envtest.Environment with a real client and API server. -*/ -package fake diff --git a/vendor/sigs.k8s.io/controller-runtime/pkg/controller/controllertest/doc.go b/vendor/sigs.k8s.io/controller-runtime/pkg/controller/controllertest/doc.go deleted file mode 100644 index 91c5a3e35e..0000000000 --- a/vendor/sigs.k8s.io/controller-runtime/pkg/controller/controllertest/doc.go +++ /dev/null @@ -1,20 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Package controllertest contains fake informers for testing controllers -// When in doubt, it's almost always better to test against a real API server -// using envtest.Environment. -package controllertest diff --git a/vendor/sigs.k8s.io/controller-runtime/pkg/controller/controllertest/testing.go b/vendor/sigs.k8s.io/controller-runtime/pkg/controller/controllertest/testing.go deleted file mode 100644 index 570a97e36d..0000000000 --- a/vendor/sigs.k8s.io/controller-runtime/pkg/controller/controllertest/testing.go +++ /dev/null @@ -1,62 +0,0 @@ -/* -Copyright 2018 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package controllertest - -import ( - "time" - - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/client-go/util/workqueue" -) - -var _ runtime.Object = &ErrorType{} - -// ErrorType implements runtime.Object but isn't registered in any scheme and should cause errors in tests as a result. -type ErrorType struct{} - -// GetObjectKind implements runtime.Object -func (ErrorType) GetObjectKind() schema.ObjectKind { return nil } - -// DeepCopyObject implements runtime.Object -func (ErrorType) DeepCopyObject() runtime.Object { return nil } - -var _ workqueue.RateLimitingInterface = Queue{} - -// Queue implements a RateLimiting queue as a non-ratelimited queue for testing. -// This helps testing by having functions that use a RateLimiting queue synchronously add items to the queue. -type Queue struct { - workqueue.Interface -} - -// AddAfter implements RateLimitingInterface. -func (q Queue) AddAfter(item interface{}, duration time.Duration) { - q.Add(item) -} - -// AddRateLimited implements RateLimitingInterface. TODO(community): Implement this. -func (q Queue) AddRateLimited(item interface{}) { - q.Add(item) -} - -// Forget implements RateLimitingInterface. TODO(community): Implement this. -func (q Queue) Forget(item interface{}) {} - -// NumRequeues implements RateLimitingInterface. TODO(community): Implement this. -func (q Queue) NumRequeues(item interface{}) int { - return 0 -} diff --git a/vendor/sigs.k8s.io/controller-runtime/pkg/controller/controllertest/unconventionallisttypecrd.go b/vendor/sigs.k8s.io/controller-runtime/pkg/controller/controllertest/unconventionallisttypecrd.go deleted file mode 100644 index a4d23f8abe..0000000000 --- a/vendor/sigs.k8s.io/controller-runtime/pkg/controller/controllertest/unconventionallisttypecrd.go +++ /dev/null @@ -1,60 +0,0 @@ -package controllertest - -import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime" -) - -var _ runtime.Object = &UnconventionalListType{} -var _ runtime.Object = &UnconventionalListTypeList{} - -// UnconventionalListType is used to test CRDs with List types that -// have a slice of pointers rather than a slice of literals. -type UnconventionalListType struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - Spec string `json:"spec,omitempty"` -} - -// DeepCopyObject implements runtime.Object -// Handwritten for simplicity. -func (u *UnconventionalListType) DeepCopyObject() runtime.Object { - return u.DeepCopy() -} - -// DeepCopy implements *UnconventionalListType -// Handwritten for simplicity. -func (u *UnconventionalListType) DeepCopy() *UnconventionalListType { - return &UnconventionalListType{ - TypeMeta: u.TypeMeta, - ObjectMeta: *u.ObjectMeta.DeepCopy(), - Spec: u.Spec, - } -} - -// UnconventionalListTypeList is used to test CRDs with List types that -// have a slice of pointers rather than a slice of literals. -type UnconventionalListTypeList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []*UnconventionalListType `json:"items"` -} - -// DeepCopyObject implements runtime.Object -// Handwritten for simplicity. -func (u *UnconventionalListTypeList) DeepCopyObject() runtime.Object { - return u.DeepCopy() -} - -// DeepCopy implements *UnconventionalListTypeListt -// Handwritten for simplicity. -func (u *UnconventionalListTypeList) DeepCopy() *UnconventionalListTypeList { - out := &UnconventionalListTypeList{ - TypeMeta: u.TypeMeta, - ListMeta: *u.ListMeta.DeepCopy(), - } - for _, item := range u.Items { - out.Items = append(out.Items, item.DeepCopy()) - } - return out -} diff --git a/vendor/sigs.k8s.io/controller-runtime/pkg/controller/controllertest/util.go b/vendor/sigs.k8s.io/controller-runtime/pkg/controller/controllertest/util.go deleted file mode 100644 index 5557c80cfa..0000000000 --- a/vendor/sigs.k8s.io/controller-runtime/pkg/controller/controllertest/util.go +++ /dev/null @@ -1,108 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package controllertest - -import ( - "time" - - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/client-go/tools/cache" -) - -var _ cache.SharedIndexInformer = &FakeInformer{} - -// FakeInformer provides fake Informer functionality for testing -type FakeInformer struct { - // Synced is returned by the HasSynced functions to implement the Informer interface - Synced bool - - // RunCount is incremented each time RunInformersAndControllers is called - RunCount int - - handlers []cache.ResourceEventHandler -} - -// AddIndexers does nothing. TODO(community): Implement this. -func (f *FakeInformer) AddIndexers(indexers cache.Indexers) error { - return nil -} - -// GetIndexer does nothing. TODO(community): Implement this. -func (f *FakeInformer) GetIndexer() cache.Indexer { - return nil -} - -// Informer returns the fake Informer. -func (f *FakeInformer) Informer() cache.SharedIndexInformer { - return f -} - -// HasSynced implements the Informer interface. Returns f.Synced -func (f *FakeInformer) HasSynced() bool { - return f.Synced -} - -// AddEventHandler implements the Informer interface. Adds an EventHandler to the fake Informers. -func (f *FakeInformer) AddEventHandler(handler cache.ResourceEventHandler) { - f.handlers = append(f.handlers, handler) -} - -// Run implements the Informer interface. Increments f.RunCount -func (f *FakeInformer) Run(<-chan struct{}) { - f.RunCount++ -} - -// Add fakes an Add event for obj -func (f *FakeInformer) Add(obj metav1.Object) { - for _, h := range f.handlers { - h.OnAdd(obj) - } -} - -// Update fakes an Update event for obj -func (f *FakeInformer) Update(oldObj, newObj metav1.Object) { - for _, h := range f.handlers { - h.OnUpdate(oldObj, newObj) - } -} - -// Delete fakes an Delete event for obj -func (f *FakeInformer) Delete(obj metav1.Object) { - for _, h := range f.handlers { - h.OnDelete(obj) - } -} - -// AddEventHandlerWithResyncPeriod does nothing. TODO(community): Implement this. -func (f *FakeInformer) AddEventHandlerWithResyncPeriod(handler cache.ResourceEventHandler, resyncPeriod time.Duration) { - -} - -// GetStore does nothing. TODO(community): Implement this. -func (f *FakeInformer) GetStore() cache.Store { - return nil -} - -// GetController does nothing. TODO(community): Implement this. -func (f *FakeInformer) GetController() cache.Controller { - return nil -} - -// LastSyncResourceVersion does nothing. TODO(community): Implement this. -func (f *FakeInformer) LastSyncResourceVersion() string { - return "" -} diff --git a/vendor/sigs.k8s.io/controller-runtime/pkg/internal/objectutil/filter.go b/vendor/sigs.k8s.io/controller-runtime/pkg/internal/objectutil/filter.go deleted file mode 100644 index 8513846e2c..0000000000 --- a/vendor/sigs.k8s.io/controller-runtime/pkg/internal/objectutil/filter.go +++ /dev/null @@ -1,42 +0,0 @@ -/* -Copyright 2018 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package objectutil - -import ( - apimeta "k8s.io/apimachinery/pkg/api/meta" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/apimachinery/pkg/runtime" -) - -// FilterWithLabels returns a copy of the items in objs matching labelSel -func FilterWithLabels(objs []runtime.Object, labelSel labels.Selector) ([]runtime.Object, error) { - outItems := make([]runtime.Object, 0, len(objs)) - for _, obj := range objs { - meta, err := apimeta.Accessor(obj) - if err != nil { - return nil, err - } - if labelSel != nil { - lbls := labels.Set(meta.GetLabels()) - if !labelSel.Matches(lbls) { - continue - } - } - outItems = append(outItems, obj.DeepCopyObject()) - } - return outItems, nil -}