diff --git a/Documentation/dev-guide/api_reference_v3.md b/Documentation/dev-guide/api_reference_v3.md index f2904a98173..bb1ec9e9bf4 100644 --- a/Documentation/dev-guide/api_reference_v3.md +++ b/Documentation/dev-guide/api_reference_v3.md @@ -79,6 +79,20 @@ This is a generated documentation. Please read the proto files for more. +##### service `QoS` (etcdserver/etcdserverpb/rpc.proto) + +| Method | Request Type | Response Type | Description | +| ------ | ------------ | ------------- | ----------- | +| QoSEnable | QoSEnableRequest | QoSEnableResponse | QoSEnable enables qos. | +| QoSDisable | QoSDisableRequest | QoSDisableResponse | QoSDisable disables qos. | +| QoSRuleAdd | QoSRuleAddRequest | QoSRuleAddResponse | QoSRuleAdd adds a qos rule into the cluster. | +| QoSRuleGet | QoSRuleGetRequest | QoSRuleGetResponse | QoSRuleGet get a qos rule into the cluster. | +| QoSRuleDelete | QoSRuleDeleteRequest | QoSRuleDeleteResponse | QoSRuleDelete deletes a qos rule from the cluster. | +| QoSRuleUpdate | QoSRuleUpdateRequest | QoSRuleUpdateResponse | QoSRuleUpdate updates a qos rule into the cluster. | +| QoSRuleList | QoSRuleListRequest | QoSRuleListResponse | QoSRuleList lists all qos rule from the cluster. | + + + ##### service `Watch` (etcdserver/etcdserverpb/rpc.proto) | Method | Request Type | Response Type | Description | @@ -777,6 +791,114 @@ Empty field. +##### message `QoSDisableRequest` (etcdserver/etcdserverpb/rpc.proto) + +Empty field. + + + +##### message `QoSDisableResponse` (etcdserver/etcdserverpb/rpc.proto) + +| Field | Description | Type | +| ----- | ----------- | ---- | +| header | | ResponseHeader | + + + +##### message `QoSEnableRequest` (etcdserver/etcdserverpb/rpc.proto) + +Empty field. + + + +##### message `QoSEnableResponse` (etcdserver/etcdserverpb/rpc.proto) + +| Field | Description | Type | +| ----- | ----------- | ---- | +| header | | ResponseHeader | + + + +##### message `QoSRuleAddRequest` (etcdserver/etcdserverpb/rpc.proto) + +| Field | Description | Type | +| ----- | ----------- | ---- | +| qos_rule | | qospb.QoSRule | + + + +##### message `QoSRuleAddResponse` (etcdserver/etcdserverpb/rpc.proto) + +| Field | Description | Type | +| ----- | ----------- | ---- | +| header | | ResponseHeader | + + + +##### message `QoSRuleDeleteRequest` (etcdserver/etcdserverpb/rpc.proto) + +| Field | Description | Type | +| ----- | ----------- | ---- | +| rule_name | | string | + + + +##### message `QoSRuleDeleteResponse` (etcdserver/etcdserverpb/rpc.proto) + +| Field | Description | Type | +| ----- | ----------- | ---- | +| header | | ResponseHeader | + + + +##### message `QoSRuleGetRequest` (etcdserver/etcdserverpb/rpc.proto) + +| Field | Description | Type | +| ----- | ----------- | ---- | +| rule_name | | string | + + + +##### message `QoSRuleGetResponse` (etcdserver/etcdserverpb/rpc.proto) + +| Field | Description | Type | +| ----- | ----------- | ---- | +| header | | ResponseHeader | +| qos_rule | | qospb.QoSRule | + + + +##### message `QoSRuleListRequest` (etcdserver/etcdserverpb/rpc.proto) + +Empty field. + + + +##### message `QoSRuleListResponse` (etcdserver/etcdserverpb/rpc.proto) + +| Field | Description | Type | +| ----- | ----------- | ---- | +| header | | ResponseHeader | +| qos_rules | | (slice of) qospb.QoSRule | + + + +##### message `QoSRuleUpdateRequest` (etcdserver/etcdserverpb/rpc.proto) + +| Field | Description | Type | +| ----- | ----------- | ---- | +| qos_rule | | qospb.QoSRule | + + + +##### message `QoSRuleUpdateResponse` (etcdserver/etcdserverpb/rpc.proto) + +| Field | Description | Type | +| ----- | ----------- | ---- | +| header | | ResponseHeader | + + + ##### message `RangeRequest` (etcdserver/etcdserverpb/rpc.proto) | Field | Description | Type | diff --git a/Documentation/dev-guide/apispec/swagger/rpc.swagger.json b/Documentation/dev-guide/apispec/swagger/rpc.swagger.json index cdcb32c3d45..fd42742b77f 100644 --- a/Documentation/dev-guide/apispec/swagger/rpc.swagger.json +++ b/Documentation/dev-guide/apispec/swagger/rpc.swagger.json @@ -1416,6 +1416,237 @@ } } }, + "/v3/qos/disable": { + "post": { + "tags": [ + "QoS" + ], + "summary": "QoSDisable disables qos.", + "operationId": "QoS_QoSDisable", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/etcdserverpbQoSDisableRequest" + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/etcdserverpbQoSDisableResponse" + } + }, + "default": { + "description": "An unexpected error response", + "schema": { + "$ref": "#/definitions/runtimeError" + } + } + } + } + }, + "/v3/qos/enable": { + "post": { + "tags": [ + "QoS" + ], + "summary": "QoSEnable enables qos.", + "operationId": "QoS_QoSEnable", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/etcdserverpbQoSEnableRequest" + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/etcdserverpbQoSEnableResponse" + } + }, + "default": { + "description": "An unexpected error response", + "schema": { + "$ref": "#/definitions/runtimeError" + } + } + } + } + }, + "/v3/qos/rule/add": { + "post": { + "tags": [ + "QoS" + ], + "summary": "QoSRuleAdd adds a qos rule into the cluster.", + "operationId": "QoS_QoSRuleAdd", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/etcdserverpbQoSRuleAddRequest" + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/etcdserverpbQoSRuleAddResponse" + } + }, + "default": { + "description": "An unexpected error response", + "schema": { + "$ref": "#/definitions/runtimeError" + } + } + } + } + }, + "/v3/qos/rule/delete": { + "post": { + "tags": [ + "QoS" + ], + "summary": "QoSRuleDelete deletes a qos rule from the cluster.", + "operationId": "QoS_QoSRuleDelete", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/etcdserverpbQoSRuleDeleteRequest" + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/etcdserverpbQoSRuleDeleteResponse" + } + }, + "default": { + "description": "An unexpected error response", + "schema": { + "$ref": "#/definitions/runtimeError" + } + } + } + } + }, + "/v3/qos/rule/get": { + "post": { + "tags": [ + "QoS" + ], + "summary": "QoSRuleGet get a qos rule into the cluster.", + "operationId": "QoS_QoSRuleGet", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/etcdserverpbQoSRuleGetRequest" + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/etcdserverpbQoSRuleGetResponse" + } + }, + "default": { + "description": "An unexpected error response", + "schema": { + "$ref": "#/definitions/runtimeError" + } + } + } + } + }, + "/v3/qos/rule/list": { + "post": { + "tags": [ + "QoS" + ], + "summary": "QoSRuleList lists all qos rule from the cluster.", + "operationId": "QoS_QoSRuleList", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/etcdserverpbQoSRuleListRequest" + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/etcdserverpbQoSRuleListResponse" + } + }, + "default": { + "description": "An unexpected error response", + "schema": { + "$ref": "#/definitions/runtimeError" + } + } + } + } + }, + "/v3/qos/rule/update": { + "post": { + "tags": [ + "QoS" + ], + "summary": "QoSRuleUpdate updates a qos rule into the cluster.", + "operationId": "QoS_QoSRuleUpdate", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/etcdserverpbQoSRuleUpdateRequest" + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/etcdserverpbQoSRuleUpdateResponse" + } + }, + "default": { + "description": "An unexpected error response", + "schema": { + "$ref": "#/definitions/runtimeError" + } + } + } + } + }, "/v3/watch": { "post": { "tags": [ @@ -1567,8 +1798,7 @@ "type": "object", "properties": { "no_password": { - "type": "boolean", - "format": "boolean" + "type": "boolean" } } }, @@ -1779,8 +2009,7 @@ "title": "authRevision is the current revision of auth store" }, "enabled": { - "type": "boolean", - "format": "boolean" + "type": "boolean" }, "header": { "$ref": "#/definitions/etcdserverpbResponseHeader" @@ -1962,8 +2191,7 @@ "properties": { "physical": { "description": "physical is set so the RPC will wait until the compaction is physically\napplied to the local database such that compacted entries are totally\nremoved from the backend database.", - "type": "boolean", - "format": "boolean" + "type": "boolean" }, "revision": { "description": "revision is the key-value store revision for the compaction operation.", @@ -2049,8 +2277,7 @@ }, "prev_kv": { "description": "If prev_kv is set, etcd gets the previous key-value pairs before deleting it.\nThe previous key-value pairs will be returned in the delete response.", - "type": "boolean", - "format": "boolean" + "type": "boolean" }, "range_end": { "description": "range_end is the key following the last key to delete for the range [key, range_end).\nIf range_end is not given, the range is defined to contain only the key argument.\nIf range_end is one bit larger than the given key, then the range is all the keys\nwith the prefix (the given key).\nIf range_end is '\\0', the range is all keys greater than or equal to the key argument.", @@ -2266,8 +2493,7 @@ }, "keys": { "description": "keys is true to query all the keys attached to this lease.", - "type": "boolean", - "format": "boolean" + "type": "boolean" } } }, @@ -2319,8 +2545,7 @@ }, "isLearner": { "description": "isLearner indicates if the member is raft learner.", - "type": "boolean", - "format": "boolean" + "type": "boolean" }, "name": { "description": "name is the human-readable name of the member. If the member is not started, the name will be an empty string.", @@ -2340,8 +2565,7 @@ "properties": { "isLearner": { "description": "isLearner indicates if the added member is raft learner.", - "type": "boolean", - "format": "boolean" + "type": "boolean" }, "peerURLs": { "description": "peerURLs is the list of URLs the added member will use to communicate with the cluster.", @@ -2375,8 +2599,7 @@ "type": "object", "properties": { "linearizable": { - "type": "boolean", - "format": "boolean" + "type": "boolean" } } }, @@ -2500,13 +2723,11 @@ "properties": { "ignore_lease": { "description": "If ignore_lease is set, etcd updates the key using its current lease.\nReturns an error if the key does not exist.", - "type": "boolean", - "format": "boolean" + "type": "boolean" }, "ignore_value": { "description": "If ignore_value is set, etcd updates the key using its current value.\nReturns an error if the key does not exist.", - "type": "boolean", - "format": "boolean" + "type": "boolean" }, "key": { "description": "key is the key, in bytes, to put into the key-value store.", @@ -2520,8 +2741,7 @@ }, "prev_kv": { "description": "If prev_kv is set, etcd gets the previous key-value pair before changing it.\nThe previous key-value pair will be returned in the put response.", - "type": "boolean", - "format": "boolean" + "type": "boolean" }, "value": { "description": "value is the value, in bytes, to associate with the key in the key-value store.", @@ -2542,13 +2762,118 @@ } } }, + "etcdserverpbQoSDisableRequest": { + "type": "object" + }, + "etcdserverpbQoSDisableResponse": { + "type": "object", + "properties": { + "header": { + "$ref": "#/definitions/etcdserverpbResponseHeader" + } + } + }, + "etcdserverpbQoSEnableRequest": { + "type": "object" + }, + "etcdserverpbQoSEnableResponse": { + "type": "object", + "properties": { + "header": { + "$ref": "#/definitions/etcdserverpbResponseHeader" + } + } + }, + "etcdserverpbQoSRuleAddRequest": { + "type": "object", + "properties": { + "qos_rule": { + "$ref": "#/definitions/qospbQoSRule" + } + } + }, + "etcdserverpbQoSRuleAddResponse": { + "type": "object", + "properties": { + "header": { + "$ref": "#/definitions/etcdserverpbResponseHeader" + } + } + }, + "etcdserverpbQoSRuleDeleteRequest": { + "type": "object", + "properties": { + "rule_name": { + "type": "string" + } + } + }, + "etcdserverpbQoSRuleDeleteResponse": { + "type": "object", + "properties": { + "header": { + "$ref": "#/definitions/etcdserverpbResponseHeader" + } + } + }, + "etcdserverpbQoSRuleGetRequest": { + "type": "object", + "properties": { + "rule_name": { + "type": "string" + } + } + }, + "etcdserverpbQoSRuleGetResponse": { + "type": "object", + "properties": { + "header": { + "$ref": "#/definitions/etcdserverpbResponseHeader" + }, + "qos_rule": { + "$ref": "#/definitions/qospbQoSRule" + } + } + }, + "etcdserverpbQoSRuleListRequest": { + "type": "object" + }, + "etcdserverpbQoSRuleListResponse": { + "type": "object", + "properties": { + "header": { + "$ref": "#/definitions/etcdserverpbResponseHeader" + }, + "qos_rules": { + "type": "array", + "items": { + "$ref": "#/definitions/qospbQoSRule" + } + } + } + }, + "etcdserverpbQoSRuleUpdateRequest": { + "type": "object", + "properties": { + "qos_rule": { + "$ref": "#/definitions/qospbQoSRule" + } + } + }, + "etcdserverpbQoSRuleUpdateResponse": { + "type": "object", + "properties": { + "header": { + "$ref": "#/definitions/etcdserverpbResponseHeader" + } + } + }, "etcdserverpbRangeRequest": { "type": "object", "properties": { "count_only": { "description": "count_only when set returns only the count of the keys in the range.", - "type": "boolean", - "format": "boolean" + "type": "boolean" }, "key": { "description": "key is the first key for the range. If range_end is not given, the request only looks up key.", @@ -2557,8 +2882,7 @@ }, "keys_only": { "description": "keys_only when set returns only the keys and not the values.", - "type": "boolean", - "format": "boolean" + "type": "boolean" }, "limit": { "description": "limit is a limit on the number of keys returned for the request. When limit is set to 0,\nit is treated as no limit.", @@ -2597,8 +2921,7 @@ }, "serializable": { "description": "serializable sets the range request to use serializable member-local reads.\nRange requests are linearizable by default; linearizable requests have higher\nlatency and lower throughput than serializable requests but reflect the current\nconsensus of the cluster. For better performance, in exchange for possible stale reads,\na serializable range request is served locally without needing to reach consensus\nwith other nodes in the cluster.", - "type": "boolean", - "format": "boolean" + "type": "boolean" }, "sort_order": { "description": "sort_order is the order for returned sorted results.", @@ -2630,8 +2953,7 @@ }, "more": { "description": "more indicates if there are more keys to return in the requested range.", - "type": "boolean", - "format": "boolean" + "type": "boolean" } } }, @@ -2744,8 +3066,7 @@ }, "isLearner": { "description": "isLearner indicates if the member is raft learner.", - "type": "boolean", - "format": "boolean" + "type": "boolean" }, "leader": { "description": "leader is the member ID which the responding member believes is the current leader.", @@ -2815,8 +3136,7 @@ }, "succeeded": { "description": "succeeded is set to true if the compare evaluated to true or false otherwise.", - "type": "boolean", - "format": "boolean" + "type": "boolean" } } }, @@ -2842,8 +3162,7 @@ }, "fragment": { "description": "fragment enables splitting large revisions into multiple watch responses.", - "type": "boolean", - "format": "boolean" + "type": "boolean" }, "key": { "description": "key is the key to register for watching.", @@ -2852,13 +3171,11 @@ }, "prev_kv": { "description": "If prev_kv is set, created watcher gets the previous KV before the event happens.\nIf the previous KV is already compacted, nothing will be returned.", - "type": "boolean", - "format": "boolean" + "type": "boolean" }, "progress_notify": { "description": "progress_notify is set so that the etcd server will periodically send a WatchResponse with\nno events to the new watcher if there are no recent events. It is useful when clients\nwish to recover a disconnected watcher starting from a recent known revision.\nThe etcd server may decide how often it will send notifications based on current load.", - "type": "boolean", - "format": "boolean" + "type": "boolean" }, "range_end": { "description": "range_end is the end of the range [key, range_end) to watch. If range_end is not given,\nonly the key argument is watched. If range_end is equal to '\\0', all keys greater than\nor equal to the key argument are watched.\nIf the range_end is one bit larger than the given key,\nthen all keys with the prefix (the given key) will be watched.", @@ -2904,8 +3221,7 @@ }, "canceled": { "description": "canceled is set to true if the response is for a cancel watch request.\nNo further events will be sent to the canceled watcher.", - "type": "boolean", - "format": "boolean" + "type": "boolean" }, "compact_revision": { "description": "compact_revision is set to the minimum index if a watcher tries to watch\nat a compacted index.\n\nThis happens when creating a watcher at a compacted revision or the watcher cannot\ncatch up with the progress of the key-value store.\n\nThe client should treat the watcher as canceled and should not try to create any\nwatcher with the same start_revision again.", @@ -2914,8 +3230,7 @@ }, "created": { "description": "created is set to true if the response is for a create watch request.\nThe client should record the watch_id and expect to receive events for\nthe created watcher from the same stream.\nAll events sent to the created watcher will attach with the same watch_id.", - "type": "boolean", - "format": "boolean" + "type": "boolean" }, "events": { "type": "array", @@ -2925,8 +3240,7 @@ }, "fragment": { "description": "framgment is true if large watch response was split over multiple responses.", - "type": "boolean", - "format": "boolean" + "type": "boolean" }, "header": { "$ref": "#/definitions/etcdserverpbResponseHeader" @@ -3002,6 +3316,49 @@ } } }, + "qospbQoSRule": { + "type": "object", + "properties": { + "condition": { + "type": "string" + }, + "priority": { + "type": "string", + "format": "uint64" + }, + "qps": { + "type": "string", + "format": "uint64" + }, + "ratelimiter": { + "type": "string" + }, + "rule_name": { + "type": "string" + }, + "rule_type": { + "type": "string" + }, + "subject": { + "$ref": "#/definitions/qospbSubject" + }, + "threshold": { + "type": "string", + "format": "uint64" + } + } + }, + "qospbSubject": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "prefix": { + "type": "string" + } + } + }, "runtimeError": { "type": "object", "properties": { diff --git a/bill-of-materials.json b/bill-of-materials.json index 7a233d436de..6d00b249595 100644 --- a/bill-of-materials.json +++ b/bill-of-materials.json @@ -1,4 +1,13 @@ [ + { + "project": "github.com/antonmedv/expr", + "licenses": [ + { + "type": "MIT License", + "confidence": 1 + } + ] + }, { "project": "github.com/beorn7/perks/quantile", "licenses": [ diff --git a/clientv3/client.go b/clientv3/client.go index 3b6dd32986f..bdcd4c2ddea 100644 --- a/clientv3/client.go +++ b/clientv3/client.go @@ -76,6 +76,7 @@ type Client struct { Watcher Auth Maintenance + QoS conn *grpc.ClientConn @@ -495,6 +496,7 @@ func newClient(cfg *Config) (*Client, error) { client.Watcher = NewWatcher(client) client.Auth = NewAuth(client) client.Maintenance = NewMaintenance(client) + client.QoS = NewQoS(client) if cfg.RejectOldCluster { if err := client.checkVersion(); err != nil { diff --git a/clientv3/qos.go b/clientv3/qos.go new file mode 100644 index 00000000000..88eb5ef5716 --- /dev/null +++ b/clientv3/qos.go @@ -0,0 +1,97 @@ +// Copyright 2016 The etcd Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package clientv3 + +import ( + "context" + + pb "go.etcd.io/etcd/v3/etcdserver/etcdserverpb" + "google.golang.org/grpc" +) + +type ( + QoSEnableResponse pb.QoSEnableResponse + QoSDisableResponse pb.QoSDisableResponse + QoSRuleAddResponse pb.QoSRuleAddResponse + QoSRuleGetResponse pb.QoSRuleGetResponse + QoSRuleDeleteResponse pb.QoSRuleDeleteResponse + QoSRuleUpdateResponse pb.QoSRuleUpdateResponse + QoSRuleListResponse pb.QoSRuleListResponse +) + +type QoS interface { + // QoSEnable enables qos. + QoSEnable(context.Context, *pb.QoSEnableRequest) (*QoSEnableResponse, error) + // QoSDisable disables qos. + QoSDisable(context.Context, *pb.QoSDisableRequest) (*QoSDisableResponse, error) + // QoSRuleAdd adds a qos rule into the cluster. + QoSRuleAdd(context.Context, *pb.QoSRuleAddRequest) (*QoSRuleAddResponse, error) + // QoSRuleGet get a qos rule into the cluster. + QoSRuleGet(context.Context, *pb.QoSRuleGetRequest) (*QoSRuleGetResponse, error) + // QoSRuleDelete deletes a qos rule from the cluster. + QoSRuleDelete(context.Context, *pb.QoSRuleDeleteRequest) (*QoSRuleDeleteResponse, error) + // QoSRuleUpdate updates a qos rule into the cluster. + QoSRuleUpdate(context.Context, *pb.QoSRuleUpdateRequest) (*QoSRuleUpdateResponse, error) + // QoSRuleList lists all qos rule from the cluster. + QoSRuleList(context.Context, *pb.QoSRuleListRequest) (*QoSRuleListResponse, error) +} + +type QoSClient struct { + remote pb.QoSClient + callOpts []grpc.CallOption +} + +func NewQoS(c *Client) QoS { + api := &QoSClient{remote: RetryQoSClient(c)} + if c != nil { + api.callOpts = c.callOpts + } + return api +} + +func (QoS *QoSClient) QoSEnable(ctx context.Context, r *pb.QoSEnableRequest) (*QoSEnableResponse, error) { + resp, err := QoS.remote.QoSEnable(ctx, r, QoS.callOpts...) + return (*QoSEnableResponse)(resp), toErr(ctx, err) +} + +func (QoS *QoSClient) QoSDisable(ctx context.Context, r *pb.QoSDisableRequest) (*QoSDisableResponse, error) { + resp, err := QoS.remote.QoSDisable(ctx, r, QoS.callOpts...) + return (*QoSDisableResponse)(resp), toErr(ctx, err) +} + +func (QoS *QoSClient) QoSRuleAdd(ctx context.Context, r *pb.QoSRuleAddRequest) (*QoSRuleAddResponse, error) { + resp, err := QoS.remote.QoSRuleAdd(ctx, r, QoS.callOpts...) + return (*QoSRuleAddResponse)(resp), toErr(ctx, err) +} + +func (QoS *QoSClient) QoSRuleDelete(ctx context.Context, r *pb.QoSRuleDeleteRequest) (*QoSRuleDeleteResponse, error) { + resp, err := QoS.remote.QoSRuleDelete(ctx, r, QoS.callOpts...) + return (*QoSRuleDeleteResponse)(resp), toErr(ctx, err) +} + +func (QoS *QoSClient) QoSRuleUpdate(ctx context.Context, r *pb.QoSRuleUpdateRequest) (*QoSRuleUpdateResponse, error) { + resp, err := QoS.remote.QoSRuleUpdate(ctx, r, QoS.callOpts...) + return (*QoSRuleUpdateResponse)(resp), toErr(ctx, err) +} + +func (QoS *QoSClient) QoSRuleGet(ctx context.Context, r *pb.QoSRuleGetRequest) (*QoSRuleGetResponse, error) { + resp, err := QoS.remote.QoSRuleGet(ctx, r, QoS.callOpts...) + return (*QoSRuleGetResponse)(resp), toErr(ctx, err) +} + +func (QoS *QoSClient) QoSRuleList(ctx context.Context, r *pb.QoSRuleListRequest) (*QoSRuleListResponse, error) { + resp, err := QoS.remote.QoSRuleList(ctx, r, QoS.callOpts...) + return (*QoSRuleListResponse)(resp), toErr(ctx, err) +} diff --git a/clientv3/retry.go b/clientv3/retry.go index c4e84030308..465096b0c07 100644 --- a/clientv3/retry.go +++ b/clientv3/retry.go @@ -304,3 +304,42 @@ func (rac *retryAuthClient) RoleRevokePermission(ctx context.Context, in *pb.Aut func (rac *retryAuthClient) Authenticate(ctx context.Context, in *pb.AuthenticateRequest, opts ...grpc.CallOption) (resp *pb.AuthenticateResponse, err error) { return rac.ac.Authenticate(ctx, in, opts...) } + +type retryQoSClient struct { + qos pb.QoSClient +} + +// RetryQoSClient implements a QoSClient. +func RetryQoSClient(c *Client) pb.QoSClient { + return &retryQoSClient{ + qos: pb.NewQoSClient(c.conn), + } +} + +func (rqs *retryQoSClient) QoSEnable(ctx context.Context, in *pb.QoSEnableRequest, opts ...grpc.CallOption) (resp *pb.QoSEnableResponse, err error) { + return rqs.qos.QoSEnable(ctx, in, append(opts, withRetryPolicy(repeatable))...) +} + +func (rqs *retryQoSClient) QoSDisable(ctx context.Context, in *pb.QoSDisableRequest, opts ...grpc.CallOption) (resp *pb.QoSDisableResponse, err error) { + return rqs.qos.QoSDisable(ctx, in, append(opts, withRetryPolicy(repeatable))...) +} + +func (rqs *retryQoSClient) QoSRuleAdd(ctx context.Context, in *pb.QoSRuleAddRequest, opts ...grpc.CallOption) (resp *pb.QoSRuleAddResponse, err error) { + return rqs.qos.QoSRuleAdd(ctx, in, append(opts, withRetryPolicy(repeatable))...) +} + +func (rqs *retryQoSClient) QoSRuleGet(ctx context.Context, in *pb.QoSRuleGetRequest, opts ...grpc.CallOption) (resp *pb.QoSRuleGetResponse, err error) { + return rqs.qos.QoSRuleGet(ctx, in, append(opts, withRetryPolicy(repeatable))...) +} + +func (rqs *retryQoSClient) QoSRuleUpdate(ctx context.Context, in *pb.QoSRuleUpdateRequest, opts ...grpc.CallOption) (resp *pb.QoSRuleUpdateResponse, err error) { + return rqs.qos.QoSRuleUpdate(ctx, in, append(opts, withRetryPolicy(repeatable))...) +} + +func (rqs *retryQoSClient) QoSRuleDelete(ctx context.Context, in *pb.QoSRuleDeleteRequest, opts ...grpc.CallOption) (resp *pb.QoSRuleDeleteResponse, err error) { + return rqs.qos.QoSRuleDelete(ctx, in, append(opts, withRetryPolicy(repeatable))...) +} + +func (rqs *retryQoSClient) QoSRuleList(ctx context.Context, in *pb.QoSRuleListRequest, opts ...grpc.CallOption) (resp *pb.QoSRuleListResponse, err error) { + return rqs.qos.QoSRuleList(ctx, in, append(opts, withRetryPolicy(repeatable))...) +} diff --git a/etcdctl/ctlv3/command/printer.go b/etcdctl/ctlv3/command/printer.go index 2bb6086c838..aeed319920f 100644 --- a/etcdctl/ctlv3/command/printer.go +++ b/etcdctl/ctlv3/command/printer.go @@ -69,6 +69,14 @@ type printer interface { UserDelete(user string, r v3.AuthUserDeleteResponse) AuthStatus(r v3.AuthStatusResponse) + + QoSEnable(r v3.QoSEnableResponse) + QoSDisable(r v3.QoSDisableResponse) + QoSRuleAdd(r v3.QoSRuleAddResponse) + QoSRuleUpdate(r v3.QoSRuleUpdateResponse) + QoSRuleGet(r v3.QoSRuleGetResponse) + QoSRuleDelete(r v3.QoSRuleDeleteResponse) + QoSRuleList(r v3.QoSRuleListResponse) } func NewPrinter(printerType string, isHex bool) printer { diff --git a/etcdctl/ctlv3/command/printer_simple.go b/etcdctl/ctlv3/command/printer_simple.go index 1ed5c21daba..fb481b39468 100644 --- a/etcdctl/ctlv3/command/printer_simple.go +++ b/etcdctl/ctlv3/command/printer_simple.go @@ -23,6 +23,7 @@ import ( "go.etcd.io/etcd/v3/clientv3/snapshot" pb "go.etcd.io/etcd/v3/etcdserver/etcdserverpb" "go.etcd.io/etcd/v3/pkg/types" + "go.etcd.io/etcd/v3/qos/qospb" ) type simplePrinter struct { @@ -290,3 +291,46 @@ func (s *simplePrinter) AuthStatus(r v3.AuthStatusResponse) { fmt.Println("Authentication Status:", r.Enabled) fmt.Println("AuthRevision:", r.AuthRevision) } + +func (s *simplePrinter) QoSEnable(r v3.QoSEnableResponse) { + fmt.Println("qos enabled") +} + +func (s *simplePrinter) QoSDisable(r v3.QoSDisableResponse) { + fmt.Println("qos disabled") +} + +func (s *simplePrinter) QoSRuleAdd(r v3.QoSRuleAddResponse) { + fmt.Println("qos rule added") +} + +func (s *simplePrinter) QoSRuleGet(r v3.QoSRuleGetResponse) { + s.printQoSRule(r.QosRule) +} + +func (s *simplePrinter) printQoSRule(r *qospb.QoSRule) { + fmt.Printf("name:%s\n", r.RuleName) + fmt.Printf("subject name:%s\n", r.Subject.Name) + fmt.Printf("subject prefix:%s\n", r.Subject.Prefix) + fmt.Printf("rule type:%s\n", r.RuleType) + fmt.Printf("qps:%d\n", r.Qps) + fmt.Printf("ratelimiter:%s\n", r.Ratelimiter) + fmt.Printf("priority:%d\n", r.Priority) + fmt.Printf("threshold:%d\n", r.Threshold) + fmt.Printf("condition:%s\n", r.Condition) + fmt.Println("---------------------------") +} + +func (s *simplePrinter) QoSRuleUpdate(r v3.QoSRuleUpdateResponse) { + fmt.Println("qos rule updated") +} + +func (s *simplePrinter) QoSRuleDelete(r v3.QoSRuleDeleteResponse) { + fmt.Println("qos rule deleted") +} + +func (s *simplePrinter) QoSRuleList(r v3.QoSRuleListResponse) { + for _, rule := range r.QosRules { + s.printQoSRule(rule) + } +} diff --git a/etcdctl/ctlv3/command/qos_command.go b/etcdctl/ctlv3/command/qos_command.go new file mode 100644 index 00000000000..981685a9c52 --- /dev/null +++ b/etcdctl/ctlv3/command/qos_command.go @@ -0,0 +1,285 @@ +// Copyright 2016 The etcd Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package command + +import ( + "fmt" + "strconv" + + pb "go.etcd.io/etcd/v3/etcdserver/etcdserverpb" + "go.etcd.io/etcd/v3/qos" + "go.etcd.io/etcd/v3/qos/qospb" + + "github.com/spf13/cobra" +) + +// NewQoSCommand returns the cobra command for "qos". +func NewQoSCommand() *cobra.Command { + qc := &cobra.Command{ + Use: "qos ", + Short: "qos related commands", + } + qc.AddCommand(NewQoSEnableCommand()) + qc.AddCommand(NewQoSDisableCommand()) + qc.AddCommand(NewQoSAddCommand()) + qc.AddCommand(NewQoSDeleteCommand()) + qc.AddCommand(NewQoSUpdateCommand()) + qc.AddCommand(NewQoSGetCommand()) + qc.AddCommand(NewQoSListCommand()) + + return qc +} + +var helpdoc = ` +add,update the QoS Rule into the store. +rule name is the unique name of a qos rule,you can get/update/delete qos rule by name. +rule type supports gRPCMethod,slowquery,traffic,custom. +subject supports gRPCMethod(such as Range,Put,Txn,Authenticate) and RangeKeyNum,DBUsedByte. +key prefix,if it is not empty, the rule will only take effect when the user key matches it.. +qps indicates the maximum number of requests allowed to pass. +ratelimiter supports TokenBucket,MaxInflight,etc. +priority indicates the priority of this rule,when a request satisfies multiple rules, the rule with the highest priority is selected. +threshold indicates rule will take affect when subject(RangeKeyNum,DBUsedByte) > threshold,it runs more fastly than condition expr. +condition supports complex expression.it supports following key words,RangeKeyNum,DBUsedByte,gRPCMethod,key and prefix function. +RangeKeyNum: the total number of keys traversed by the query request +DBUsedByte: the bytes of backend db used. + +for example: +$ etcdctl qos add/update rule-gRPCMethod-1 gRPCMethod Range /prefix 100 TokenBucket 1 0 "" +$ etcdctl qos add/update rule-slowquery-1 slowquery RangeKeyNum "" 100 MaxInflight 9 1000 "" +$ etcdctl qos add/update rule-custom-1 custom "" "" 100 TokenBucket 2 0 'DBUsedByte > 4096 && prefix(key,"/config") && gRPCMethod == "Put"' +` + +// NewQoSAddCommand returns the cobra command for "qos add". +func NewQoSAddCommand() *cobra.Command { + cc := &cobra.Command{ + Use: "add ", + Short: "adds a qos rule into the cluster", + Long: helpdoc, + Run: QoSAddCommandFunc, + } + + return cc +} + +// NewQoSDeleteCommand returns the cobra command for "qos delete". +func NewQoSDeleteCommand() *cobra.Command { + cc := &cobra.Command{ + Use: "delete ", + Short: "deletes a qos rule from the cluster", + + Run: QoSDeleteCommandFunc, + } + + return cc +} + +// NewQoSUpdateCommand returns the cobra command for "qos update". +func NewQoSUpdateCommand() *cobra.Command { + cc := &cobra.Command{ + Use: "update ", + Short: "updates a qos rule in the cluster", + Long: helpdoc, + Run: QoSUpdateCommandFunc, + } + + return cc +} + +// NewQoSListCommand returns the cobra command for "qos list". +func NewQoSListCommand() *cobra.Command { + cc := &cobra.Command{ + Use: "list", + Short: "Lists all qos rules in the cluster", + Run: QoSListCommandFunc, + } + + return cc +} + +// NewQoSEnableCommand enable qos feature. +func NewQoSEnableCommand() *cobra.Command { + cc := &cobra.Command{ + Use: "enable", + Short: "enable qos feature", + Run: QoSEnableCommandFunc, + } + return cc +} + +// NewQoSDisableCommand disable qos feature. +func NewQoSDisableCommand() *cobra.Command { + cc := &cobra.Command{ + Use: "disable", + Short: "disable qos feature", + Run: QoSDisableCommandFunc, + } + return cc +} + +// NewQoSGetCommand get qos rule. +func NewQoSGetCommand() *cobra.Command { + cc := &cobra.Command{ + Use: "get ", + Short: "get qos rule", + Run: QoSGetRuleCommandFunc, + } + return cc +} + +// QoSEnableCommandFunc executes the "qos enable" command. +func QoSEnableCommandFunc(cmd *cobra.Command, args []string) { + ctx, cancel := commandCtx(cmd) + resp, err := mustClientFromCmd(cmd).QoS.QoSEnable(ctx, &pb.QoSEnableRequest{}) + cancel() + if err != nil { + ExitWithError(ExitError, err) + } + display.QoSEnable(*resp) +} + +// QoSDisableCommandFunc executes the "qos disable" command. +func QoSDisableCommandFunc(cmd *cobra.Command, args []string) { + ctx, cancel := commandCtx(cmd) + resp, err := mustClientFromCmd(cmd).QoS.QoSDisable(ctx, &pb.QoSDisableRequest{}) + cancel() + if err != nil { + ExitWithError(ExitError, err) + } + display.QoSDisable(*resp) +} + +// QoSAddCommandFunc executes the "qos add" command. +func QoSAddCommandFunc(cmd *cobra.Command, args []string) { + if len(args) <= 5 { + err := fmt.Errorf("qos add requires at least four argument,please see help doc(-h)") + ExitWithError(ExitBadArgs, err) + } + rule := parseQoSRuleFromArgv(args) + ctx, cancel := commandCtx(cmd) + resp, err := mustClientFromCmd(cmd).QoS.QoSRuleAdd(ctx, &pb.QoSRuleAddRequest{QosRule: rule}) + cancel() + if err != nil { + ExitWithError(ExitError, err) + } + display.QoSRuleAdd(*resp) +} + +// QoSGetRuleCommandFunc executes the "qos get" command. +func QoSGetRuleCommandFunc(cmd *cobra.Command, args []string) { + if len(args) != 1 { + err := fmt.Errorf("qos get requires exactly one argument") + ExitWithError(ExitBadArgs, err) + } + ruleName := args[0] + ctx, cancel := commandCtx(cmd) + resp, err := mustClientFromCmd(cmd).QoS.QoSRuleGet(ctx, &pb.QoSRuleGetRequest{RuleName: ruleName}) + cancel() + if err != nil { + ExitWithError(ExitError, err) + } + display.QoSRuleGet(*resp) +} + +// QoSDeleteCommandFunc executes the "qos delete" command. +func QoSDeleteCommandFunc(cmd *cobra.Command, args []string) { + if len(args) != 1 { + err := fmt.Errorf("qos delete requires exactly one argument") + ExitWithError(ExitBadArgs, err) + } + ruleName := args[0] + ctx, cancel := commandCtx(cmd) + resp, err := mustClientFromCmd(cmd).QoS.QoSRuleDelete(ctx, &pb.QoSRuleDeleteRequest{RuleName: ruleName}) + cancel() + if err != nil { + ExitWithError(ExitError, err) + } + display.QoSRuleDelete(*resp) +} + +// QoSUpdateCommandFunc executes the "qos update" command. +func QoSUpdateCommandFunc(cmd *cobra.Command, args []string) { + if len(args) <= 5 { + err := fmt.Errorf("qos update requires at least five argument,please see help doc(-h)") + ExitWithError(ExitBadArgs, err) + } + rule := parseQoSRuleFromArgv(args) + ctx, cancel := commandCtx(cmd) + resp, err := mustClientFromCmd(cmd).QoS.QoSRuleUpdate(ctx, &pb.QoSRuleUpdateRequest{QosRule: rule}) + cancel() + if err != nil { + ExitWithError(ExitError, err) + } + display.QoSRuleUpdate(*resp) +} + +// QoSListCommandFunc executes the "qos list" command. +func QoSListCommandFunc(cmd *cobra.Command, args []string) { + ctx, cancel := commandCtx(cmd) + resp, err := mustClientFromCmd(cmd).QoS.QoSRuleList(ctx, &pb.QoSRuleListRequest{}) + cancel() + if err != nil { + ExitWithError(ExitError, err) + } + display.QoSRuleList(*resp) + +} + +func parseInt(arg string) int { + num, err := strconv.Atoi(arg) + if err != nil { + ExitWithError(ExitBadArgs, err) + } + return num +} + +func parseQoSRuleFromArgv(args []string) *qospb.QoSRule { + //add/update + ruleName := args[0] + if ruleType := qos.QoSRuleType(args[1]); ruleType != qos.RuleTypeGRPCMethod && + ruleType != qos.RuleTypeSlowQuery && + ruleType != qos.RuleTypeTraffic && + ruleType != qos.RuleTypeCustom { + err := fmt.Errorf("rule type %s is invalid,please see qos help doc", args[1]) + ExitWithError(ExitBadArgs, err) + } + subjectName := args[2] + prefix := args[3] + qps := parseInt(args[4]) + rule := &qospb.QoSRule{RuleName: ruleName, + RuleType: args[1], + Subject: &qospb.Subject{Name: subjectName, Prefix: prefix}, + Qps: uint64(qps), + } + if len(args) > 5 { + rule.Ratelimiter = args[5] + } else { + rule.Ratelimiter = qos.RateLimiterTokenBucket + } + if len(args) > 6 { + rule.Priority = uint64(parseInt(args[6])) + if rule.Priority < 0 || rule.Priority > 9 { + err := fmt.Errorf("rule priority %d is invalid,it should be in [0,9]", rule.Priority) + ExitWithError(ExitBadArgs, err) + } + } + if len(args) > 7 { + rule.Threshold = uint64(parseInt(args[7])) + } + if len(args) > 8 { + rule.Condition = args[8] + } + return rule +} diff --git a/etcdctl/ctlv3/ctl.go b/etcdctl/ctlv3/ctl.go index e16e8e3c287..5c42a863931 100644 --- a/etcdctl/ctlv3/ctl.go +++ b/etcdctl/ctlv3/ctl.go @@ -92,6 +92,7 @@ func init() { command.NewUserCommand(), command.NewRoleCommand(), command.NewCheckCommand(), + command.NewQoSCommand(), ) } diff --git a/etcdserver/api/v3rpc/grpc.go b/etcdserver/api/v3rpc/grpc.go index 2e991074665..796bc746b1a 100644 --- a/etcdserver/api/v3rpc/grpc.go +++ b/etcdserver/api/v3rpc/grpc.go @@ -62,6 +62,7 @@ func Server(s *etcdserver.EtcdServer, tls *tls.Config, gopts ...grpc.ServerOptio pb.RegisterClusterServer(grpcServer, NewClusterServer(s)) pb.RegisterAuthServer(grpcServer, NewAuthServer(s)) pb.RegisterMaintenanceServer(grpcServer, NewMaintenanceServer(s)) + pb.RegisterQoSServer(grpcServer, NewQoSServer(s)) // server should register all the services manually // use empty service name for all etcd services' health status, diff --git a/etcdserver/api/v3rpc/qos.go b/etcdserver/api/v3rpc/qos.go new file mode 100644 index 00000000000..4986d8ddb40 --- /dev/null +++ b/etcdserver/api/v3rpc/qos.go @@ -0,0 +1,86 @@ +// Copyright 2016 The etcd QoSors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package v3rpc + +import ( + "context" + + "go.etcd.io/etcd/v3/etcdserver" + pb "go.etcd.io/etcd/v3/etcdserver/etcdserverpb" +) + +type QoSServer struct { + qos etcdserver.QoS +} + +func NewQoSServer(s *etcdserver.EtcdServer) *QoSServer { + return &QoSServer{qos: s} +} + +func (as *QoSServer) QoSEnable(ctx context.Context, r *pb.QoSEnableRequest) (*pb.QoSEnableResponse, error) { + resp, err := as.qos.QoSEnable(ctx, r) + if err != nil { + return nil, togRPCError(err) + } + return resp, nil +} + +func (as *QoSServer) QoSDisable(ctx context.Context, r *pb.QoSDisableRequest) (*pb.QoSDisableResponse, error) { + resp, err := as.qos.QoSDisable(ctx, r) + if err != nil { + return nil, togRPCError(err) + } + return resp, nil +} + +func (as *QoSServer) QoSRuleAdd(ctx context.Context, r *pb.QoSRuleAddRequest) (*pb.QoSRuleAddResponse, error) { + resp, err := as.qos.QoSRuleAdd(ctx, r) + if err != nil { + return nil, togRPCError(err) + } + return resp, nil +} + +func (as *QoSServer) QoSRuleGet(ctx context.Context, r *pb.QoSRuleGetRequest) (*pb.QoSRuleGetResponse, error) { + resp, err := as.qos.QoSRuleGet(ctx, r) + if err != nil { + return nil, togRPCError(err) + } + return resp, nil +} + +func (as *QoSServer) QoSRuleUpdate(ctx context.Context, r *pb.QoSRuleUpdateRequest) (*pb.QoSRuleUpdateResponse, error) { + resp, err := as.qos.QoSRuleUpdate(ctx, r) + if err != nil { + return nil, togRPCError(err) + } + return resp, nil +} + +func (as *QoSServer) QoSRuleDelete(ctx context.Context, r *pb.QoSRuleDeleteRequest) (*pb.QoSRuleDeleteResponse, error) { + resp, err := as.qos.QoSRuleDelete(ctx, r) + if err != nil { + return nil, togRPCError(err) + } + return resp, nil +} + +func (as *QoSServer) QoSRuleList(ctx context.Context, r *pb.QoSRuleListRequest) (*pb.QoSRuleListResponse, error) { + resp, err := as.qos.QoSRuleList(ctx, r) + if err != nil { + return nil, togRPCError(err) + } + return resp, nil +} diff --git a/etcdserver/apply.go b/etcdserver/apply.go index 201486a71af..228ec1b2e4b 100644 --- a/etcdserver/apply.go +++ b/etcdserver/apply.go @@ -94,6 +94,14 @@ type applierV3 interface { RoleDelete(ua *pb.AuthRoleDeleteRequest) (*pb.AuthRoleDeleteResponse, error) UserList(ua *pb.AuthUserListRequest) (*pb.AuthUserListResponse, error) RoleList(ua *pb.AuthRoleListRequest) (*pb.AuthRoleListResponse, error) + + QoSEnable(*pb.QoSEnableRequest) (*pb.QoSEnableResponse, error) + QoSDisable(*pb.QoSDisableRequest) (*pb.QoSDisableResponse, error) + QoSRuleAdd(*pb.QoSRuleAddRequest) (*pb.QoSRuleAddResponse, error) + QoSRuleGet(*pb.QoSRuleGetRequest) (*pb.QoSRuleGetResponse, error) + QoSRuleDelete(*pb.QoSRuleDeleteRequest) (*pb.QoSRuleDeleteResponse, error) + QoSRuleUpdate(*pb.QoSRuleUpdateRequest) (*pb.QoSRuleUpdateResponse, error) + QoSRuleList(*pb.QoSRuleListRequest) (*pb.QoSRuleListResponse, error) } type checkReqFunc func(mvcc.ReadView, *pb.RequestOp) error @@ -198,6 +206,20 @@ func (a *applierV3backend) Apply(r *pb.InternalRaftRequest) *applyResult { a.s.applyV3Internal.ClusterMemberAttrSet(r.ClusterMemberAttrSet) case r.DowngradeInfoSet != nil: a.s.applyV3Internal.DowngradeInfoSet(r.DowngradeInfoSet) + case r.QosEnable != nil: + ar.resp, ar.err = a.s.applyV3.QoSEnable(r.QosEnable) + case r.QosDisable != nil: + ar.resp, ar.err = a.s.applyV3.QoSDisable(r.QosDisable) + case r.QosRuleAdd != nil: + ar.resp, ar.err = a.s.applyV3.QoSRuleAdd(r.QosRuleAdd) + case r.QosRuleGet != nil: + ar.resp, ar.err = a.s.applyV3.QoSRuleGet(r.QosRuleGet) + case r.QosRuleList != nil: + ar.resp, ar.err = a.s.applyV3.QoSRuleList(r.QosRuleList) + case r.QosRuleUpdate != nil: + ar.resp, ar.err = a.s.applyV3.QoSRuleUpdate(r.QosRuleUpdate) + case r.QosRuleDelete != nil: + ar.resp, ar.err = a.s.applyV3.QoSRuleDelete(r.QosRuleDelete) default: panic("not implemented") } @@ -1095,3 +1117,59 @@ func newHeader(s *EtcdServer) *pb.ResponseHeader { RaftTerm: s.Term(), } } + +func (a *applierV3backend) QoSEnable(r *pb.QoSEnableRequest) (*pb.QoSEnableResponse, error) { + err := a.s.QoSStore().QoSEnable(r) + if err != nil { + return nil, err + } + return &pb.QoSEnableResponse{Header: newHeader(a.s)}, nil +} + +func (a *applierV3backend) QoSDisable(r *pb.QoSDisableRequest) (*pb.QoSDisableResponse, error) { + err := a.s.QoSStore().QoSDisable(r) + if err != nil { + return nil, err + } + return &pb.QoSDisableResponse{Header: newHeader(a.s)}, nil +} + +func (a *applierV3backend) QoSRuleAdd(r *pb.QoSRuleAddRequest) (*pb.QoSRuleAddResponse, error) { + resp, err := a.s.QoSStore().QoSRuleAdd(r) + if resp != nil { + resp.Header = newHeader(a.s) + } + return resp, err +} + +func (a *applierV3backend) QoSRuleUpdate(r *pb.QoSRuleUpdateRequest) (*pb.QoSRuleUpdateResponse, error) { + resp, err := a.s.QoSStore().QoSRuleUpdate(r) + if resp != nil { + resp.Header = newHeader(a.s) + } + return resp, err +} + +func (a *applierV3backend) QoSRuleDelete(r *pb.QoSRuleDeleteRequest) (*pb.QoSRuleDeleteResponse, error) { + resp, err := a.s.QoSStore().QoSRuleDelete(r) + if resp != nil { + resp.Header = newHeader(a.s) + } + return resp, err +} + +func (a *applierV3backend) QoSRuleGet(r *pb.QoSRuleGetRequest) (*pb.QoSRuleGetResponse, error) { + resp, err := a.s.QoSStore().QoSRuleGet(r) + if resp != nil { + resp.Header = newHeader(a.s) + } + return resp, err +} + +func (a *applierV3backend) QoSRuleList(r *pb.QoSRuleListRequest) (*pb.QoSRuleListResponse, error) { + resp, err := a.s.QoSStore().QoSRuleList(r) + if resp != nil { + resp.Header = newHeader(a.s) + } + return resp, err +} diff --git a/etcdserver/etcdserverpb/etcdserver.pb.go b/etcdserver/etcdserverpb/etcdserver.pb.go index 6e0b76c2e7a..529104e2507 100644 --- a/etcdserver/etcdserverpb/etcdserver.pb.go +++ b/etcdserver/etcdserverpb/etcdserver.pb.go @@ -111,6 +111,20 @@ AuthRoleDeleteResponse AuthRoleGrantPermissionResponse AuthRoleRevokePermissionResponse + QoSEnableRequest + QoSDisableRequest + QoSEnableResponse + QoSDisableResponse + QoSRuleAddRequest + QoSRuleAddResponse + QoSRuleDeleteRequest + QoSRuleDeleteResponse + QoSRuleGetRequest + QoSRuleGetResponse + QoSRuleUpdateRequest + QoSRuleUpdateResponse + QoSRuleListRequest + QoSRuleListResponse */ package etcdserverpb diff --git a/etcdserver/etcdserverpb/gw/rpc.pb.gw.go b/etcdserver/etcdserverpb/gw/rpc.pb.gw.go index 5b1f7eba277..f9480414cd7 100644 --- a/etcdserver/etcdserverpb/gw/rpc.pb.gw.go +++ b/etcdserver/etcdserverpb/gw/rpc.pb.gw.go @@ -687,6 +687,97 @@ func request_Auth_RoleRevokePermission_0(ctx context.Context, marshaler runtime. } +func request_QoS_QoSEnable_0(ctx context.Context, marshaler runtime.Marshaler, client etcdserverpb.QoSClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq etcdserverpb.QoSEnableRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.QoSEnable(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func request_QoS_QoSDisable_0(ctx context.Context, marshaler runtime.Marshaler, client etcdserverpb.QoSClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq etcdserverpb.QoSDisableRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.QoSDisable(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func request_QoS_QoSRuleAdd_0(ctx context.Context, marshaler runtime.Marshaler, client etcdserverpb.QoSClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq etcdserverpb.QoSRuleAddRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.QoSRuleAdd(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func request_QoS_QoSRuleGet_0(ctx context.Context, marshaler runtime.Marshaler, client etcdserverpb.QoSClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq etcdserverpb.QoSRuleGetRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.QoSRuleGet(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func request_QoS_QoSRuleDelete_0(ctx context.Context, marshaler runtime.Marshaler, client etcdserverpb.QoSClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq etcdserverpb.QoSRuleDeleteRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.QoSRuleDelete(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func request_QoS_QoSRuleUpdate_0(ctx context.Context, marshaler runtime.Marshaler, client etcdserverpb.QoSClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq etcdserverpb.QoSRuleUpdateRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.QoSRuleUpdate(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func request_QoS_QoSRuleList_0(ctx context.Context, marshaler runtime.Marshaler, client etcdserverpb.QoSClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq etcdserverpb.QoSRuleListRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.QoSRuleList(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + // RegisterKVHandlerFromEndpoint is same as RegisterKVHandler but // automatically dials to "endpoint" and closes the connection when "ctx" gets done. func RegisterKVHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { @@ -2408,3 +2499,279 @@ var ( forward_Auth_RoleRevokePermission_0 = runtime.ForwardResponseMessage ) + +// RegisterQoSHandlerFromEndpoint is same as RegisterQoSHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterQoSHandlerFromEndpoint(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.Printf("Failed to close conn to %s: %v", endpoint, cerr) + } + return + } + go func() { + <-ctx.Done() + if cerr := conn.Close(); cerr != nil { + grpclog.Printf("Failed to close conn to %s: %v", endpoint, cerr) + } + }() + }() + + return RegisterQoSHandler(ctx, mux, conn) +} + +// RegisterQoSHandler registers the http handlers for service QoS to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterQoSHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + return RegisterQoSHandlerClient(ctx, mux, etcdserverpb.NewQoSClient(conn)) +} + +// RegisterQoSHandler registers the http handlers for service QoS to "mux". +// The handlers forward requests to the grpc endpoint over the given implementation of "QoSClient". +// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "QoSClient" +// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in +// "QoSClient" to call the correct interceptors. +func RegisterQoSHandlerClient(ctx context.Context, mux *runtime.ServeMux, client etcdserverpb.QoSClient) error { + + mux.Handle("POST", pattern_QoS_QoSEnable_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + if cn, ok := w.(http.CloseNotifier); ok { + go func(done <-chan struct{}, closed <-chan bool) { + select { + case <-done: + case <-closed: + cancel() + } + }(ctx.Done(), cn.CloseNotify()) + } + 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_QoS_QoSEnable_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_QoS_QoSEnable_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_QoS_QoSDisable_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + if cn, ok := w.(http.CloseNotifier); ok { + go func(done <-chan struct{}, closed <-chan bool) { + select { + case <-done: + case <-closed: + cancel() + } + }(ctx.Done(), cn.CloseNotify()) + } + 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_QoS_QoSDisable_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_QoS_QoSDisable_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_QoS_QoSRuleAdd_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + if cn, ok := w.(http.CloseNotifier); ok { + go func(done <-chan struct{}, closed <-chan bool) { + select { + case <-done: + case <-closed: + cancel() + } + }(ctx.Done(), cn.CloseNotify()) + } + 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_QoS_QoSRuleAdd_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_QoS_QoSRuleAdd_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_QoS_QoSRuleGet_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + if cn, ok := w.(http.CloseNotifier); ok { + go func(done <-chan struct{}, closed <-chan bool) { + select { + case <-done: + case <-closed: + cancel() + } + }(ctx.Done(), cn.CloseNotify()) + } + 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_QoS_QoSRuleGet_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_QoS_QoSRuleGet_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_QoS_QoSRuleDelete_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + if cn, ok := w.(http.CloseNotifier); ok { + go func(done <-chan struct{}, closed <-chan bool) { + select { + case <-done: + case <-closed: + cancel() + } + }(ctx.Done(), cn.CloseNotify()) + } + 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_QoS_QoSRuleDelete_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_QoS_QoSRuleDelete_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_QoS_QoSRuleUpdate_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + if cn, ok := w.(http.CloseNotifier); ok { + go func(done <-chan struct{}, closed <-chan bool) { + select { + case <-done: + case <-closed: + cancel() + } + }(ctx.Done(), cn.CloseNotify()) + } + 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_QoS_QoSRuleUpdate_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_QoS_QoSRuleUpdate_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_QoS_QoSRuleList_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + if cn, ok := w.(http.CloseNotifier); ok { + go func(done <-chan struct{}, closed <-chan bool) { + select { + case <-done: + case <-closed: + cancel() + } + }(ctx.Done(), cn.CloseNotify()) + } + 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_QoS_QoSRuleList_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_QoS_QoSRuleList_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +var ( + pattern_QoS_QoSEnable_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v3", "qos", "enable"}, "")) + + pattern_QoS_QoSDisable_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v3", "qos", "disable"}, "")) + + pattern_QoS_QoSRuleAdd_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v3", "qos", "rule", "add"}, "")) + + pattern_QoS_QoSRuleGet_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v3", "qos", "rule", "get"}, "")) + + pattern_QoS_QoSRuleDelete_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v3", "qos", "rule", "delete"}, "")) + + pattern_QoS_QoSRuleUpdate_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v3", "qos", "rule", "update"}, "")) + + pattern_QoS_QoSRuleList_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v3", "qos", "rule", "list"}, "")) +) + +var ( + forward_QoS_QoSEnable_0 = runtime.ForwardResponseMessage + + forward_QoS_QoSDisable_0 = runtime.ForwardResponseMessage + + forward_QoS_QoSRuleAdd_0 = runtime.ForwardResponseMessage + + forward_QoS_QoSRuleGet_0 = runtime.ForwardResponseMessage + + forward_QoS_QoSRuleDelete_0 = runtime.ForwardResponseMessage + + forward_QoS_QoSRuleUpdate_0 = runtime.ForwardResponseMessage + + forward_QoS_QoSRuleList_0 = runtime.ForwardResponseMessage +) diff --git a/etcdserver/etcdserverpb/raft_internal.pb.go b/etcdserver/etcdserverpb/raft_internal.pb.go index c8dad53a0cb..0a39aa08065 100644 --- a/etcdserver/etcdserverpb/raft_internal.pb.go +++ b/etcdserver/etcdserverpb/raft_internal.pb.go @@ -70,6 +70,13 @@ type InternalRaftRequest struct { ClusterVersionSet *membershippb.ClusterVersionSetRequest `protobuf:"bytes,1300,opt,name=cluster_version_set,json=clusterVersionSet" json:"cluster_version_set,omitempty"` ClusterMemberAttrSet *membershippb.ClusterMemberAttrSetRequest `protobuf:"bytes,1301,opt,name=cluster_member_attr_set,json=clusterMemberAttrSet" json:"cluster_member_attr_set,omitempty"` DowngradeInfoSet *membershippb.DowngradeInfoSetRequest `protobuf:"bytes,1302,opt,name=downgrade_info_set,json=downgradeInfoSet" json:"downgrade_info_set,omitempty"` + QosEnable *QoSEnableRequest `protobuf:"bytes,1400,opt,name=qos_enable,json=qosEnable" json:"qos_enable,omitempty"` + QosDisable *QoSDisableRequest `protobuf:"bytes,1401,opt,name=qos_disable,json=qosDisable" json:"qos_disable,omitempty"` + QosRuleAdd *QoSRuleAddRequest `protobuf:"bytes,1402,opt,name=qos_rule_add,json=qosRuleAdd" json:"qos_rule_add,omitempty"` + QosRuleUpdate *QoSRuleUpdateRequest `protobuf:"bytes,1403,opt,name=qos_rule_update,json=qosRuleUpdate" json:"qos_rule_update,omitempty"` + QosRuleDelete *QoSRuleDeleteRequest `protobuf:"bytes,1404,opt,name=qos_rule_delete,json=qosRuleDelete" json:"qos_rule_delete,omitempty"` + QosRuleGet *QoSRuleGetRequest `protobuf:"bytes,1405,opt,name=qos_rule_get,json=qosRuleGet" json:"qos_rule_get,omitempty"` + QosRuleList *QoSRuleListRequest `protobuf:"bytes,1406,opt,name=qos_rule_list,json=qosRuleList" json:"qos_rule_list,omitempty"` } func (m *InternalRaftRequest) Reset() { *m = InternalRaftRequest{} } @@ -514,6 +521,90 @@ func (m *InternalRaftRequest) MarshalTo(dAtA []byte) (int, error) { } i += n31 } + if m.QosEnable != nil { + dAtA[i] = 0xc2 + i++ + dAtA[i] = 0x57 + i++ + i = encodeVarintRaftInternal(dAtA, i, uint64(m.QosEnable.Size())) + n32, err := m.QosEnable.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n32 + } + if m.QosDisable != nil { + dAtA[i] = 0xca + i++ + dAtA[i] = 0x57 + i++ + i = encodeVarintRaftInternal(dAtA, i, uint64(m.QosDisable.Size())) + n33, err := m.QosDisable.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n33 + } + if m.QosRuleAdd != nil { + dAtA[i] = 0xd2 + i++ + dAtA[i] = 0x57 + i++ + i = encodeVarintRaftInternal(dAtA, i, uint64(m.QosRuleAdd.Size())) + n34, err := m.QosRuleAdd.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n34 + } + if m.QosRuleUpdate != nil { + dAtA[i] = 0xda + i++ + dAtA[i] = 0x57 + i++ + i = encodeVarintRaftInternal(dAtA, i, uint64(m.QosRuleUpdate.Size())) + n35, err := m.QosRuleUpdate.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n35 + } + if m.QosRuleDelete != nil { + dAtA[i] = 0xe2 + i++ + dAtA[i] = 0x57 + i++ + i = encodeVarintRaftInternal(dAtA, i, uint64(m.QosRuleDelete.Size())) + n36, err := m.QosRuleDelete.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n36 + } + if m.QosRuleGet != nil { + dAtA[i] = 0xea + i++ + dAtA[i] = 0x57 + i++ + i = encodeVarintRaftInternal(dAtA, i, uint64(m.QosRuleGet.Size())) + n37, err := m.QosRuleGet.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n37 + } + if m.QosRuleList != nil { + dAtA[i] = 0xf2 + i++ + dAtA[i] = 0x57 + i++ + i = encodeVarintRaftInternal(dAtA, i, uint64(m.QosRuleList.Size())) + n38, err := m.QosRuleList.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n38 + } return i, nil } @@ -726,6 +817,34 @@ func (m *InternalRaftRequest) Size() (n int) { l = m.DowngradeInfoSet.Size() n += 2 + l + sovRaftInternal(uint64(l)) } + if m.QosEnable != nil { + l = m.QosEnable.Size() + n += 2 + l + sovRaftInternal(uint64(l)) + } + if m.QosDisable != nil { + l = m.QosDisable.Size() + n += 2 + l + sovRaftInternal(uint64(l)) + } + if m.QosRuleAdd != nil { + l = m.QosRuleAdd.Size() + n += 2 + l + sovRaftInternal(uint64(l)) + } + if m.QosRuleUpdate != nil { + l = m.QosRuleUpdate.Size() + n += 2 + l + sovRaftInternal(uint64(l)) + } + if m.QosRuleDelete != nil { + l = m.QosRuleDelete.Size() + n += 2 + l + sovRaftInternal(uint64(l)) + } + if m.QosRuleGet != nil { + l = m.QosRuleGet.Size() + n += 2 + l + sovRaftInternal(uint64(l)) + } + if m.QosRuleList != nil { + l = m.QosRuleList.Size() + n += 2 + l + sovRaftInternal(uint64(l)) + } return n } @@ -1954,6 +2073,237 @@ func (m *InternalRaftRequest) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 1400: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field QosEnable", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRaftInternal + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthRaftInternal + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.QosEnable == nil { + m.QosEnable = &QoSEnableRequest{} + } + if err := m.QosEnable.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 1401: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field QosDisable", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRaftInternal + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthRaftInternal + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.QosDisable == nil { + m.QosDisable = &QoSDisableRequest{} + } + if err := m.QosDisable.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 1402: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field QosRuleAdd", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRaftInternal + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthRaftInternal + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.QosRuleAdd == nil { + m.QosRuleAdd = &QoSRuleAddRequest{} + } + if err := m.QosRuleAdd.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 1403: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field QosRuleUpdate", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRaftInternal + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthRaftInternal + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.QosRuleUpdate == nil { + m.QosRuleUpdate = &QoSRuleUpdateRequest{} + } + if err := m.QosRuleUpdate.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 1404: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field QosRuleDelete", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRaftInternal + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthRaftInternal + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.QosRuleDelete == nil { + m.QosRuleDelete = &QoSRuleDeleteRequest{} + } + if err := m.QosRuleDelete.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 1405: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field QosRuleGet", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRaftInternal + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthRaftInternal + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.QosRuleGet == nil { + m.QosRuleGet = &QoSRuleGetRequest{} + } + if err := m.QosRuleGet.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 1406: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field QosRuleList", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRaftInternal + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthRaftInternal + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.QosRuleList == nil { + m.QosRuleList = &QoSRuleListRequest{} + } + if err := m.QosRuleList.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipRaftInternal(dAtA[iNdEx:]) @@ -2270,69 +2620,77 @@ var ( func init() { proto.RegisterFile("raft_internal.proto", fileDescriptorRaftInternal) } var fileDescriptorRaftInternal = []byte{ - // 1010 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x96, 0x5b, 0x73, 0xdb, 0x44, - 0x14, 0xc7, 0x6b, 0x37, 0x4d, 0xe3, 0x75, 0x92, 0xa6, 0x9b, 0x94, 0x2e, 0xce, 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0x37, 0xb3, 0x5f, 0x2c, 0x73, - 0x37, 0xcb, 0x7f, 0xe3, 0x5b, 0x68, 0x99, 0x47, 0xa3, 0x2c, 0x06, 0x5f, 0xa4, 0xa7, 0xa0, 0xaf, - 0x66, 0x0d, 0xaf, 0xa9, 0xb5, 0x63, 0x29, 0xbd, 0xbb, 0xf1, 0xf4, 0xcf, 0xf6, 0xa5, 0xa7, 0xe7, - 0xed, 0xda, 0xb3, 0xf3, 0x76, 0xed, 0x8f, 0xf3, 0x76, 0xed, 0xeb, 0xbf, 0xda, 0x97, 0xfa, 0x8b, - 0xea, 0x62, 0x78, 0xef, 0xff, 0x00, 0x00, 0x00, 0xff, 0xff, 0xbd, 0x24, 0x2a, 0xcc, 0xae, 0x0a, - 0x00, 0x00, + // 1151 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x97, 0xdb, 0x72, 0x1b, 0x45, + 0x13, 0xc7, 0x23, 0xc7, 0x71, 0xac, 0x96, 0x4f, 0x19, 0x3b, 0xc9, 0x7c, 0x76, 0x95, 0x3e, 0xc7, + 0x21, 0x10, 0x4e, 0x36, 0xe5, 0xdc, 0x52, 0x80, 0x62, 0xb9, 0x1c, 0x17, 0x21, 0x38, 0x6b, 0x07, + 0xa8, 0xe2, 0x62, 0x19, 0xef, 0x8e, 0xa5, 0xc5, 0xab, 0xdd, 0xf5, 0xcc, 0xac, 0x62, 0xee, 0x78, + 0x08, 0xa0, 0x78, 0x0c, 0x4e, 0x0f, 0x91, 0x0b, 0x0e, 0x01, 0x5e, 0x00, 0xcc, 0x0d, 0xf7, 0x40, + 0x15, 0xe7, 0xa2, 0xe6, 0xb0, 0x27, 0x69, 0xa4, 0xbb, 0x55, 0xf7, 0xbf, 0x7f, 0x3d, 0x3d, 0xdb, + 0xbd, 0x33, 0x82, 0x45, 0x46, 0x8e, 0x84, 0x1b, 0x44, 0x82, 0xb2, 0x88, 0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0x5c, 0x75, 0xa5, + 0x91, 0xcc, 0xaa, 0x93, 0x13, 0xb9, 0x0d, 0xb3, 0x39, 0x43, 0x7d, 0xb8, 0xfe, 0x05, 0xdb, 0x60, + 0x1b, 0x48, 0xf9, 0xbb, 0xd5, 0x30, 0x14, 0x69, 0x5b, 0x9b, 0x87, 0xd9, 0xed, 0x5e, 0x22, 0xde, + 0x73, 0x28, 0x4f, 0xe2, 0x88, 0xd3, 0xb5, 0x04, 0x56, 0xc6, 0x9c, 0xe4, 0x08, 0xc1, 0xa4, 0xba, + 0x6f, 0xd7, 0xd4, 0x7d, 0x5b, 0x3d, 0xcb, 0x7b, 0x78, 0x7e, 0x3a, 0x99, 0x7b, 0x78, 0xf6, 0x1b, + 0x5d, 0x83, 0x19, 0x1e, 0xf4, 0x92, 0x90, 0xba, 0x22, 0x3e, 0xa6, 0xfa, 0x1a, 0x5e, 0x77, 0x1a, + 0xda, 0x76, 0x20, 0x4d, 0xb7, 0x97, 0x1e, 0xfd, 0xd8, 0x3c, 0xf7, 0xe8, 0xac, 0x59, 0x7b, 0x7c, + 0xd6, 0xac, 0xfd, 0x70, 0xd6, 0xac, 0x7d, 0xfc, 0x53, 0xf3, 0xdc, 0xe1, 0x94, 0xfa, 0x13, 0x70, + 0xeb, 0xbf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x8f, 0x7d, 0x6d, 0x30, 0x9a, 0x0c, 0x00, 0x00, } diff --git a/etcdserver/etcdserverpb/raft_internal.proto b/etcdserver/etcdserverpb/raft_internal.proto index b7f2f311f56..399a1224534 100644 --- a/etcdserver/etcdserverpb/raft_internal.proto +++ b/etcdserver/etcdserverpb/raft_internal.proto @@ -64,6 +64,15 @@ message InternalRaftRequest { membershippb.ClusterVersionSetRequest cluster_version_set = 1300; membershippb.ClusterMemberAttrSetRequest cluster_member_attr_set = 1301; membershippb.DowngradeInfoSetRequest downgrade_info_set = 1302; + + QoSEnableRequest qos_enable = 1400; + QoSDisableRequest qos_disable = 1401; + QoSRuleAddRequest qos_rule_add = 1402; + QoSRuleUpdateRequest qos_rule_update = 1403; + QoSRuleDeleteRequest qos_rule_delete = 1404; + QoSRuleGetRequest qos_rule_get = 1405; + QoSRuleListRequest qos_rule_list = 1406; + } message EmptyResponse { diff --git a/etcdserver/etcdserverpb/rpc.pb.go b/etcdserver/etcdserverpb/rpc.pb.go index a101ee7150c..3898309f7d3 100644 --- a/etcdserver/etcdserverpb/rpc.pb.go +++ b/etcdserver/etcdserverpb/rpc.pb.go @@ -16,6 +16,8 @@ import ( authpb "go.etcd.io/etcd/v3/auth/authpb" + qospb "go.etcd.io/etcd/v3/qos/qospb" + context "golang.org/x/net/context" grpc "google.golang.org/grpc" @@ -3469,6 +3471,222 @@ func (m *AuthRoleRevokePermissionResponse) GetHeader() *ResponseHeader { return nil } +type QoSEnableRequest struct { +} + +func (m *QoSEnableRequest) Reset() { *m = QoSEnableRequest{} } +func (m *QoSEnableRequest) String() string { return proto.CompactTextString(m) } +func (*QoSEnableRequest) ProtoMessage() {} +func (*QoSEnableRequest) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{95} } + +type QoSDisableRequest struct { +} + +func (m *QoSDisableRequest) Reset() { *m = QoSDisableRequest{} } +func (m *QoSDisableRequest) String() string { return proto.CompactTextString(m) } +func (*QoSDisableRequest) ProtoMessage() {} +func (*QoSDisableRequest) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{96} } + +type QoSEnableResponse struct { + Header *ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"` +} + +func (m *QoSEnableResponse) Reset() { *m = QoSEnableResponse{} } +func (m *QoSEnableResponse) String() string { return proto.CompactTextString(m) } +func (*QoSEnableResponse) ProtoMessage() {} +func (*QoSEnableResponse) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{97} } + +func (m *QoSEnableResponse) GetHeader() *ResponseHeader { + if m != nil { + return m.Header + } + return nil +} + +type QoSDisableResponse struct { + Header *ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"` +} + +func (m *QoSDisableResponse) Reset() { *m = QoSDisableResponse{} } +func (m *QoSDisableResponse) String() string { return proto.CompactTextString(m) } +func (*QoSDisableResponse) ProtoMessage() {} +func (*QoSDisableResponse) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{98} } + +func (m *QoSDisableResponse) GetHeader() *ResponseHeader { + if m != nil { + return m.Header + } + return nil +} + +type QoSRuleAddRequest struct { + QosRule *qospb.QoSRule `protobuf:"bytes,1,opt,name=qos_rule,json=qosRule" json:"qos_rule,omitempty"` +} + +func (m *QoSRuleAddRequest) Reset() { *m = QoSRuleAddRequest{} } +func (m *QoSRuleAddRequest) String() string { return proto.CompactTextString(m) } +func (*QoSRuleAddRequest) ProtoMessage() {} +func (*QoSRuleAddRequest) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{99} } + +func (m *QoSRuleAddRequest) GetQosRule() *qospb.QoSRule { + if m != nil { + return m.QosRule + } + return nil +} + +type QoSRuleAddResponse struct { + Header *ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"` +} + +func (m *QoSRuleAddResponse) Reset() { *m = QoSRuleAddResponse{} } +func (m *QoSRuleAddResponse) String() string { return proto.CompactTextString(m) } +func (*QoSRuleAddResponse) ProtoMessage() {} +func (*QoSRuleAddResponse) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{100} } + +func (m *QoSRuleAddResponse) GetHeader() *ResponseHeader { + if m != nil { + return m.Header + } + return nil +} + +type QoSRuleDeleteRequest struct { + RuleName string `protobuf:"bytes,1,opt,name=rule_name,json=ruleName,proto3" json:"rule_name,omitempty"` +} + +func (m *QoSRuleDeleteRequest) Reset() { *m = QoSRuleDeleteRequest{} } +func (m *QoSRuleDeleteRequest) String() string { return proto.CompactTextString(m) } +func (*QoSRuleDeleteRequest) ProtoMessage() {} +func (*QoSRuleDeleteRequest) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{101} } + +func (m *QoSRuleDeleteRequest) GetRuleName() string { + if m != nil { + return m.RuleName + } + return "" +} + +type QoSRuleDeleteResponse struct { + Header *ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"` +} + +func (m *QoSRuleDeleteResponse) Reset() { *m = QoSRuleDeleteResponse{} } +func (m *QoSRuleDeleteResponse) String() string { return proto.CompactTextString(m) } +func (*QoSRuleDeleteResponse) ProtoMessage() {} +func (*QoSRuleDeleteResponse) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{102} } + +func (m *QoSRuleDeleteResponse) GetHeader() *ResponseHeader { + if m != nil { + return m.Header + } + return nil +} + +type QoSRuleGetRequest struct { + RuleName string `protobuf:"bytes,1,opt,name=rule_name,json=ruleName,proto3" json:"rule_name,omitempty"` +} + +func (m *QoSRuleGetRequest) Reset() { *m = QoSRuleGetRequest{} } +func (m *QoSRuleGetRequest) String() string { return proto.CompactTextString(m) } +func (*QoSRuleGetRequest) ProtoMessage() {} +func (*QoSRuleGetRequest) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{103} } + +func (m *QoSRuleGetRequest) GetRuleName() string { + if m != nil { + return m.RuleName + } + return "" +} + +type QoSRuleGetResponse struct { + Header *ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"` + QosRule *qospb.QoSRule `protobuf:"bytes,2,opt,name=qos_rule,json=qosRule" json:"qos_rule,omitempty"` +} + +func (m *QoSRuleGetResponse) Reset() { *m = QoSRuleGetResponse{} } +func (m *QoSRuleGetResponse) String() string { return proto.CompactTextString(m) } +func (*QoSRuleGetResponse) ProtoMessage() {} +func (*QoSRuleGetResponse) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{104} } + +func (m *QoSRuleGetResponse) GetHeader() *ResponseHeader { + if m != nil { + return m.Header + } + return nil +} + +func (m *QoSRuleGetResponse) GetQosRule() *qospb.QoSRule { + if m != nil { + return m.QosRule + } + return nil +} + +type QoSRuleUpdateRequest struct { + QosRule *qospb.QoSRule `protobuf:"bytes,1,opt,name=qos_rule,json=qosRule" json:"qos_rule,omitempty"` +} + +func (m *QoSRuleUpdateRequest) Reset() { *m = QoSRuleUpdateRequest{} } +func (m *QoSRuleUpdateRequest) String() string { return proto.CompactTextString(m) } +func (*QoSRuleUpdateRequest) ProtoMessage() {} +func (*QoSRuleUpdateRequest) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{105} } + +func (m *QoSRuleUpdateRequest) GetQosRule() *qospb.QoSRule { + if m != nil { + return m.QosRule + } + return nil +} + +type QoSRuleUpdateResponse struct { + Header *ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"` +} + +func (m *QoSRuleUpdateResponse) Reset() { *m = QoSRuleUpdateResponse{} } +func (m *QoSRuleUpdateResponse) String() string { return proto.CompactTextString(m) } +func (*QoSRuleUpdateResponse) ProtoMessage() {} +func (*QoSRuleUpdateResponse) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{106} } + +func (m *QoSRuleUpdateResponse) GetHeader() *ResponseHeader { + if m != nil { + return m.Header + } + return nil +} + +type QoSRuleListRequest struct { +} + +func (m *QoSRuleListRequest) Reset() { *m = QoSRuleListRequest{} } +func (m *QoSRuleListRequest) String() string { return proto.CompactTextString(m) } +func (*QoSRuleListRequest) ProtoMessage() {} +func (*QoSRuleListRequest) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{107} } + +type QoSRuleListResponse struct { + Header *ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"` + QosRules []*qospb.QoSRule `protobuf:"bytes,2,rep,name=qos_rules,json=qosRules" json:"qos_rules,omitempty"` +} + +func (m *QoSRuleListResponse) Reset() { *m = QoSRuleListResponse{} } +func (m *QoSRuleListResponse) String() string { return proto.CompactTextString(m) } +func (*QoSRuleListResponse) ProtoMessage() {} +func (*QoSRuleListResponse) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{108} } + +func (m *QoSRuleListResponse) GetHeader() *ResponseHeader { + if m != nil { + return m.Header + } + return nil +} + +func (m *QoSRuleListResponse) GetQosRules() []*qospb.QoSRule { + if m != nil { + return m.QosRules + } + return nil +} + func init() { proto.RegisterType((*ResponseHeader)(nil), "etcdserverpb.ResponseHeader") proto.RegisterType((*RangeRequest)(nil), "etcdserverpb.RangeRequest") @@ -3565,6 +3783,20 @@ func init() { proto.RegisterType((*AuthRoleDeleteResponse)(nil), "etcdserverpb.AuthRoleDeleteResponse") proto.RegisterType((*AuthRoleGrantPermissionResponse)(nil), "etcdserverpb.AuthRoleGrantPermissionResponse") proto.RegisterType((*AuthRoleRevokePermissionResponse)(nil), "etcdserverpb.AuthRoleRevokePermissionResponse") + proto.RegisterType((*QoSEnableRequest)(nil), "etcdserverpb.QoSEnableRequest") + proto.RegisterType((*QoSDisableRequest)(nil), "etcdserverpb.QoSDisableRequest") + proto.RegisterType((*QoSEnableResponse)(nil), "etcdserverpb.QoSEnableResponse") + proto.RegisterType((*QoSDisableResponse)(nil), "etcdserverpb.QoSDisableResponse") + proto.RegisterType((*QoSRuleAddRequest)(nil), "etcdserverpb.QoSRuleAddRequest") + proto.RegisterType((*QoSRuleAddResponse)(nil), "etcdserverpb.QoSRuleAddResponse") + proto.RegisterType((*QoSRuleDeleteRequest)(nil), "etcdserverpb.QoSRuleDeleteRequest") + proto.RegisterType((*QoSRuleDeleteResponse)(nil), "etcdserverpb.QoSRuleDeleteResponse") + proto.RegisterType((*QoSRuleGetRequest)(nil), "etcdserverpb.QoSRuleGetRequest") + proto.RegisterType((*QoSRuleGetResponse)(nil), "etcdserverpb.QoSRuleGetResponse") + proto.RegisterType((*QoSRuleUpdateRequest)(nil), "etcdserverpb.QoSRuleUpdateRequest") + proto.RegisterType((*QoSRuleUpdateResponse)(nil), "etcdserverpb.QoSRuleUpdateResponse") + proto.RegisterType((*QoSRuleListRequest)(nil), "etcdserverpb.QoSRuleListRequest") + proto.RegisterType((*QoSRuleListResponse)(nil), "etcdserverpb.QoSRuleListResponse") proto.RegisterEnum("etcdserverpb.AlarmType", AlarmType_name, AlarmType_value) proto.RegisterEnum("etcdserverpb.RangeRequest_SortOrder", RangeRequest_SortOrder_name, RangeRequest_SortOrder_value) proto.RegisterEnum("etcdserverpb.RangeRequest_SortTarget", RangeRequest_SortTarget_name, RangeRequest_SortTarget_value) @@ -5341,113 +5573,389 @@ var _Auth_serviceDesc = grpc.ServiceDesc{ Metadata: "rpc.proto", } -func (m *ResponseHeader) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) +// Client API for QoS service + +type QoSClient interface { + // QoSEnable enables qos. + QoSEnable(ctx context.Context, in *QoSEnableRequest, opts ...grpc.CallOption) (*QoSEnableResponse, error) + // QoSDisable disables qos. + QoSDisable(ctx context.Context, in *QoSDisableRequest, opts ...grpc.CallOption) (*QoSDisableResponse, error) + // QoSRuleAdd adds a qos rule into the cluster. + QoSRuleAdd(ctx context.Context, in *QoSRuleAddRequest, opts ...grpc.CallOption) (*QoSRuleAddResponse, error) + // QoSRuleGet get a qos rule into the cluster. + QoSRuleGet(ctx context.Context, in *QoSRuleGetRequest, opts ...grpc.CallOption) (*QoSRuleGetResponse, error) + // QoSRuleDelete deletes a qos rule from the cluster. + QoSRuleDelete(ctx context.Context, in *QoSRuleDeleteRequest, opts ...grpc.CallOption) (*QoSRuleDeleteResponse, error) + // QoSRuleUpdate updates a qos rule into the cluster. + QoSRuleUpdate(ctx context.Context, in *QoSRuleUpdateRequest, opts ...grpc.CallOption) (*QoSRuleUpdateResponse, error) + // QoSRuleList lists all qos rule from the cluster. + QoSRuleList(ctx context.Context, in *QoSRuleListRequest, opts ...grpc.CallOption) (*QoSRuleListResponse, error) +} + +type qoSClient struct { + cc *grpc.ClientConn +} + +func NewQoSClient(cc *grpc.ClientConn) QoSClient { + return &qoSClient{cc} +} + +func (c *qoSClient) QoSEnable(ctx context.Context, in *QoSEnableRequest, opts ...grpc.CallOption) (*QoSEnableResponse, error) { + out := new(QoSEnableResponse) + err := grpc.Invoke(ctx, "/etcdserverpb.QoS/QoSEnable", in, out, c.cc, opts...) if err != nil { return nil, err } - return dAtA[:n], nil + return out, nil } -func (m *ResponseHeader) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.ClusterId != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.ClusterId)) +func (c *qoSClient) QoSDisable(ctx context.Context, in *QoSDisableRequest, opts ...grpc.CallOption) (*QoSDisableResponse, error) { + out := new(QoSDisableResponse) + err := grpc.Invoke(ctx, "/etcdserverpb.QoS/QoSDisable", in, out, c.cc, opts...) + if err != nil { + return nil, err } - if m.MemberId != 0 { - dAtA[i] = 0x10 - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.MemberId)) + return out, nil +} + +func (c *qoSClient) QoSRuleAdd(ctx context.Context, in *QoSRuleAddRequest, opts ...grpc.CallOption) (*QoSRuleAddResponse, error) { + out := new(QoSRuleAddResponse) + err := grpc.Invoke(ctx, "/etcdserverpb.QoS/QoSRuleAdd", in, out, c.cc, opts...) + if err != nil { + return nil, err } - if m.Revision != 0 { - dAtA[i] = 0x18 - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.Revision)) + return out, nil +} + +func (c *qoSClient) QoSRuleGet(ctx context.Context, in *QoSRuleGetRequest, opts ...grpc.CallOption) (*QoSRuleGetResponse, error) { + out := new(QoSRuleGetResponse) + err := grpc.Invoke(ctx, "/etcdserverpb.QoS/QoSRuleGet", in, out, c.cc, opts...) + if err != nil { + return nil, err } - if m.RaftTerm != 0 { - dAtA[i] = 0x20 - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.RaftTerm)) + return out, nil +} + +func (c *qoSClient) QoSRuleDelete(ctx context.Context, in *QoSRuleDeleteRequest, opts ...grpc.CallOption) (*QoSRuleDeleteResponse, error) { + out := new(QoSRuleDeleteResponse) + err := grpc.Invoke(ctx, "/etcdserverpb.QoS/QoSRuleDelete", in, out, c.cc, opts...) + if err != nil { + return nil, err } - return i, nil + return out, nil } -func (m *RangeRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) +func (c *qoSClient) QoSRuleUpdate(ctx context.Context, in *QoSRuleUpdateRequest, opts ...grpc.CallOption) (*QoSRuleUpdateResponse, error) { + out := new(QoSRuleUpdateResponse) + err := grpc.Invoke(ctx, "/etcdserverpb.QoS/QoSRuleUpdate", in, out, c.cc, opts...) if err != nil { return nil, err } - return dAtA[:n], nil + return out, nil } -func (m *RangeRequest) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if len(m.Key) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintRpc(dAtA, i, uint64(len(m.Key))) - i += copy(dAtA[i:], m.Key) +func (c *qoSClient) QoSRuleList(ctx context.Context, in *QoSRuleListRequest, opts ...grpc.CallOption) (*QoSRuleListResponse, error) { + out := new(QoSRuleListResponse) + err := grpc.Invoke(ctx, "/etcdserverpb.QoS/QoSRuleList", in, out, c.cc, opts...) + if err != nil { + return nil, err } - if len(m.RangeEnd) > 0 { - dAtA[i] = 0x12 - i++ - i = encodeVarintRpc(dAtA, i, uint64(len(m.RangeEnd))) - i += copy(dAtA[i:], m.RangeEnd) + return out, nil +} + +// Server API for QoS service + +type QoSServer interface { + // QoSEnable enables qos. + QoSEnable(context.Context, *QoSEnableRequest) (*QoSEnableResponse, error) + // QoSDisable disables qos. + QoSDisable(context.Context, *QoSDisableRequest) (*QoSDisableResponse, error) + // QoSRuleAdd adds a qos rule into the cluster. + QoSRuleAdd(context.Context, *QoSRuleAddRequest) (*QoSRuleAddResponse, error) + // QoSRuleGet get a qos rule into the cluster. + QoSRuleGet(context.Context, *QoSRuleGetRequest) (*QoSRuleGetResponse, error) + // QoSRuleDelete deletes a qos rule from the cluster. + QoSRuleDelete(context.Context, *QoSRuleDeleteRequest) (*QoSRuleDeleteResponse, error) + // QoSRuleUpdate updates a qos rule into the cluster. + QoSRuleUpdate(context.Context, *QoSRuleUpdateRequest) (*QoSRuleUpdateResponse, error) + // QoSRuleList lists all qos rule from the cluster. + QoSRuleList(context.Context, *QoSRuleListRequest) (*QoSRuleListResponse, error) +} + +func RegisterQoSServer(s *grpc.Server, srv QoSServer) { + s.RegisterService(&_QoS_serviceDesc, srv) +} + +func _QoS_QoSEnable_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QoSEnableRequest) + if err := dec(in); err != nil { + return nil, err } - if m.Limit != 0 { - dAtA[i] = 0x18 - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.Limit)) + if interceptor == nil { + return srv.(QoSServer).QoSEnable(ctx, in) } - if m.Revision != 0 { - dAtA[i] = 0x20 - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.Revision)) + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/etcdserverpb.QoS/QoSEnable", } - if m.SortOrder != 0 { - dAtA[i] = 0x28 - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.SortOrder)) + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QoSServer).QoSEnable(ctx, req.(*QoSEnableRequest)) } - if m.SortTarget != 0 { - dAtA[i] = 0x30 - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.SortTarget)) + return interceptor(ctx, in, info, handler) +} + +func _QoS_QoSDisable_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QoSDisableRequest) + if err := dec(in); err != nil { + return nil, err } - if m.Serializable { - dAtA[i] = 0x38 - i++ - if m.Serializable { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i++ + if interceptor == nil { + return srv.(QoSServer).QoSDisable(ctx, in) } - if m.KeysOnly { - dAtA[i] = 0x40 - i++ - if m.KeysOnly { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i++ + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/etcdserverpb.QoS/QoSDisable", } - if m.CountOnly { - dAtA[i] = 0x48 + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QoSServer).QoSDisable(ctx, req.(*QoSDisableRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _QoS_QoSRuleAdd_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QoSRuleAddRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QoSServer).QoSRuleAdd(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/etcdserverpb.QoS/QoSRuleAdd", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QoSServer).QoSRuleAdd(ctx, req.(*QoSRuleAddRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _QoS_QoSRuleGet_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QoSRuleGetRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QoSServer).QoSRuleGet(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/etcdserverpb.QoS/QoSRuleGet", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QoSServer).QoSRuleGet(ctx, req.(*QoSRuleGetRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _QoS_QoSRuleDelete_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QoSRuleDeleteRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QoSServer).QoSRuleDelete(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/etcdserverpb.QoS/QoSRuleDelete", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QoSServer).QoSRuleDelete(ctx, req.(*QoSRuleDeleteRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _QoS_QoSRuleUpdate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QoSRuleUpdateRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QoSServer).QoSRuleUpdate(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/etcdserverpb.QoS/QoSRuleUpdate", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QoSServer).QoSRuleUpdate(ctx, req.(*QoSRuleUpdateRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _QoS_QoSRuleList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QoSRuleListRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QoSServer).QoSRuleList(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/etcdserverpb.QoS/QoSRuleList", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QoSServer).QoSRuleList(ctx, req.(*QoSRuleListRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _QoS_serviceDesc = grpc.ServiceDesc{ + ServiceName: "etcdserverpb.QoS", + HandlerType: (*QoSServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "QoSEnable", + Handler: _QoS_QoSEnable_Handler, + }, + { + MethodName: "QoSDisable", + Handler: _QoS_QoSDisable_Handler, + }, + { + MethodName: "QoSRuleAdd", + Handler: _QoS_QoSRuleAdd_Handler, + }, + { + MethodName: "QoSRuleGet", + Handler: _QoS_QoSRuleGet_Handler, + }, + { + MethodName: "QoSRuleDelete", + Handler: _QoS_QoSRuleDelete_Handler, + }, + { + MethodName: "QoSRuleUpdate", + Handler: _QoS_QoSRuleUpdate_Handler, + }, + { + MethodName: "QoSRuleList", + Handler: _QoS_QoSRuleList_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "rpc.proto", +} + +func (m *ResponseHeader) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ResponseHeader) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if m.ClusterId != 0 { + dAtA[i] = 0x8 + i++ + i = encodeVarintRpc(dAtA, i, uint64(m.ClusterId)) + } + if m.MemberId != 0 { + dAtA[i] = 0x10 + i++ + i = encodeVarintRpc(dAtA, i, uint64(m.MemberId)) + } + if m.Revision != 0 { + dAtA[i] = 0x18 + i++ + i = encodeVarintRpc(dAtA, i, uint64(m.Revision)) + } + if m.RaftTerm != 0 { + dAtA[i] = 0x20 + i++ + i = encodeVarintRpc(dAtA, i, uint64(m.RaftTerm)) + } + return i, nil +} + +func (m *RangeRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *RangeRequest) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if len(m.Key) > 0 { + dAtA[i] = 0xa + i++ + i = encodeVarintRpc(dAtA, i, uint64(len(m.Key))) + i += copy(dAtA[i:], m.Key) + } + if len(m.RangeEnd) > 0 { + dAtA[i] = 0x12 + i++ + i = encodeVarintRpc(dAtA, i, uint64(len(m.RangeEnd))) + i += copy(dAtA[i:], m.RangeEnd) + } + if m.Limit != 0 { + dAtA[i] = 0x18 + i++ + i = encodeVarintRpc(dAtA, i, uint64(m.Limit)) + } + if m.Revision != 0 { + dAtA[i] = 0x20 + i++ + i = encodeVarintRpc(dAtA, i, uint64(m.Revision)) + } + if m.SortOrder != 0 { + dAtA[i] = 0x28 + i++ + i = encodeVarintRpc(dAtA, i, uint64(m.SortOrder)) + } + if m.SortTarget != 0 { + dAtA[i] = 0x30 + i++ + i = encodeVarintRpc(dAtA, i, uint64(m.SortTarget)) + } + if m.Serializable { + dAtA[i] = 0x38 + i++ + if m.Serializable { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i++ + } + if m.KeysOnly { + dAtA[i] = 0x40 + i++ + if m.KeysOnly { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i++ + } + if m.CountOnly { + dAtA[i] = 0x48 i++ if m.CountOnly { dAtA[i] = 1 @@ -8829,380 +9337,756 @@ func (m *AuthRoleRevokePermissionResponse) MarshalTo(dAtA []byte) (int, error) { return i, nil } -func encodeVarintRpc(dAtA []byte, offset int, v uint64) int { - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ +func (m *QoSEnableRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err } - dAtA[offset] = uint8(v) - return offset + 1 + return dAtA[:n], nil } -func (m *ResponseHeader) Size() (n int) { + +func (m *QoSEnableRequest) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i var l int _ = l - if m.ClusterId != 0 { - n += 1 + sovRpc(uint64(m.ClusterId)) - } - if m.MemberId != 0 { - n += 1 + sovRpc(uint64(m.MemberId)) - } - if m.Revision != 0 { - n += 1 + sovRpc(uint64(m.Revision)) - } - if m.RaftTerm != 0 { - n += 1 + sovRpc(uint64(m.RaftTerm)) + return i, nil +} + +func (m *QoSDisableRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err } - return n + return dAtA[:n], nil } -func (m *RangeRequest) Size() (n int) { +func (m *QoSDisableRequest) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i var l int _ = l - l = len(m.Key) - if l > 0 { - n += 1 + l + sovRpc(uint64(l)) - } - l = len(m.RangeEnd) - if l > 0 { - n += 1 + l + sovRpc(uint64(l)) - } - if m.Limit != 0 { - n += 1 + sovRpc(uint64(m.Limit)) + return i, nil +} + +func (m *QoSEnableResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err } - if m.Revision != 0 { - n += 1 + sovRpc(uint64(m.Revision)) - } - if m.SortOrder != 0 { - n += 1 + sovRpc(uint64(m.SortOrder)) - } - if m.SortTarget != 0 { - n += 1 + sovRpc(uint64(m.SortTarget)) - } - if m.Serializable { - n += 2 - } - if m.KeysOnly { - n += 2 - } - if m.CountOnly { - n += 2 - } - if m.MinModRevision != 0 { - n += 1 + sovRpc(uint64(m.MinModRevision)) - } - if m.MaxModRevision != 0 { - n += 1 + sovRpc(uint64(m.MaxModRevision)) - } - if m.MinCreateRevision != 0 { - n += 1 + sovRpc(uint64(m.MinCreateRevision)) - } - if m.MaxCreateRevision != 0 { - n += 1 + sovRpc(uint64(m.MaxCreateRevision)) - } - return n + return dAtA[:n], nil } -func (m *RangeResponse) Size() (n int) { +func (m *QoSEnableResponse) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i var l int _ = l if m.Header != nil { - l = m.Header.Size() - n += 1 + l + sovRpc(uint64(l)) - } - if len(m.Kvs) > 0 { - for _, e := range m.Kvs { - l = e.Size() - n += 1 + l + sovRpc(uint64(l)) + dAtA[i] = 0xa + i++ + i = encodeVarintRpc(dAtA, i, uint64(m.Header.Size())) + n64, err := m.Header.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err } + i += n64 } - if m.More { - n += 2 - } - if m.Count != 0 { - n += 1 + sovRpc(uint64(m.Count)) - } - return n + return i, nil } -func (m *PutRequest) Size() (n int) { - var l int - _ = l - l = len(m.Key) - if l > 0 { - n += 1 + l + sovRpc(uint64(l)) - } - l = len(m.Value) - if l > 0 { - n += 1 + l + sovRpc(uint64(l)) - } - if m.Lease != 0 { - n += 1 + sovRpc(uint64(m.Lease)) - } - if m.PrevKv { - n += 2 - } - if m.IgnoreValue { - n += 2 - } - if m.IgnoreLease { - n += 2 +func (m *QoSDisableResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err } - return n + return dAtA[:n], nil } -func (m *PutResponse) Size() (n int) { +func (m *QoSDisableResponse) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i var l int _ = l if m.Header != nil { - l = m.Header.Size() - n += 1 + l + sovRpc(uint64(l)) + dAtA[i] = 0xa + i++ + i = encodeVarintRpc(dAtA, i, uint64(m.Header.Size())) + n65, err := m.Header.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n65 } - if m.PrevKv != nil { - l = m.PrevKv.Size() - n += 1 + l + sovRpc(uint64(l)) + return i, nil +} + +func (m *QoSRuleAddRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err } - return n + return dAtA[:n], nil } -func (m *DeleteRangeRequest) Size() (n int) { +func (m *QoSRuleAddRequest) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i var l int _ = l - l = len(m.Key) - if l > 0 { - n += 1 + l + sovRpc(uint64(l)) - } - l = len(m.RangeEnd) - if l > 0 { - n += 1 + l + sovRpc(uint64(l)) + if m.QosRule != nil { + dAtA[i] = 0xa + i++ + i = encodeVarintRpc(dAtA, i, uint64(m.QosRule.Size())) + n66, err := m.QosRule.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n66 } - if m.PrevKv { - n += 2 + return i, nil +} + +func (m *QoSRuleAddResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err } - return n + return dAtA[:n], nil } -func (m *DeleteRangeResponse) Size() (n int) { +func (m *QoSRuleAddResponse) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i var l int _ = l if m.Header != nil { - l = m.Header.Size() - n += 1 + l + sovRpc(uint64(l)) - } - if m.Deleted != 0 { - n += 1 + sovRpc(uint64(m.Deleted)) - } - if len(m.PrevKvs) > 0 { - for _, e := range m.PrevKvs { - l = e.Size() - n += 1 + l + sovRpc(uint64(l)) + dAtA[i] = 0xa + i++ + i = encodeVarintRpc(dAtA, i, uint64(m.Header.Size())) + n67, err := m.Header.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err } + i += n67 } - return n + return i, nil } -func (m *RequestOp) Size() (n int) { - var l int - _ = l - if m.Request != nil { - n += m.Request.Size() +func (m *QoSRuleDeleteRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err } - return n + return dAtA[:n], nil } -func (m *RequestOp_RequestRange) Size() (n int) { +func (m *QoSRuleDeleteRequest) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i var l int _ = l - if m.RequestRange != nil { - l = m.RequestRange.Size() - n += 1 + l + sovRpc(uint64(l)) + if len(m.RuleName) > 0 { + dAtA[i] = 0xa + i++ + i = encodeVarintRpc(dAtA, i, uint64(len(m.RuleName))) + i += copy(dAtA[i:], m.RuleName) } - return n + return i, nil } -func (m *RequestOp_RequestPut) Size() (n int) { - var l int - _ = l - if m.RequestPut != nil { - l = m.RequestPut.Size() - n += 1 + l + sovRpc(uint64(l)) + +func (m *QoSRuleDeleteResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err } - return n + return dAtA[:n], nil } -func (m *RequestOp_RequestDeleteRange) Size() (n int) { + +func (m *QoSRuleDeleteResponse) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i var l int _ = l - if m.RequestDeleteRange != nil { - l = m.RequestDeleteRange.Size() - n += 1 + l + sovRpc(uint64(l)) + if m.Header != nil { + dAtA[i] = 0xa + i++ + i = encodeVarintRpc(dAtA, i, uint64(m.Header.Size())) + n68, err := m.Header.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n68 } - return n + return i, nil } -func (m *RequestOp_RequestTxn) Size() (n int) { - var l int - _ = l - if m.RequestTxn != nil { - l = m.RequestTxn.Size() - n += 1 + l + sovRpc(uint64(l)) + +func (m *QoSRuleGetRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err } - return n + return dAtA[:n], nil } -func (m *ResponseOp) Size() (n int) { + +func (m *QoSRuleGetRequest) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i var l int _ = l - if m.Response != nil { - n += m.Response.Size() + if len(m.RuleName) > 0 { + dAtA[i] = 0xa + i++ + i = encodeVarintRpc(dAtA, i, uint64(len(m.RuleName))) + i += copy(dAtA[i:], m.RuleName) } - return n + return i, nil } -func (m *ResponseOp_ResponseRange) Size() (n int) { - var l int - _ = l - if m.ResponseRange != nil { - l = m.ResponseRange.Size() - n += 1 + l + sovRpc(uint64(l)) +func (m *QoSRuleGetResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err } - return n + return dAtA[:n], nil } -func (m *ResponseOp_ResponsePut) Size() (n int) { + +func (m *QoSRuleGetResponse) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i var l int _ = l - if m.ResponsePut != nil { - l = m.ResponsePut.Size() - n += 1 + l + sovRpc(uint64(l)) - } - return n -} -func (m *ResponseOp_ResponseDeleteRange) Size() (n int) { - var l int - _ = l - if m.ResponseDeleteRange != nil { - l = m.ResponseDeleteRange.Size() - n += 1 + l + sovRpc(uint64(l)) + if m.Header != nil { + dAtA[i] = 0xa + i++ + i = encodeVarintRpc(dAtA, i, uint64(m.Header.Size())) + n69, err := m.Header.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n69 } - return n + if m.QosRule != nil { + dAtA[i] = 0x12 + i++ + i = encodeVarintRpc(dAtA, i, uint64(m.QosRule.Size())) + n70, err := m.QosRule.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n70 + } + return i, nil } -func (m *ResponseOp_ResponseTxn) Size() (n int) { - var l int - _ = l - if m.ResponseTxn != nil { - l = m.ResponseTxn.Size() - n += 1 + l + sovRpc(uint64(l)) + +func (m *QoSRuleUpdateRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err } - return n + return dAtA[:n], nil } -func (m *Compare) Size() (n int) { + +func (m *QoSRuleUpdateRequest) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i var l int _ = l - if m.Result != 0 { - n += 1 + sovRpc(uint64(m.Result)) - } - if m.Target != 0 { - n += 1 + sovRpc(uint64(m.Target)) - } - l = len(m.Key) - if l > 0 { - n += 1 + l + sovRpc(uint64(l)) - } - if m.TargetUnion != nil { - n += m.TargetUnion.Size() + if m.QosRule != nil { + dAtA[i] = 0xa + i++ + i = encodeVarintRpc(dAtA, i, uint64(m.QosRule.Size())) + n71, err := m.QosRule.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n71 } - l = len(m.RangeEnd) - if l > 0 { - n += 2 + l + sovRpc(uint64(l)) + return i, nil +} + +func (m *QoSRuleUpdateResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err } - return n + return dAtA[:n], nil } -func (m *Compare_Version) Size() (n int) { +func (m *QoSRuleUpdateResponse) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i var l int _ = l - n += 1 + sovRpc(uint64(m.Version)) - return n + if m.Header != nil { + dAtA[i] = 0xa + i++ + i = encodeVarintRpc(dAtA, i, uint64(m.Header.Size())) + n72, err := m.Header.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n72 + } + return i, nil } -func (m *Compare_CreateRevision) Size() (n int) { - var l int - _ = l - n += 1 + sovRpc(uint64(m.CreateRevision)) - return n + +func (m *QoSRuleListRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil } -func (m *Compare_ModRevision) Size() (n int) { + +func (m *QoSRuleListRequest) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i var l int _ = l - n += 1 + sovRpc(uint64(m.ModRevision)) - return n + return i, nil } -func (m *Compare_Value) Size() (n int) { + +func (m *QoSRuleListResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QoSRuleListResponse) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i var l int _ = l - if m.Value != nil { - l = len(m.Value) - n += 1 + l + sovRpc(uint64(l)) + if m.Header != nil { + dAtA[i] = 0xa + i++ + i = encodeVarintRpc(dAtA, i, uint64(m.Header.Size())) + n73, err := m.Header.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n73 } - return n + if len(m.QosRules) > 0 { + for _, msg := range m.QosRules { + dAtA[i] = 0x12 + i++ + i = encodeVarintRpc(dAtA, i, uint64(msg.Size())) + n, err := msg.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n + } + } + return i, nil } -func (m *Compare_Lease) Size() (n int) { + +func encodeVarintRpc(dAtA []byte, offset int, v uint64) int { + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return offset + 1 +} +func (m *ResponseHeader) Size() (n int) { var l int _ = l - n += 1 + sovRpc(uint64(m.Lease)) + if m.ClusterId != 0 { + n += 1 + sovRpc(uint64(m.ClusterId)) + } + if m.MemberId != 0 { + n += 1 + sovRpc(uint64(m.MemberId)) + } + if m.Revision != 0 { + n += 1 + sovRpc(uint64(m.Revision)) + } + if m.RaftTerm != 0 { + n += 1 + sovRpc(uint64(m.RaftTerm)) + } return n } -func (m *TxnRequest) Size() (n int) { + +func (m *RangeRequest) Size() (n int) { var l int _ = l - if len(m.Compare) > 0 { - for _, e := range m.Compare { - l = e.Size() - n += 1 + l + sovRpc(uint64(l)) - } + l = len(m.Key) + if l > 0 { + n += 1 + l + sovRpc(uint64(l)) } - if len(m.Success) > 0 { - for _, e := range m.Success { - l = e.Size() - n += 1 + l + sovRpc(uint64(l)) - } + l = len(m.RangeEnd) + if l > 0 { + n += 1 + l + sovRpc(uint64(l)) } - if len(m.Failure) > 0 { - for _, e := range m.Failure { - l = e.Size() - n += 1 + l + sovRpc(uint64(l)) - } + if m.Limit != 0 { + n += 1 + sovRpc(uint64(m.Limit)) + } + if m.Revision != 0 { + n += 1 + sovRpc(uint64(m.Revision)) + } + if m.SortOrder != 0 { + n += 1 + sovRpc(uint64(m.SortOrder)) + } + if m.SortTarget != 0 { + n += 1 + sovRpc(uint64(m.SortTarget)) + } + if m.Serializable { + n += 2 + } + if m.KeysOnly { + n += 2 + } + if m.CountOnly { + n += 2 + } + if m.MinModRevision != 0 { + n += 1 + sovRpc(uint64(m.MinModRevision)) + } + if m.MaxModRevision != 0 { + n += 1 + sovRpc(uint64(m.MaxModRevision)) + } + if m.MinCreateRevision != 0 { + n += 1 + sovRpc(uint64(m.MinCreateRevision)) + } + if m.MaxCreateRevision != 0 { + n += 1 + sovRpc(uint64(m.MaxCreateRevision)) } return n } -func (m *TxnResponse) Size() (n int) { +func (m *RangeResponse) Size() (n int) { var l int _ = l if m.Header != nil { l = m.Header.Size() n += 1 + l + sovRpc(uint64(l)) } - if m.Succeeded { - n += 2 - } - if len(m.Responses) > 0 { - for _, e := range m.Responses { + if len(m.Kvs) > 0 { + for _, e := range m.Kvs { l = e.Size() n += 1 + l + sovRpc(uint64(l)) } } + if m.More { + n += 2 + } + if m.Count != 0 { + n += 1 + sovRpc(uint64(m.Count)) + } return n } -func (m *CompactionRequest) Size() (n int) { +func (m *PutRequest) Size() (n int) { var l int _ = l - if m.Revision != 0 { - n += 1 + sovRpc(uint64(m.Revision)) + l = len(m.Key) + if l > 0 { + n += 1 + l + sovRpc(uint64(l)) } - if m.Physical { + l = len(m.Value) + if l > 0 { + n += 1 + l + sovRpc(uint64(l)) + } + if m.Lease != 0 { + n += 1 + sovRpc(uint64(m.Lease)) + } + if m.PrevKv { + n += 2 + } + if m.IgnoreValue { + n += 2 + } + if m.IgnoreLease { n += 2 } return n } -func (m *CompactionResponse) Size() (n int) { +func (m *PutResponse) Size() (n int) { + var l int + _ = l + if m.Header != nil { + l = m.Header.Size() + n += 1 + l + sovRpc(uint64(l)) + } + if m.PrevKv != nil { + l = m.PrevKv.Size() + n += 1 + l + sovRpc(uint64(l)) + } + return n +} + +func (m *DeleteRangeRequest) Size() (n int) { + var l int + _ = l + l = len(m.Key) + if l > 0 { + n += 1 + l + sovRpc(uint64(l)) + } + l = len(m.RangeEnd) + if l > 0 { + n += 1 + l + sovRpc(uint64(l)) + } + if m.PrevKv { + n += 2 + } + return n +} + +func (m *DeleteRangeResponse) Size() (n int) { + var l int + _ = l + if m.Header != nil { + l = m.Header.Size() + n += 1 + l + sovRpc(uint64(l)) + } + if m.Deleted != 0 { + n += 1 + sovRpc(uint64(m.Deleted)) + } + if len(m.PrevKvs) > 0 { + for _, e := range m.PrevKvs { + l = e.Size() + n += 1 + l + sovRpc(uint64(l)) + } + } + return n +} + +func (m *RequestOp) Size() (n int) { + var l int + _ = l + if m.Request != nil { + n += m.Request.Size() + } + return n +} + +func (m *RequestOp_RequestRange) Size() (n int) { + var l int + _ = l + if m.RequestRange != nil { + l = m.RequestRange.Size() + n += 1 + l + sovRpc(uint64(l)) + } + return n +} +func (m *RequestOp_RequestPut) Size() (n int) { + var l int + _ = l + if m.RequestPut != nil { + l = m.RequestPut.Size() + n += 1 + l + sovRpc(uint64(l)) + } + return n +} +func (m *RequestOp_RequestDeleteRange) Size() (n int) { + var l int + _ = l + if m.RequestDeleteRange != nil { + l = m.RequestDeleteRange.Size() + n += 1 + l + sovRpc(uint64(l)) + } + return n +} +func (m *RequestOp_RequestTxn) Size() (n int) { + var l int + _ = l + if m.RequestTxn != nil { + l = m.RequestTxn.Size() + n += 1 + l + sovRpc(uint64(l)) + } + return n +} +func (m *ResponseOp) Size() (n int) { + var l int + _ = l + if m.Response != nil { + n += m.Response.Size() + } + return n +} + +func (m *ResponseOp_ResponseRange) Size() (n int) { + var l int + _ = l + if m.ResponseRange != nil { + l = m.ResponseRange.Size() + n += 1 + l + sovRpc(uint64(l)) + } + return n +} +func (m *ResponseOp_ResponsePut) Size() (n int) { + var l int + _ = l + if m.ResponsePut != nil { + l = m.ResponsePut.Size() + n += 1 + l + sovRpc(uint64(l)) + } + return n +} +func (m *ResponseOp_ResponseDeleteRange) Size() (n int) { + var l int + _ = l + if m.ResponseDeleteRange != nil { + l = m.ResponseDeleteRange.Size() + n += 1 + l + sovRpc(uint64(l)) + } + return n +} +func (m *ResponseOp_ResponseTxn) Size() (n int) { + var l int + _ = l + if m.ResponseTxn != nil { + l = m.ResponseTxn.Size() + n += 1 + l + sovRpc(uint64(l)) + } + return n +} +func (m *Compare) Size() (n int) { + var l int + _ = l + if m.Result != 0 { + n += 1 + sovRpc(uint64(m.Result)) + } + if m.Target != 0 { + n += 1 + sovRpc(uint64(m.Target)) + } + l = len(m.Key) + if l > 0 { + n += 1 + l + sovRpc(uint64(l)) + } + if m.TargetUnion != nil { + n += m.TargetUnion.Size() + } + l = len(m.RangeEnd) + if l > 0 { + n += 2 + l + sovRpc(uint64(l)) + } + return n +} + +func (m *Compare_Version) Size() (n int) { + var l int + _ = l + n += 1 + sovRpc(uint64(m.Version)) + return n +} +func (m *Compare_CreateRevision) Size() (n int) { + var l int + _ = l + n += 1 + sovRpc(uint64(m.CreateRevision)) + return n +} +func (m *Compare_ModRevision) Size() (n int) { + var l int + _ = l + n += 1 + sovRpc(uint64(m.ModRevision)) + return n +} +func (m *Compare_Value) Size() (n int) { + var l int + _ = l + if m.Value != nil { + l = len(m.Value) + n += 1 + l + sovRpc(uint64(l)) + } + return n +} +func (m *Compare_Lease) Size() (n int) { + var l int + _ = l + n += 1 + sovRpc(uint64(m.Lease)) + return n +} +func (m *TxnRequest) Size() (n int) { + var l int + _ = l + if len(m.Compare) > 0 { + for _, e := range m.Compare { + l = e.Size() + n += 1 + l + sovRpc(uint64(l)) + } + } + if len(m.Success) > 0 { + for _, e := range m.Success { + l = e.Size() + n += 1 + l + sovRpc(uint64(l)) + } + } + if len(m.Failure) > 0 { + for _, e := range m.Failure { + l = e.Size() + n += 1 + l + sovRpc(uint64(l)) + } + } + return n +} + +func (m *TxnResponse) Size() (n int) { + var l int + _ = l + if m.Header != nil { + l = m.Header.Size() + n += 1 + l + sovRpc(uint64(l)) + } + if m.Succeeded { + n += 2 + } + if len(m.Responses) > 0 { + for _, e := range m.Responses { + l = e.Size() + n += 1 + l + sovRpc(uint64(l)) + } + } + return n +} + +func (m *CompactionRequest) Size() (n int) { + var l int + _ = l + if m.Revision != 0 { + n += 1 + sovRpc(uint64(m.Revision)) + } + if m.Physical { + n += 2 + } + return n +} + +func (m *CompactionResponse) Size() (n int) { var l int _ = l if m.Header != nil { @@ -10298,11 +11182,149 @@ func (m *AuthRoleRevokePermissionResponse) Size() (n int) { return n } -func sovRpc(x uint64) (n int) { - for { - n++ - x >>= 7 - if x == 0 { +func (m *QoSEnableRequest) Size() (n int) { + var l int + _ = l + return n +} + +func (m *QoSDisableRequest) Size() (n int) { + var l int + _ = l + return n +} + +func (m *QoSEnableResponse) Size() (n int) { + var l int + _ = l + if m.Header != nil { + l = m.Header.Size() + n += 1 + l + sovRpc(uint64(l)) + } + return n +} + +func (m *QoSDisableResponse) Size() (n int) { + var l int + _ = l + if m.Header != nil { + l = m.Header.Size() + n += 1 + l + sovRpc(uint64(l)) + } + return n +} + +func (m *QoSRuleAddRequest) Size() (n int) { + var l int + _ = l + if m.QosRule != nil { + l = m.QosRule.Size() + n += 1 + l + sovRpc(uint64(l)) + } + return n +} + +func (m *QoSRuleAddResponse) Size() (n int) { + var l int + _ = l + if m.Header != nil { + l = m.Header.Size() + n += 1 + l + sovRpc(uint64(l)) + } + return n +} + +func (m *QoSRuleDeleteRequest) Size() (n int) { + var l int + _ = l + l = len(m.RuleName) + if l > 0 { + n += 1 + l + sovRpc(uint64(l)) + } + return n +} + +func (m *QoSRuleDeleteResponse) Size() (n int) { + var l int + _ = l + if m.Header != nil { + l = m.Header.Size() + n += 1 + l + sovRpc(uint64(l)) + } + return n +} + +func (m *QoSRuleGetRequest) Size() (n int) { + var l int + _ = l + l = len(m.RuleName) + if l > 0 { + n += 1 + l + sovRpc(uint64(l)) + } + return n +} + +func (m *QoSRuleGetResponse) Size() (n int) { + var l int + _ = l + if m.Header != nil { + l = m.Header.Size() + n += 1 + l + sovRpc(uint64(l)) + } + if m.QosRule != nil { + l = m.QosRule.Size() + n += 1 + l + sovRpc(uint64(l)) + } + return n +} + +func (m *QoSRuleUpdateRequest) Size() (n int) { + var l int + _ = l + if m.QosRule != nil { + l = m.QosRule.Size() + n += 1 + l + sovRpc(uint64(l)) + } + return n +} + +func (m *QoSRuleUpdateResponse) Size() (n int) { + var l int + _ = l + if m.Header != nil { + l = m.Header.Size() + n += 1 + l + sovRpc(uint64(l)) + } + return n +} + +func (m *QoSRuleListRequest) Size() (n int) { + var l int + _ = l + return n +} + +func (m *QoSRuleListResponse) Size() (n int) { + var l int + _ = l + if m.Header != nil { + l = m.Header.Size() + n += 1 + l + sovRpc(uint64(l)) + } + if len(m.QosRules) > 0 { + for _, e := range m.QosRules { + l = e.Size() + n += 1 + l + sovRpc(uint64(l)) + } + } + return n +} + +func sovRpc(x uint64) (n int) { + for { + n++ + x >>= 7 + if x == 0 { break } } @@ -10324,27 +11346,692 @@ func (m *ResponseHeader) Unmarshal(dAtA []byte) error { if iNdEx >= l { return io.ErrUnexpectedEOF } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ResponseHeader: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ResponseHeader: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ClusterId", wireType) + } + m.ClusterId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ClusterId |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field MemberId", wireType) + } + m.MemberId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.MemberId |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Revision", wireType) + } + m.Revision = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Revision |= (int64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field RaftTerm", wireType) + } + m.RaftTerm = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.RaftTerm |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipRpc(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthRpc + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *RangeRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: RangeRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: RangeRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthRpc + } + postIndex := iNdEx + byteLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Key = append(m.Key[:0], dAtA[iNdEx:postIndex]...) + if m.Key == nil { + m.Key = []byte{} + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RangeEnd", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthRpc + } + postIndex := iNdEx + byteLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RangeEnd = append(m.RangeEnd[:0], dAtA[iNdEx:postIndex]...) + if m.RangeEnd == nil { + m.RangeEnd = []byte{} + } + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Limit", wireType) + } + m.Limit = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Limit |= (int64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Revision", wireType) + } + m.Revision = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Revision |= (int64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field SortOrder", wireType) + } + m.SortOrder = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.SortOrder |= (RangeRequest_SortOrder(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field SortTarget", wireType) + } + m.SortTarget = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.SortTarget |= (RangeRequest_SortTarget(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + case 7: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Serializable", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.Serializable = bool(v != 0) + case 8: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field KeysOnly", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.KeysOnly = bool(v != 0) + case 9: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field CountOnly", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.CountOnly = bool(v != 0) + case 10: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field MinModRevision", wireType) + } + m.MinModRevision = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.MinModRevision |= (int64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + case 11: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field MaxModRevision", wireType) + } + m.MaxModRevision = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.MaxModRevision |= (int64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + case 12: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field MinCreateRevision", wireType) + } + m.MinCreateRevision = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.MinCreateRevision |= (int64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + case 13: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field MaxCreateRevision", wireType) + } + m.MaxCreateRevision = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.MaxCreateRevision |= (int64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipRpc(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthRpc + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *RangeResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: RangeResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: RangeResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthRpc + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Header == nil { + m.Header = &ResponseHeader{} + } + if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Kvs", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthRpc + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Kvs = append(m.Kvs, &mvccpb.KeyValue{}) + if err := m.Kvs[len(m.Kvs)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field More", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.More = bool(v != 0) + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Count", wireType) + } + m.Count = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Count |= (int64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipRpc(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthRpc + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *PutRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: PutRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PutRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthRpc + } + postIndex := iNdEx + byteLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Key = append(m.Key[:0], dAtA[iNdEx:postIndex]...) + if m.Key == nil { + m.Key = []byte{} + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthRpc + } + postIndex := iNdEx + byteLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Value = append(m.Value[:0], dAtA[iNdEx:postIndex]...) + if m.Value == nil { + m.Value = []byte{} } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ResponseHeader: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ResponseHeader: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: + iNdEx = postIndex + case 3: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ClusterId", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Lease", wireType) } - m.ClusterId = 0 + m.Lease = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc @@ -10354,16 +12041,16 @@ func (m *ResponseHeader) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.ClusterId |= (uint64(b) & 0x7F) << shift + m.Lease |= (int64(b) & 0x7F) << shift if b < 0x80 { break } } - case 2: + case 4: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MemberId", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field PrevKv", wireType) } - m.MemberId = 0 + var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc @@ -10373,16 +12060,17 @@ func (m *ResponseHeader) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.MemberId |= (uint64(b) & 0x7F) << shift + v |= (int(b) & 0x7F) << shift if b < 0x80 { break } } - case 3: + m.PrevKv = bool(v != 0) + case 5: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Revision", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field IgnoreValue", wireType) } - m.Revision = 0 + var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc @@ -10392,16 +12080,17 @@ func (m *ResponseHeader) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Revision |= (int64(b) & 0x7F) << shift + v |= (int(b) & 0x7F) << shift if b < 0x80 { break } } - case 4: + m.IgnoreValue = bool(v != 0) + case 6: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field RaftTerm", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field IgnoreLease", wireType) } - m.RaftTerm = 0 + var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc @@ -10411,11 +12100,12 @@ func (m *ResponseHeader) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.RaftTerm |= (uint64(b) & 0x7F) << shift + v |= (int(b) & 0x7F) << shift if b < 0x80 { break } } + m.IgnoreLease = bool(v != 0) default: iNdEx = preIndex skippy, err := skipRpc(dAtA[iNdEx:]) @@ -10437,7 +12127,7 @@ func (m *ResponseHeader) Unmarshal(dAtA []byte) error { } return nil } -func (m *RangeRequest) Unmarshal(dAtA []byte) error { +func (m *PutResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -10460,17 +12150,17 @@ func (m *RangeRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: RangeRequest: wiretype end group for non-group") + return fmt.Errorf("proto: PutResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: RangeRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: PutResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) } - var byteLen int + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc @@ -10480,28 +12170,30 @@ func (m *RangeRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - byteLen |= (int(b) & 0x7F) << shift + msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } - if byteLen < 0 { + if msglen < 0 { return ErrInvalidLengthRpc } - postIndex := iNdEx + byteLen + postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } - m.Key = append(m.Key[:0], dAtA[iNdEx:postIndex]...) - if m.Key == nil { - m.Key = []byte{} + if m.Header == nil { + m.Header = &ResponseHeader{} + } + if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err } iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field RangeEnd", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field PrevKv", wireType) } - var byteLen int + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc @@ -10511,28 +12203,80 @@ func (m *RangeRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - byteLen |= (int(b) & 0x7F) << shift + msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } - if byteLen < 0 { + if msglen < 0 { return ErrInvalidLengthRpc } - postIndex := iNdEx + byteLen + postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } - m.RangeEnd = append(m.RangeEnd[:0], dAtA[iNdEx:postIndex]...) - if m.RangeEnd == nil { - m.RangeEnd = []byte{} + if m.PrevKv == nil { + m.PrevKv = &mvccpb.KeyValue{} + } + if err := m.PrevKv.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err } iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Limit", wireType) + default: + iNdEx = preIndex + skippy, err := skipRpc(dAtA[iNdEx:]) + if err != nil { + return err } - m.Limit = 0 + if skippy < 0 { + return ErrInvalidLengthRpc + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *DeleteRangeRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: DeleteRangeRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: DeleteRangeRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) + } + var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc @@ -10542,16 +12286,28 @@ func (m *RangeRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Limit |= (int64(b) & 0x7F) << shift + byteLen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Revision", wireType) + if byteLen < 0 { + return ErrInvalidLengthRpc } - m.Revision = 0 + postIndex := iNdEx + byteLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Key = append(m.Key[:0], dAtA[iNdEx:postIndex]...) + if m.Key == nil { + m.Key = []byte{} + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RangeEnd", wireType) + } + var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc @@ -10561,16 +12317,28 @@ func (m *RangeRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Revision |= (int64(b) & 0x7F) << shift + byteLen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } - case 5: + if byteLen < 0 { + return ErrInvalidLengthRpc + } + postIndex := iNdEx + byteLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RangeEnd = append(m.RangeEnd[:0], dAtA[iNdEx:postIndex]...) + if m.RangeEnd == nil { + m.RangeEnd = []byte{} + } + iNdEx = postIndex + case 3: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field SortOrder", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field PrevKv", wireType) } - m.SortOrder = 0 + var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc @@ -10580,16 +12348,67 @@ func (m *RangeRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.SortOrder |= (RangeRequest_SortOrder(b) & 0x7F) << shift + v |= (int(b) & 0x7F) << shift if b < 0x80 { break } } - case 6: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field SortTarget", wireType) + m.PrevKv = bool(v != 0) + default: + iNdEx = preIndex + skippy, err := skipRpc(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthRpc + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *DeleteRangeResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: DeleteRangeResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: DeleteRangeResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) } - m.SortTarget = 0 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc @@ -10599,36 +12418,30 @@ func (m *RangeRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.SortTarget |= (RangeRequest_SortTarget(b) & 0x7F) << shift + msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } - case 7: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Serializable", wireType) + if msglen < 0 { + return ErrInvalidLengthRpc } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF } - m.Serializable = bool(v != 0) - case 8: + if m.Header == nil { + m.Header = &ResponseHeader{} + } + if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field KeysOnly", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Deleted", wireType) } - var v int + m.Deleted = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc @@ -10638,17 +12451,16 @@ func (m *RangeRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - v |= (int(b) & 0x7F) << shift + m.Deleted |= (int64(b) & 0x7F) << shift if b < 0x80 { break } } - m.KeysOnly = bool(v != 0) - case 9: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field CountOnly", wireType) + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PrevKvs", wireType) } - var v int + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc @@ -10658,17 +12470,78 @@ func (m *RangeRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - v |= (int(b) & 0x7F) << shift + msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } - m.CountOnly = bool(v != 0) - case 10: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MinModRevision", wireType) + if msglen < 0 { + return ErrInvalidLengthRpc } - m.MinModRevision = 0 + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.PrevKvs = append(m.PrevKvs, &mvccpb.KeyValue{}) + if err := m.PrevKvs[len(m.PrevKvs)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipRpc(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthRpc + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *RequestOp) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: RequestOp: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: RequestOp: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RequestRange", wireType) + } + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc @@ -10678,16 +12551,29 @@ func (m *RangeRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.MinModRevision |= (int64(b) & 0x7F) << shift + msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } - case 11: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MaxModRevision", wireType) + if msglen < 0 { + return ErrInvalidLengthRpc } - m.MaxModRevision = 0 + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &RangeRequest{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Request = &RequestOp_RequestRange{v} + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RequestPut", wireType) + } + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc @@ -10697,16 +12583,29 @@ func (m *RangeRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.MaxModRevision |= (int64(b) & 0x7F) << shift + msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } - case 12: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MinCreateRevision", wireType) + if msglen < 0 { + return ErrInvalidLengthRpc } - m.MinCreateRevision = 0 + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &PutRequest{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Request = &RequestOp_RequestPut{v} + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RequestDeleteRange", wireType) + } + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc @@ -10716,16 +12615,29 @@ func (m *RangeRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.MinCreateRevision |= (int64(b) & 0x7F) << shift + msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } - case 13: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MaxCreateRevision", wireType) + if msglen < 0 { + return ErrInvalidLengthRpc } - m.MaxCreateRevision = 0 + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &DeleteRangeRequest{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Request = &RequestOp_RequestDeleteRange{v} + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RequestTxn", wireType) + } + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc @@ -10735,11 +12647,24 @@ func (m *RangeRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.MaxCreateRevision |= (int64(b) & 0x7F) << shift + msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } + if msglen < 0 { + return ErrInvalidLengthRpc + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &TxnRequest{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Request = &RequestOp_RequestTxn{v} + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipRpc(dAtA[iNdEx:]) @@ -10761,7 +12686,7 @@ func (m *RangeRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *RangeResponse) Unmarshal(dAtA []byte) error { +func (m *ResponseOp) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -10784,15 +12709,15 @@ func (m *RangeResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: RangeResponse: wiretype end group for non-group") + return fmt.Errorf("proto: ResponseOp: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: RangeResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: ResponseOp: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ResponseRange", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -10816,16 +12741,15 @@ func (m *RangeResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.Header == nil { - m.Header = &ResponseHeader{} - } - if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + v := &RangeResponse{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } + m.Response = &ResponseOp_ResponseRange{v} iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Kvs", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ResponsePut", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -10849,16 +12773,17 @@ func (m *RangeResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Kvs = append(m.Kvs, &mvccpb.KeyValue{}) - if err := m.Kvs[len(m.Kvs)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + v := &PutResponse{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } + m.Response = &ResponseOp_ResponsePut{v} iNdEx = postIndex case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field More", wireType) + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ResponseDeleteRange", wireType) } - var v int + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc @@ -10868,17 +12793,29 @@ func (m *RangeResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - v |= (int(b) & 0x7F) << shift + msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } - m.More = bool(v != 0) + if msglen < 0 { + return ErrInvalidLengthRpc + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &DeleteRangeResponse{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Response = &ResponseOp_ResponseDeleteRange{v} + iNdEx = postIndex case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Count", wireType) + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ResponseTxn", wireType) } - m.Count = 0 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc @@ -10888,11 +12825,24 @@ func (m *RangeResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Count |= (int64(b) & 0x7F) << shift + msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } + if msglen < 0 { + return ErrInvalidLengthRpc + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &TxnResponse{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Response = &ResponseOp_ResponseTxn{v} + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipRpc(dAtA[iNdEx:]) @@ -10914,7 +12864,7 @@ func (m *RangeResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *PutRequest) Unmarshal(dAtA []byte) error { +func (m *Compare) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -10937,17 +12887,17 @@ func (m *PutRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: PutRequest: wiretype end group for non-group") + return fmt.Errorf("proto: Compare: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: PutRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: Compare: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Result", wireType) } - var byteLen int + m.Result = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc @@ -10957,26 +12907,33 @@ func (m *PutRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - byteLen |= (int(b) & 0x7F) << shift + m.Result |= (Compare_CompareResult(b) & 0x7F) << shift if b < 0x80 { break } } - if byteLen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + byteLen - if postIndex > l { - return io.ErrUnexpectedEOF + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Target", wireType) } - m.Key = append(m.Key[:0], dAtA[iNdEx:postIndex]...) - if m.Key == nil { - m.Key = []byte{} + m.Target = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Target |= (Compare_CompareTarget(b) & 0x7F) << shift + if b < 0x80 { + break + } } - iNdEx = postIndex - case 2: + case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) } var byteLen int for shift := uint(0); ; shift += 7 { @@ -11000,16 +12957,16 @@ func (m *PutRequest) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Value = append(m.Value[:0], dAtA[iNdEx:postIndex]...) - if m.Value == nil { - m.Value = []byte{} + m.Key = append(m.Key[:0], dAtA[iNdEx:postIndex]...) + if m.Key == nil { + m.Key = []byte{} } iNdEx = postIndex - case 3: + case 4: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Lease", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType) } - m.Lease = 0 + var v int64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc @@ -11019,16 +12976,17 @@ func (m *PutRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Lease |= (int64(b) & 0x7F) << shift + v |= (int64(b) & 0x7F) << shift if b < 0x80 { break } } - case 4: + m.TargetUnion = &Compare_Version{v} + case 5: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field PrevKv", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field CreateRevision", wireType) } - var v int + var v int64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc @@ -11038,17 +12996,17 @@ func (m *PutRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - v |= (int(b) & 0x7F) << shift + v |= (int64(b) & 0x7F) << shift if b < 0x80 { break } } - m.PrevKv = bool(v != 0) - case 5: + m.TargetUnion = &Compare_CreateRevision{v} + case 6: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field IgnoreValue", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ModRevision", wireType) } - var v int + var v int64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc @@ -11058,17 +13016,17 @@ func (m *PutRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - v |= (int(b) & 0x7F) << shift + v |= (int64(b) & 0x7F) << shift if b < 0x80 { break } } - m.IgnoreValue = bool(v != 0) - case 6: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field IgnoreLease", wireType) + m.TargetUnion = &Compare_ModRevision{v} + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) } - var v int + var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc @@ -11078,67 +13036,27 @@ func (m *PutRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - v |= (int(b) & 0x7F) << shift + byteLen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } - m.IgnoreLease = bool(v != 0) - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { + if byteLen < 0 { return ErrInvalidLengthRpc } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *PutResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { + postIndex := iNdEx + byteLen + if postIndex > l { return io.ErrUnexpectedEOF } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: PutResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: PutResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) + v := make([]byte, postIndex-iNdEx) + copy(v, dAtA[iNdEx:postIndex]) + m.TargetUnion = &Compare_Value{v} + iNdEx = postIndex + case 8: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Lease", wireType) } - var msglen int + var v int64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc @@ -11148,30 +13066,17 @@ func (m *PutResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + v |= (int64(b) & 0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Header == nil { - m.Header = &ResponseHeader{} - } - if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: + m.TargetUnion = &Compare_Lease{v} + case 64: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PrevKv", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field RangeEnd", wireType) } - var msglen int + var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc @@ -11181,23 +13086,21 @@ func (m *PutResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + byteLen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + if byteLen < 0 { return ErrInvalidLengthRpc } - postIndex := iNdEx + msglen + postIndex := iNdEx + byteLen if postIndex > l { return io.ErrUnexpectedEOF } - if m.PrevKv == nil { - m.PrevKv = &mvccpb.KeyValue{} - } - if err := m.PrevKv.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err + m.RangeEnd = append(m.RangeEnd[:0], dAtA[iNdEx:postIndex]...) + if m.RangeEnd == nil { + m.RangeEnd = []byte{} } iNdEx = postIndex default: @@ -11221,7 +13124,7 @@ func (m *PutResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *DeleteRangeRequest) Unmarshal(dAtA []byte) error { +func (m *TxnRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -11244,17 +13147,17 @@ func (m *DeleteRangeRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: DeleteRangeRequest: wiretype end group for non-group") + return fmt.Errorf("proto: TxnRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: DeleteRangeRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: TxnRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Compare", wireType) } - var byteLen int + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc @@ -11264,28 +13167,28 @@ func (m *DeleteRangeRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - byteLen |= (int(b) & 0x7F) << shift + msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } - if byteLen < 0 { + if msglen < 0 { return ErrInvalidLengthRpc } - postIndex := iNdEx + byteLen + postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } - m.Key = append(m.Key[:0], dAtA[iNdEx:postIndex]...) - if m.Key == nil { - m.Key = []byte{} + m.Compare = append(m.Compare, &Compare{}) + if err := m.Compare[len(m.Compare)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err } iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field RangeEnd", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Success", wireType) } - var byteLen int + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc @@ -11295,28 +13198,28 @@ func (m *DeleteRangeRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - byteLen |= (int(b) & 0x7F) << shift + msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } - if byteLen < 0 { + if msglen < 0 { return ErrInvalidLengthRpc } - postIndex := iNdEx + byteLen + postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } - m.RangeEnd = append(m.RangeEnd[:0], dAtA[iNdEx:postIndex]...) - if m.RangeEnd == nil { - m.RangeEnd = []byte{} + m.Success = append(m.Success, &RequestOp{}) + if err := m.Success[len(m.Success)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err } iNdEx = postIndex case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field PrevKv", wireType) + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Failure", wireType) } - var v int + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc @@ -11326,12 +13229,23 @@ func (m *DeleteRangeRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - v |= (int(b) & 0x7F) << shift + msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } - m.PrevKv = bool(v != 0) + if msglen < 0 { + return ErrInvalidLengthRpc + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Failure = append(m.Failure, &RequestOp{}) + if err := m.Failure[len(m.Failure)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipRpc(dAtA[iNdEx:]) @@ -11353,7 +13267,7 @@ func (m *DeleteRangeRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *DeleteRangeResponse) Unmarshal(dAtA []byte) error { +func (m *TxnResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -11376,10 +13290,10 @@ func (m *DeleteRangeResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: DeleteRangeResponse: wiretype end group for non-group") + return fmt.Errorf("proto: TxnResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: DeleteRangeResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: TxnResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -11417,9 +13331,9 @@ func (m *DeleteRangeResponse) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 2: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Deleted", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Succeeded", wireType) } - m.Deleted = 0 + var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc @@ -11429,14 +13343,15 @@ func (m *DeleteRangeResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Deleted |= (int64(b) & 0x7F) << shift + v |= (int(b) & 0x7F) << shift if b < 0x80 { break } } + m.Succeeded = bool(v != 0) case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PrevKvs", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Responses", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -11460,8 +13375,8 @@ func (m *DeleteRangeResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.PrevKvs = append(m.PrevKvs, &mvccpb.KeyValue{}) - if err := m.PrevKvs[len(m.PrevKvs)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.Responses = append(m.Responses, &ResponseOp{}) + if err := m.Responses[len(m.Responses)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -11486,7 +13401,7 @@ func (m *DeleteRangeResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *RequestOp) Unmarshal(dAtA []byte) error { +func (m *CompactionRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -11509,17 +13424,17 @@ func (m *RequestOp) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: RequestOp: wiretype end group for non-group") + return fmt.Errorf("proto: CompactionRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: RequestOp: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: CompactionRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field RequestRange", wireType) + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Revision", wireType) } - var msglen int + m.Revision = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc @@ -11529,29 +13444,16 @@ func (m *RequestOp) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + m.Revision |= (int64(b) & 0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &RangeRequest{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Request = &RequestOp_RequestRange{v} - iNdEx = postIndex case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field RequestPut", wireType) + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Physical", wireType) } - var msglen int + var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc @@ -11561,27 +13463,65 @@ func (m *RequestOp) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + v |= (int(b) & 0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + m.Physical = bool(v != 0) + default: + iNdEx = preIndex + skippy, err := skipRpc(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { return ErrInvalidLengthRpc } - postIndex := iNdEx + msglen - if postIndex > l { + if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } - v := &PutRequest{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *CompactionResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRpc } - m.Request = &RequestOp_RequestPut{v} - iNdEx = postIndex - case 3: + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: CompactionResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: CompactionResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field RequestDeleteRange", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -11605,44 +13545,132 @@ func (m *RequestOp) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - v := &DeleteRangeRequest{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if m.Header == nil { + m.Header = &ResponseHeader{} + } + if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } - m.Request = &RequestOp_RequestDeleteRange{v} iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field RequestTxn", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } + default: + iNdEx = preIndex + skippy, err := skipRpc(dAtA[iNdEx:]) + if err != nil { + return err } - if msglen < 0 { + if skippy < 0 { return ErrInvalidLengthRpc } - postIndex := iNdEx + msglen - if postIndex > l { + if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } - v := &TxnRequest{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *HashRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: HashRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: HashRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipRpc(dAtA[iNdEx:]) + if err != nil { return err } - m.Request = &RequestOp_RequestTxn{v} - iNdEx = postIndex + if skippy < 0 { + return ErrInvalidLengthRpc + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *HashKVRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: HashKVRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: HashKVRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Revision", wireType) + } + m.Revision = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Revision |= (int64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := skipRpc(dAtA[iNdEx:]) @@ -11664,7 +13692,7 @@ func (m *RequestOp) Unmarshal(dAtA []byte) error { } return nil } -func (m *ResponseOp) Unmarshal(dAtA []byte) error { +func (m *HashKVResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -11687,15 +13715,15 @@ func (m *ResponseOp) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: ResponseOp: wiretype end group for non-group") + return fmt.Errorf("proto: HashKVResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: ResponseOp: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: HashKVResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ResponseRange", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -11719,17 +13747,18 @@ func (m *ResponseOp) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - v := &RangeResponse{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if m.Header == nil { + m.Header = &ResponseHeader{} + } + if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } - m.Response = &ResponseOp_ResponseRange{v} iNdEx = postIndex case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ResponsePut", wireType) + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Hash", wireType) } - var msglen int + m.Hash = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc @@ -11739,61 +13768,16 @@ func (m *ResponseOp) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + m.Hash |= (uint32(b) & 0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &PutResponse{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Response = &ResponseOp_ResponsePut{v} - iNdEx = postIndex case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ResponseDeleteRange", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &DeleteRangeResponse{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Response = &ResponseOp_ResponseDeleteRange{v} - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ResponseTxn", wireType) + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field CompactRevision", wireType) } - var msglen int + m.CompactRevision = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc @@ -11803,24 +13787,11 @@ func (m *ResponseOp) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + m.CompactRevision |= (int64(b) & 0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &TxnResponse{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Response = &ResponseOp_ResponseTxn{v} - iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipRpc(dAtA[iNdEx:]) @@ -11842,7 +13813,7 @@ func (m *ResponseOp) Unmarshal(dAtA []byte) error { } return nil } -func (m *Compare) Unmarshal(dAtA []byte) error { +func (m *HashResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -11865,17 +13836,17 @@ func (m *Compare) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: Compare: wiretype end group for non-group") + return fmt.Errorf("proto: HashResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: Compare: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: HashResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Result", wireType) + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) } - m.Result = 0 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc @@ -11885,16 +13856,30 @@ func (m *Compare) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Result |= (Compare_CompareResult(b) & 0x7F) << shift + msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } + if msglen < 0 { + return ErrInvalidLengthRpc + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Header == nil { + m.Header = &ResponseHeader{} + } + if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex case 2: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Target", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Hash", wireType) } - m.Target = 0 + m.Hash = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc @@ -11904,107 +13889,116 @@ func (m *Compare) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Target |= (Compare_CompareTarget(b) & 0x7F) << shift + m.Hash |= (uint32(b) & 0x7F) << shift if b < 0x80 { break } } - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } + default: + iNdEx = preIndex + skippy, err := skipRpc(dAtA[iNdEx:]) + if err != nil { + return err } - if byteLen < 0 { + if skippy < 0 { return ErrInvalidLengthRpc } - postIndex := iNdEx + byteLen - if postIndex > l { + if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } - m.Key = append(m.Key[:0], dAtA[iNdEx:postIndex]...) - if m.Key == nil { - m.Key = []byte{} + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SnapshotRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRpc } - iNdEx = postIndex - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType) + if iNdEx >= l { + return io.ErrUnexpectedEOF } - var v int64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= (int64(b) & 0x7F) << shift - if b < 0x80 { - break - } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break } - m.TargetUnion = &Compare_Version{v} - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field CreateRevision", wireType) + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: SnapshotRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SnapshotRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipRpc(dAtA[iNdEx:]) + if err != nil { + return err } - var v int64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= (int64(b) & 0x7F) << shift - if b < 0x80 { - break - } + if skippy < 0 { + return ErrInvalidLengthRpc + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SnapshotResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRpc } - m.TargetUnion = &Compare_CreateRevision{v} - case 6: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ModRevision", wireType) + if iNdEx >= l { + return io.ErrUnexpectedEOF } - var v int64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= (int64(b) & 0x7F) << shift - if b < 0x80 { - break - } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break } - m.TargetUnion = &Compare_ModRevision{v} - case 7: + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: SnapshotResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SnapshotResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) } - var byteLen int + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc @@ -12014,27 +14008,30 @@ func (m *Compare) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - byteLen |= (int(b) & 0x7F) << shift + msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } - if byteLen < 0 { + if msglen < 0 { return ErrInvalidLengthRpc } - postIndex := iNdEx + byteLen + postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } - v := make([]byte, postIndex-iNdEx) - copy(v, dAtA[iNdEx:postIndex]) - m.TargetUnion = &Compare_Value{v} + if m.Header == nil { + m.Header = &ResponseHeader{} + } + if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex - case 8: + case 2: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Lease", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field RemainingBytes", wireType) } - var v int64 + m.RemainingBytes = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc @@ -12044,15 +14041,14 @@ func (m *Compare) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - v |= (int64(b) & 0x7F) << shift + m.RemainingBytes |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } - m.TargetUnion = &Compare_Lease{v} - case 64: + case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field RangeEnd", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Blob", wireType) } var byteLen int for shift := uint(0); ; shift += 7 { @@ -12076,9 +14072,9 @@ func (m *Compare) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.RangeEnd = append(m.RangeEnd[:0], dAtA[iNdEx:postIndex]...) - if m.RangeEnd == nil { - m.RangeEnd = []byte{} + m.Blob = append(m.Blob[:0], dAtA[iNdEx:postIndex]...) + if m.Blob == nil { + m.Blob = []byte{} } iNdEx = postIndex default: @@ -12102,7 +14098,7 @@ func (m *Compare) Unmarshal(dAtA []byte) error { } return nil } -func (m *TxnRequest) Unmarshal(dAtA []byte) error { +func (m *WatchRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -12125,15 +14121,15 @@ func (m *TxnRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: TxnRequest: wiretype end group for non-group") + return fmt.Errorf("proto: WatchRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: TxnRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: WatchRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Compare", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field CreateRequest", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -12157,14 +14153,15 @@ func (m *TxnRequest) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Compare = append(m.Compare, &Compare{}) - if err := m.Compare[len(m.Compare)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + v := &WatchCreateRequest{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } + m.RequestUnion = &WatchRequest_CreateRequest{v} iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Success", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field CancelRequest", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -12188,14 +14185,15 @@ func (m *TxnRequest) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Success = append(m.Success, &RequestOp{}) - if err := m.Success[len(m.Success)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + v := &WatchCancelRequest{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } + m.RequestUnion = &WatchRequest_CancelRequest{v} iNdEx = postIndex case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Failure", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ProgressRequest", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -12219,10 +14217,11 @@ func (m *TxnRequest) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Failure = append(m.Failure, &RequestOp{}) - if err := m.Failure[len(m.Failure)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + v := &WatchProgressRequest{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } + m.RequestUnion = &WatchRequest_ProgressRequest{v} iNdEx = postIndex default: iNdEx = preIndex @@ -12245,7 +14244,7 @@ func (m *TxnRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *TxnResponse) Unmarshal(dAtA []byte) error { +func (m *WatchCreateRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -12268,17 +14267,17 @@ func (m *TxnResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: TxnResponse: wiretype end group for non-group") + return fmt.Errorf("proto: WatchCreateRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: TxnResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: WatchCreateRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) } - var msglen int + var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc @@ -12288,30 +14287,28 @@ func (m *TxnResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + byteLen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + if byteLen < 0 { return ErrInvalidLengthRpc } - postIndex := iNdEx + msglen + postIndex := iNdEx + byteLen if postIndex > l { return io.ErrUnexpectedEOF } - if m.Header == nil { - m.Header = &ResponseHeader{} - } - if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err + m.Key = append(m.Key[:0], dAtA[iNdEx:postIndex]...) + if m.Key == nil { + m.Key = []byte{} } iNdEx = postIndex case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Succeeded", wireType) + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RangeEnd", wireType) } - var v int + var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc @@ -12321,17 +14318,28 @@ func (m *TxnResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - v |= (int(b) & 0x7F) << shift + byteLen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } - m.Succeeded = bool(v != 0) + if byteLen < 0 { + return ErrInvalidLengthRpc + } + postIndex := iNdEx + byteLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RangeEnd = append(m.RangeEnd[:0], dAtA[iNdEx:postIndex]...) + if m.RangeEnd == nil { + m.RangeEnd = []byte{} + } + iNdEx = postIndex case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Responses", wireType) + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field StartRevision", wireType) } - var msglen int + m.StartRevision = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc @@ -12341,78 +14349,118 @@ func (m *TxnResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + m.StartRevision |= (int64(b) & 0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Responses = append(m.Responses, &ResponseOp{}) - if err := m.Responses[len(m.Responses)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthRpc + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ProgressNotify", wireType) } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *CompactionRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc + m.ProgressNotify = bool(v != 0) + case 5: + if wireType == 0 { + var v WatchCreateRequest_FilterType + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= (WatchCreateRequest_FilterType(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.Filters = append(m.Filters, v) + } else if wireType == 2 { + var packedLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + packedLen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if packedLen < 0 { + return ErrInvalidLengthRpc + } + postIndex := iNdEx + packedLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + for iNdEx < postIndex { + var v WatchCreateRequest_FilterType + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= (WatchCreateRequest_FilterType(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.Filters = append(m.Filters, v) + } + } else { + return fmt.Errorf("proto: wrong wireType = %d for field Filters", wireType) } - if iNdEx >= l { - return io.ErrUnexpectedEOF + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field PrevKv", wireType) } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: CompactionRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: CompactionRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: + m.PrevKv = bool(v != 0) + case 7: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Revision", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field WatchId", wireType) } - m.Revision = 0 + m.WatchId = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc @@ -12422,14 +14470,14 @@ func (m *CompactionRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Revision |= (int64(b) & 0x7F) << shift + m.WatchId |= (int64(b) & 0x7F) << shift if b < 0x80 { break } } - case 2: + case 8: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Physical", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Fragment", wireType) } var v int for shift := uint(0); ; shift += 7 { @@ -12446,7 +14494,7 @@ func (m *CompactionRequest) Unmarshal(dAtA []byte) error { break } } - m.Physical = bool(v != 0) + m.Fragment = bool(v != 0) default: iNdEx = preIndex skippy, err := skipRpc(dAtA[iNdEx:]) @@ -12468,7 +14516,7 @@ func (m *CompactionRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *CompactionResponse) Unmarshal(dAtA []byte) error { +func (m *WatchCancelRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -12491,17 +14539,17 @@ func (m *CompactionResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: CompactionResponse: wiretype end group for non-group") + return fmt.Errorf("proto: WatchCancelRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: CompactionResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: WatchCancelRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field WatchId", wireType) } - var msglen int + m.WatchId = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc @@ -12511,25 +14559,11 @@ func (m *CompactionResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + m.WatchId |= (int64(b) & 0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Header == nil { - m.Header = &ResponseHeader{} - } - if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipRpc(dAtA[iNdEx:]) @@ -12551,7 +14585,7 @@ func (m *CompactionResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *HashRequest) Unmarshal(dAtA []byte) error { +func (m *WatchProgressRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -12574,10 +14608,10 @@ func (m *HashRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: HashRequest: wiretype end group for non-group") + return fmt.Errorf("proto: WatchProgressRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: HashRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: WatchProgressRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { default: @@ -12601,7 +14635,7 @@ func (m *HashRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *HashKVRequest) Unmarshal(dAtA []byte) error { +func (m *WatchResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -12624,17 +14658,17 @@ func (m *HashKVRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: HashKVRequest: wiretype end group for non-group") + return fmt.Errorf("proto: WatchResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: HashKVRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: WatchResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Revision", wireType) + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) } - m.Revision = 0 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc @@ -12644,66 +14678,108 @@ func (m *HashKVRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Revision |= (int64(b) & 0x7F) << shift + msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { + if msglen < 0 { return ErrInvalidLengthRpc } - if (iNdEx + skippy) > l { + postIndex := iNdEx + msglen + if postIndex > l { return io.ErrUnexpectedEOF } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *HashKVResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc + if m.Header == nil { + m.Header = &ResponseHeader{} } - if iNdEx >= l { - return io.ErrUnexpectedEOF + if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field WatchId", wireType) } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: HashKVResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: HashKVResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: + m.WatchId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.WatchId |= (int64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Created", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.Created = bool(v != 0) + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Canceled", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.Canceled = bool(v != 0) + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field CompactRevision", wireType) + } + m.CompactRevision = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.CompactRevision |= (int64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + case 6: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field CancelReason", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc @@ -12713,30 +14789,26 @@ func (m *HashKVResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthRpc } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex > l { return io.ErrUnexpectedEOF } - if m.Header == nil { - m.Header = &ResponseHeader{} - } - if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.CancelReason = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 2: + case 7: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Hash", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Fragment", wireType) } - m.Hash = 0 + var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc @@ -12746,16 +14818,17 @@ func (m *HashKVResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Hash |= (uint32(b) & 0x7F) << shift + v |= (int(b) & 0x7F) << shift if b < 0x80 { break } } - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field CompactRevision", wireType) + m.Fragment = bool(v != 0) + case 11: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Events", wireType) } - m.CompactRevision = 0 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc @@ -12765,11 +14838,23 @@ func (m *HashKVResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.CompactRevision |= (int64(b) & 0x7F) << shift + msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } + if msglen < 0 { + return ErrInvalidLengthRpc + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Events = append(m.Events, &mvccpb.Event{}) + if err := m.Events[len(m.Events)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipRpc(dAtA[iNdEx:]) @@ -12791,7 +14876,7 @@ func (m *HashKVResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *HashResponse) Unmarshal(dAtA []byte) error { +func (m *LeaseGrantRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -12814,17 +14899,17 @@ func (m *HashResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: HashResponse: wiretype end group for non-group") + return fmt.Errorf("proto: LeaseGrantRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: HashResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: LeaseGrantRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field TTL", wireType) } - var msglen int + m.TTL = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc @@ -12834,30 +14919,16 @@ func (m *HashResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + m.TTL |= (int64(b) & 0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Header == nil { - m.Header = &ResponseHeader{} - } - if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex case 2: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Hash", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType) } - m.Hash = 0 + m.ID = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc @@ -12867,7 +14938,7 @@ func (m *HashResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Hash |= (uint32(b) & 0x7F) << shift + m.ID |= (int64(b) & 0x7F) << shift if b < 0x80 { break } @@ -12893,57 +14964,7 @@ func (m *HashResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *SnapshotRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: SnapshotRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: SnapshotRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *SnapshotResponse) Unmarshal(dAtA []byte) error { +func (m *LeaseGrantResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -12966,10 +14987,10 @@ func (m *SnapshotResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: SnapshotResponse: wiretype end group for non-group") + return fmt.Errorf("proto: LeaseGrantResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: SnapshotResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: LeaseGrantResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -13007,9 +15028,9 @@ func (m *SnapshotResponse) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 2: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field RemainingBytes", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType) } - m.RemainingBytes = 0 + m.ID = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc @@ -13019,16 +15040,35 @@ func (m *SnapshotResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.RemainingBytes |= (uint64(b) & 0x7F) << shift + m.ID |= (int64(b) & 0x7F) << shift if b < 0x80 { break } } case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field TTL", wireType) + } + m.TTL = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.TTL |= (int64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + case 4: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Blob", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Error", wireType) } - var byteLen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc @@ -13038,22 +15078,20 @@ func (m *SnapshotResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - byteLen |= (int(b) & 0x7F) << shift + stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } - if byteLen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthRpc } - postIndex := iNdEx + byteLen + postIndex := iNdEx + intStringLen if postIndex > l { return io.ErrUnexpectedEOF } - m.Blob = append(m.Blob[:0], dAtA[iNdEx:postIndex]...) - if m.Blob == nil { - m.Blob = []byte{} - } + m.Error = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -13076,7 +15114,7 @@ func (m *SnapshotResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *WatchRequest) Unmarshal(dAtA []byte) error { +func (m *LeaseRevokeRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -13096,84 +15134,20 @@ func (m *WatchRequest) Unmarshal(dAtA []byte) error { break } } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: WatchRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: WatchRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CreateRequest", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &WatchCreateRequest{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.RequestUnion = &WatchRequest_CreateRequest{v} - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CancelRequest", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &WatchCancelRequest{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.RequestUnion = &WatchRequest_CancelRequest{v} - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ProgressRequest", wireType) + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: LeaseRevokeRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: LeaseRevokeRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType) } - var msglen int + m.ID = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc @@ -13183,24 +15157,11 @@ func (m *WatchRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + m.ID |= (int64(b) & 0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &WatchProgressRequest{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.RequestUnion = &WatchRequest_ProgressRequest{v} - iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipRpc(dAtA[iNdEx:]) @@ -13222,7 +15183,7 @@ func (m *WatchRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *WatchCreateRequest) Unmarshal(dAtA []byte) error { +func (m *LeaseRevokeResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -13245,17 +15206,17 @@ func (m *WatchCreateRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: WatchCreateRequest: wiretype end group for non-group") + return fmt.Errorf("proto: LeaseRevokeResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: WatchCreateRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: LeaseRevokeResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) } - var byteLen int + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc @@ -13265,59 +15226,80 @@ func (m *WatchCreateRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - byteLen |= (int(b) & 0x7F) << shift + msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } - if byteLen < 0 { + if msglen < 0 { return ErrInvalidLengthRpc } - postIndex := iNdEx + byteLen + postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } - m.Key = append(m.Key[:0], dAtA[iNdEx:postIndex]...) - if m.Key == nil { - m.Key = []byte{} + if m.Header == nil { + m.Header = &ResponseHeader{} } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field RangeEnd", wireType) + if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipRpc(dAtA[iNdEx:]) + if err != nil { + return err } - if byteLen < 0 { + if skippy < 0 { return ErrInvalidLengthRpc } - postIndex := iNdEx + byteLen - if postIndex > l { + if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } - m.RangeEnd = append(m.RangeEnd[:0], dAtA[iNdEx:postIndex]...) - if m.RangeEnd == nil { - m.RangeEnd = []byte{} + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *LeaseCheckpoint) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRpc } - iNdEx = postIndex - case 3: + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: LeaseCheckpoint: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: LeaseCheckpoint: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field StartRevision", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType) } - m.StartRevision = 0 + m.ID = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc @@ -13327,16 +15309,16 @@ func (m *WatchCreateRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.StartRevision |= (int64(b) & 0x7F) << shift + m.ID |= (int64(b) & 0x7F) << shift if b < 0x80 { break } } - case 4: + case 2: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ProgressNotify", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Remaining_TTL", wireType) } - var v int + m.Remaining_TTL = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc @@ -13346,99 +15328,66 @@ func (m *WatchCreateRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - v |= (int(b) & 0x7F) << shift + m.Remaining_TTL |= (int64(b) & 0x7F) << shift if b < 0x80 { break } } - m.ProgressNotify = bool(v != 0) - case 5: - if wireType == 0 { - var v WatchCreateRequest_FilterType - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= (WatchCreateRequest_FilterType(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.Filters = append(m.Filters, v) - } else if wireType == 2 { - var packedLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - packedLen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if packedLen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + packedLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - for iNdEx < postIndex { - var v WatchCreateRequest_FilterType - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= (WatchCreateRequest_FilterType(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.Filters = append(m.Filters, v) - } - } else { - return fmt.Errorf("proto: wrong wireType = %d for field Filters", wireType) + default: + iNdEx = preIndex + skippy, err := skipRpc(dAtA[iNdEx:]) + if err != nil { + return err } - case 6: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field PrevKv", wireType) + if skippy < 0 { + return ErrInvalidLengthRpc } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF } - m.PrevKv = bool(v != 0) - case 7: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field WatchId", wireType) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *LeaseCheckpointRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break } - m.WatchId = 0 + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: LeaseCheckpointRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: LeaseCheckpointRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Checkpoints", wireType) + } + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc @@ -13448,31 +15397,23 @@ func (m *WatchCreateRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.WatchId |= (int64(b) & 0x7F) << shift + msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } - case 8: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Fragment", wireType) + if msglen < 0 { + return ErrInvalidLengthRpc } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF } - m.Fragment = bool(v != 0) + m.Checkpoints = append(m.Checkpoints, &LeaseCheckpoint{}) + if err := m.Checkpoints[len(m.Checkpoints)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipRpc(dAtA[iNdEx:]) @@ -13494,7 +15435,7 @@ func (m *WatchCreateRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *WatchCancelRequest) Unmarshal(dAtA []byte) error { +func (m *LeaseCheckpointResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -13517,17 +15458,17 @@ func (m *WatchCancelRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: WatchCancelRequest: wiretype end group for non-group") + return fmt.Errorf("proto: LeaseCheckpointResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: WatchCancelRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: LeaseCheckpointResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field WatchId", wireType) + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) } - m.WatchId = 0 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc @@ -13537,11 +15478,25 @@ func (m *WatchCancelRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.WatchId |= (int64(b) & 0x7F) << shift + msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } + if msglen < 0 { + return ErrInvalidLengthRpc + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Header == nil { + m.Header = &ResponseHeader{} + } + if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipRpc(dAtA[iNdEx:]) @@ -13563,7 +15518,7 @@ func (m *WatchCancelRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *WatchProgressRequest) Unmarshal(dAtA []byte) error { +func (m *LeaseKeepAliveRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -13586,12 +15541,31 @@ func (m *WatchProgressRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: WatchProgressRequest: wiretype end group for non-group") + return fmt.Errorf("proto: LeaseKeepAliveRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: WatchProgressRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: LeaseKeepAliveRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType) + } + m.ID = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ID |= (int64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := skipRpc(dAtA[iNdEx:]) @@ -13613,7 +15587,7 @@ func (m *WatchProgressRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *WatchResponse) Unmarshal(dAtA []byte) error { +func (m *LeaseKeepAliveResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -13636,10 +15610,10 @@ func (m *WatchResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: WatchResponse: wiretype end group for non-group") + return fmt.Errorf("proto: LeaseKeepAliveResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: WatchResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: LeaseKeepAliveResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -13677,9 +15651,9 @@ func (m *WatchResponse) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 2: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field WatchId", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType) } - m.WatchId = 0 + m.ID = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc @@ -13689,14 +15663,102 @@ func (m *WatchResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.WatchId |= (int64(b) & 0x7F) << shift + m.ID |= (int64(b) & 0x7F) << shift if b < 0x80 { break } } case 3: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Created", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field TTL", wireType) + } + m.TTL = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.TTL |= (int64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipRpc(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthRpc + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *LeaseTimeToLiveRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: LeaseTimeToLiveRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: LeaseTimeToLiveRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType) + } + m.ID = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ID |= (int64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Keys", wireType) } var v int for shift := uint(0); ; shift += 7 { @@ -13713,12 +15775,62 @@ func (m *WatchResponse) Unmarshal(dAtA []byte) error { break } } - m.Created = bool(v != 0) - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Canceled", wireType) + m.Keys = bool(v != 0) + default: + iNdEx = preIndex + skippy, err := skipRpc(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthRpc + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *LeaseTimeToLiveResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: LeaseTimeToLiveResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: LeaseTimeToLiveResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) } - var v int + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc @@ -13728,17 +15840,30 @@ func (m *WatchResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - v |= (int(b) & 0x7F) << shift + msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } - m.Canceled = bool(v != 0) - case 5: + if msglen < 0 { + return ErrInvalidLengthRpc + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Header == nil { + m.Header = &ResponseHeader{} + } + if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field CompactRevision", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType) } - m.CompactRevision = 0 + m.ID = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc @@ -13748,16 +15873,16 @@ func (m *WatchResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.CompactRevision |= (int64(b) & 0x7F) << shift + m.ID |= (int64(b) & 0x7F) << shift if b < 0x80 { break } } - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CancelReason", wireType) + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field TTL", wireType) } - var stringLen uint64 + m.TTL = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc @@ -13767,26 +15892,16 @@ func (m *WatchResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + m.TTL |= (int64(b) & 0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.CancelReason = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 7: + case 4: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Fragment", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field GrantedTTL", wireType) } - var v int + m.GrantedTTL = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc @@ -13796,17 +15911,16 @@ func (m *WatchResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - v |= (int(b) & 0x7F) << shift + m.GrantedTTL |= (int64(b) & 0x7F) << shift if b < 0x80 { break } } - m.Fragment = bool(v != 0) - case 11: + case 5: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Events", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Keys", wireType) } - var msglen int + var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc @@ -13816,22 +15930,20 @@ func (m *WatchResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + byteLen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + if byteLen < 0 { return ErrInvalidLengthRpc } - postIndex := iNdEx + msglen + postIndex := iNdEx + byteLen if postIndex > l { return io.ErrUnexpectedEOF } - m.Events = append(m.Events, &mvccpb.Event{}) - if err := m.Events[len(m.Events)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.Keys = append(m.Keys, make([]byte, postIndex-iNdEx)) + copy(m.Keys[len(m.Keys)-1], dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -13854,7 +15966,7 @@ func (m *WatchResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *LeaseGrantRequest) Unmarshal(dAtA []byte) error { +func (m *LeaseLeasesRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -13877,32 +15989,63 @@ func (m *LeaseGrantRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: LeaseGrantRequest: wiretype end group for non-group") + return fmt.Errorf("proto: LeaseLeasesRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: LeaseGrantRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: LeaseLeasesRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field TTL", wireType) + default: + iNdEx = preIndex + skippy, err := skipRpc(dAtA[iNdEx:]) + if err != nil { + return err } - m.TTL = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.TTL |= (int64(b) & 0x7F) << shift - if b < 0x80 { - break - } + if skippy < 0 { + return ErrInvalidLengthRpc } - case 2: + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *LeaseStatus) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: LeaseStatus: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: LeaseStatus: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType) } @@ -13942,7 +16085,7 @@ func (m *LeaseGrantRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *LeaseGrantResponse) Unmarshal(dAtA []byte) error { +func (m *LeaseLeasesResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -13965,10 +16108,10 @@ func (m *LeaseGrantResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: LeaseGrantResponse: wiretype end group for non-group") + return fmt.Errorf("proto: LeaseLeasesResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: LeaseGrantResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: LeaseLeasesResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -14005,10 +16148,110 @@ func (m *LeaseGrantResponse) Unmarshal(dAtA []byte) error { } iNdEx = postIndex case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Leases", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthRpc + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Leases = append(m.Leases, &LeaseStatus{}) + if err := m.Leases[len(m.Leases)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipRpc(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthRpc + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Member) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Member: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Member: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType) } - m.ID = 0 + m.ID = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ID |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc @@ -14018,16 +16261,26 @@ func (m *LeaseGrantResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.ID |= (int64(b) & 0x7F) << shift + stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthRpc + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field TTL", wireType) + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PeerURLs", wireType) } - m.TTL = 0 + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc @@ -14037,14 +16290,24 @@ func (m *LeaseGrantResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.TTL |= (int64(b) & 0x7F) << shift + stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthRpc + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.PeerURLs = append(m.PeerURLs, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex case 4: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Error", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ClientURLs", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -14069,8 +16332,28 @@ func (m *LeaseGrantResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Error = string(dAtA[iNdEx:postIndex]) + m.ClientURLs = append(m.ClientURLs, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field IsLearner", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.IsLearner = bool(v != 0) default: iNdEx = preIndex skippy, err := skipRpc(dAtA[iNdEx:]) @@ -14092,7 +16375,7 @@ func (m *LeaseGrantResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *LeaseRevokeRequest) Unmarshal(dAtA []byte) error { +func (m *MemberAddRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -14115,17 +16398,46 @@ func (m *LeaseRevokeRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: LeaseRevokeRequest: wiretype end group for non-group") + return fmt.Errorf("proto: MemberAddRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: LeaseRevokeRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MemberAddRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PeerURLs", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthRpc + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.PeerURLs = append(m.PeerURLs, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 2: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field IsLearner", wireType) } - m.ID = 0 + var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc @@ -14135,11 +16447,12 @@ func (m *LeaseRevokeRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.ID |= (int64(b) & 0x7F) << shift + v |= (int(b) & 0x7F) << shift if b < 0x80 { break } } + m.IsLearner = bool(v != 0) default: iNdEx = preIndex skippy, err := skipRpc(dAtA[iNdEx:]) @@ -14161,7 +16474,7 @@ func (m *LeaseRevokeRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *LeaseRevokeResponse) Unmarshal(dAtA []byte) error { +func (m *MemberAddResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -14184,10 +16497,10 @@ func (m *LeaseRevokeResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: LeaseRevokeResponse: wiretype end group for non-group") + return fmt.Errorf("proto: MemberAddResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: LeaseRevokeResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MemberAddResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -14223,61 +16536,11 @@ func (m *LeaseRevokeResponse) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *LeaseCheckpoint) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: LeaseCheckpoint: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: LeaseCheckpoint: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType) + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Member", wireType) } - m.ID = 0 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc @@ -14287,16 +16550,30 @@ func (m *LeaseCheckpoint) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.ID |= (int64(b) & 0x7F) << shift + msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Remaining_TTL", wireType) + if msglen < 0 { + return ErrInvalidLengthRpc } - m.Remaining_TTL = 0 + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Member == nil { + m.Member = &Member{} + } + if err := m.Member.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Members", wireType) + } + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc @@ -14306,11 +16583,23 @@ func (m *LeaseCheckpoint) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Remaining_TTL |= (int64(b) & 0x7F) << shift + msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } + if msglen < 0 { + return ErrInvalidLengthRpc + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Members = append(m.Members, &Member{}) + if err := m.Members[len(m.Members)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipRpc(dAtA[iNdEx:]) @@ -14332,7 +16621,7 @@ func (m *LeaseCheckpoint) Unmarshal(dAtA []byte) error { } return nil } -func (m *LeaseCheckpointRequest) Unmarshal(dAtA []byte) error { +func (m *MemberRemoveRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -14355,17 +16644,17 @@ func (m *LeaseCheckpointRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: LeaseCheckpointRequest: wiretype end group for non-group") + return fmt.Errorf("proto: MemberRemoveRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: LeaseCheckpointRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MemberRemoveRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Checkpoints", wireType) + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType) } - var msglen int + m.ID = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc @@ -14375,23 +16664,11 @@ func (m *LeaseCheckpointRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + m.ID |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Checkpoints = append(m.Checkpoints, &LeaseCheckpoint{}) - if err := m.Checkpoints[len(m.Checkpoints)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipRpc(dAtA[iNdEx:]) @@ -14413,7 +16690,7 @@ func (m *LeaseCheckpointRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *LeaseCheckpointResponse) Unmarshal(dAtA []byte) error { +func (m *MemberRemoveResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -14436,15 +16713,48 @@ func (m *LeaseCheckpointResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: LeaseCheckpointResponse: wiretype end group for non-group") + return fmt.Errorf("proto: MemberRemoveResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: LeaseCheckpointResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MemberRemoveResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthRpc + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Header == nil { + m.Header = &ResponseHeader{} + } + if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Members", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -14468,10 +16778,8 @@ func (m *LeaseCheckpointResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.Header == nil { - m.Header = &ResponseHeader{} - } - if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.Members = append(m.Members, &Member{}) + if err := m.Members[len(m.Members)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -14496,7 +16804,7 @@ func (m *LeaseCheckpointResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *LeaseKeepAliveRequest) Unmarshal(dAtA []byte) error { +func (m *MemberUpdateRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -14519,10 +16827,10 @@ func (m *LeaseKeepAliveRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: LeaseKeepAliveRequest: wiretype end group for non-group") + return fmt.Errorf("proto: MemberUpdateRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: LeaseKeepAliveRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MemberUpdateRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -14539,11 +16847,40 @@ func (m *LeaseKeepAliveRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.ID |= (int64(b) & 0x7F) << shift + m.ID |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PeerURLs", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthRpc + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.PeerURLs = append(m.PeerURLs, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipRpc(dAtA[iNdEx:]) @@ -14565,7 +16902,7 @@ func (m *LeaseKeepAliveRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *LeaseKeepAliveResponse) Unmarshal(dAtA []byte) error { +func (m *MemberUpdateResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -14588,10 +16925,10 @@ func (m *LeaseKeepAliveResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: LeaseKeepAliveResponse: wiretype end group for non-group") + return fmt.Errorf("proto: MemberUpdateResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: LeaseKeepAliveResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MemberUpdateResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -14628,10 +16965,10 @@ func (m *LeaseKeepAliveResponse) Unmarshal(dAtA []byte) error { } iNdEx = postIndex case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType) + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Members", wireType) } - m.ID = 0 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc @@ -14641,30 +16978,23 @@ func (m *LeaseKeepAliveResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.ID |= (int64(b) & 0x7F) << shift + msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field TTL", wireType) + if msglen < 0 { + return ErrInvalidLengthRpc } - m.TTL = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.TTL |= (int64(b) & 0x7F) << shift - if b < 0x80 { - break - } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Members = append(m.Members, &Member{}) + if err := m.Members[len(m.Members)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipRpc(dAtA[iNdEx:]) @@ -14686,7 +17016,7 @@ func (m *LeaseKeepAliveResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *LeaseTimeToLiveRequest) Unmarshal(dAtA []byte) error { +func (m *MemberListRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -14709,34 +17039,15 @@ func (m *LeaseTimeToLiveRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: LeaseTimeToLiveRequest: wiretype end group for non-group") + return fmt.Errorf("proto: MemberListRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: LeaseTimeToLiveRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MemberListRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType) - } - m.ID = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.ID |= (int64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Keys", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Linearizable", wireType) } var v int for shift := uint(0); ; shift += 7 { @@ -14753,7 +17064,7 @@ func (m *LeaseTimeToLiveRequest) Unmarshal(dAtA []byte) error { break } } - m.Keys = bool(v != 0) + m.Linearizable = bool(v != 0) default: iNdEx = preIndex skippy, err := skipRpc(dAtA[iNdEx:]) @@ -14775,7 +17086,7 @@ func (m *LeaseTimeToLiveRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *LeaseTimeToLiveResponse) Unmarshal(dAtA []byte) error { +func (m *MemberListResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -14798,10 +17109,10 @@ func (m *LeaseTimeToLiveResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: LeaseTimeToLiveResponse: wiretype end group for non-group") + return fmt.Errorf("proto: MemberListResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: LeaseTimeToLiveResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MemberListResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -14838,67 +17149,10 @@ func (m *LeaseTimeToLiveResponse) Unmarshal(dAtA []byte) error { } iNdEx = postIndex case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType) - } - m.ID = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.ID |= (int64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field TTL", wireType) - } - m.TTL = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.TTL |= (int64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field GrantedTTL", wireType) - } - m.GrantedTTL = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.GrantedTTL |= (int64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - case 5: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Keys", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Members", wireType) } - var byteLen int + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc @@ -14908,71 +17162,23 @@ func (m *LeaseTimeToLiveResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - byteLen |= (int(b) & 0x7F) << shift + msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } - if byteLen < 0 { + if msglen < 0 { return ErrInvalidLengthRpc } - postIndex := iNdEx + byteLen + postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } - m.Keys = append(m.Keys, make([]byte, postIndex-iNdEx)) - copy(m.Keys[len(m.Keys)-1], dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { + m.Members = append(m.Members, &Member{}) + if err := m.Members[len(m.Members)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *LeaseLeasesRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: LeaseLeasesRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: LeaseLeasesRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipRpc(dAtA[iNdEx:]) @@ -14994,7 +17200,7 @@ func (m *LeaseLeasesRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *LeaseStatus) Unmarshal(dAtA []byte) error { +func (m *MemberPromoteRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -15017,10 +17223,10 @@ func (m *LeaseStatus) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: LeaseStatus: wiretype end group for non-group") + return fmt.Errorf("proto: MemberPromoteRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: LeaseStatus: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MemberPromoteRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -15037,7 +17243,7 @@ func (m *LeaseStatus) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.ID |= (int64(b) & 0x7F) << shift + m.ID |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } @@ -15063,7 +17269,7 @@ func (m *LeaseStatus) Unmarshal(dAtA []byte) error { } return nil } -func (m *LeaseLeasesResponse) Unmarshal(dAtA []byte) error { +func (m *MemberPromoteResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -15086,10 +17292,10 @@ func (m *LeaseLeasesResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: LeaseLeasesResponse: wiretype end group for non-group") + return fmt.Errorf("proto: MemberPromoteResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: LeaseLeasesResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MemberPromoteResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -15127,7 +17333,7 @@ func (m *LeaseLeasesResponse) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Leases", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Members", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -15151,8 +17357,8 @@ func (m *LeaseLeasesResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Leases = append(m.Leases, &LeaseStatus{}) - if err := m.Leases[len(m.Leases)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.Members = append(m.Members, &Member{}) + if err := m.Members[len(m.Members)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -15177,7 +17383,7 @@ func (m *LeaseLeasesResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *Member) Unmarshal(dAtA []byte) error { +func (m *DefragmentRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -15200,65 +17406,67 @@ func (m *Member) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: Member: wiretype end group for non-group") + return fmt.Errorf("proto: DefragmentRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: Member: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: DefragmentRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType) - } - m.ID = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.ID |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } + default: + iNdEx = preIndex + skippy, err := skipRpc(dAtA[iNdEx:]) + if err != nil { + return err } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + if skippy < 0 { + return ErrInvalidLengthRpc } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthRpc + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *DefragmentResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRpc } - postIndex := iNdEx + intStringLen - if postIndex > l { + if iNdEx >= l { return io.ErrUnexpectedEOF } - m.Name = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: DefragmentResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: DefragmentResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PeerURLs", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc @@ -15268,55 +17476,80 @@ func (m *Member) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthRpc } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } - m.PeerURLs = append(m.PeerURLs, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ClientURLs", wireType) + if m.Header == nil { + m.Header = &ResponseHeader{} } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } + if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err } - intStringLen := int(stringLen) - if intStringLen < 0 { + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipRpc(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { return ErrInvalidLengthRpc } - postIndex := iNdEx + intStringLen - if postIndex > l { + if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } - m.ClientURLs = append(m.ClientURLs, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 5: + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MoveLeaderRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MoveLeaderRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MoveLeaderRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field IsLearner", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field TargetID", wireType) } - var v int + m.TargetID = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc @@ -15326,12 +17559,11 @@ func (m *Member) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - v |= (int(b) & 0x7F) << shift + m.TargetID |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } - m.IsLearner = bool(v != 0) default: iNdEx = preIndex skippy, err := skipRpc(dAtA[iNdEx:]) @@ -15353,7 +17585,7 @@ func (m *Member) Unmarshal(dAtA []byte) error { } return nil } -func (m *MemberAddRequest) Unmarshal(dAtA []byte) error { +func (m *MoveLeaderResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -15376,17 +17608,17 @@ func (m *MemberAddRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MemberAddRequest: wiretype end group for non-group") + return fmt.Errorf("proto: MoveLeaderResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MemberAddRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MoveLeaderResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PeerURLs", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc @@ -15396,41 +17628,25 @@ func (m *MemberAddRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthRpc } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } - m.PeerURLs = append(m.PeerURLs, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field IsLearner", wireType) + if m.Header == nil { + m.Header = &ResponseHeader{} } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } + if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err } - m.IsLearner = bool(v != 0) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipRpc(dAtA[iNdEx:]) @@ -15452,7 +17668,7 @@ func (m *MemberAddRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *MemberAddResponse) Unmarshal(dAtA []byte) error { +func (m *AlarmRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -15475,17 +17691,17 @@ func (m *MemberAddResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MemberAddResponse: wiretype end group for non-group") + return fmt.Errorf("proto: AlarmRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MemberAddResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: AlarmRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Action", wireType) } - var msglen int + m.Action = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc @@ -15495,30 +17711,16 @@ func (m *MemberAddResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + m.Action |= (AlarmRequest_AlarmAction(b) & 0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Header == nil { - m.Header = &ResponseHeader{} - } - if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Member", wireType) + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field MemberID", wireType) } - var msglen int + m.MemberID = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc @@ -15528,30 +17730,16 @@ func (m *MemberAddResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + m.MemberID |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Member == nil { - m.Member = &Member{} - } - if err := m.Member.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Members", wireType) + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Alarm", wireType) } - var msglen int + m.Alarm = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc @@ -15561,23 +17749,11 @@ func (m *MemberAddResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + m.Alarm |= (AlarmType(b) & 0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Members = append(m.Members, &Member{}) - if err := m.Members[len(m.Members)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipRpc(dAtA[iNdEx:]) @@ -15599,7 +17775,7 @@ func (m *MemberAddResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *MemberRemoveRequest) Unmarshal(dAtA []byte) error { +func (m *AlarmMember) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -15622,17 +17798,17 @@ func (m *MemberRemoveRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MemberRemoveRequest: wiretype end group for non-group") + return fmt.Errorf("proto: AlarmMember: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MemberRemoveRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: AlarmMember: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field MemberID", wireType) } - m.ID = 0 + m.MemberID = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc @@ -15642,7 +17818,26 @@ func (m *MemberRemoveRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.ID |= (uint64(b) & 0x7F) << shift + m.MemberID |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Alarm", wireType) + } + m.Alarm = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Alarm |= (AlarmType(b) & 0x7F) << shift if b < 0x80 { break } @@ -15668,7 +17863,7 @@ func (m *MemberRemoveRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *MemberRemoveResponse) Unmarshal(dAtA []byte) error { +func (m *AlarmResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -15691,10 +17886,10 @@ func (m *MemberRemoveResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MemberRemoveResponse: wiretype end group for non-group") + return fmt.Errorf("proto: AlarmResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MemberRemoveResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: AlarmResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -15732,7 +17927,7 @@ func (m *MemberRemoveResponse) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Members", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Alarms", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -15756,8 +17951,8 @@ func (m *MemberRemoveResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Members = append(m.Members, &Member{}) - if err := m.Members[len(m.Members)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.Alarms = append(m.Alarms, &AlarmMember{}) + if err := m.Alarms[len(m.Alarms)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -15782,7 +17977,7 @@ func (m *MemberRemoveResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *MemberUpdateRequest) Unmarshal(dAtA []byte) error { +func (m *DowngradeRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -15805,17 +18000,17 @@ func (m *MemberUpdateRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MemberUpdateRequest: wiretype end group for non-group") + return fmt.Errorf("proto: DowngradeRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MemberUpdateRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: DowngradeRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Action", wireType) } - m.ID = 0 + m.Action = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc @@ -15825,14 +18020,14 @@ func (m *MemberUpdateRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.ID |= (uint64(b) & 0x7F) << shift + m.Action |= (DowngradeRequest_DowngradeAction(b) & 0x7F) << shift if b < 0x80 { break } } case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PeerURLs", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -15857,7 +18052,7 @@ func (m *MemberUpdateRequest) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.PeerURLs = append(m.PeerURLs, string(dAtA[iNdEx:postIndex])) + m.Version = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -15880,7 +18075,7 @@ func (m *MemberUpdateRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *MemberUpdateResponse) Unmarshal(dAtA []byte) error { +func (m *DowngradeResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -15903,10 +18098,10 @@ func (m *MemberUpdateResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MemberUpdateResponse: wiretype end group for non-group") + return fmt.Errorf("proto: DowngradeResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MemberUpdateResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: DowngradeResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -15944,9 +18139,9 @@ func (m *MemberUpdateResponse) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Members", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc @@ -15956,22 +18151,20 @@ func (m *MemberUpdateResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthRpc } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex > l { return io.ErrUnexpectedEOF } - m.Members = append(m.Members, &Member{}) - if err := m.Members[len(m.Members)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.Version = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -15994,7 +18187,7 @@ func (m *MemberUpdateResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *MemberListRequest) Unmarshal(dAtA []byte) error { +func (m *StatusRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -16017,32 +18210,12 @@ func (m *MemberListRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MemberListRequest: wiretype end group for non-group") + return fmt.Errorf("proto: StatusRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MemberListRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: StatusRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Linearizable", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.Linearizable = bool(v != 0) default: iNdEx = preIndex skippy, err := skipRpc(dAtA[iNdEx:]) @@ -16064,7 +18237,7 @@ func (m *MemberListRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *MemberListResponse) Unmarshal(dAtA []byte) error { +func (m *StatusResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -16087,10 +18260,10 @@ func (m *MemberListResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MemberListResponse: wiretype end group for non-group") + return fmt.Errorf("proto: StatusResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MemberListResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: StatusResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -16128,9 +18301,9 @@ func (m *MemberListResponse) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Members", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc @@ -16140,78 +18313,45 @@ func (m *MemberListResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthRpc } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex > l { return io.ErrUnexpectedEOF } - m.Members = append(m.Members, &Member{}) - if err := m.Members[len(m.Members)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.Version = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MemberPromoteRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field DbSize", wireType) } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MemberPromoteRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MemberPromoteRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: + m.DbSize = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.DbSize |= (int64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + case 4: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Leader", wireType) } - m.ID = 0 + m.Leader = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc @@ -16221,66 +18361,73 @@ func (m *MemberPromoteRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.ID |= (uint64(b) & 0x7F) << shift + m.Leader |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field RaftIndex", wireType) } - if skippy < 0 { - return ErrInvalidLengthRpc + m.RaftIndex = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.RaftIndex |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field RaftTerm", wireType) } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MemberPromoteResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc + m.RaftTerm = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.RaftTerm |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } } - if iNdEx >= l { - return io.ErrUnexpectedEOF + case 7: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field RaftAppliedIndex", wireType) } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break + m.RaftAppliedIndex = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.RaftAppliedIndex |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MemberPromoteResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MemberPromoteResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: + case 8: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Errors", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc @@ -16290,30 +18437,26 @@ func (m *MemberPromoteResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthRpc } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex > l { return io.ErrUnexpectedEOF } - if m.Header == nil { - m.Header = &ResponseHeader{} - } - if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.Errors = append(m.Errors, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Members", wireType) + case 9: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field DbSizeInUse", wireType) } - var msglen int + m.DbSizeInUse = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc @@ -16323,23 +18466,31 @@ func (m *MemberPromoteResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + m.DbSizeInUse |= (int64(b) & 0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF + case 10: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field IsLearner", wireType) } - m.Members = append(m.Members, &Member{}) - if err := m.Members[len(m.Members)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } } - iNdEx = postIndex + m.IsLearner = bool(v != 0) default: iNdEx = preIndex skippy, err := skipRpc(dAtA[iNdEx:]) @@ -16361,7 +18512,7 @@ func (m *MemberPromoteResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *DefragmentRequest) Unmarshal(dAtA []byte) error { +func (m *AuthEnableRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -16384,10 +18535,10 @@ func (m *DefragmentRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: DefragmentRequest: wiretype end group for non-group") + return fmt.Errorf("proto: AuthEnableRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: DefragmentRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: AuthEnableRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { default: @@ -16411,7 +18562,7 @@ func (m *DefragmentRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *DefragmentResponse) Unmarshal(dAtA []byte) error { +func (m *AuthDisableRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -16434,45 +18585,12 @@ func (m *DefragmentResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: DefragmentResponse: wiretype end group for non-group") + return fmt.Errorf("proto: AuthDisableRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: DefragmentResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: AuthDisableRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Header == nil { - m.Header = &ResponseHeader{} - } - if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipRpc(dAtA[iNdEx:]) @@ -16494,7 +18612,7 @@ func (m *DefragmentResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *MoveLeaderRequest) Unmarshal(dAtA []byte) error { +func (m *AuthStatusRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -16517,31 +18635,12 @@ func (m *MoveLeaderRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MoveLeaderRequest: wiretype end group for non-group") + return fmt.Errorf("proto: AuthStatusRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MoveLeaderRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: AuthStatusRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field TargetID", wireType) - } - m.TargetID = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.TargetID |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } default: iNdEx = preIndex skippy, err := skipRpc(dAtA[iNdEx:]) @@ -16563,7 +18662,7 @@ func (m *MoveLeaderRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *MoveLeaderResponse) Unmarshal(dAtA []byte) error { +func (m *AuthenticateRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -16586,17 +18685,46 @@ func (m *MoveLeaderResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MoveLeaderResponse: wiretype end group for non-group") + return fmt.Errorf("proto: AuthenticateRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MoveLeaderResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: AuthenticateRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthRpc + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Password", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc @@ -16606,24 +18734,20 @@ func (m *MoveLeaderResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthRpc } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex > l { return io.ErrUnexpectedEOF } - if m.Header == nil { - m.Header = &ResponseHeader{} - } - if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.Password = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -16646,7 +18770,7 @@ func (m *MoveLeaderResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *AlarmRequest) Unmarshal(dAtA []byte) error { +func (m *AuthUserAddRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -16669,17 +18793,17 @@ func (m *AlarmRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: AlarmRequest: wiretype end group for non-group") + return fmt.Errorf("proto: AuthUserAddRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: AlarmRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: AuthUserAddRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Action", wireType) + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) } - m.Action = 0 + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc @@ -16689,16 +18813,26 @@ func (m *AlarmRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Action |= (AlarmRequest_AlarmAction(b) & 0x7F) << shift + stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthRpc + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MemberID", wireType) + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Password", wireType) } - m.MemberID = 0 + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc @@ -16708,16 +18842,26 @@ func (m *AlarmRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.MemberID |= (uint64(b) & 0x7F) << shift + stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthRpc + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Password = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Alarm", wireType) + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Options", wireType) } - m.Alarm = 0 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc @@ -16727,11 +18871,54 @@ func (m *AlarmRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Alarm |= (AlarmType(b) & 0x7F) << shift + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthRpc + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Options == nil { + m.Options = &authpb.UserAddOptions{} + } + if err := m.Options.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field HashedPassword", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthRpc + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.HashedPassword = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipRpc(dAtA[iNdEx:]) @@ -16753,7 +18940,7 @@ func (m *AlarmRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *AlarmMember) Unmarshal(dAtA []byte) error { +func (m *AuthUserGetRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -16776,17 +18963,17 @@ func (m *AlarmMember) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: AlarmMember: wiretype end group for non-group") + return fmt.Errorf("proto: AuthUserGetRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: AlarmMember: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: AuthUserGetRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MemberID", wireType) + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) } - m.MemberID = 0 + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc @@ -16796,30 +18983,21 @@ func (m *AlarmMember) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.MemberID |= (uint64(b) & 0x7F) << shift + stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Alarm", wireType) + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthRpc } - m.Alarm = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Alarm |= (AlarmType(b) & 0x7F) << shift - if b < 0x80 { - break - } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipRpc(dAtA[iNdEx:]) @@ -16841,7 +19019,7 @@ func (m *AlarmMember) Unmarshal(dAtA []byte) error { } return nil } -func (m *AlarmResponse) Unmarshal(dAtA []byte) error { +func (m *AuthUserDeleteRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -16864,50 +19042,17 @@ func (m *AlarmResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: AlarmResponse: wiretype end group for non-group") + return fmt.Errorf("proto: AuthUserDeleteRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: AlarmResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: AuthUserDeleteRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Header == nil { - m.Header = &ResponseHeader{} - } - if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Alarms", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc @@ -16917,22 +19062,20 @@ func (m *AlarmResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthRpc } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex > l { return io.ErrUnexpectedEOF } - m.Alarms = append(m.Alarms, &AlarmMember{}) - if err := m.Alarms[len(m.Alarms)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.Name = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -16955,7 +19098,7 @@ func (m *AlarmResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *DowngradeRequest) Unmarshal(dAtA []byte) error { +func (m *AuthUserChangePasswordRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -16978,17 +19121,46 @@ func (m *DowngradeRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: DowngradeRequest: wiretype end group for non-group") + return fmt.Errorf("proto: AuthUserChangePasswordRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: DowngradeRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: AuthUserChangePasswordRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Action", wireType) + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthRpc + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Password", wireType) } - m.Action = 0 + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc @@ -16998,14 +19170,24 @@ func (m *DowngradeRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Action |= (DowngradeRequest_DowngradeAction(b) & 0x7F) << shift + stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } - case 2: + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthRpc + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Password = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field HashedPassword", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -17030,7 +19212,7 @@ func (m *DowngradeRequest) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Version = string(dAtA[iNdEx:postIndex]) + m.HashedPassword = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -17053,7 +19235,7 @@ func (m *DowngradeRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *DowngradeResponse) Unmarshal(dAtA []byte) error { +func (m *AuthUserGrantRoleRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -17076,17 +19258,17 @@ func (m *DowngradeResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: DowngradeResponse: wiretype end group for non-group") + return fmt.Errorf("proto: AuthUserGrantRoleRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: DowngradeResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: AuthUserGrantRoleRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field User", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc @@ -17096,28 +19278,24 @@ func (m *DowngradeResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthRpc } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex > l { return io.ErrUnexpectedEOF } - if m.Header == nil { - m.Header = &ResponseHeader{} - } - if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.User = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Role", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -17142,7 +19320,7 @@ func (m *DowngradeResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Version = string(dAtA[iNdEx:postIndex]) + m.Role = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -17165,57 +19343,7 @@ func (m *DowngradeResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *StatusRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: StatusRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: StatusRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *StatusResponse) Unmarshal(dAtA []byte) error { +func (m *AuthUserRevokeRoleRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -17238,17 +19366,17 @@ func (m *StatusResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: StatusResponse: wiretype end group for non-group") + return fmt.Errorf("proto: AuthUserRevokeRoleRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: StatusResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: AuthUserRevokeRoleRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc @@ -17258,28 +19386,24 @@ func (m *StatusResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthRpc } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex > l { return io.ErrUnexpectedEOF } - if m.Header == nil { - m.Header = &ResponseHeader{} - } - if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.Name = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Role", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -17304,106 +19428,61 @@ func (m *StatusResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Version = string(dAtA[iNdEx:postIndex]) + m.Role = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field DbSize", wireType) - } - m.DbSize = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.DbSize |= (int64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Leader", wireType) - } - m.Leader = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Leader |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field RaftIndex", wireType) + default: + iNdEx = preIndex + skippy, err := skipRpc(dAtA[iNdEx:]) + if err != nil { + return err } - m.RaftIndex = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.RaftIndex |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } + if skippy < 0 { + return ErrInvalidLengthRpc } - case 6: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field RaftTerm", wireType) + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF } - m.RaftTerm = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.RaftTerm |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *AuthRoleAddRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRpc } - case 7: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field RaftAppliedIndex", wireType) + if iNdEx >= l { + return io.ErrUnexpectedEOF } - m.RaftAppliedIndex = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.RaftAppliedIndex |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break } - case 8: + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: AuthRoleAddRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: AuthRoleAddRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Errors", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -17428,32 +19507,63 @@ func (m *StatusResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Errors = append(m.Errors, string(dAtA[iNdEx:postIndex])) + m.Name = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 9: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field DbSizeInUse", wireType) + default: + iNdEx = preIndex + skippy, err := skipRpc(dAtA[iNdEx:]) + if err != nil { + return err } - m.DbSizeInUse = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.DbSizeInUse |= (int64(b) & 0x7F) << shift - if b < 0x80 { - break - } + if skippy < 0 { + return ErrInvalidLengthRpc } - case 10: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field IsLearner", wireType) + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF } - var v int + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *AuthRoleGetRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: AuthRoleGetRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: AuthRoleGetRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Role", wireType) + } + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc @@ -17463,12 +19573,21 @@ func (m *StatusResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - v |= (int(b) & 0x7F) << shift + stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } - m.IsLearner = bool(v != 0) + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthRpc + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Role = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipRpc(dAtA[iNdEx:]) @@ -17490,7 +19609,7 @@ func (m *StatusResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *AuthEnableRequest) Unmarshal(dAtA []byte) error { +func (m *AuthUserListRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -17513,10 +19632,10 @@ func (m *AuthEnableRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: AuthEnableRequest: wiretype end group for non-group") + return fmt.Errorf("proto: AuthUserListRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: AuthEnableRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: AuthUserListRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { default: @@ -17540,7 +19659,7 @@ func (m *AuthEnableRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *AuthDisableRequest) Unmarshal(dAtA []byte) error { +func (m *AuthRoleListRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -17563,10 +19682,10 @@ func (m *AuthDisableRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: AuthDisableRequest: wiretype end group for non-group") + return fmt.Errorf("proto: AuthRoleListRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: AuthDisableRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: AuthRoleListRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { default: @@ -17590,7 +19709,7 @@ func (m *AuthDisableRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *AuthStatusRequest) Unmarshal(dAtA []byte) error { +func (m *AuthRoleDeleteRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -17613,12 +19732,41 @@ func (m *AuthStatusRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: AuthStatusRequest: wiretype end group for non-group") + return fmt.Errorf("proto: AuthRoleDeleteRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: AuthStatusRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: AuthRoleDeleteRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Role", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthRpc + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Role = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipRpc(dAtA[iNdEx:]) @@ -17640,7 +19788,7 @@ func (m *AuthStatusRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *AuthenticateRequest) Unmarshal(dAtA []byte) error { +func (m *AuthRoleGrantPermissionRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -17663,10 +19811,10 @@ func (m *AuthenticateRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: AuthenticateRequest: wiretype end group for non-group") + return fmt.Errorf("proto: AuthRoleGrantPermissionRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: AuthenticateRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: AuthRoleGrantPermissionRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -17700,9 +19848,9 @@ func (m *AuthenticateRequest) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Password", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Perm", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc @@ -17712,20 +19860,24 @@ func (m *AuthenticateRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthRpc } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } - m.Password = string(dAtA[iNdEx:postIndex]) + if m.Perm == nil { + m.Perm = &authpb.Permission{} + } + if err := m.Perm.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex default: iNdEx = preIndex @@ -17748,7 +19900,7 @@ func (m *AuthenticateRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *AuthUserAddRequest) Unmarshal(dAtA []byte) error { +func (m *AuthRoleRevokePermissionRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -17771,15 +19923,15 @@ func (m *AuthUserAddRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: AuthUserAddRequest: wiretype end group for non-group") + return fmt.Errorf("proto: AuthRoleRevokePermissionRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: AuthUserAddRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: AuthRoleRevokePermissionRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Role", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -17804,13 +19956,13 @@ func (m *AuthUserAddRequest) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Name = string(dAtA[iNdEx:postIndex]) + m.Role = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Password", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) } - var stringLen uint64 + var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc @@ -17820,24 +19972,107 @@ func (m *AuthUserAddRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + byteLen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if byteLen < 0 { + return ErrInvalidLengthRpc + } + postIndex := iNdEx + byteLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Key = append(m.Key[:0], dAtA[iNdEx:postIndex]...) + if m.Key == nil { + m.Key = []byte{} + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RangeEnd", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthRpc + } + postIndex := iNdEx + byteLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RangeEnd = append(m.RangeEnd[:0], dAtA[iNdEx:postIndex]...) + if m.RangeEnd == nil { + m.RangeEnd = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipRpc(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { return ErrInvalidLengthRpc } - postIndex := iNdEx + intStringLen - if postIndex > l { + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *AuthEnableResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRpc + } + if iNdEx >= l { return io.ErrUnexpectedEOF } - m.Password = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: AuthEnableResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: AuthEnableResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Options", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -17861,42 +20096,13 @@ func (m *AuthUserAddRequest) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.Options == nil { - m.Options = &authpb.UserAddOptions{} + if m.Header == nil { + m.Header = &ResponseHeader{} } - if err := m.Options.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field HashedPassword", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.HashedPassword = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipRpc(dAtA[iNdEx:]) @@ -17918,7 +20124,7 @@ func (m *AuthUserAddRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *AuthUserGetRequest) Unmarshal(dAtA []byte) error { +func (m *AuthDisableResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -17941,17 +20147,17 @@ func (m *AuthUserGetRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: AuthUserGetRequest: wiretype end group for non-group") + return fmt.Errorf("proto: AuthDisableResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: AuthUserGetRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: AuthDisableResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc @@ -17961,20 +20167,24 @@ func (m *AuthUserGetRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthRpc } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } - m.Name = string(dAtA[iNdEx:postIndex]) + if m.Header == nil { + m.Header = &ResponseHeader{} + } + if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex default: iNdEx = preIndex @@ -17997,7 +20207,7 @@ func (m *AuthUserGetRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *AuthUserDeleteRequest) Unmarshal(dAtA []byte) error { +func (m *AuthStatusResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -18020,17 +20230,17 @@ func (m *AuthUserDeleteRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: AuthUserDeleteRequest: wiretype end group for non-group") + return fmt.Errorf("proto: AuthStatusResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: AuthUserDeleteRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: AuthStatusResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc @@ -18040,21 +20250,64 @@ func (m *AuthUserDeleteRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthRpc } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } - m.Name = string(dAtA[iNdEx:postIndex]) + if m.Header == nil { + m.Header = &ResponseHeader{} + } + if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Enabled", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.Enabled = bool(v != 0) + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AuthRevision", wireType) + } + m.AuthRevision = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.AuthRevision |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := skipRpc(dAtA[iNdEx:]) @@ -18076,7 +20329,7 @@ func (m *AuthUserDeleteRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *AuthUserChangePasswordRequest) Unmarshal(dAtA []byte) error { +func (m *AuthenticateResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -18099,17 +20352,17 @@ func (m *AuthUserChangePasswordRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: AuthUserChangePasswordRequest: wiretype end group for non-group") + return fmt.Errorf("proto: AuthenticateResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: AuthUserChangePasswordRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: AuthenticateResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc @@ -18119,24 +20372,28 @@ func (m *AuthUserChangePasswordRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthRpc } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } - m.Name = string(dAtA[iNdEx:postIndex]) + if m.Header == nil { + m.Header = &ResponseHeader{} + } + if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Password", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Token", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -18161,13 +20418,63 @@ func (m *AuthUserChangePasswordRequest) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Password = string(dAtA[iNdEx:postIndex]) + m.Token = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 3: + default: + iNdEx = preIndex + skippy, err := skipRpc(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthRpc + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *AuthUserAddResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: AuthUserAddResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: AuthUserAddResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field HashedPassword", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc @@ -18177,20 +20484,24 @@ func (m *AuthUserChangePasswordRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthRpc } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } - m.HashedPassword = string(dAtA[iNdEx:postIndex]) + if m.Header == nil { + m.Header = &ResponseHeader{} + } + if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex default: iNdEx = preIndex @@ -18213,7 +20524,7 @@ func (m *AuthUserChangePasswordRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *AuthUserGrantRoleRequest) Unmarshal(dAtA []byte) error { +func (m *AuthUserGetResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -18236,17 +20547,17 @@ func (m *AuthUserGrantRoleRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: AuthUserGrantRoleRequest: wiretype end group for non-group") + return fmt.Errorf("proto: AuthUserGetResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: AuthUserGrantRoleRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: AuthUserGetResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field User", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc @@ -18256,24 +20567,28 @@ func (m *AuthUserGrantRoleRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthRpc } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } - m.User = string(dAtA[iNdEx:postIndex]) + if m.Header == nil { + m.Header = &ResponseHeader{} + } + if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Role", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Roles", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -18298,7 +20613,7 @@ func (m *AuthUserGrantRoleRequest) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Role = string(dAtA[iNdEx:postIndex]) + m.Roles = append(m.Roles, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex default: iNdEx = preIndex @@ -18321,7 +20636,7 @@ func (m *AuthUserGrantRoleRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *AuthUserRevokeRoleRequest) Unmarshal(dAtA []byte) error { +func (m *AuthUserDeleteResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -18344,17 +20659,17 @@ func (m *AuthUserRevokeRoleRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: AuthUserRevokeRoleRequest: wiretype end group for non-group") + return fmt.Errorf("proto: AuthUserDeleteResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: AuthUserRevokeRoleRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: AuthUserDeleteResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc @@ -18364,49 +20679,24 @@ func (m *AuthUserRevokeRoleRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthRpc } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } - m.Name = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Role", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthRpc + if m.Header == nil { + m.Header = &ResponseHeader{} } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF + if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err } - m.Role = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -18429,7 +20719,7 @@ func (m *AuthUserRevokeRoleRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *AuthRoleAddRequest) Unmarshal(dAtA []byte) error { +func (m *AuthUserChangePasswordResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -18452,17 +20742,17 @@ func (m *AuthRoleAddRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: AuthRoleAddRequest: wiretype end group for non-group") + return fmt.Errorf("proto: AuthUserChangePasswordResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: AuthRoleAddRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: AuthUserChangePasswordResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc @@ -18472,20 +20762,24 @@ func (m *AuthRoleAddRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthRpc } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } - m.Name = string(dAtA[iNdEx:postIndex]) + if m.Header == nil { + m.Header = &ResponseHeader{} + } + if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex default: iNdEx = preIndex @@ -18508,7 +20802,7 @@ func (m *AuthRoleAddRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *AuthRoleGetRequest) Unmarshal(dAtA []byte) error { +func (m *AuthUserGrantRoleResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -18531,17 +20825,17 @@ func (m *AuthRoleGetRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: AuthRoleGetRequest: wiretype end group for non-group") + return fmt.Errorf("proto: AuthUserGrantRoleResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: AuthRoleGetRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: AuthUserGrantRoleResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Role", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc @@ -18551,20 +20845,24 @@ func (m *AuthRoleGetRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthRpc } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } - m.Role = string(dAtA[iNdEx:postIndex]) + if m.Header == nil { + m.Header = &ResponseHeader{} + } + if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex default: iNdEx = preIndex @@ -18587,7 +20885,7 @@ func (m *AuthRoleGetRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *AuthUserListRequest) Unmarshal(dAtA []byte) error { +func (m *AuthUserRevokeRoleResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -18610,12 +20908,45 @@ func (m *AuthUserListRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: AuthUserListRequest: wiretype end group for non-group") + return fmt.Errorf("proto: AuthUserRevokeRoleResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: AuthUserListRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: AuthUserRevokeRoleResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthRpc + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Header == nil { + m.Header = &ResponseHeader{} + } + if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipRpc(dAtA[iNdEx:]) @@ -18637,7 +20968,7 @@ func (m *AuthUserListRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *AuthRoleListRequest) Unmarshal(dAtA []byte) error { +func (m *AuthRoleAddResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -18660,12 +20991,45 @@ func (m *AuthRoleListRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: AuthRoleListRequest: wiretype end group for non-group") + return fmt.Errorf("proto: AuthRoleAddResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: AuthRoleListRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: AuthRoleAddResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthRpc + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Header == nil { + m.Header = &ResponseHeader{} + } + if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipRpc(dAtA[iNdEx:]) @@ -18687,7 +21051,7 @@ func (m *AuthRoleListRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *AuthRoleDeleteRequest) Unmarshal(dAtA []byte) error { +func (m *AuthRoleGetResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -18710,17 +21074,17 @@ func (m *AuthRoleDeleteRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: AuthRoleDeleteRequest: wiretype end group for non-group") + return fmt.Errorf("proto: AuthRoleGetResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: AuthRoleDeleteRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: AuthRoleGetResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Role", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc @@ -18730,20 +21094,55 @@ func (m *AuthRoleDeleteRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthRpc } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } - m.Role = string(dAtA[iNdEx:postIndex]) + if m.Header == nil { + m.Header = &ResponseHeader{} + } + if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Perm", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthRpc + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Perm = append(m.Perm, &authpb.Permission{}) + if err := m.Perm[len(m.Perm)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex default: iNdEx = preIndex @@ -18766,7 +21165,7 @@ func (m *AuthRoleDeleteRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *AuthRoleGrantPermissionRequest) Unmarshal(dAtA []byte) error { +func (m *AuthRoleListResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -18789,17 +21188,17 @@ func (m *AuthRoleGrantPermissionRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: AuthRoleGrantPermissionRequest: wiretype end group for non-group") + return fmt.Errorf("proto: AuthRoleListResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: AuthRoleGrantPermissionRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: AuthRoleListResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc @@ -18809,26 +21208,30 @@ func (m *AuthRoleGrantPermissionRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthRpc } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } - m.Name = string(dAtA[iNdEx:postIndex]) + if m.Header == nil { + m.Header = &ResponseHeader{} + } + if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Perm", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Roles", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc @@ -18838,24 +21241,20 @@ func (m *AuthRoleGrantPermissionRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthRpc } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex > l { return io.ErrUnexpectedEOF } - if m.Perm == nil { - m.Perm = &authpb.Permission{} - } - if err := m.Perm.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.Roles = append(m.Roles, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex default: iNdEx = preIndex @@ -18878,7 +21277,7 @@ func (m *AuthRoleGrantPermissionRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *AuthRoleRevokePermissionRequest) Unmarshal(dAtA []byte) error { +func (m *AuthUserListResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -18901,17 +21300,17 @@ func (m *AuthRoleRevokePermissionRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: AuthRoleRevokePermissionRequest: wiretype end group for non-group") + return fmt.Errorf("proto: AuthUserListResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: AuthRoleRevokePermissionRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: AuthUserListResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Role", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc @@ -18921,57 +21320,30 @@ func (m *AuthRoleRevokePermissionRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthRpc } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } - m.Role = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + byteLen - if postIndex > l { - return io.ErrUnexpectedEOF + if m.Header == nil { + m.Header = &ResponseHeader{} } - m.Key = append(m.Key[:0], dAtA[iNdEx:postIndex]...) - if m.Key == nil { - m.Key = []byte{} + if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err } iNdEx = postIndex - case 3: + case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field RangeEnd", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Users", wireType) } - var byteLen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc @@ -18981,22 +21353,20 @@ func (m *AuthRoleRevokePermissionRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - byteLen |= (int(b) & 0x7F) << shift + stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } - if byteLen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthRpc } - postIndex := iNdEx + byteLen + postIndex := iNdEx + intStringLen if postIndex > l { return io.ErrUnexpectedEOF } - m.RangeEnd = append(m.RangeEnd[:0], dAtA[iNdEx:postIndex]...) - if m.RangeEnd == nil { - m.RangeEnd = []byte{} - } + m.Users = append(m.Users, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex default: iNdEx = preIndex @@ -19019,7 +21389,7 @@ func (m *AuthRoleRevokePermissionRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *AuthEnableResponse) Unmarshal(dAtA []byte) error { +func (m *AuthRoleDeleteResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -19042,10 +21412,10 @@ func (m *AuthEnableResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: AuthEnableResponse: wiretype end group for non-group") + return fmt.Errorf("proto: AuthRoleDeleteResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: AuthEnableResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: AuthRoleDeleteResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -19102,7 +21472,7 @@ func (m *AuthEnableResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *AuthDisableResponse) Unmarshal(dAtA []byte) error { +func (m *AuthRoleGrantPermissionResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -19125,10 +21495,10 @@ func (m *AuthDisableResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: AuthDisableResponse: wiretype end group for non-group") + return fmt.Errorf("proto: AuthRoleGrantPermissionResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: AuthDisableResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: AuthRoleGrantPermissionResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -19185,7 +21555,7 @@ func (m *AuthDisableResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *AuthStatusResponse) Unmarshal(dAtA []byte) error { +func (m *AuthRoleRevokePermissionResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -19208,10 +21578,10 @@ func (m *AuthStatusResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: AuthStatusResponse: wiretype end group for non-group") + return fmt.Errorf("proto: AuthRoleRevokePermissionResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: AuthStatusResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: AuthRoleRevokePermissionResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -19247,45 +21617,6 @@ func (m *AuthStatusResponse) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Enabled", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.Enabled = bool(v != 0) - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field AuthRevision", wireType) - } - m.AuthRevision = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.AuthRevision |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } default: iNdEx = preIndex skippy, err := skipRpc(dAtA[iNdEx:]) @@ -19307,7 +21638,7 @@ func (m *AuthStatusResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *AuthenticateResponse) Unmarshal(dAtA []byte) error { +func (m *QoSEnableRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -19330,74 +21661,62 @@ func (m *AuthenticateResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: AuthenticateResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QoSEnableRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: AuthenticateResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QoSEnableRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } + default: + iNdEx = preIndex + skippy, err := skipRpc(dAtA[iNdEx:]) + if err != nil { + return err } - if msglen < 0 { + if skippy < 0 { return ErrInvalidLengthRpc } - postIndex := iNdEx + msglen - if postIndex > l { + if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } - if m.Header == nil { - m.Header = &ResponseHeader{} - } - if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Token", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthRpc + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QoSDisableRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRpc } - postIndex := iNdEx + intStringLen - if postIndex > l { + if iNdEx >= l { return io.ErrUnexpectedEOF } - m.Token = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QoSDisableRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QoSDisableRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { default: iNdEx = preIndex skippy, err := skipRpc(dAtA[iNdEx:]) @@ -19419,7 +21738,7 @@ func (m *AuthenticateResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *AuthUserAddResponse) Unmarshal(dAtA []byte) error { +func (m *QoSEnableResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -19442,10 +21761,10 @@ func (m *AuthUserAddResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: AuthUserAddResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QoSEnableResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: AuthUserAddResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QoSEnableResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -19502,7 +21821,7 @@ func (m *AuthUserAddResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *AuthUserGetResponse) Unmarshal(dAtA []byte) error { +func (m *QoSDisableResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -19525,10 +21844,10 @@ func (m *AuthUserGetResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: AuthUserGetResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QoSDisableResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: AuthUserGetResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QoSDisableResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -19564,35 +21883,6 @@ func (m *AuthUserGetResponse) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Roles", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Roles = append(m.Roles, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipRpc(dAtA[iNdEx:]) @@ -19614,7 +21904,7 @@ func (m *AuthUserGetResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *AuthUserDeleteResponse) Unmarshal(dAtA []byte) error { +func (m *QoSRuleAddRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -19637,15 +21927,15 @@ func (m *AuthUserDeleteResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: AuthUserDeleteResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QoSRuleAddRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: AuthUserDeleteResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QoSRuleAddRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field QosRule", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -19669,10 +21959,10 @@ func (m *AuthUserDeleteResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.Header == nil { - m.Header = &ResponseHeader{} + if m.QosRule == nil { + m.QosRule = &qospb.QoSRule{} } - if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.QosRule.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -19697,7 +21987,7 @@ func (m *AuthUserDeleteResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *AuthUserChangePasswordResponse) Unmarshal(dAtA []byte) error { +func (m *QoSRuleAddResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -19720,10 +22010,10 @@ func (m *AuthUserChangePasswordResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: AuthUserChangePasswordResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QoSRuleAddResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: AuthUserChangePasswordResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QoSRuleAddResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -19780,7 +22070,7 @@ func (m *AuthUserChangePasswordResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *AuthUserGrantRoleResponse) Unmarshal(dAtA []byte) error { +func (m *QoSRuleDeleteRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -19803,17 +22093,17 @@ func (m *AuthUserGrantRoleResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: AuthUserGrantRoleResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QoSRuleDeleteRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: AuthUserGrantRoleResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QoSRuleDeleteRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field RuleName", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc @@ -19823,24 +22113,20 @@ func (m *AuthUserGrantRoleResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthRpc } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex > l { return io.ErrUnexpectedEOF } - if m.Header == nil { - m.Header = &ResponseHeader{} - } - if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.RuleName = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -19863,7 +22149,7 @@ func (m *AuthUserGrantRoleResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *AuthUserRevokeRoleResponse) Unmarshal(dAtA []byte) error { +func (m *QoSRuleDeleteResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -19886,10 +22172,10 @@ func (m *AuthUserRevokeRoleResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: AuthUserRevokeRoleResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QoSRuleDeleteResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: AuthUserRevokeRoleResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QoSRuleDeleteResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -19946,7 +22232,7 @@ func (m *AuthUserRevokeRoleResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *AuthRoleAddResponse) Unmarshal(dAtA []byte) error { +func (m *QoSRuleGetRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -19969,17 +22255,17 @@ func (m *AuthRoleAddResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: AuthRoleAddResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QoSRuleGetRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: AuthRoleAddResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QoSRuleGetRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field RuleName", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc @@ -19989,24 +22275,20 @@ func (m *AuthRoleAddResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthRpc } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex > l { return io.ErrUnexpectedEOF } - if m.Header == nil { - m.Header = &ResponseHeader{} - } - if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.RuleName = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -20029,7 +22311,7 @@ func (m *AuthRoleAddResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *AuthRoleGetResponse) Unmarshal(dAtA []byte) error { +func (m *QoSRuleGetResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -20052,10 +22334,10 @@ func (m *AuthRoleGetResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: AuthRoleGetResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QoSRuleGetResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: AuthRoleGetResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QoSRuleGetResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -20093,7 +22375,7 @@ func (m *AuthRoleGetResponse) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Perm", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field QosRule", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -20117,8 +22399,10 @@ func (m *AuthRoleGetResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Perm = append(m.Perm, &authpb.Permission{}) - if err := m.Perm[len(m.Perm)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if m.QosRule == nil { + m.QosRule = &qospb.QoSRule{} + } + if err := m.QosRule.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -20143,7 +22427,7 @@ func (m *AuthRoleGetResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *AuthRoleListResponse) Unmarshal(dAtA []byte) error { +func (m *QoSRuleUpdateRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -20166,15 +22450,15 @@ func (m *AuthRoleListResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: AuthRoleListResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QoSRuleUpdateRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: AuthRoleListResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QoSRuleUpdateRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field QosRule", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -20198,42 +22482,13 @@ func (m *AuthRoleListResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.Header == nil { - m.Header = &ResponseHeader{} + if m.QosRule == nil { + m.QosRule = &qospb.QoSRule{} } - if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.QosRule.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Roles", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Roles = append(m.Roles, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipRpc(dAtA[iNdEx:]) @@ -20255,7 +22510,7 @@ func (m *AuthRoleListResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *AuthUserListResponse) Unmarshal(dAtA []byte) error { +func (m *QoSRuleUpdateResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -20278,10 +22533,10 @@ func (m *AuthUserListResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: AuthUserListResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QoSRuleUpdateResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: AuthUserListResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QoSRuleUpdateResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -20317,35 +22572,6 @@ func (m *AuthUserListResponse) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Users", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Users = append(m.Users, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipRpc(dAtA[iNdEx:]) @@ -20367,7 +22593,7 @@ func (m *AuthUserListResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *AuthRoleDeleteResponse) Unmarshal(dAtA []byte) error { +func (m *QoSRuleListRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -20390,45 +22616,12 @@ func (m *AuthRoleDeleteResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: AuthRoleDeleteResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QoSRuleListRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: AuthRoleDeleteResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QoSRuleListRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Header == nil { - m.Header = &ResponseHeader{} - } - if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipRpc(dAtA[iNdEx:]) @@ -20450,7 +22643,7 @@ func (m *AuthRoleDeleteResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *AuthRoleGrantPermissionResponse) Unmarshal(dAtA []byte) error { +func (m *QoSRuleListResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -20473,10 +22666,10 @@ func (m *AuthRoleGrantPermissionResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: AuthRoleGrantPermissionResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QoSRuleListResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: AuthRoleGrantPermissionResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QoSRuleListResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -20512,59 +22705,9 @@ func (m *AuthRoleGrantPermissionResponse) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *AuthRoleRevokePermissionResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: AuthRoleRevokePermissionResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: AuthRoleRevokePermissionResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: + case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field QosRules", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -20588,10 +22731,8 @@ func (m *AuthRoleRevokePermissionResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.Header == nil { - m.Header = &ResponseHeader{} - } - if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.QosRules = append(m.QosRules, &qospb.QoSRule{}) + if err := m.QosRules[len(m.QosRules)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -20724,262 +22865,283 @@ var ( func init() { proto.RegisterFile("rpc.proto", fileDescriptorRpc) } var fileDescriptorRpc = []byte{ - // 4111 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x5b, 0x5b, 0x73, 0x1b, 0xc9, - 0x75, 0xe6, 0x00, 0xc4, 0xed, 0xe0, 0x42, 0x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x92, 0xf2, 0x66, 0x30, 0xd1, 0x32, 0xe4, 0xfb, 0xc7, 0x87, 0xe6, 0x97, 0xf2, - 0xe6, 0x48, 0x94, 0x28, 0x7d, 0xc0, 0x71, 0xf8, 0xf5, 0xad, 0x28, 0xd1, 0x30, 0xee, 0x18, 0x27, - 0xde, 0xb6, 0xd5, 0x27, 0x17, 0x6c, 0x53, 0x30, 0xab, 0x07, 0x04, 0x96, 0x61, 0x12, 0xd7, 0xbc, - 0xec, 0x64, 0xa5, 0x5c, 0xfb, 0xa2, 0x87, 0x50, 0xa7, 0xdf, 0xed, 0xd1, 0x68, 0x60, 0x92, 0x3e, - 0x17, 0x50, 0x60, 0x3c, 0x31, 0x3a, 0x45, 0x67, 0x67, 0x11, 0xb7, 0x51, 0x64, 0x61, 0x49, 0x94, - 0xd0, 0x2a, 0x94, 0xb9, 0x7e, 0xdb, 0xd6, 0x0b, 0x97, 0xb0, 0xbb, 0xcf, 0xac, 0xae, 0x92, 0xc2, - 0xdb, 0x0c, 0x88, 0x6e, 0x33, 0x16, 0x60, 0xbe, 0x3d, 0xf6, 0xce, 0x3a, 0x16, 0x8d, 0x15, 0xd2, - 0xca, 0x8b, 0x80, 0x28, 0x71, 0xcb, 0x74, 0x55, 0xaa, 0x60, 0x0d, 0x0f, 0x48, 0x07, 0x16, 0x28, - 0x91, 0x58, 0x9e, 0xd9, 0x53, 0xe2, 0xaa, 0xdc, 0x79, 0x69, 0x91, 0x9d, 0x97, 0xe1, 0xba, 0xaf, - 0x6c, 0xa7, 0x2f, 0x6c, 0xee, 0x97, 0xf1, 0x3f, 0x6a, 0x1c, 0xf2, 0x85, 0x1b, 0xda, 0x3e, 0xfd, - 0x96, 0x62, 0xd0, 0x07, 0x50, 0xb0, 0x47, 0xec, 0x86, 0x5f, 0xa4, 0x61, 0x96, 0xd7, 0xf9, 0x9b, - 0x80, 0x75, 0x21, 0x78, 0x9f, 0xd7, 0xea, 0x92, 0x0d, 0x3d, 0x80, 0xda, 0x99,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40, 0xc9, 0xcf, 0x3a, 0x47, 0xbd, 0x6d, 0x34, 0x1b, 0x1e, 0xf5, 0xb6, 0xb1, 0x74, 0x75, 0xd8, - 0xed, 0x84, 0x66, 0x8b, 0x64, 0xa5, 0x0b, 0xf0, 0x17, 0x75, 0x98, 0xa5, 0xbb, 0x6e, 0xba, 0x39, - 0x09, 0xf2, 0x26, 0xd1, 0xde, 0xc7, 0xb2, 0xa8, 0xd1, 0xde, 0xc7, 0x53, 0x2e, 0xe1, 0xcd, 0x09, - 0xfb, 0x05, 0x13, 0x4f, 0x51, 0xd0, 0x9e, 0xda, 0x50, 0x56, 0x12, 0x2b, 0x28, 0x41, 0x58, 0x38, - 0x3d, 0x1b, 0x0d, 0x77, 0x09, 0x59, 0x19, 0x7c, 0x8b, 0xe1, 0x2d, 0xf1, 0x70, 0xc7, 0xf0, 0xfa, - 0x9c, 0x83, 0x02, 0x8a, 0xde, 0x89, 0x75, 0x9f, 0xd0, 0xbb, 0xf0, 0xda, 0x5f, 0x4d, 0x67, 0x48, - 0xed, 0x5d, 0xb0, 0xf0, 0x5f, 0x41, 0x45, 0x4d, 0xaf, 0xa0, 0x04, 0xe5, 0x23, 0x29, 0xe5, 0x68, - 0x1c, 0x49, 0xca, 0xce, 0x84, 0x3d, 0x9b, 0xff, 0x93, 0x30, 0xc9, 0x46, 0x81, 0x07, 0x50, 0x10, - 0xf9, 0x96, 0x24, 0x93, 0x86, 0xd3, 0xcf, 0x49, 0x26, 0x8d, 0x24, 0x6b, 0xc2, 0xbb, 0x67, 0x86, - 0x48, 0x8f, 0x94, 0x32, 0x56, 0x0b, 0xb4, 0xa7, 0xc4, 0x4b, 0x43, 0x0b, 0x32, 0x99, 0x69, 0x68, - 0xca, 0x71, 0x3e, 0x0d, 0xed, 0x94, 0x78, 0xc2, 0x1f, 0xc8, 0x63, 0x32, 0x4a, 0x11, 0xa6, 0xc6, - 0x47, 0x7c, 0x15, 0x4b, 0xd2, 0xe1, 0x26, 0x00, 0x94, 0xc1, 0xf1, 0x02, 0x20, 0xc8, 0x06, 0x45, - 0x77, 0xac, 0x89, 0x59, 0xf0, 0xe8, 0x8e, 0x35, 0x39, 0xa1, 0x14, 0xf6, 0x7d, 0x01, 0x2e, 0x3f, - 0x5b, 0x51, 0xe4, 0x9f, 0x69, 0x80, 0xe2, 0x89, 0x23, 0xf4, 0x28, 0x59, 0x7a, 0x62, 0x6e, 0xbd, - 0xf9, 0xde, 0xeb, 0x31, 0x27, 0x85, 0xb3, 0x40, 0xa5, 0x1e, 0xe3, 0x1e, 0xbd, 0xa2, 0x4a, 0xfd, - 0xa5, 0x06, 0xd5, 0x50, 0xd6, 0x09, 0x3d, 0x48, 0x19, 0xd3, 0x48, 0xca, 0xbd, 0xf9, 0xce, 0xb5, - 0x7c, 0x49, 0x5b, 0x79, 0x65, 0x06, 0xc8, 0x33, 0xcd, 0x4f, 0x34, 0xa8, 0x85, 0xb3, 0x54, 0x28, - 0x45, 0x76, 0x2c, 0x65, 0xdf, 0x5c, 0xbb, 0x9e, 0xf1, 0xea, 0xe1, 0x09, 0x8e, 0x33, 0x03, 0x28, - 0x88, 0xbc, 0x56, 0xd2, 0xc4, 0x0f, 0x27, 0xfb, 0x93, 0x26, 0x7e, 0x24, 0x29, 0x96, 0x30, 0xf1, - 0x1d, 0x7b, 0x40, 0x94, 0x65, 0x26, 0x12, 0x5f, 0x69, 0x68, 0x57, 0x2f, 0xb3, 0x48, 0xd6, 0x2c, - 0x0d, 0x2d, 0x58, 0x66, 0x32, 0xe3, 0x85, 0x52, 0x84, 0x5d, 0xb3, 0xcc, 0xa2, 0x09, 0xb3, 0x84, - 0x65, 0xc6, 0x00, 0x95, 0x65, 0x16, 0xe4, 0xa6, 0x92, 0x96, 0x59, 0xec, 0xee, 0x22, 0x69, 0x99, - 0xc5, 0xd3, 0x5b, 0x09, 0xe3, 0xc8, 0x70, 0x43, 0xcb, 0x6c, 0x21, 0x21, 0x8d, 0x85, 0xde, 0x4b, - 0x31, 0x62, 0xe2, 0x95, 0x48, 0xf3, 0xfd, 0xd7, 0xe4, 0x4e, 0x9d, 0xe3, 0xdc, 0xfc, 0x72, 0x8e, - 0xff, 0xad, 0x06, 0x8b, 0x49, 0x29, 0x30, 0x94, 0x82, 0x93, 0x72, 0x95, 0xd2, 0x5c, 0x7f, 0x5d, - 0xf6, 0xab, 0xad, 0xe5, 0xcf, 0xfa, 0x27, 0xf5, 0x7f, 0xfd, 0x6a, 0x45, 0xfb, 0x8f, 0xaf, 0x56, - 0xb4, 0xff, 0xfe, 0x6a, 0x45, 0xfb, 0xbb, 0xff, 0x59, 0x99, 0x39, 0xce, 0xb3, 0x1f, 0x1a, 0x7f, - 0xfb, 0x37, 0x01, 0x00, 0x00, 0xff, 0xff, 0x7a, 0xd4, 0x63, 0xa4, 0xef, 0x3c, 0x00, 0x00, + // 4435 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x3c, 0x5d, 0x73, 0x1b, 0x47, + 0x72, 0x5c, 0x80, 0xc4, 0x47, 0xe3, 0x83, 0xe0, 0x90, 0x94, 0x20, 0x58, 0xa2, 0xa8, 0x91, 0x25, + 0xd3, 0x92, 0x4d, 0xfa, 0xe8, 0xbb, 0xb8, 0x4a, 0x49, 0x9c, 0x83, 0x48, 0x58, 0xa2, 0x45, 0x91, + 0xd4, 0x92, 0x92, 0x3f, 0xea, 0x2a, 0xac, 0x25, 0x30, 0x22, 0x11, 0x02, 0xbb, 0xd0, 0xee, 0x82, + 0x22, 0x9d, 0x8f, 0x4b, 0x5d, 0x5d, 0xae, 0x92, 0xd7, 0xbb, 0xaa, 0x54, 0xf2, 0x70, 0x79, 0x49, + 0xa5, 0xae, 0xee, 0xe1, 0x9e, 0xf3, 0x17, 0xf2, 0x94, 0x8f, 0xca, 0x1f, 0x48, 0x39, 0xf7, 0x92, + 0xfc, 0x88, 0x54, 0x6a, 0xbe, 0x76, 0x67, 0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x42, 0xc5, 0xe7, + 0x8d, 0x43, 0x36, 0x1f, 0x21, 0x51, 0x23, 0xdd, 0x08, 0x3d, 0x9c, 0xb2, 0xcb, 0x62, 0x08, 0x03, + 0xa3, 0xdf, 0x87, 0x92, 0x24, 0x31, 0x18, 0x86, 0x42, 0xe5, 0x75, 0x9d, 0x40, 0xbc, 0xff, 0x1e, + 0x4e, 0xd9, 0x20, 0xd0, 0xf7, 0x86, 0x21, 0x3a, 0x80, 0x05, 0x39, 0x98, 0xcf, 0x46, 0x88, 0x91, + 0x65, 0x54, 0x96, 0x75, 0x2a, 0xa3, 0x4b, 0xf5, 0x70, 0xca, 0x46, 0x62, 0xbc, 0xd2, 0xa9, 0x8a, + 0x14, 0x9e, 0x73, 0xe3, 0x3d, 0x22, 0xd2, 0xc1, 0xb9, 0x3b, 0x2a, 0xd2, 0xc1, 0xb9, 0x7b, 0xbf, + 0x08, 0x79, 0xd1, 0xc2, 0xff, 0x9c, 0x01, 0x90, 0xab, 0xb1, 0x3b, 0x40, 0x9b, 0x50, 0xf5, 0x45, + 0x4b, 0xd3, 0xd6, 0x5b, 0x46, 0x6d, 0x89, 0x45, 0x9c, 0xb2, 0x2b, 0x72, 0x10, 0x17, 0xee, 0x63, + 0x28, 0x47, 0x54, 0x62, 0x85, 0x5d, 0x31, 0x28, 0x2c, 0xa2, 0x50, 0x92, 0x03, 0xa8, 0xca, 0x3e, + 0x83, 0xc5, 0x68, 0xbc, 0x41, 0x67, 0x37, 0xc6, 0xe8, 0x2c, 0x22, 0x38, 0x2f, 0x29, 0xa8, 0x5a, + 0x53, 0x05, 0x8b, 0xd5, 0x76, 0xc5, 0xa0, 0xb6, 0x51, 0xc1, 0xa8, 0xe2, 0x80, 0xfa, 0x4b, 0xde, + 0xc4, 0xff, 0x93, 0x85, 0xfc, 0x86, 0xd7, 0x1f, 0x38, 0x3e, 0x5d, 0x8d, 0x9c, 0x4f, 0x82, 0x61, + 0x2f, 0x64, 0xea, 0xaa, 0xae, 0x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xf8, 0x0e, 0xcc, 0xfa, 0xa4, 0xef, 0x74, 0xdd, 0xae, 0x7b, 0x7c, 0x78, 0x74, 0x11, + 0x92, 0x40, 0x5c, 0x98, 0xaa, 0x11, 0xf8, 0x3e, 0x85, 0x52, 0xd1, 0x8e, 0x7a, 0xde, 0x91, 0x30, + 0x73, 0xec, 0x1b, 0xff, 0x2c, 0x03, 0xe5, 0xcf, 0x9c, 0xb0, 0x2d, 0x97, 0x0e, 0x6d, 0x41, 0x35, + 0x32, 0x6e, 0x0c, 0x22, 0x64, 0x49, 0xb8, 0x58, 0x36, 0x46, 0x86, 0xd2, 0xd2, 0x3b, 0x56, 0xda, + 0x2a, 0x80, 0x91, 0x72, 0xdc, 0x36, 0xe9, 0x45, 0xa4, 0x32, 0xe9, 0xa4, 0x18, 0xa2, 0x4a, 0x4a, + 0x05, 0xa0, 0x5d, 0xa8, 0x0d, 0x7c, 0xef, 0xd8, 0x27, 0x41, 0x10, 0x11, 0xe3, 0x6e, 0x0c, 0x1b, + 0x88, 0xed, 0x09, 0xd4, 0x98, 0xdc, 0xec, 0x40, 0x07, 0xdd, 0x9f, 0x8d, 0xe3, 0x19, 0x6e, 0x9c, + 0xfe, 0x23, 0x03, 0x68, 0x74, 0x52, 0xdf, 0x34, 0xc4, 0xbb, 0x05, 0xd5, 0x20, 0x74, 0xfc, 0x91, + 0xcd, 0x56, 0x61, 0xd0, 0xc8, 0xe2, 0xbf, 0x03, 0x91, 0x40, 0x87, 0xae, 0x17, 0x76, 0x9f, 0x5f, + 0x88, 0x28, 0xb9, 0x2a, 0xc1, 0x3b, 0x0c, 0x8a, 0x5a, 0x90, 0x7f, 0xde, 0xed, 0x85, 0xc4, 0x0f, + 0xea, 0x33, 0xcb, 0xd9, 0x95, 0xea, 0xfa, 0xdd, 0x57, 0x2d, 0xc3, 0xea, 0x27, 0x0c, 0xff, 0xe0, + 0x62, 0x40, 0x6c, 0x39, 0x56, 0x8d, 0x3c, 0x73, 0x5a, 0x34, 0x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c, 0xb8, 0x81, 0x59, 0x22, 0xf1, 0xad, 0x87, 0x23, 0x94, 0x99, 0x3f, 0x54, 0xcf, 0x34, 0xc4, + 0x99, 0xe2, 0x14, 0x6e, 0xca, 0xa9, 0x5e, 0x4e, 0x47, 0x18, 0xcb, 0x4d, 0x9c, 0xe9, 0x73, 0xa8, + 0x68, 0x89, 0xf1, 0xe4, 0x2d, 0xcf, 0x94, 0x6a, 0x4f, 0xde, 0xf2, 0x8c, 0x99, 0x75, 0x7d, 0x33, + 0x47, 0x6c, 0xe3, 0x13, 0x16, 0x73, 0x16, 0x57, 0x6a, 0x33, 0x67, 0xfd, 0x4e, 0x7d, 0x73, 0x2c, + 0xce, 0x58, 0xce, 0xf1, 0x75, 0x7a, 0x00, 0x25, 0x25, 0xd9, 0x8c, 0xcc, 0x1a, 0x54, 0x2d, 0xd9, + 0x8d, 0x31, 0x18, 0x26, 0xcb, 0x19, 0xf1, 0x14, 0x76, 0xec, 0x7e, 0xed, 0x5f, 0xbe, 0x5e, 0xb2, + 0xfe, 0xfd, 0xeb, 0x25, 0xeb, 0xbf, 0xbe, 0x5e, 0xb2, 0xfe, 0xee, 0xbf, 0x97, 0xa6, 0x8e, 0x72, + 0xec, 0xff, 0x91, 0xf1, 0xe1, 0xff, 0x07, 0x00, 0x00, 0xff, 0xff, 0xfd, 0x4b, 0xb3, 0x60, 0xc4, + 0x43, 0x00, 0x00, } diff --git a/etcdserver/etcdserverpb/rpc.proto b/etcdserver/etcdserverpb/rpc.proto index 1c27bafae11..00ac4872e82 100644 --- a/etcdserver/etcdserverpb/rpc.proto +++ b/etcdserver/etcdserverpb/rpc.proto @@ -4,6 +4,8 @@ package etcdserverpb; import "gogoproto/gogo.proto"; import "etcd/mvcc/mvccpb/kv.proto"; import "etcd/auth/authpb/auth.proto"; +import "etcd/qos/qospb/qos.proto"; + // for grpc-gateway import "google/api/annotations.proto"; @@ -385,6 +387,67 @@ service Auth { } } + +service QoS { + + // QoSEnable enables qos. + rpc QoSEnable(QoSEnableRequest) returns (QoSEnableResponse) { + option (google.api.http) = { + post: "/v3/qos/enable" + body: "*" + }; + } + + // QoSDisable disables qos. + rpc QoSDisable(QoSDisableRequest) returns (QoSDisableResponse) { + option (google.api.http) = { + post: "/v3/qos/disable" + body: "*" + }; + } + + // QoSRuleAdd adds a qos rule into the cluster. + rpc QoSRuleAdd (QoSRuleAddRequest) returns (QoSRuleAddResponse) { + option (google.api.http) = { + post: "/v3/qos/rule/add" + body: "*" + }; + } + + // QoSRuleGet get a qos rule into the cluster. + rpc QoSRuleGet (QoSRuleGetRequest) returns (QoSRuleGetResponse) { + option (google.api.http) = { + post: "/v3/qos/rule/get" + body: "*" + }; + } + + // QoSRuleDelete deletes a qos rule from the cluster. + rpc QoSRuleDelete(QoSRuleDeleteRequest) returns (QoSRuleDeleteResponse) { + option (google.api.http) = { + post: "/v3/qos/rule/delete" + body: "*" + }; + } + + // QoSRuleUpdate updates a qos rule into the cluster. + rpc QoSRuleUpdate(QoSRuleUpdateRequest) returns (QoSRuleUpdateResponse) { + option (google.api.http) = { + post: "/v3/qos/rule/update" + body: "*" + }; + } + + // QoSRuleList lists all qos rule from the cluster. + rpc QoSRuleList(QoSRuleListRequest) returns (QoSRuleListResponse) { + option (google.api.http) = { + post: "/v3/qos/rule/list" + body: "*" + }; + } + +} + message ResponseHeader { // cluster_id is the ID of the cluster which sent the response. uint64 cluster_id = 1; @@ -1195,3 +1258,58 @@ message AuthRoleGrantPermissionResponse { message AuthRoleRevokePermissionResponse { ResponseHeader header = 1; } + +message QoSEnableRequest { +} + +message QoSDisableRequest { +} + +message QoSEnableResponse { + ResponseHeader header = 1; +} + +message QoSDisableResponse { + ResponseHeader header = 1; +} + +message QoSRuleAddRequest { + qospb.QoSRule qos_rule = 1; +} + +message QoSRuleAddResponse { + ResponseHeader header = 1; +} + +message QoSRuleDeleteRequest { + string rule_name = 1; +} + +message QoSRuleDeleteResponse { + ResponseHeader header = 1; +} + +message QoSRuleGetRequest { + string rule_name = 1; +} + +message QoSRuleGetResponse { + ResponseHeader header = 1; + qospb.QoSRule qos_rule = 2; +} + +message QoSRuleUpdateRequest { + qospb.QoSRule qos_rule = 1; +} + +message QoSRuleUpdateResponse { + ResponseHeader header = 1; +} + +message QoSRuleListRequest { +} + +message QoSRuleListResponse { + ResponseHeader header = 1; + repeated qospb.QoSRule qos_rules = 2; +} \ No newline at end of file diff --git a/etcdserver/server.go b/etcdserver/server.go index 1d04c721b3e..69bf0902138 100644 --- a/etcdserver/server.go +++ b/etcdserver/server.go @@ -60,6 +60,7 @@ import ( "go.etcd.io/etcd/v3/pkg/traceutil" "go.etcd.io/etcd/v3/pkg/types" "go.etcd.io/etcd/v3/pkg/wait" + "go.etcd.io/etcd/v3/qos" "go.etcd.io/etcd/v3/raft" "go.etcd.io/etcd/v3/raft/raftpb" "go.etcd.io/etcd/v3/version" @@ -246,6 +247,7 @@ type EtcdServer struct { bemu sync.Mutex be backend.Backend authStore auth.AuthStore + qosStore qos.QoSStore alarmStore *v3alarm.AlarmStore stats *stats.ServerStats @@ -556,6 +558,7 @@ func NewServer(cfg ServerConfig) (srv *EtcdServer, err error) { } srv.authStore = auth.NewAuthStore(srv.getLogger(), srv.be, srv.consistIndex, tp, int(cfg.BcryptCost)) + srv.qosStore = qos.NewQoSStore(srv.getLogger(), srv.be, srv.consistIndex) newSrv := srv // since srv == nil in defer if srv is returned as nil defer func() { @@ -2356,6 +2359,8 @@ func (s *EtcdServer) Backend() backend.Backend { func (s *EtcdServer) AuthStore() auth.AuthStore { return s.authStore } +func (s *EtcdServer) QoSStore() qos.QoSStore { return s.qosStore } + func (s *EtcdServer) restoreAlarms() error { s.applyV3 = s.newApplierV3() as, err := v3alarm.NewAlarmStore(s.lg, s) diff --git a/etcdserver/v3_server.go b/etcdserver/v3_server.go index e96f9660d44..f100b8ed26c 100644 --- a/etcdserver/v3_server.go +++ b/etcdserver/v3_server.go @@ -29,6 +29,7 @@ import ( "go.etcd.io/etcd/v3/lease/leasehttp" "go.etcd.io/etcd/v3/mvcc" "go.etcd.io/etcd/v3/pkg/traceutil" + "go.etcd.io/etcd/v3/qos" "go.etcd.io/etcd/v3/raft" "github.com/gogo/protobuf/proto" @@ -90,6 +91,23 @@ type Authenticator interface { RoleList(ctx context.Context, r *pb.AuthRoleListRequest) (*pb.AuthRoleListResponse, error) } +type QoS interface { + // QoSEnable enables qos. + QoSEnable(context.Context, *pb.QoSEnableRequest) (*pb.QoSEnableResponse, error) + // QoSDisable disables qos. + QoSDisable(context.Context, *pb.QoSDisableRequest) (*pb.QoSDisableResponse, error) + // QoSRuleAdd adds a qos rule into the cluster. + QoSRuleAdd(context.Context, *pb.QoSRuleAddRequest) (*pb.QoSRuleAddResponse, error) + // QoSRuleGet get a qos rule into the cluster. + QoSRuleGet(context.Context, *pb.QoSRuleGetRequest) (*pb.QoSRuleGetResponse, error) + // QoSRuleDelete deletes a qos rule from the cluster. + QoSRuleDelete(context.Context, *pb.QoSRuleDeleteRequest) (*pb.QoSRuleDeleteResponse, error) + // QoSRuleUpdate updates a qos rule into the cluster. + QoSRuleUpdate(context.Context, *pb.QoSRuleUpdateRequest) (*pb.QoSRuleUpdateResponse, error) + // QoSRuleList lists all qos rule from the cluster. + QoSRuleList(context.Context, *pb.QoSRuleListRequest) (*pb.QoSRuleListResponse, error) +} + func (s *EtcdServer) Range(ctx context.Context, r *pb.RangeRequest) (*pb.RangeResponse, error) { trace := traceutil.New("range", s.getLogger(), @@ -97,7 +115,12 @@ func (s *EtcdServer) Range(ctx context.Context, r *pb.RangeRequest) (*pb.RangeRe traceutil.Field{Key: "range_end", Value: string(r.RangeEnd)}, ) ctx = context.WithValue(ctx, traceutil.TraceKey, trace) - + object := &qos.RequestContext{GRPCMethod: "Range", Key: string(r.Key)} + if !s.qosStore.GetToken(object) { + s.lg.Warn("failed to Range due to rate limit", zap.String("key", string(r.Key))) + return nil, qos.ErrQoSRateExceeded + } + defer s.qosStore.PutToken(object) var resp *pb.RangeResponse var err error defer func(start time.Time) { @@ -917,3 +940,59 @@ func (s *EtcdServer) downgradeCancel(ctx context.Context) (*pb.DowngradeResponse resp := pb.DowngradeResponse{Version: s.ClusterVersion().String()} return &resp, nil } + +func (s *EtcdServer) QoSEnable(ctx context.Context, r *pb.QoSEnableRequest) (*pb.QoSEnableResponse, error) { + resp, err := s.raftRequestOnce(ctx, pb.InternalRaftRequest{QosEnable: r}) + if err != nil { + return nil, err + } + return resp.(*pb.QoSEnableResponse), nil +} + +func (s *EtcdServer) QoSDisable(ctx context.Context, r *pb.QoSDisableRequest) (*pb.QoSDisableResponse, error) { + resp, err := s.raftRequest(ctx, pb.InternalRaftRequest{QosDisable: r}) + if err != nil { + return nil, err + } + return resp.(*pb.QoSDisableResponse), nil +} + +func (s *EtcdServer) QoSRuleAdd(ctx context.Context, r *pb.QoSRuleAddRequest) (*pb.QoSRuleAddResponse, error) { + resp, err := s.raftRequest(ctx, pb.InternalRaftRequest{QosRuleAdd: r}) + if err != nil { + return nil, err + } + return resp.(*pb.QoSRuleAddResponse), nil +} + +func (s *EtcdServer) QoSRuleGet(ctx context.Context, r *pb.QoSRuleGetRequest) (*pb.QoSRuleGetResponse, error) { + resp, err := s.raftRequest(ctx, pb.InternalRaftRequest{QosRuleGet: r}) + if err != nil { + return nil, err + } + return resp.(*pb.QoSRuleGetResponse), nil +} + +func (s *EtcdServer) QoSRuleDelete(ctx context.Context, r *pb.QoSRuleDeleteRequest) (*pb.QoSRuleDeleteResponse, error) { + resp, err := s.raftRequest(ctx, pb.InternalRaftRequest{QosRuleDelete: r}) + if err != nil { + return nil, err + } + return resp.(*pb.QoSRuleDeleteResponse), nil +} + +func (s *EtcdServer) QoSRuleUpdate(ctx context.Context, r *pb.QoSRuleUpdateRequest) (*pb.QoSRuleUpdateResponse, error) { + resp, err := s.raftRequest(ctx, pb.InternalRaftRequest{QosRuleUpdate: r}) + if err != nil { + return nil, err + } + return resp.(*pb.QoSRuleUpdateResponse), nil +} + +func (s *EtcdServer) QoSRuleList(ctx context.Context, r *pb.QoSRuleListRequest) (*pb.QoSRuleListResponse, error) { + resp, err := s.raftRequest(ctx, pb.InternalRaftRequest{QosRuleList: r}) + if err != nil { + return nil, err + } + return resp.(*pb.QoSRuleListResponse), nil +} diff --git a/go.mod b/go.mod index 73a1371152b..d3e6a3f09ab 100644 --- a/go.mod +++ b/go.mod @@ -3,6 +3,7 @@ module go.etcd.io/etcd/v3 go 1.14 require ( + github.com/antonmedv/expr v1.8.9 github.com/bgentry/speakeasy v0.1.0 github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa github.com/coreos/go-semver v0.2.0 @@ -26,7 +27,6 @@ require ( github.com/json-iterator/go v1.1.7 github.com/mattn/go-colorable v0.0.9 // indirect github.com/mattn/go-isatty v0.0.4 // indirect - github.com/mattn/go-runewidth v0.0.2 // indirect github.com/modern-go/reflect2 v1.0.1 github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5 github.com/prometheus/client_golang v1.0.0 diff --git a/go.sum b/go.sum index f520a0bd264..b59370c807c 100644 --- a/go.sum +++ b/go.sum @@ -1,8 +1,11 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/DATA-DOG/go-sqlmock v1.3.3/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q5eFN3EC/SaM= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= +github.com/antonmedv/expr v1.8.9 h1:O9stiHmHHww9b4ozhPx7T6BK7fXfOCHJ8ybxf0833zw= +github.com/antonmedv/expr v1.8.9/go.mod h1:5qsM3oLGDND7sDmQGDXHkYfkjYMUX14qsgqmHhwGEk8= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973 h1:xJ4a3vCFaGF/jqvzLMYoU8P317H5OQ+Via4RmuPwCS0= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0 h1:HWo1m869IqiPhD389kmkxeTalrjNbbJTC8LXupb+sl0= @@ -19,6 +22,7 @@ github.com/coreos/go-systemd/v22 v22.0.0 h1:XJIw/+VlJ+87J+doOxznsAWIdmWuViOVhkQa github.com/coreos/go-systemd/v22 v22.0.0/go.mod h1:xO0FLkIi5MaZafQlIrOotqXZ90ih+1atmu1JpKERPPk= github.com/creack/pty v1.1.11 h1:07n33Z8lZxZ2qwegKbObQohDhXDQxiMMz1NOUGYlesw= github.com/creack/pty v1.1.11/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= +github.com/davecgh/go-spew v0.0.0-20161028175848-04cdfd42973b/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -32,6 +36,8 @@ github.com/etcd-io/gofail v0.0.0-20190801230047-ad7f989257ca h1:Y2I0lxOttdUKz+hN github.com/etcd-io/gofail v0.0.0-20190801230047-ad7f989257ca/go.mod h1:49H/RkXP8pKaZy4h0d+NW16rSLhyVBt4o6VLJbmOqDE= github.com/fatih/color v1.7.0 h1:DkWD4oS2D8LGGgTQ6IvwJJXSL5Vp2ffcQg58nFV38Ys= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= +github.com/gdamore/encoding v1.0.0/go.mod h1:alR0ol34c49FCSBLjhosxzcPHQbf2trDkoo5dl+VrEg= +github.com/gdamore/tcell v1.3.0/go.mod h1:Hjvr+Ofd+gLglo7RYKxxnzCBmev3BzsS67MebKS4zMM= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= @@ -87,12 +93,15 @@ github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORN github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/lucasb-eyer/go-colorful v1.0.2/go.mod h1:0MS4r+7BZKSJ5mw4/S5MPN+qHFF1fYclkSPilDOKW0s= +github.com/lucasb-eyer/go-colorful v1.0.3/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i7ruzyGqttikkLy0= github.com/mattn/go-colorable v0.0.9 h1:UVL0vNpWh04HeJXV0KLcaT7r06gOH2l4OW6ddYRUIY4= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-isatty v0.0.4 h1:bnP0vzxcAdeI1zdubAl5PjU6zsERjGZb7raWodagDYs= github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= -github.com/mattn/go-runewidth v0.0.2 h1:UnlwIPBGaTZfPQ6T1IGzPI0EkYAQmT9fAEJ/poFC63o= -github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= +github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= +github.com/mattn/go-runewidth v0.0.8 h1:3tS41NlGYSmhhe/8fhGRzc+z3AYCw1Fe1WAyLuujKs0= +github.com/mattn/go-runewidth v0.0.8/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= @@ -108,6 +117,7 @@ github.com/pkg/errors v0.8.0 h1:WdK/asTD0HN+q6hsWO3/vpuAkAr+tw6aNJNDFFf0+qw= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pmezard/go-difflib v0.0.0-20151028094244-d8ed2627bdf0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= @@ -123,8 +133,11 @@ github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y8 github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2 h1:6LJUbpNm42llc4HRCuvApCSWB/WfhuNo9K98Q9sNGfs= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= +github.com/rivo/tview v0.0.0-20200219210816-cd38d7432498/go.mod h1:6lkG1x+13OShEf0EaOCaTQYyB7d5nSbb181KtjlS+84= +github.com/rivo/uniseg v0.1.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/sanity-io/litter v1.2.0/go.mod h1:JF6pZUFgu2Q0sBZ+HSV35P8TVPI1TTzEwyu9FXAw2W4= github.com/sirupsen/logrus v1.2.0 h1:juTguoYk5qI21pwyTXY3B3Y5cOTH3ZUyZCg1v/mihuo= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.2 h1:SPIRibHv4MatM3XXNO2BJeFLZwZ2LvZgfQ5+UNI2im4= @@ -137,12 +150,15 @@ github.com/spf13/pflag v1.0.1 h1:aCvUg6QPl3ibpQUxyLkrEkCHtPqYJL4x9AuhqVqFis4= github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= 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 v0.0.0-20161117074351-18a02ba4a312/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1w= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +github.com/stretchr/testify v1.5.1 h1:nOGnQDM7FYENwehXlg/kFVnos3rEvtKTjRvOWSzb6H4= +github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8 h1:ndzgwNDnKIqyCvHTXaCqh9KlOWKvBry6nuXMJmonVsE= github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/urfave/cli v1.20.0 h1:fDqGv3UG/4jbVl/QkFwEdddtEDjh/5Ov6X+0B/3bPaw= @@ -199,15 +215,20 @@ golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a h1:1BGLXjeY4akVXGgbC9HugT3Jv golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190626150813-e07cf5db2756/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5 h1:LfCXLvNmTYH9kEmVgqbnsWfruoXZIrh4YBgqVHtDvw0= golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4 h1:sfkvUWPNGwSV+8/fNqctR5lS2AqCSqYwXdrjCxp/dXo= +golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/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/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3 h1:cokOdA+Jmi5PJGXLlLllQSgYigAEfHXJAERHVMaCc2k= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2 h1:+DCIGbF/swA92ohVg0//6X2IVY3KZs6p9mix0ziNYJM= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= diff --git a/qos/doc.go b/qos/doc.go new file mode 100644 index 00000000000..63d408af779 --- /dev/null +++ b/qos/doc.go @@ -0,0 +1,16 @@ +// Copyright 2016 The etcd Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Package qos provides client qos management for accessing keys in etcd. +package qos diff --git a/qos/enforcer.go b/qos/enforcer.go new file mode 100644 index 00000000000..e5c6ce40475 --- /dev/null +++ b/qos/enforcer.go @@ -0,0 +1,166 @@ +// Copyright 2016 The etcd Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "qs IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package qos + +import ( + "strings" + "sync" + + "go.etcd.io/etcd/v3/qos/qospb" + "go.uber.org/zap" +) + +type QoSRuleType string + +const ( + RuleTypeGRPCMethod QoSRuleType = "gRPCMethod" + RuleTypeSlowQuery QoSRuleType = "slowquery" + RuleTypeTraffic QoSRuleType = "traffic" + RuleTypeCustom QoSRuleType = "custom" + + RulePriorityMax = 9 + RulePriorityMin = 0 +) + +type RequestContext struct { + GRPCMethod string + Key string + RangeKeyNum int + DBUsedByte int + MatchedRuleName string +} + +type Enforcer interface { + SyncRule(r *qospb.QoSRule) error + + DeleteRule(r *qospb.QoSRule) error + + GetToken(r *RequestContext) bool + + PutToken(r *RequestContext) bool +} + +type QosEnforcer struct { + mu sync.Mutex + lg *zap.Logger + objectRateLimiter map[string]RateLimiter + rulePriList []map[string]*qospb.QoSRule +} + +func NewQoSEnforcer(lg *zap.Logger) Enforcer { + return &QosEnforcer{ + lg: lg, + objectRateLimiter: make(map[string]RateLimiter), + rulePriList: make([]map[string]*qospb.QoSRule, RulePriorityMax+1), + } +} + +func (qe *QosEnforcer) SyncRule(r *qospb.QoSRule) error { + qe.mu.Lock() + defer qe.mu.Unlock() + if r.Priority < RulePriorityMin || r.Priority > RulePriorityMax { + return ErrInvalidPriorityRule + } + limiter, err := NewRateLimiter(r.Ratelimiter, r.Qps) + if err != nil { + qe.lg.Error("failed to add qos rule", zap.Error(err)) + return err + } + qe.lg.Debug("create qos rule ratelimiter", zap.Any("rule", *r)) + qe.objectRateLimiter[r.RuleName] = limiter + if qe.rulePriList[r.Priority] != nil { + qe.rulePriList[r.Priority][r.RuleName] = r + } else { + set := make(map[string]*qospb.QoSRule) + set[r.RuleName] = r + qe.rulePriList[r.Priority] = set + } + return nil +} + +func (qe *QosEnforcer) DeleteRule(r *qospb.QoSRule) error { + qe.mu.Lock() + defer qe.mu.Unlock() + if r.Priority < RulePriorityMin || r.Priority > RulePriorityMax { + return ErrInvalidPriorityRule + } + delete(qe.objectRateLimiter, r.RuleName) + set := qe.rulePriList[r.Priority] + if set != nil { + delete(set, r.RuleName) + } + return nil +} + +func (qe *QosEnforcer) GetToken(r *RequestContext) bool { + qe.mu.Lock() + defer qe.mu.Unlock() + // to do, optimize performance, used lru cache to store matched rule + rule, err := qe.matchRule(r) + if err != nil { + return true + } + qe.lg.Info("matched rule", zap.Any("object", r), zap.Any("rule", rule)) + limiter, ok := qe.objectRateLimiter[rule.RuleName] + if ok { + return limiter.GetToken() + } + return true +} + +func (qe *QosEnforcer) PutToken(r *RequestContext) bool { + qe.mu.Lock() + defer qe.mu.Unlock() + limiter, ok := qe.objectRateLimiter[r.MatchedRuleName] + if ok { + return limiter.PutToken() + } + return true +} + +func (qe *QosEnforcer) matchRule(r *RequestContext) (*qospb.QoSRule, error) { + matched := false + qe.lg.Debug("start to match rule", zap.Any("object", r)) + // to do,optimize and benchmark performance + for i := RulePriorityMax; i >= RulePriorityMin; i-- { + for _, rule := range qe.rulePriList[i] { + qe.lg.Debug("matching rule", zap.Any("rule", rule)) + executor, err := NewRuleExecutor(qe.lg, QoSRuleType(rule.RuleType)) + if err != nil { + qe.lg.Warn("failed to create new rule executor", zap.Error(err), zap.Any("rule", rule)) + return nil, err + } + matched, err = executor.Run(rule, qe.populateEnv(r)) + if err != nil { + qe.lg.Warn("failed to run rule executor", zap.Error(err), zap.Any("rule", rule)) + return nil, err + } + if matched { + return rule, nil + } + } + } + return nil, ErrNoRuleMatched +} + +func (qe *QosEnforcer) populateEnv(r *RequestContext) map[string]interface{} { + env := make(map[string]interface{}) + env["gRPCMethod"] = r.GRPCMethod + env["key"] = r.Key + env["prefix"] = strings.HasPrefix + env["RangeKeyNum"] = r.RangeKeyNum + env["DBUsedByte"] = r.DBUsedByte + return env +} diff --git a/qos/executor.go b/qos/executor.go new file mode 100644 index 00000000000..b54e5664fd0 --- /dev/null +++ b/qos/executor.go @@ -0,0 +1,140 @@ +// Copyright 2016 The etcd Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "qs IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package qos + +import ( + "errors" + "fmt" + "strings" + + "github.com/antonmedv/expr" + "go.etcd.io/etcd/v3/qos/qospb" + "go.uber.org/zap" +) + +const ( + RuleExecutorExpr = "exprExecutor" + RuleExecutorCmpThreshold = "cmpThresholdExecutor" + RuleExecutorGRPCMethod = "gRPCMethodExecutor" +) + +var ( + ErrInvalidRuleExecutorName = errors.New("qos: rule executor name is invalid") +) + +type RuleExecutor interface { + Run(r *qospb.QoSRule, Env map[string]interface{}) (bool, error) + + Name() string +} + +func NewRuleExecutor(lg *zap.Logger, ruleType QoSRuleType) (RuleExecutor, error) { + switch ruleType { + case RuleTypeGRPCMethod: + return NewGRPCMethodRuleExecutor(lg, RuleExecutorGRPCMethod), nil + case RuleTypeSlowQuery, RuleTypeTraffic: + return NewCompareRuleExecutor(lg, RuleExecutorCmpThreshold), nil + case RuleTypeCustom: + return NewExprRuleExecutor(lg, RuleExecutorExpr), nil + default: + return nil, ErrInvalidRuleExecutorName + } +} + +type exprRuleExecutor struct { + lg *zap.Logger + name string +} + +func NewExprRuleExecutor(lg *zap.Logger, name string) RuleExecutor { + return &exprRuleExecutor{lg: lg, name: name} +} + +func (ee *exprRuleExecutor) Run(r *qospb.QoSRule, env map[string]interface{}) (bool, error) { + code, err := expr.Compile(r.Condition, expr.Env(env)) + if err != nil { + ee.lg.Warn("failed to compile code", zap.String("condition", r.Condition), zap.Error(err)) + return false, err + } + result, err := expr.Run(code, env) + if err != nil { + ee.lg.Warn("failed to run expr code", zap.String("code", r.Condition), zap.Error(err)) + return false, err + } + return result.(bool), nil +} + +func (ee *exprRuleExecutor) Name() string { + return ee.name +} + +type gRPCMethodRuleExecutor struct { + lg *zap.Logger + name string +} + +func NewGRPCMethodRuleExecutor(lg *zap.Logger, name string) RuleExecutor { + return &gRPCMethodRuleExecutor{lg: lg, name: name} +} + +func (ee *gRPCMethodRuleExecutor) Run(r *qospb.QoSRule, env map[string]interface{}) (bool, error) { + gRPCMethod := env["gRPCMethod"].(string) + key, ok := env["key"].(string) + if !ok { + return false, ErrEnvLackOfKey + } + if gRPCMethod == r.Subject.Name { + if r.Subject.Prefix != "" && key != "" && !strings.HasPrefix(key, r.Subject.Prefix) { + return false, nil + } + return true, nil + } + return false, nil +} + +func (ee *gRPCMethodRuleExecutor) Name() string { + return ee.name +} + +type cmpThresholdRuleExecutor struct { + lg *zap.Logger + name string +} + +func NewCompareRuleExecutor(lg *zap.Logger, name string) RuleExecutor { + return &cmpThresholdRuleExecutor{lg: lg, name: name} +} + +func (ce *cmpThresholdRuleExecutor) Run(r *qospb.QoSRule, env map[string]interface{}) (bool, error) { + key, ok := env["key"].(string) + if !ok { + return false, ErrEnvLackOfKey + } + if r.Subject.Prefix != "" && !strings.HasPrefix(key, r.Subject.Prefix) { + return false, nil + } + value, ok := env[r.Subject.Name].(int) + if !ok { + return false, fmt.Errorf("failed to get subject name %s", r.Subject.Name) + } + if uint64(value) > r.Threshold { + return true, nil + } + return false, nil +} + +func (ce *cmpThresholdRuleExecutor) Name() string { + return ce.name +} diff --git a/qos/qospb/qos.pb.go b/qos/qospb/qos.pb.go new file mode 100644 index 00000000000..2cf1d9e71d7 --- /dev/null +++ b/qos/qospb/qos.pb.go @@ -0,0 +1,728 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: qos.proto + +/* + Package qospb is a generated protocol buffer package. + + It is generated from these files: + qos.proto + + It has these top-level messages: + Subject + QoSRule +*/ +package qospb + +import ( + "fmt" + + proto "github.com/golang/protobuf/proto" + + math "math" + + _ "github.com/gogo/protobuf/gogoproto" + + io "io" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package + +type Subject struct { + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Prefix string `protobuf:"bytes,2,opt,name=prefix,proto3" json:"prefix,omitempty"` +} + +func (m *Subject) Reset() { *m = Subject{} } +func (m *Subject) String() string { return proto.CompactTextString(m) } +func (*Subject) ProtoMessage() {} +func (*Subject) Descriptor() ([]byte, []int) { return fileDescriptorQos, []int{0} } + +type QoSRule struct { + RuleName string `protobuf:"bytes,1,opt,name=rule_name,json=ruleName,proto3" json:"rule_name,omitempty"` + RuleType string `protobuf:"bytes,2,opt,name=rule_type,json=ruleType,proto3" json:"rule_type,omitempty"` + Subject *Subject `protobuf:"bytes,3,opt,name=subject" json:"subject,omitempty"` + Qps uint64 `protobuf:"varint,4,opt,name=qps,proto3" json:"qps,omitempty"` + Threshold uint64 `protobuf:"varint,5,opt,name=threshold,proto3" json:"threshold,omitempty"` + Condition string `protobuf:"bytes,6,opt,name=condition,proto3" json:"condition,omitempty"` + Priority uint64 `protobuf:"varint,7,opt,name=priority,proto3" json:"priority,omitempty"` + Ratelimiter string `protobuf:"bytes,8,opt,name=ratelimiter,proto3" json:"ratelimiter,omitempty"` +} + +func (m *QoSRule) Reset() { *m = QoSRule{} } +func (m *QoSRule) String() string { return proto.CompactTextString(m) } +func (*QoSRule) ProtoMessage() {} +func (*QoSRule) Descriptor() ([]byte, []int) { return fileDescriptorQos, []int{1} } + +func init() { + proto.RegisterType((*Subject)(nil), "qospb.Subject") + proto.RegisterType((*QoSRule)(nil), "qospb.QoSRule") +} +func (m *Subject) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Subject) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if len(m.Name) > 0 { + dAtA[i] = 0xa + i++ + i = encodeVarintQos(dAtA, i, uint64(len(m.Name))) + i += copy(dAtA[i:], m.Name) + } + if len(m.Prefix) > 0 { + dAtA[i] = 0x12 + i++ + i = encodeVarintQos(dAtA, i, uint64(len(m.Prefix))) + i += copy(dAtA[i:], m.Prefix) + } + return i, nil +} + +func (m *QoSRule) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QoSRule) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if len(m.RuleName) > 0 { + dAtA[i] = 0xa + i++ + i = encodeVarintQos(dAtA, i, uint64(len(m.RuleName))) + i += copy(dAtA[i:], m.RuleName) + } + if len(m.RuleType) > 0 { + dAtA[i] = 0x12 + i++ + i = encodeVarintQos(dAtA, i, uint64(len(m.RuleType))) + i += copy(dAtA[i:], m.RuleType) + } + if m.Subject != nil { + dAtA[i] = 0x1a + i++ + i = encodeVarintQos(dAtA, i, uint64(m.Subject.Size())) + n1, err := m.Subject.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n1 + } + if m.Qps != 0 { + dAtA[i] = 0x20 + i++ + i = encodeVarintQos(dAtA, i, uint64(m.Qps)) + } + if m.Threshold != 0 { + dAtA[i] = 0x28 + i++ + i = encodeVarintQos(dAtA, i, uint64(m.Threshold)) + } + if len(m.Condition) > 0 { + dAtA[i] = 0x32 + i++ + i = encodeVarintQos(dAtA, i, uint64(len(m.Condition))) + i += copy(dAtA[i:], m.Condition) + } + if m.Priority != 0 { + dAtA[i] = 0x38 + i++ + i = encodeVarintQos(dAtA, i, uint64(m.Priority)) + } + if len(m.Ratelimiter) > 0 { + dAtA[i] = 0x42 + i++ + i = encodeVarintQos(dAtA, i, uint64(len(m.Ratelimiter))) + i += copy(dAtA[i:], m.Ratelimiter) + } + return i, nil +} + +func encodeVarintQos(dAtA []byte, offset int, v uint64) int { + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return offset + 1 +} +func (m *Subject) Size() (n int) { + var l int + _ = l + l = len(m.Name) + if l > 0 { + n += 1 + l + sovQos(uint64(l)) + } + l = len(m.Prefix) + if l > 0 { + n += 1 + l + sovQos(uint64(l)) + } + return n +} + +func (m *QoSRule) Size() (n int) { + var l int + _ = l + l = len(m.RuleName) + if l > 0 { + n += 1 + l + sovQos(uint64(l)) + } + l = len(m.RuleType) + if l > 0 { + n += 1 + l + sovQos(uint64(l)) + } + if m.Subject != nil { + l = m.Subject.Size() + n += 1 + l + sovQos(uint64(l)) + } + if m.Qps != 0 { + n += 1 + sovQos(uint64(m.Qps)) + } + if m.Threshold != 0 { + n += 1 + sovQos(uint64(m.Threshold)) + } + l = len(m.Condition) + if l > 0 { + n += 1 + l + sovQos(uint64(l)) + } + if m.Priority != 0 { + n += 1 + sovQos(uint64(m.Priority)) + } + l = len(m.Ratelimiter) + if l > 0 { + n += 1 + l + sovQos(uint64(l)) + } + return n +} + +func sovQos(x uint64) (n int) { + for { + n++ + x >>= 7 + if x == 0 { + break + } + } + return n +} +func sozQos(x uint64) (n int) { + return sovQos(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *Subject) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQos + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Subject: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Subject: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQos + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQos + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Prefix", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQos + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQos + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Prefix = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQos(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthQos + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QoSRule) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQos + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QoSRule: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QoSRule: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RuleName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQos + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQos + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RuleName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RuleType", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQos + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQos + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RuleType = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Subject", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQos + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Subject == nil { + m.Subject = &Subject{} + } + if err := m.Subject.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Qps", wireType) + } + m.Qps = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQos + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Qps |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Threshold", wireType) + } + m.Threshold = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQos + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Threshold |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Condition", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQos + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQos + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Condition = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 7: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Priority", wireType) + } + m.Priority = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQos + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Priority |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Ratelimiter", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQos + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQos + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Ratelimiter = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQos(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthQos + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipQos(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowQos + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowQos + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + return iNdEx, nil + case 1: + iNdEx += 8 + return iNdEx, nil + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowQos + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + iNdEx += length + if length < 0 { + return 0, ErrInvalidLengthQos + } + return iNdEx, nil + case 3: + for { + var innerWire uint64 + var start int = iNdEx + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowQos + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + innerWire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + innerWireType := int(innerWire & 0x7) + if innerWireType == 4 { + break + } + next, err := skipQos(dAtA[start:]) + if err != nil { + return 0, err + } + iNdEx = start + next + } + return iNdEx, nil + case 4: + return iNdEx, nil + case 5: + iNdEx += 4 + return iNdEx, nil + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + } + panic("unreachable") +} + +var ( + ErrInvalidLengthQos = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowQos = fmt.Errorf("proto: integer overflow") +) + +func init() { proto.RegisterFile("qos.proto", fileDescriptorQos) } + +var fileDescriptorQos = []byte{ + // 280 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x4c, 0x90, 0xdd, 0x4a, 0xc3, 0x30, + 0x14, 0xc7, 0x1b, 0xd7, 0xf5, 0xe3, 0x0c, 0x44, 0x82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0x23, + 0xb1, 0x60, 0x9e, 0x5d, 0x7b, 0x02, 0x74, 0x0c, 0x81, 0xd2, 0x12, 0xb5, 0x34, 0x0d, 0xf3, 0x6d, + 0xf5, 0xf8, 0xa6, 0x11, 0x8c, 0xf4, 0xcc, 0x88, 0x5c, 0xae, 0xa5, 0x11, 0x9a, 0x05, 0xb6, 0x7b, + 0x8e, 0x9e, 0xd9, 0x66, 0xc7, 0x9d, 0xed, 0x8e, 0x3b, 0x9b, 0x96, 0x93, 0x6d, 0xcb, 0xc9, 0x4f, + 0xcb, 0xc9, 0xf7, 0x2f, 0x77, 0x32, 0xcf, 0xfe, 0xe9, 0xe3, 0x7f, 0x00, 0x00, 0x00, 0xff, 0xff, + 0x57, 0xba, 0xb8, 0xc5, 0x7d, 0x01, 0x00, 0x00, +} diff --git a/qos/qospb/qos.proto b/qos/qospb/qos.proto new file mode 100644 index 00000000000..ace55e8b59a --- /dev/null +++ b/qos/qospb/qos.proto @@ -0,0 +1,27 @@ +syntax = "proto3"; +package qospb; + +import "gogoproto/gogo.proto"; + +option (gogoproto.marshaler_all) = true; +option (gogoproto.sizer_all) = true; +option (gogoproto.unmarshaler_all) = true; +option (gogoproto.goproto_getters_all) = false; +option (gogoproto.goproto_enum_prefix_all) = false; + + +message Subject { + string name = 1; + string prefix = 2; +} + +message QoSRule { + string rule_name = 1; + string rule_type = 2; + Subject subject = 3; + uint64 qps = 4; + uint64 threshold = 5; + string condition = 6; + uint64 priority = 7; + string ratelimiter = 8; +} diff --git a/qos/ratelimiter.go b/qos/ratelimiter.go new file mode 100644 index 00000000000..fd66c352c14 --- /dev/null +++ b/qos/ratelimiter.go @@ -0,0 +1,125 @@ +// Copyright 2016 The etcd Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "qs IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package qos + +import ( + "errors" + + "golang.org/x/time/rate" +) + +const ( + RateLimiterTokenBucket = "TokenBucket" + RateLimiterLeakyBucket = "LeakyBucket" + RateLimiterMaxInflight = "MaxInflight" +) + +var ( + ErrInvalidRateLimiterName = errors.New("qos: ratelimiter name is invalid") +) + +type RateLimiter interface { + // GetToken returns true if rate do not exceed. Otherwise, + // it returns false. + GetToken() bool + // PutToken returns token to rate limiter. + PutToken() bool + // QPS returns QPS of rate limiter + QPS() float32 + // Name returns Name of rate limiter + Name() string +} + +func NewRateLimiter(name string, qps uint64) (RateLimiter, error) { + switch name { + case RateLimiterTokenBucket: + return newTokenBucketRateLimiter(float32(qps), int(qps)), nil + case RateLimiterMaxInflight: + return newMaxInflightRateLimiter(int(qps)), nil + default: + return nil, ErrInvalidRateLimiterName + } +} + +type tokenBucketRateLimiter struct { + limiter *rate.Limiter + qps float32 + name string +} + +func newTokenBucketRateLimiter(qps float32, burst int) RateLimiter { + limiter := rate.NewLimiter(rate.Limit(qps), burst) + return &tokenBucketRateLimiter{ + limiter: limiter, + qps: qps, + name: RateLimiterTokenBucket, + } +} + +func (t *tokenBucketRateLimiter) GetToken() bool { + return t.limiter.Allow() +} + +func (t *tokenBucketRateLimiter) PutToken() bool { + return true +} + +func (t *tokenBucketRateLimiter) QPS() float32 { + return t.qps +} + +func (t *tokenBucketRateLimiter) Name() string { + return t.name +} + +type maxInflightRateLimiter struct { + token chan struct{} + maxInflight int + name string +} + +func newMaxInflightRateLimiter(qps int) RateLimiter { + return &maxInflightRateLimiter{ + token: make(chan struct{}, qps), + maxInflight: qps, + name: RateLimiterMaxInflight, + } +} + +func (r *maxInflightRateLimiter) QPS() float32 { + return float32(r.maxInflight) +} + +func (r *maxInflightRateLimiter) Name() string { + return r.name +} + +func (r *maxInflightRateLimiter) GetToken() bool { + select { + case r.token <- struct{}{}: + return true + default: + return false + } +} + +func (r *maxInflightRateLimiter) PutToken() bool { + select { + case <-r.token: + return true + default: + return false + } +} diff --git a/qos/store.go b/qos/store.go new file mode 100644 index 00000000000..f942a479c59 --- /dev/null +++ b/qos/store.go @@ -0,0 +1,366 @@ +// Copyright 2016 The etcd Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "qs IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package qos + +import ( + "bytes" + "errors" + "sync" + + "go.etcd.io/etcd/v3/etcdserver/cindex" + pb "go.etcd.io/etcd/v3/etcdserver/etcdserverpb" + "go.etcd.io/etcd/v3/mvcc/backend" + "go.etcd.io/etcd/v3/qos/qospb" + "go.uber.org/zap" +) + +var ( + enableFlagKey = []byte("qosEnabled") + qosEnabled = []byte{1} + qosDisabled = []byte{0} + + qosBucketName = []byte("qos") + qosRuleBucketName = []byte("qosRules") + + ErrQoSNotEnabled = errors.New("qos: qos is not enabled") + ErrQoSRuleAlreadyExist = errors.New("qos: QoSRule already exists") + ErrQoSRuleEmpty = errors.New("qos: QoSRule name is empty") + ErrQoSRuleNotFound = errors.New("qos: QoSRule not found") + ErrQoSRateExceeded = errors.New("qos: rate exceeded ") + ErrInvalidPriorityRule = errors.New("qos: invalid rule priority") + ErrNoRuleMatched = errors.New("qos: no rules are matched") + ErrEnvLackOfKey = errors.New("qos: lack of env key") +) + +// QoSStore defines qos storage interface. +type QoSStore interface { + + // Recover recovers the state of qos store from the given backend + Recover(b backend.Backend) + + // QoSEnable turns on the qos feature + QoSEnable(r *pb.QoSEnableRequest) error + + // QoSDisable turns on the qos feature + QoSDisable(r *pb.QoSDisableRequest) error + + // IsQoSEnabled returns true if the qos feature is enabled. + IsQoSEnabled() bool + + // QoSRuleAdd adds a new QoSRule into the backend store + QoSRuleAdd(r *pb.QoSRuleAddRequest) (*pb.QoSRuleAddResponse, error) + + // QoSRuleDelete deletes a QoSRule from the backend store + QoSRuleDelete(r *pb.QoSRuleDeleteRequest) (*pb.QoSRuleDeleteResponse, error) + + // QoSRuleUpdate updates a QoSRule into the backend store + QoSRuleUpdate(r *pb.QoSRuleUpdateRequest) (*pb.QoSRuleUpdateResponse, error) + + // QoSRuleGet gets the detailed information of a QoSRules + QoSRuleGet(r *pb.QoSRuleGetRequest) (*pb.QoSRuleGetResponse, error) + + // QoSRuleList list the detailed information of all QoSRules + QoSRuleList(r *pb.QoSRuleListRequest) (*pb.QoSRuleListResponse, error) + + // GetToken returns true if rate do not exceed,otherwise return false + GetToken(r *RequestContext) bool + + // PutToken returns token to rate limiter, return true if returns succeed,otherwise return false + PutToken(r *RequestContext) bool + + // Close does cleanup of QoSStore + Close() error +} + +type qosStore struct { + lg *zap.Logger + be backend.Backend + enabled bool + enabledMu sync.RWMutex + ci cindex.ConsistentIndexer + enforcer Enforcer +} + +func (qs *qosStore) QoSEnable(r *pb.QoSEnableRequest) error { + qs.enabledMu.Lock() + defer qs.enabledMu.Unlock() + if qs.enabled { + qs.lg.Info("qos is already enabled; ignored qos enable request") + return nil + } + b := qs.be + tx := b.BatchTx() + tx.Lock() + defer func() { + tx.Unlock() + b.ForceCommit() + }() + + tx.UnsafePut(qosBucketName, enableFlagKey, qosEnabled) + + qs.enabled = true + qs.saveConsistentIndex(tx) + + qs.lg.Info("enabled qos") + return nil +} + +func (qs *qosStore) QoSDisable(r *pb.QoSDisableRequest) error { + qs.enabledMu.Lock() + defer qs.enabledMu.Unlock() + if !qs.enabled { + return ErrQoSNotEnabled + } + b := qs.be + tx := b.BatchTx() + tx.Lock() + tx.UnsafePut(qosBucketName, enableFlagKey, qosDisabled) + qs.saveConsistentIndex(tx) + tx.Unlock() + b.ForceCommit() + + qs.enabled = false + qs.lg.Info("disabled qos") + return nil +} + +func (qs *qosStore) Close() error { + qs.enabledMu.Lock() + defer qs.enabledMu.Unlock() + if !qs.enabled { + return nil + } + return nil +} + +func (qs *qosStore) Recover(be backend.Backend) { + enabled := false + qs.be = be + tx := be.BatchTx() + tx.Lock() + _, vs := tx.UnsafeRange(qosBucketName, enableFlagKey, nil, 0) + if len(vs) == 1 { + if bytes.Equal(vs[0], qosEnabled) { + enabled = true + } + } + + tx.Unlock() + qs.enabledMu.Lock() + qs.enabled = enabled + qs.enabledMu.Unlock() +} + +func (qs *qosStore) QoSRuleAdd(r *pb.QoSRuleAddRequest) (*pb.QoSRuleAddResponse, error) { + tx := qs.be.BatchTx() + tx.Lock() + defer tx.Unlock() + + QoSRule := getQoSRule(qs.lg, tx, r.QosRule.RuleName) + if QoSRule != nil { + return nil, ErrQoSRuleAlreadyExist + } + + putQoSRule(qs.lg, tx, r.QosRule) + qs.enforcer.SyncRule(r.QosRule) + + qs.saveConsistentIndex(tx) + + qs.lg.Info("added a QoSRule", zap.String("name", r.QosRule.RuleName)) + return &pb.QoSRuleAddResponse{}, nil +} + +func (qs *qosStore) QoSRuleUpdate(r *pb.QoSRuleUpdateRequest) (*pb.QoSRuleUpdateResponse, error) { + tx := qs.be.BatchTx() + tx.Lock() + defer tx.Unlock() + + rule := getQoSRule(qs.lg, tx, r.QosRule.RuleName) + if rule == nil { + return nil, ErrQoSRuleNotFound + } + + putQoSRule(qs.lg, tx, r.QosRule) + qs.enforcer.SyncRule(r.QosRule) + + qs.saveConsistentIndex(tx) + + qs.lg.Info("updated a QoSRule", zap.String("name", r.QosRule.RuleName)) + return &pb.QoSRuleUpdateResponse{}, nil +} + +func (qs *qosStore) QoSRuleDelete(r *pb.QoSRuleDeleteRequest) (*pb.QoSRuleDeleteResponse, error) { + tx := qs.be.BatchTx() + tx.Lock() + defer tx.Unlock() + + rule := getQoSRule(qs.lg, tx, r.RuleName) + if rule == nil { + return nil, ErrQoSRuleNotFound + } + + delQoSRule(tx, r.RuleName) + + qs.saveConsistentIndex(tx) + qs.enforcer.DeleteRule(rule) + + qs.lg.Info( + "deleted a QoSRule", + zap.String("QoSRule-name", r.RuleName), + ) + return &pb.QoSRuleDeleteResponse{}, nil +} + +func (qs *qosStore) QoSRuleGet(r *pb.QoSRuleGetRequest) (*pb.QoSRuleGetResponse, error) { + tx := qs.be.BatchTx() + tx.Lock() + var resp pb.QoSRuleGetResponse + resp.QosRule = getQoSRule(qs.lg, tx, r.RuleName) + tx.Unlock() + + if resp.QosRule == nil { + return nil, ErrQoSRuleNotFound + } + return &resp, nil +} + +func (qs *qosStore) QoSRuleList(r *pb.QoSRuleListRequest) (*pb.QoSRuleListResponse, error) { + tx := qs.be.BatchTx() + tx.Lock() + QoSRules := getAllQoSRules(qs.lg, tx) + tx.Unlock() + resp := &pb.QoSRuleListResponse{} + resp.QosRules = QoSRules + return resp, nil +} + +func getQoSRule(lg *zap.Logger, tx backend.BatchTx, ruleName string) *qospb.QoSRule { + _, vs := tx.UnsafeRange(qosRuleBucketName, []byte(ruleName), nil, 0) + if len(vs) == 0 { + return nil + } + + QoSRule := &qospb.QoSRule{} + err := QoSRule.Unmarshal(vs[0]) + if err != nil { + lg.Panic( + "failed to unmarshal 'qospb.QoSRule'", + zap.String("QoSRule-name", ruleName), + zap.Error(err), + ) + } + return QoSRule +} + +func getAllQoSRules(lg *zap.Logger, tx backend.BatchTx) []*qospb.QoSRule { + _, vs := tx.UnsafeRange(qosRuleBucketName, []byte{0}, []byte{0xff}, -1) + if len(vs) == 0 { + return nil + } + + QoSRules := make([]*qospb.QoSRule, len(vs)) + for i := range vs { + rule := &qospb.QoSRule{} + err := rule.Unmarshal(vs[i]) + if err != nil { + lg.Panic("failed to unmarshal 'qospb.QoSRule'", zap.Error(err)) + } + QoSRules[i] = rule + } + return QoSRules +} + +func putQoSRule(lg *zap.Logger, tx backend.BatchTx, r *qospb.QoSRule) { + b, err := r.Marshal() + if err != nil { + lg.Panic("failed to unmarshal 'qospb.QoSRule'", zap.Error(err)) + } + tx.UnsafePut(qosRuleBucketName, []byte(r.RuleName), b) +} + +func delQoSRule(tx backend.BatchTx, QoSRulename string) { + tx.UnsafeDelete(qosRuleBucketName, []byte(QoSRulename)) +} + +func (qs *qosStore) IsQoSEnabled() bool { + qs.enabledMu.RLock() + defer qs.enabledMu.RUnlock() + return qs.enabled +} + +// NewQoSStore creates a new qosStore. +func NewQoSStore(lg *zap.Logger, be backend.Backend, ci cindex.ConsistentIndexer) *qosStore { + if lg == nil { + lg = zap.NewNop() + } + + tx := be.BatchTx() + tx.Lock() + + tx.UnsafeCreateBucket(qosRuleBucketName) + tx.UnsafeCreateBucket(qosBucketName) + + enabled := false + _, vs := tx.UnsafeRange(qosBucketName, enableFlagKey, nil, 0) + if len(vs) == 1 { + if bytes.Equal(vs[0], qosEnabled) { + enabled = true + } + } + + qs := &qosStore{ + lg: lg, + be: be, + ci: ci, + enabled: enabled, + } + + qs.enforcer = NewQoSEnforcer(lg) + qs.buildQoSRules() + + tx.Unlock() + be.ForceCommit() + + return qs +} + +func (qs *qosStore) buildQoSRules() { + rules := getAllQoSRules(qs.lg, qs.be.BatchTx()) + for i := 0; i < len(rules); i++ { + qs.enforcer.SyncRule(rules[i]) + } +} + +func (qs *qosStore) GetToken(r *RequestContext) bool { + if !qs.IsQoSEnabled() { + return true + } + return qs.enforcer.GetToken(r) +} + +func (qs *qosStore) PutToken(r *RequestContext) bool { + if !qs.IsQoSEnabled() { + return true + } + return qs.enforcer.PutToken(r) +} + +func (qs *qosStore) saveConsistentIndex(tx backend.BatchTx) { + if qs.ci != nil { + qs.ci.UnsafeSave(tx) + } else { + qs.lg.Error("failed to save consistentIndex,consistentIndexer is nil") + } +} diff --git a/scripts/genproto.sh b/scripts/genproto.sh index d50d535a0eb..27f36530386 100755 --- a/scripts/genproto.sh +++ b/scripts/genproto.sh @@ -16,7 +16,7 @@ if [[ $(protoc --version | cut -f2 -d' ') != "3.7.1" ]]; then fi # directories containing protos to be built -DIRS="./wal/walpb ./etcdserver/etcdserverpb ./etcdserver/api/snap/snappb ./raft/raftpb ./mvcc/mvccpb ./lease/leasepb ./auth/authpb ./etcdserver/api/v3lock/v3lockpb ./etcdserver/api/v3election/v3electionpb ./etcdserver/api/membership/membershippb" +DIRS="./wal/walpb ./etcdserver/etcdserverpb ./etcdserver/api/snap/snappb ./raft/raftpb ./mvcc/mvccpb ./lease/leasepb ./auth/authpb ./qos/qospb ./etcdserver/api/v3lock/v3lockpb ./etcdserver/api/v3election/v3electionpb ./etcdserver/api/membership/membershippb" # disable go mod - this is for the go get/install invocations export GO111MODULE=off diff --git a/vendor/github.com/antonmedv/expr/.gitignore b/vendor/github.com/antonmedv/expr/.gitignore new file mode 100644 index 00000000000..39b3c482075 --- /dev/null +++ b/vendor/github.com/antonmedv/expr/.gitignore @@ -0,0 +1,7 @@ +*.exe +*.exe~ +*.dll +*.so +*.dylib +*.test +*.out diff --git a/vendor/github.com/antonmedv/expr/.travis.yml b/vendor/github.com/antonmedv/expr/.travis.yml new file mode 100644 index 00000000000..745b115e208 --- /dev/null +++ b/vendor/github.com/antonmedv/expr/.travis.yml @@ -0,0 +1,3 @@ +language: go +go: + - 1.13.x diff --git a/vendor/github.com/antonmedv/expr/LICENSE b/vendor/github.com/antonmedv/expr/LICENSE new file mode 100644 index 00000000000..7d058f841cb --- /dev/null +++ b/vendor/github.com/antonmedv/expr/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2019 Anton Medvedev + +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/antonmedv/expr/README.md b/vendor/github.com/antonmedv/expr/README.md new file mode 100644 index 00000000000..7cff2804cce --- /dev/null +++ b/vendor/github.com/antonmedv/expr/README.md @@ -0,0 +1,169 @@ +# Expr +[![Build Status](https://travis-ci.org/antonmedv/expr.svg?branch=master)](https://travis-ci.org/antonmedv/expr) +[![Go Report Card](https://goreportcard.com/badge/github.com/antonmedv/expr)](https://goreportcard.com/report/github.com/antonmedv/expr) +[![GoDoc](https://godoc.org/github.com/antonmedv/expr?status.svg)](https://godoc.org/github.com/antonmedv/expr) + +expr logo + +**Expr** package provides an engine that can compile and evaluate expressions. +An expression is a one-liner that returns a value (mostly, but not limited to, booleans). +It is designed for simplicity, speed and safety. + +The purpose of the package is to allow users to use expressions inside configuration for more complex logic. +It is a perfect candidate for the foundation of a _business rule engine_. +The idea is to let configure things in a dynamic way without recompile of a program: + +```coffeescript +# Get the special price if +user.Group in ["good_customers", "collaborator"] + +# Promote article to the homepage when +len(article.Comments) > 100 and article.Category not in ["misc"] + +# Send an alert when +product.Stock < 15 +``` + +## Features + +* Seamless integration with Go (no need to redefine types) +* Static typing ([example](https://godoc.org/github.com/antonmedv/expr#example-Env)). + ```go + out, err := expr.Compile(`name + age`) + // err: invalid operation + (mismatched types string and int) + // | name + age + // | .....^ + ``` +* User-friendly error messages. +* Reasonable set of basic operators. +* Builtins `all`, `none`, `any`, `one`, `filter`, `map`. + ```coffeescript + all(Tweets, {.Size <= 280}) + ``` +* Fast ([benchmarks](https://github.com/antonmedv/golang-expression-evaluation-comparison#readme)): uses bytecode virtual machine and optimizing compiler. + +## Install + +``` +go get github.com/antonmedv/expr +``` + +## Documentation + +* See [Getting Started](docs/Getting-Started.md) page for developer documentation. +* See [Language Definition](docs/Language-Definition.md) page to learn the syntax. + +## Expr Code Editor + + + Expr Code Editor + + +Also, I have an embeddable code editor written in JavaScript which allows editing expressions with syntax highlighting and autocomplete based on your types declaration. + +[Learn more →](https://antonmedv.github.io/expr/) + +## Examples + +[Play Online](https://play.golang.org/p/z7T8ytJ1T1d) + +```go +package main + +import ( + "fmt" + "github.com/antonmedv/expr" +) + +func main() { + env := map[string]interface{}{ + "greet": "Hello, %v!", + "names": []string{"world", "you"}, + "sprintf": fmt.Sprintf, + } + + code := `sprintf(greet, names[0])` + + program, err := expr.Compile(code, expr.Env(env)) + if err != nil { + panic(err) + } + + output, err := expr.Run(program, env) + if err != nil { + panic(err) + } + + fmt.Println(output) +} +``` + +[Play Online](https://play.golang.org/p/4S4brsIvU4i) + +```go +package main + +import ( + "fmt" + "github.com/antonmedv/expr" +) + +type Tweet struct { + Len int +} + +type Env struct { + Tweets []Tweet +} + +func main() { + code := `all(Tweets, {.Len <= 240})` + + program, err := expr.Compile(code, expr.Env(Env{})) + if err != nil { + panic(err) + } + + env := Env{ + Tweets: []Tweet{{42}, {98}, {69}}, + } + output, err := expr.Run(program, env) + if err != nil { + panic(err) + } + + fmt.Println(output) +} +``` + +## Contributing + +**Expr** consist of a few packages for parsing source code to AST, type checking AST, compiling to bytecode and VM for running bytecode program. + +Also expr provides powerful tool [exe](cmd/exe) for debugging. It has interactive terminal debugger for our bytecode virtual machine. + +

+ debugger +

+ + +## Who is using Expr? + + + + + + +
+

Aviasales Logo

+

Aviasales are actively using Expr for different parts of the search engine.

+
+

Mystery Minds Logo

+

Mystery Minds uses Expr to allow easy yet powerful customization of its matching algorithm.

+
+ +[Add you company too](https://github.com/antonmedv/expr/edit/master/README.md) + +## License + +[MIT](LICENSE) diff --git a/vendor/github.com/antonmedv/expr/ast/node.go b/vendor/github.com/antonmedv/expr/ast/node.go new file mode 100644 index 00000000000..c4465e14a24 --- /dev/null +++ b/vendor/github.com/antonmedv/expr/ast/node.go @@ -0,0 +1,168 @@ +package ast + +import ( + "reflect" + "regexp" + + "github.com/antonmedv/expr/file" +) + +// Node represents items of abstract syntax tree. +type Node interface { + Location() file.Location + SetLocation(file.Location) + Type() reflect.Type + SetType(reflect.Type) +} + +func Patch(node *Node, newNode Node) { + newNode.SetType((*node).Type()) + newNode.SetLocation((*node).Location()) + *node = newNode +} + +type base struct { + loc file.Location + nodeType reflect.Type +} + +func (n *base) Location() file.Location { + return n.loc +} + +func (n *base) SetLocation(loc file.Location) { + n.loc = loc +} + +func (n *base) Type() reflect.Type { + return n.nodeType +} + +func (n *base) SetType(t reflect.Type) { + n.nodeType = t +} + +type NilNode struct { + base +} + +type IdentifierNode struct { + base + Value string +} + +type IntegerNode struct { + base + Value int +} + +type FloatNode struct { + base + Value float64 +} + +type BoolNode struct { + base + Value bool +} + +type StringNode struct { + base + Value string +} + +type ConstantNode struct { + base + Value interface{} +} + +type UnaryNode struct { + base + Operator string + Node Node +} + +type BinaryNode struct { + base + Operator string + Left Node + Right Node +} + +type MatchesNode struct { + base + Regexp *regexp.Regexp + Left Node + Right Node +} + +type PropertyNode struct { + base + Node Node + Property string +} + +type IndexNode struct { + base + Node Node + Index Node +} + +type SliceNode struct { + base + Node Node + From Node + To Node +} + +type MethodNode struct { + base + Node Node + Method string + Arguments []Node +} + +type FunctionNode struct { + base + Name string + Arguments []Node + Fast bool +} + +type BuiltinNode struct { + base + Name string + Arguments []Node +} + +type ClosureNode struct { + base + Node Node +} + +type PointerNode struct { + base +} + +type ConditionalNode struct { + base + Cond Node + Exp1 Node + Exp2 Node +} + +type ArrayNode struct { + base + Nodes []Node +} + +type MapNode struct { + base + Pairs []Node +} + +type PairNode struct { + base + Key Node + Value Node +} diff --git a/vendor/github.com/antonmedv/expr/ast/print.go b/vendor/github.com/antonmedv/expr/ast/print.go new file mode 100644 index 00000000000..285984bd9a6 --- /dev/null +++ b/vendor/github.com/antonmedv/expr/ast/print.go @@ -0,0 +1,59 @@ +package ast + +import ( + "fmt" + "reflect" + "regexp" +) + +func Dump(node Node) string { + return dump(reflect.ValueOf(node), "") +} + +func dump(v reflect.Value, ident string) string { + if !v.IsValid() { + return "nil" + } + t := v.Type() + switch t.Kind() { + case reflect.Struct: + out := t.Name() + "{\n" + for i := 0; i < t.NumField(); i++ { + f := t.Field(i) + if isPrivate(f.Name) { + continue + } + s := v.Field(i) + out += fmt.Sprintf("%v%v: %v,\n", ident+"\t", f.Name, dump(s, ident+"\t")) + } + return out + ident + "}" + case reflect.Slice: + if v.Len() == 0 { + return "[]" + } + out := "[\n" + for i := 0; i < v.Len(); i++ { + s := v.Index(i) + out += fmt.Sprintf("%v%v,", ident+"\t", dump(s, ident+"\t")) + if i+1 < v.Len() { + out += "\n" + } + } + return out + "\n" + ident + "]" + case reflect.Ptr: + return dump(v.Elem(), ident) + case reflect.Interface: + return dump(reflect.ValueOf(v.Interface()), ident) + + case reflect.String: + return fmt.Sprintf("%q", v) + default: + return fmt.Sprintf("%v", v) + } +} + +var isCapital = regexp.MustCompile("^[A-Z]") + +func isPrivate(s string) bool { + return !isCapital.Match([]byte(s)) +} diff --git a/vendor/github.com/antonmedv/expr/ast/visitor.go b/vendor/github.com/antonmedv/expr/ast/visitor.go new file mode 100644 index 00000000000..a3e270e030d --- /dev/null +++ b/vendor/github.com/antonmedv/expr/ast/visitor.go @@ -0,0 +1,108 @@ +package ast + +import "fmt" + +type Visitor interface { + Enter(node *Node) + Exit(node *Node) +} + +type walker struct { + visitor Visitor +} + +func Walk(node *Node, visitor Visitor) { + w := walker{ + visitor: visitor, + } + w.walk(node) +} + +func (w *walker) walk(node *Node) { + w.visitor.Enter(node) + + switch n := (*node).(type) { + case *NilNode: + w.visitor.Exit(node) + case *IdentifierNode: + w.visitor.Exit(node) + case *IntegerNode: + w.visitor.Exit(node) + case *FloatNode: + w.visitor.Exit(node) + case *BoolNode: + w.visitor.Exit(node) + case *StringNode: + w.visitor.Exit(node) + case *ConstantNode: + w.visitor.Exit(node) + case *UnaryNode: + w.walk(&n.Node) + w.visitor.Exit(node) + case *BinaryNode: + w.walk(&n.Left) + w.walk(&n.Right) + w.visitor.Exit(node) + case *MatchesNode: + w.walk(&n.Left) + w.walk(&n.Right) + w.visitor.Exit(node) + case *PropertyNode: + w.walk(&n.Node) + w.visitor.Exit(node) + case *IndexNode: + w.walk(&n.Node) + w.walk(&n.Index) + w.visitor.Exit(node) + case *SliceNode: + if n.From != nil { + w.walk(&n.From) + } + if n.To != nil { + w.walk(&n.To) + } + w.visitor.Exit(node) + case *MethodNode: + w.walk(&n.Node) + for i := range n.Arguments { + w.walk(&n.Arguments[i]) + } + w.visitor.Exit(node) + case *FunctionNode: + for i := range n.Arguments { + w.walk(&n.Arguments[i]) + } + w.visitor.Exit(node) + case *BuiltinNode: + for i := range n.Arguments { + w.walk(&n.Arguments[i]) + } + w.visitor.Exit(node) + case *ClosureNode: + w.walk(&n.Node) + w.visitor.Exit(node) + case *PointerNode: + w.visitor.Exit(node) + case *ConditionalNode: + w.walk(&n.Cond) + w.walk(&n.Exp1) + w.walk(&n.Exp2) + w.visitor.Exit(node) + case *ArrayNode: + for i := range n.Nodes { + w.walk(&n.Nodes[i]) + } + w.visitor.Exit(node) + case *MapNode: + for i := range n.Pairs { + w.walk(&n.Pairs[i]) + } + w.visitor.Exit(node) + case *PairNode: + w.walk(&n.Key) + w.walk(&n.Value) + w.visitor.Exit(node) + default: + panic(fmt.Sprintf("undefined node type (%T)", node)) + } +} diff --git a/vendor/github.com/antonmedv/expr/checker/checker.go b/vendor/github.com/antonmedv/expr/checker/checker.go new file mode 100644 index 00000000000..ec66daf440d --- /dev/null +++ b/vendor/github.com/antonmedv/expr/checker/checker.go @@ -0,0 +1,597 @@ +package checker + +import ( + "fmt" + "reflect" + + "github.com/antonmedv/expr/ast" + "github.com/antonmedv/expr/conf" + "github.com/antonmedv/expr/file" + "github.com/antonmedv/expr/parser" +) + +func Check(tree *parser.Tree, config *conf.Config) (reflect.Type, error) { + v := &visitor{ + collections: make([]reflect.Type, 0), + } + if config != nil { + v.types = config.Types + v.operators = config.Operators + v.expect = config.Expect + v.strict = config.Strict + v.defaultType = config.DefaultType + } + + t := v.visit(tree.Node) + + if v.expect != reflect.Invalid { + switch v.expect { + case reflect.Int64, reflect.Float64: + if !isNumber(t) { + return nil, fmt.Errorf("expected %v, but got %v", v.expect, t) + } + default: + if t.Kind() != v.expect { + return nil, fmt.Errorf("expected %v, but got %v", v.expect, t) + } + } + } + + if v.err != nil { + return t, v.err.Bind(tree.Source) + } + + return t, nil +} + +type visitor struct { + types conf.TypesTable + operators conf.OperatorsTable + expect reflect.Kind + collections []reflect.Type + strict bool + defaultType reflect.Type + err *file.Error +} + +func (v *visitor) visit(node ast.Node) reflect.Type { + var t reflect.Type + switch n := node.(type) { + case *ast.NilNode: + t = v.NilNode(n) + case *ast.IdentifierNode: + t = v.IdentifierNode(n) + case *ast.IntegerNode: + t = v.IntegerNode(n) + case *ast.FloatNode: + t = v.FloatNode(n) + case *ast.BoolNode: + t = v.BoolNode(n) + case *ast.StringNode: + t = v.StringNode(n) + case *ast.UnaryNode: + t = v.UnaryNode(n) + case *ast.BinaryNode: + t = v.BinaryNode(n) + case *ast.MatchesNode: + t = v.MatchesNode(n) + case *ast.PropertyNode: + t = v.PropertyNode(n) + case *ast.IndexNode: + t = v.IndexNode(n) + case *ast.SliceNode: + t = v.SliceNode(n) + case *ast.MethodNode: + t = v.MethodNode(n) + case *ast.FunctionNode: + t = v.FunctionNode(n) + case *ast.BuiltinNode: + t = v.BuiltinNode(n) + case *ast.ClosureNode: + t = v.ClosureNode(n) + case *ast.PointerNode: + t = v.PointerNode(n) + case *ast.ConditionalNode: + t = v.ConditionalNode(n) + case *ast.ArrayNode: + t = v.ArrayNode(n) + case *ast.MapNode: + t = v.MapNode(n) + case *ast.PairNode: + t = v.PairNode(n) + default: + panic(fmt.Sprintf("undefined node type (%T)", node)) + } + node.SetType(t) + return t +} + +func (v *visitor) error(node ast.Node, format string, args ...interface{}) reflect.Type { + if v.err == nil { // show first error + v.err = &file.Error{ + Location: node.Location(), + Message: fmt.Sprintf(format, args...), + } + } + return interfaceType // interface represent undefined type +} + +func (v *visitor) NilNode(*ast.NilNode) reflect.Type { + return nilType +} + +func (v *visitor) IdentifierNode(node *ast.IdentifierNode) reflect.Type { + if v.types == nil { + return interfaceType + } + if t, ok := v.types[node.Value]; ok { + if t.Ambiguous { + return v.error(node, "ambiguous identifier %v", node.Value) + } + return t.Type + } + if !v.strict { + if v.defaultType != nil { + return v.defaultType + } + return interfaceType + } + return v.error(node, "unknown name %v", node.Value) +} + +func (v *visitor) IntegerNode(*ast.IntegerNode) reflect.Type { + return integerType +} + +func (v *visitor) FloatNode(*ast.FloatNode) reflect.Type { + return floatType +} + +func (v *visitor) BoolNode(*ast.BoolNode) reflect.Type { + return boolType +} + +func (v *visitor) StringNode(*ast.StringNode) reflect.Type { + return stringType +} + +func (v *visitor) UnaryNode(node *ast.UnaryNode) reflect.Type { + t := v.visit(node.Node) + + switch node.Operator { + + case "!", "not": + if isBool(t) { + return boolType + } + + case "+", "-": + if isNumber(t) { + return t + } + + default: + return v.error(node, "unknown operator (%v)", node.Operator) + } + + return v.error(node, `invalid operation: %v (mismatched type %v)`, node.Operator, t) +} + +func (v *visitor) BinaryNode(node *ast.BinaryNode) reflect.Type { + l := v.visit(node.Left) + r := v.visit(node.Right) + + // check operator overloading + if fns, ok := v.operators[node.Operator]; ok { + t, _, ok := conf.FindSuitableOperatorOverload(fns, v.types, l, r) + if ok { + return t + } + } + + switch node.Operator { + case "==", "!=": + if isNumber(l) && isNumber(r) { + return boolType + } + if isComparable(l, r) { + return boolType + } + + case "or", "||", "and", "&&": + if isBool(l) && isBool(r) { + return boolType + } + + case "in", "not in": + if isString(l) && isStruct(r) { + return boolType + } + if isMap(r) { + return boolType + } + if isArray(r) { + return boolType + } + + case "<", ">", ">=", "<=": + if isNumber(l) && isNumber(r) { + return boolType + } + if isString(l) && isString(r) { + return boolType + } + + case "/", "-", "*": + if isNumber(l) && isNumber(r) { + return combined(l, r) + } + + case "**": + if isNumber(l) && isNumber(r) { + return floatType + } + + case "%": + if isInteger(l) && isInteger(r) { + return combined(l, r) + } + + case "+": + if isNumber(l) && isNumber(r) { + return combined(l, r) + } + if isString(l) && isString(r) { + return stringType + } + + case "contains", "startsWith", "endsWith": + if isString(l) && isString(r) { + return boolType + } + + case "..": + if isInteger(l) && isInteger(r) { + return reflect.SliceOf(integerType) + } + + default: + return v.error(node, "unknown operator (%v)", node.Operator) + + } + + return v.error(node, `invalid operation: %v (mismatched types %v and %v)`, node.Operator, l, r) +} + +func (v *visitor) MatchesNode(node *ast.MatchesNode) reflect.Type { + l := v.visit(node.Left) + r := v.visit(node.Right) + + if isString(l) && isString(r) { + return boolType + } + + return v.error(node, `invalid operation: matches (mismatched types %v and %v)`, l, r) +} + +func (v *visitor) PropertyNode(node *ast.PropertyNode) reflect.Type { + t := v.visit(node.Node) + + if t, ok := fieldType(t, node.Property); ok { + return t + } + + return v.error(node, "type %v has no field %v", t, node.Property) +} + +func (v *visitor) IndexNode(node *ast.IndexNode) reflect.Type { + t := v.visit(node.Node) + i := v.visit(node.Index) + + if t, ok := indexType(t); ok { + if !isInteger(i) && !isString(i) { + return v.error(node, "invalid operation: cannot use %v as index to %v", i, t) + } + return t + } + + return v.error(node, "invalid operation: type %v does not support indexing", t) +} + +func (v *visitor) SliceNode(node *ast.SliceNode) reflect.Type { + t := v.visit(node.Node) + + _, isIndex := indexType(t) + + if isIndex || isString(t) { + if node.From != nil { + from := v.visit(node.From) + if !isInteger(from) { + return v.error(node.From, "invalid operation: non-integer slice index %v", from) + } + } + if node.To != nil { + to := v.visit(node.To) + if !isInteger(to) { + return v.error(node.To, "invalid operation: non-integer slice index %v", to) + } + } + return t + } + + return v.error(node, "invalid operation: cannot slice %v", t) +} + +func (v *visitor) FunctionNode(node *ast.FunctionNode) reflect.Type { + if f, ok := v.types[node.Name]; ok { + if fn, ok := isFuncType(f.Type); ok { + + inputParamsCount := 1 // for functions + if f.Method { + inputParamsCount = 2 // for methods + } + + if !isInterface(fn) && + fn.IsVariadic() && + fn.NumIn() == inputParamsCount && + fn.NumOut() == 1 && + fn.Out(0).Kind() == reflect.Interface { + rest := fn.In(fn.NumIn() - 1) // function has only one param for functions and two for methods + if rest.Kind() == reflect.Slice && rest.Elem().Kind() == reflect.Interface { + node.Fast = true + } + } + + return v.checkFunc(fn, f.Method, node, node.Name, node.Arguments) + } + } + if !v.strict { + if v.defaultType != nil { + return v.defaultType + } + return interfaceType + } + return v.error(node, "unknown func %v", node.Name) +} + +func (v *visitor) MethodNode(node *ast.MethodNode) reflect.Type { + t := v.visit(node.Node) + if f, method, ok := methodType(t, node.Method); ok { + if fn, ok := isFuncType(f); ok { + return v.checkFunc(fn, method, node, node.Method, node.Arguments) + } + } + return v.error(node, "type %v has no method %v", t, node.Method) +} + +// checkFunc checks func arguments and returns "return type" of func or method. +func (v *visitor) checkFunc(fn reflect.Type, method bool, node ast.Node, name string, arguments []ast.Node) reflect.Type { + if isInterface(fn) { + return interfaceType + } + + if fn.NumOut() == 0 { + return v.error(node, "func %v doesn't return value", name) + } + if fn.NumOut() != 1 { + return v.error(node, "func %v returns more then one value", name) + } + + numIn := fn.NumIn() + + // If func is method on an env, first argument should be a receiver, + // and actual arguments less then numIn by one. + if method { + numIn-- + } + + if fn.IsVariadic() { + if len(arguments) < numIn-1 { + return v.error(node, "not enough arguments to call %v", name) + } + } else { + if len(arguments) > numIn { + return v.error(node, "too many arguments to call %v", name) + } + if len(arguments) < numIn { + return v.error(node, "not enough arguments to call %v", name) + } + } + + offset := 0 + + // Skip first argument in case of the receiver. + if method { + offset = 1 + } + + for i, arg := range arguments { + t := v.visit(arg) + + var in reflect.Type + if fn.IsVariadic() && i >= numIn-1 { + // For variadic arguments fn(xs ...int), go replaces type of xs (int) with ([]int). + // As we compare arguments one by one, we need underling type. + in = fn.In(fn.NumIn() - 1) + in, _ = indexType(in) + } else { + in = fn.In(i + offset) + } + + if isIntegerOrArithmeticOperation(arg) { + t = in + setTypeForIntegers(arg, t) + } + + if t == nil { + continue + } + + if !t.AssignableTo(in) && t.Kind() != reflect.Interface { + return v.error(arg, "cannot use %v as argument (type %v) to call %v ", t, in, name) + } + } + + return fn.Out(0) +} + +func (v *visitor) BuiltinNode(node *ast.BuiltinNode) reflect.Type { + switch node.Name { + + case "len": + param := v.visit(node.Arguments[0]) + if isArray(param) || isMap(param) || isString(param) { + return integerType + } + return v.error(node, "invalid argument for len (type %v)", param) + + case "all", "none", "any", "one": + collection := v.visit(node.Arguments[0]) + if !isArray(collection) { + return v.error(node.Arguments[0], "builtin %v takes only array (got %v)", node.Name, collection) + } + + v.collections = append(v.collections, collection) + closure := v.visit(node.Arguments[1]) + v.collections = v.collections[:len(v.collections)-1] + + if isFunc(closure) && + closure.NumOut() == 1 && + closure.NumIn() == 1 && isInterface(closure.In(0)) { + + if !isBool(closure.Out(0)) { + return v.error(node.Arguments[1], "closure should return boolean (got %v)", closure.Out(0).String()) + } + return boolType + } + return v.error(node.Arguments[1], "closure should has one input and one output param") + + case "filter": + collection := v.visit(node.Arguments[0]) + if !isArray(collection) { + return v.error(node.Arguments[0], "builtin %v takes only array (got %v)", node.Name, collection) + } + + v.collections = append(v.collections, collection) + closure := v.visit(node.Arguments[1]) + v.collections = v.collections[:len(v.collections)-1] + + if isFunc(closure) && + closure.NumOut() == 1 && + closure.NumIn() == 1 && isInterface(closure.In(0)) { + + if !isBool(closure.Out(0)) { + return v.error(node.Arguments[1], "closure should return boolean (got %v)", closure.Out(0).String()) + } + if isInterface(collection) { + return arrayType + } + return reflect.SliceOf(collection.Elem()) + } + return v.error(node.Arguments[1], "closure should has one input and one output param") + + case "map": + collection := v.visit(node.Arguments[0]) + if !isArray(collection) { + return v.error(node.Arguments[0], "builtin %v takes only array (got %v)", node.Name, collection) + } + + v.collections = append(v.collections, collection) + closure := v.visit(node.Arguments[1]) + v.collections = v.collections[:len(v.collections)-1] + + if isFunc(closure) && + closure.NumOut() == 1 && + closure.NumIn() == 1 && isInterface(closure.In(0)) { + + return reflect.SliceOf(closure.Out(0)) + } + return v.error(node.Arguments[1], "closure should has one input and one output param") + + case "count": + collection := v.visit(node.Arguments[0]) + if !isArray(collection) { + return v.error(node.Arguments[0], "builtin %v takes only array (got %v)", node.Name, collection) + } + + v.collections = append(v.collections, collection) + closure := v.visit(node.Arguments[1]) + v.collections = v.collections[:len(v.collections)-1] + + if isFunc(closure) && + closure.NumOut() == 1 && + closure.NumIn() == 1 && isInterface(closure.In(0)) { + if !isBool(closure.Out(0)) { + return v.error(node.Arguments[1], "closure should return boolean (got %v)", closure.Out(0).String()) + } + + return integerType + } + return v.error(node.Arguments[1], "closure should has one input and one output param") + + default: + return v.error(node, "unknown builtin %v", node.Name) + } +} + +func (v *visitor) ClosureNode(node *ast.ClosureNode) reflect.Type { + t := v.visit(node.Node) + return reflect.FuncOf([]reflect.Type{interfaceType}, []reflect.Type{t}, false) +} + +func (v *visitor) PointerNode(node *ast.PointerNode) reflect.Type { + if len(v.collections) == 0 { + return v.error(node, "cannot use pointer accessor outside closure") + } + + collection := v.collections[len(v.collections)-1] + + if t, ok := indexType(collection); ok { + return t + } + return v.error(node, "cannot use %v as array", collection) +} + +func (v *visitor) ConditionalNode(node *ast.ConditionalNode) reflect.Type { + c := v.visit(node.Cond) + if !isBool(c) { + return v.error(node.Cond, "non-bool expression (type %v) used as condition", c) + } + + t1 := v.visit(node.Exp1) + t2 := v.visit(node.Exp2) + + if t1 == nil && t2 != nil { + return t2 + } + if t1 != nil && t2 == nil { + return t1 + } + if t1 == nil && t2 == nil { + return nilType + } + if t1.AssignableTo(t2) { + return t1 + } + return interfaceType +} + +func (v *visitor) ArrayNode(node *ast.ArrayNode) reflect.Type { + for _, node := range node.Nodes { + _ = v.visit(node) + } + return arrayType +} + +func (v *visitor) MapNode(node *ast.MapNode) reflect.Type { + for _, pair := range node.Pairs { + v.visit(pair) + } + return mapType +} + +func (v *visitor) PairNode(node *ast.PairNode) reflect.Type { + v.visit(node.Key) + v.visit(node.Value) + return nilType +} diff --git a/vendor/github.com/antonmedv/expr/checker/types.go b/vendor/github.com/antonmedv/expr/checker/types.go new file mode 100644 index 00000000000..756ed8f5dbb --- /dev/null +++ b/vendor/github.com/antonmedv/expr/checker/types.go @@ -0,0 +1,349 @@ +package checker + +import ( + "reflect" + + "github.com/antonmedv/expr/ast" +) + +var ( + nilType = reflect.TypeOf(nil) + boolType = reflect.TypeOf(true) + integerType = reflect.TypeOf(int(0)) + floatType = reflect.TypeOf(float64(0)) + stringType = reflect.TypeOf("") + arrayType = reflect.TypeOf([]interface{}{}) + mapType = reflect.TypeOf(map[string]interface{}{}) + interfaceType = reflect.TypeOf(new(interface{})).Elem() +) + +func typeWeight(t reflect.Type) int { + switch t.Kind() { + case reflect.Uint: + return 1 + case reflect.Uint8: + return 2 + case reflect.Uint16: + return 3 + case reflect.Uint32: + return 4 + case reflect.Uint64: + return 5 + case reflect.Int: + return 6 + case reflect.Int8: + return 7 + case reflect.Int16: + return 8 + case reflect.Int32: + return 9 + case reflect.Int64: + return 10 + case reflect.Float32: + return 11 + case reflect.Float64: + return 12 + default: + return 0 + } +} + +func combined(a, b reflect.Type) reflect.Type { + if typeWeight(a) > typeWeight(b) { + return a + } else { + return b + } +} + +func dereference(t reflect.Type) reflect.Type { + if t == nil { + return nil + } + if t.Kind() == reflect.Ptr { + t = dereference(t.Elem()) + } + return t +} + +func isComparable(l, r reflect.Type) bool { + l = dereference(l) + r = dereference(r) + + if l == nil || r == nil { // It is possible to compare with nil. + return true + } + if l.Kind() == r.Kind() { + return true + } + if isInterface(l) || isInterface(r) { + return true + } + return false +} + +func isInterface(t reflect.Type) bool { + t = dereference(t) + if t != nil { + switch t.Kind() { + case reflect.Interface: + return true + } + } + return false +} + +func isInteger(t reflect.Type) bool { + t = dereference(t) + if t != nil { + switch t.Kind() { + case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: + fallthrough + case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64: + return true + case reflect.Interface: + return true + } + } + return false +} + +func isFloat(t reflect.Type) bool { + t = dereference(t) + if t != nil { + switch t.Kind() { + case reflect.Float32, reflect.Float64: + return true + case reflect.Interface: + return true + } + } + return false +} + +func isNumber(t reflect.Type) bool { + return isInteger(t) || isFloat(t) +} + +func isBool(t reflect.Type) bool { + t = dereference(t) + if t != nil { + switch t.Kind() { + case reflect.Bool: + return true + case reflect.Interface: + return true + } + } + return false +} + +func isString(t reflect.Type) bool { + t = dereference(t) + if t != nil { + switch t.Kind() { + case reflect.String: + return true + case reflect.Interface: + return true + } + } + return false +} + +func isArray(t reflect.Type) bool { + t = dereference(t) + if t != nil { + switch t.Kind() { + case reflect.Slice, reflect.Array: + return true + case reflect.Interface: + return true + } + } + return false +} + +func isMap(t reflect.Type) bool { + t = dereference(t) + if t != nil { + switch t.Kind() { + case reflect.Map: + return true + case reflect.Interface: + return true + } + } + return false +} + +func isStruct(t reflect.Type) bool { + t = dereference(t) + if t != nil { + switch t.Kind() { + case reflect.Struct: + return true + } + } + return false +} + +func isFunc(t reflect.Type) bool { + t = dereference(t) + if t != nil { + switch t.Kind() { + case reflect.Func: + return true + } + } + return false +} + +func fieldType(ntype reflect.Type, name string) (reflect.Type, bool) { + ntype = dereference(ntype) + if ntype != nil { + switch ntype.Kind() { + case reflect.Interface: + return interfaceType, true + case reflect.Struct: + // First check all struct's fields. + for i := 0; i < ntype.NumField(); i++ { + f := ntype.Field(i) + if f.Name == name { + return f.Type, true + } + } + + // Second check fields of embedded structs. + for i := 0; i < ntype.NumField(); i++ { + f := ntype.Field(i) + if f.Anonymous { + if t, ok := fieldType(f.Type, name); ok { + return t, true + } + } + } + case reflect.Map: + return ntype.Elem(), true + } + } + + return nil, false +} + +func methodType(t reflect.Type, name string) (reflect.Type, bool, bool) { + if t != nil { + // First, check methods defined on type itself, + // independent of which type it is. + if m, ok := t.MethodByName(name); ok { + if t.Kind() == reflect.Interface { + // In case of interface type method will not have a receiver, + // and to prevent checker decreasing numbers of in arguments + // return method type as not method (second argument is false). + return m.Type, false, true + } else { + return m.Type, true, true + } + } + + d := t + if t.Kind() == reflect.Ptr { + d = t.Elem() + } + + switch d.Kind() { + case reflect.Interface: + return interfaceType, false, true + case reflect.Struct: + // First, check all struct's fields. + for i := 0; i < d.NumField(); i++ { + f := d.Field(i) + if !f.Anonymous && f.Name == name { + return f.Type, false, true + } + } + + // Second, check fields of embedded structs. + for i := 0; i < d.NumField(); i++ { + f := d.Field(i) + if f.Anonymous { + if t, method, ok := methodType(f.Type, name); ok { + return t, method, true + } + } + } + + case reflect.Map: + return d.Elem(), false, true + } + } + return nil, false, false +} + +func indexType(ntype reflect.Type) (reflect.Type, bool) { + ntype = dereference(ntype) + if ntype == nil { + return nil, false + } + + switch ntype.Kind() { + case reflect.Interface: + return interfaceType, true + case reflect.Map, reflect.Array, reflect.Slice: + return ntype.Elem(), true + } + + return nil, false +} + +func isFuncType(ntype reflect.Type) (reflect.Type, bool) { + ntype = dereference(ntype) + if ntype == nil { + return nil, false + } + + switch ntype.Kind() { + case reflect.Interface: + return interfaceType, true + case reflect.Func: + return ntype, true + } + + return nil, false +} + +func isIntegerOrArithmeticOperation(node ast.Node) bool { + switch n := node.(type) { + case *ast.IntegerNode: + return true + case *ast.UnaryNode: + switch n.Operator { + case "+", "-": + return true + } + case *ast.BinaryNode: + switch n.Operator { + case "+", "/", "-", "*": + return true + } + } + return false +} + +func setTypeForIntegers(node ast.Node, t reflect.Type) { + switch n := node.(type) { + case *ast.IntegerNode: + n.SetType(t) + case *ast.UnaryNode: + switch n.Operator { + case "+", "-": + setTypeForIntegers(n.Node, t) + } + case *ast.BinaryNode: + switch n.Operator { + case "+", "/", "-", "*": + setTypeForIntegers(n.Left, t) + setTypeForIntegers(n.Right, t) + } + } +} diff --git a/vendor/github.com/antonmedv/expr/compiler/compiler.go b/vendor/github.com/antonmedv/expr/compiler/compiler.go new file mode 100644 index 00000000000..33824bdfbba --- /dev/null +++ b/vendor/github.com/antonmedv/expr/compiler/compiler.go @@ -0,0 +1,663 @@ +package compiler + +import ( + "encoding/binary" + "fmt" + "math" + "reflect" + + "github.com/antonmedv/expr/ast" + "github.com/antonmedv/expr/conf" + "github.com/antonmedv/expr/file" + "github.com/antonmedv/expr/parser" + . "github.com/antonmedv/expr/vm" +) + +func Compile(tree *parser.Tree, config *conf.Config) (program *Program, err error) { + defer func() { + if r := recover(); r != nil { + err = fmt.Errorf("%v", r) + } + }() + + c := &compiler{ + index: make(map[interface{}]uint16), + locations: make(map[int]file.Location), + } + + if config != nil { + c.mapEnv = config.MapEnv + c.cast = config.Expect + } + + c.compile(tree.Node) + + switch c.cast { + case reflect.Int64: + c.emit(OpCast, encode(0)...) + case reflect.Float64: + c.emit(OpCast, encode(1)...) + } + + program = &Program{ + Source: tree.Source, + Locations: c.locations, + Constants: c.constants, + Bytecode: c.bytecode, + } + return +} + +type compiler struct { + locations map[int]file.Location + constants []interface{} + bytecode []byte + index map[interface{}]uint16 + mapEnv bool + cast reflect.Kind + nodes []ast.Node +} + +func (c *compiler) emit(op byte, b ...byte) int { + c.bytecode = append(c.bytecode, op) + current := len(c.bytecode) + c.bytecode = append(c.bytecode, b...) + + var loc file.Location + if len(c.nodes) > 0 { + loc = c.nodes[len(c.nodes)-1].Location() + } + c.locations[current-1] = loc + + return current +} + +func (c *compiler) emitPush(value interface{}) int { + return c.emit(OpPush, c.makeConstant(value)...) +} + +func (c *compiler) makeConstant(i interface{}) []byte { + hashable := true + switch reflect.TypeOf(i).Kind() { + case reflect.Slice, reflect.Map: + hashable = false + } + + if hashable { + if p, ok := c.index[i]; ok { + return encode(p) + } + } + + c.constants = append(c.constants, i) + if len(c.constants) > math.MaxUint16 { + panic("exceeded constants max space limit") + } + + p := uint16(len(c.constants) - 1) + if hashable { + c.index[i] = p + } + return encode(p) +} + +func (c *compiler) placeholder() []byte { + return []byte{0xFF, 0xFF} +} + +func (c *compiler) patchJump(placeholder int) { + offset := len(c.bytecode) - 2 - placeholder + b := encode(uint16(offset)) + c.bytecode[placeholder] = b[0] + c.bytecode[placeholder+1] = b[1] +} + +func (c *compiler) calcBackwardJump(to int) []byte { + return encode(uint16(len(c.bytecode) + 1 + 2 - to)) +} + +func (c *compiler) compile(node ast.Node) { + c.nodes = append(c.nodes, node) + defer func() { + c.nodes = c.nodes[:len(c.nodes)-1] + }() + + switch n := node.(type) { + case *ast.NilNode: + c.NilNode(n) + case *ast.IdentifierNode: + c.IdentifierNode(n) + case *ast.IntegerNode: + c.IntegerNode(n) + case *ast.FloatNode: + c.FloatNode(n) + case *ast.BoolNode: + c.BoolNode(n) + case *ast.StringNode: + c.StringNode(n) + case *ast.ConstantNode: + c.ConstantNode(n) + case *ast.UnaryNode: + c.UnaryNode(n) + case *ast.BinaryNode: + c.BinaryNode(n) + case *ast.MatchesNode: + c.MatchesNode(n) + case *ast.PropertyNode: + c.PropertyNode(n) + case *ast.IndexNode: + c.IndexNode(n) + case *ast.SliceNode: + c.SliceNode(n) + case *ast.MethodNode: + c.MethodNode(n) + case *ast.FunctionNode: + c.FunctionNode(n) + case *ast.BuiltinNode: + c.BuiltinNode(n) + case *ast.ClosureNode: + c.ClosureNode(n) + case *ast.PointerNode: + c.PointerNode(n) + case *ast.ConditionalNode: + c.ConditionalNode(n) + case *ast.ArrayNode: + c.ArrayNode(n) + case *ast.MapNode: + c.MapNode(n) + case *ast.PairNode: + c.PairNode(n) + default: + panic(fmt.Sprintf("undefined node type (%T)", node)) + } +} + +func (c *compiler) NilNode(node *ast.NilNode) { + c.emit(OpNil) +} + +func (c *compiler) IdentifierNode(node *ast.IdentifierNode) { + v := c.makeConstant(node.Value) + if c.mapEnv { + c.emit(OpFetchMap, v...) + } else { + c.emit(OpFetch, v...) + } +} + +func (c *compiler) IntegerNode(node *ast.IntegerNode) { + t := node.Type() + if t == nil { + c.emitPush(node.Value) + return + } + + switch t.Kind() { + case reflect.Float32: + c.emitPush(float32(node.Value)) + case reflect.Float64: + c.emitPush(float64(node.Value)) + + case reflect.Int: + c.emitPush(int(node.Value)) + case reflect.Int8: + c.emitPush(int8(node.Value)) + case reflect.Int16: + c.emitPush(int16(node.Value)) + case reflect.Int32: + c.emitPush(int32(node.Value)) + case reflect.Int64: + c.emitPush(int64(node.Value)) + + case reflect.Uint: + c.emitPush(uint(node.Value)) + case reflect.Uint8: + c.emitPush(uint8(node.Value)) + case reflect.Uint16: + c.emitPush(uint16(node.Value)) + case reflect.Uint32: + c.emitPush(uint32(node.Value)) + case reflect.Uint64: + c.emitPush(uint64(node.Value)) + + default: + c.emitPush(node.Value) + } +} + +func (c *compiler) FloatNode(node *ast.FloatNode) { + c.emitPush(node.Value) +} + +func (c *compiler) BoolNode(node *ast.BoolNode) { + if node.Value { + c.emit(OpTrue) + } else { + c.emit(OpFalse) + } +} + +func (c *compiler) StringNode(node *ast.StringNode) { + c.emitPush(node.Value) +} + +func (c *compiler) ConstantNode(node *ast.ConstantNode) { + c.emitPush(node.Value) +} + +func (c *compiler) UnaryNode(node *ast.UnaryNode) { + c.compile(node.Node) + + switch node.Operator { + + case "!", "not": + c.emit(OpNot) + + case "+": + // Do nothing + + case "-": + c.emit(OpNegate) + + default: + panic(fmt.Sprintf("unknown operator (%v)", node.Operator)) + } +} + +func (c *compiler) BinaryNode(node *ast.BinaryNode) { + l := kind(node.Left) + r := kind(node.Right) + + switch node.Operator { + case "==": + c.compile(node.Left) + c.compile(node.Right) + + if l == r && l == reflect.Int { + c.emit(OpEqualInt) + } else if l == r && l == reflect.String { + c.emit(OpEqualString) + } else { + c.emit(OpEqual) + } + + case "!=": + c.compile(node.Left) + c.compile(node.Right) + c.emit(OpEqual) + c.emit(OpNot) + + case "or", "||": + c.compile(node.Left) + end := c.emit(OpJumpIfTrue, c.placeholder()...) + c.emit(OpPop) + c.compile(node.Right) + c.patchJump(end) + + case "and", "&&": + c.compile(node.Left) + end := c.emit(OpJumpIfFalse, c.placeholder()...) + c.emit(OpPop) + c.compile(node.Right) + c.patchJump(end) + + case "in": + c.compile(node.Left) + c.compile(node.Right) + c.emit(OpIn) + + case "not in": + c.compile(node.Left) + c.compile(node.Right) + c.emit(OpIn) + c.emit(OpNot) + + case "<": + c.compile(node.Left) + c.compile(node.Right) + c.emit(OpLess) + + case ">": + c.compile(node.Left) + c.compile(node.Right) + c.emit(OpMore) + + case "<=": + c.compile(node.Left) + c.compile(node.Right) + c.emit(OpLessOrEqual) + + case ">=": + c.compile(node.Left) + c.compile(node.Right) + c.emit(OpMoreOrEqual) + + case "+": + c.compile(node.Left) + c.compile(node.Right) + c.emit(OpAdd) + + case "-": + c.compile(node.Left) + c.compile(node.Right) + c.emit(OpSubtract) + + case "*": + c.compile(node.Left) + c.compile(node.Right) + c.emit(OpMultiply) + + case "/": + c.compile(node.Left) + c.compile(node.Right) + c.emit(OpDivide) + + case "%": + c.compile(node.Left) + c.compile(node.Right) + c.emit(OpModulo) + + case "**": + c.compile(node.Left) + c.compile(node.Right) + c.emit(OpExponent) + + case "contains": + c.compile(node.Left) + c.compile(node.Right) + c.emit(OpContains) + + case "startsWith": + c.compile(node.Left) + c.compile(node.Right) + c.emit(OpStartsWith) + + case "endsWith": + c.compile(node.Left) + c.compile(node.Right) + c.emit(OpEndsWith) + + case "..": + c.compile(node.Left) + c.compile(node.Right) + c.emit(OpRange) + + default: + panic(fmt.Sprintf("unknown operator (%v)", node.Operator)) + + } +} + +func (c *compiler) MatchesNode(node *ast.MatchesNode) { + if node.Regexp != nil { + c.compile(node.Left) + c.emit(OpMatchesConst, c.makeConstant(node.Regexp)...) + return + } + c.compile(node.Left) + c.compile(node.Right) + c.emit(OpMatches) +} + +func (c *compiler) PropertyNode(node *ast.PropertyNode) { + c.compile(node.Node) + c.emit(OpProperty, c.makeConstant(node.Property)...) +} + +func (c *compiler) IndexNode(node *ast.IndexNode) { + c.compile(node.Node) + c.compile(node.Index) + c.emit(OpIndex) +} + +func (c *compiler) SliceNode(node *ast.SliceNode) { + c.compile(node.Node) + if node.To != nil { + c.compile(node.To) + } else { + c.emit(OpLen) + } + if node.From != nil { + c.compile(node.From) + } else { + c.emitPush(0) + } + c.emit(OpSlice) +} + +func (c *compiler) MethodNode(node *ast.MethodNode) { + c.compile(node.Node) + for _, arg := range node.Arguments { + c.compile(arg) + } + c.emit(OpMethod, c.makeConstant(Call{Name: node.Method, Size: len(node.Arguments)})...) +} + +func (c *compiler) FunctionNode(node *ast.FunctionNode) { + for _, arg := range node.Arguments { + c.compile(arg) + } + op := OpCall + if node.Fast { + op = OpCallFast + } + c.emit(op, c.makeConstant(Call{Name: node.Name, Size: len(node.Arguments)})...) +} + +func (c *compiler) BuiltinNode(node *ast.BuiltinNode) { + switch node.Name { + case "len": + c.compile(node.Arguments[0]) + c.emit(OpLen) + c.emit(OpRot) + c.emit(OpPop) + + case "all": + c.compile(node.Arguments[0]) + c.emit(OpBegin) + var loopBreak int + c.emitLoop(func() { + c.compile(node.Arguments[1]) + loopBreak = c.emit(OpJumpIfFalse, c.placeholder()...) + c.emit(OpPop) + }) + c.emit(OpTrue) + c.patchJump(loopBreak) + c.emit(OpEnd) + + case "none": + c.compile(node.Arguments[0]) + c.emit(OpBegin) + var loopBreak int + c.emitLoop(func() { + c.compile(node.Arguments[1]) + c.emit(OpNot) + loopBreak = c.emit(OpJumpIfFalse, c.placeholder()...) + c.emit(OpPop) + }) + c.emit(OpTrue) + c.patchJump(loopBreak) + c.emit(OpEnd) + + case "any": + c.compile(node.Arguments[0]) + c.emit(OpBegin) + var loopBreak int + c.emitLoop(func() { + c.compile(node.Arguments[1]) + loopBreak = c.emit(OpJumpIfTrue, c.placeholder()...) + c.emit(OpPop) + }) + c.emit(OpFalse) + c.patchJump(loopBreak) + c.emit(OpEnd) + + case "one": + count := c.makeConstant("count") + c.compile(node.Arguments[0]) + c.emit(OpBegin) + c.emitPush(0) + c.emit(OpStore, count...) + c.emitLoop(func() { + c.compile(node.Arguments[1]) + c.emitCond(func() { + c.emit(OpInc, count...) + }) + }) + c.emit(OpLoad, count...) + c.emitPush(1) + c.emit(OpEqual) + c.emit(OpEnd) + + case "filter": + count := c.makeConstant("count") + c.compile(node.Arguments[0]) + c.emit(OpBegin) + c.emitPush(0) + c.emit(OpStore, count...) + c.emitLoop(func() { + c.compile(node.Arguments[1]) + c.emitCond(func() { + c.emit(OpInc, count...) + + c.emit(OpLoad, c.makeConstant("array")...) + c.emit(OpLoad, c.makeConstant("i")...) + c.emit(OpIndex) + }) + }) + c.emit(OpLoad, count...) + c.emit(OpEnd) + c.emit(OpArray) + + case "map": + c.compile(node.Arguments[0]) + c.emit(OpBegin) + size := c.emitLoop(func() { + c.compile(node.Arguments[1]) + }) + c.emit(OpLoad, size...) + c.emit(OpEnd) + c.emit(OpArray) + + case "count": + count := c.makeConstant("count") + c.compile(node.Arguments[0]) + c.emit(OpBegin) + c.emitPush(0) + c.emit(OpStore, count...) + c.emitLoop(func() { + c.compile(node.Arguments[1]) + c.emitCond(func() { + c.emit(OpInc, count...) + }) + }) + c.emit(OpLoad, count...) + c.emit(OpEnd) + + default: + panic(fmt.Sprintf("unknown builtin %v", node.Name)) + } +} + +func (c *compiler) emitCond(body func()) { + noop := c.emit(OpJumpIfFalse, c.placeholder()...) + c.emit(OpPop) + + body() + + jmp := c.emit(OpJump, c.placeholder()...) + c.patchJump(noop) + c.emit(OpPop) + c.patchJump(jmp) +} + +func (c *compiler) emitLoop(body func()) []byte { + i := c.makeConstant("i") + size := c.makeConstant("size") + array := c.makeConstant("array") + + c.emit(OpLen) + c.emit(OpStore, size...) + c.emit(OpStore, array...) + c.emitPush(0) + c.emit(OpStore, i...) + + cond := len(c.bytecode) + c.emit(OpLoad, i...) + c.emit(OpLoad, size...) + c.emit(OpLess) + end := c.emit(OpJumpIfFalse, c.placeholder()...) + c.emit(OpPop) + + body() + + c.emit(OpInc, i...) + c.emit(OpJumpBackward, c.calcBackwardJump(cond)...) + + c.patchJump(end) + c.emit(OpPop) + + return size +} + +func (c *compiler) ClosureNode(node *ast.ClosureNode) { + c.compile(node.Node) +} + +func (c *compiler) PointerNode(node *ast.PointerNode) { + c.emit(OpLoad, c.makeConstant("array")...) + c.emit(OpLoad, c.makeConstant("i")...) + c.emit(OpIndex) +} + +func (c *compiler) ConditionalNode(node *ast.ConditionalNode) { + c.compile(node.Cond) + otherwise := c.emit(OpJumpIfFalse, c.placeholder()...) + + c.emit(OpPop) + c.compile(node.Exp1) + end := c.emit(OpJump, c.placeholder()...) + + c.patchJump(otherwise) + c.emit(OpPop) + c.compile(node.Exp2) + + c.patchJump(end) +} + +func (c *compiler) ArrayNode(node *ast.ArrayNode) { + for _, node := range node.Nodes { + c.compile(node) + } + + c.emitPush(len(node.Nodes)) + c.emit(OpArray) +} + +func (c *compiler) MapNode(node *ast.MapNode) { + for _, pair := range node.Pairs { + c.compile(pair) + } + + c.emitPush(len(node.Pairs)) + c.emit(OpMap) +} + +func (c *compiler) PairNode(node *ast.PairNode) { + c.compile(node.Key) + c.compile(node.Value) +} + +func encode(i uint16) []byte { + b := make([]byte, 2) + binary.LittleEndian.PutUint16(b, i) + return b +} + +func kind(node ast.Node) reflect.Kind { + t := node.Type() + if t == nil { + return reflect.Invalid + } + return t.Kind() +} diff --git a/vendor/github.com/antonmedv/expr/compiler/patcher.go b/vendor/github.com/antonmedv/expr/compiler/patcher.go new file mode 100644 index 00000000000..2491dec9d4f --- /dev/null +++ b/vendor/github.com/antonmedv/expr/compiler/patcher.go @@ -0,0 +1,44 @@ +package compiler + +import ( + "github.com/antonmedv/expr/ast" + "github.com/antonmedv/expr/conf" +) + +type operatorPatcher struct { + ops map[string][]string + types conf.TypesTable +} + +func (p *operatorPatcher) Enter(node *ast.Node) {} +func (p *operatorPatcher) Exit(node *ast.Node) { + binaryNode, ok := (*node).(*ast.BinaryNode) + if !ok { + return + } + + fns, ok := p.ops[binaryNode.Operator] + if !ok { + return + } + + leftType := binaryNode.Left.Type() + rightType := binaryNode.Right.Type() + + _, fn, ok := conf.FindSuitableOperatorOverload(fns, p.types, leftType, rightType) + if ok { + newNode := &ast.FunctionNode{ + Name: fn, + Arguments: []ast.Node{binaryNode.Left, binaryNode.Right}, + } + ast.Patch(node, newNode) + } +} + +func PatchOperators(node *ast.Node, config *conf.Config) { + if len(config.Operators) == 0 { + return + } + patcher := &operatorPatcher{ops: config.Operators, types: config.Types} + ast.Walk(node, patcher) +} diff --git a/vendor/github.com/antonmedv/expr/conf/config.go b/vendor/github.com/antonmedv/expr/conf/config.go new file mode 100644 index 00000000000..7ba07fe0d5f --- /dev/null +++ b/vendor/github.com/antonmedv/expr/conf/config.go @@ -0,0 +1,89 @@ +package conf + +import ( + "fmt" + "reflect" + + "github.com/antonmedv/expr/ast" + "github.com/antonmedv/expr/vm" +) + +type Config struct { + Env interface{} + MapEnv bool + Types TypesTable + Operators OperatorsTable + Expect reflect.Kind + Optimize bool + Strict bool + DefaultType reflect.Type + ConstExprFns map[string]reflect.Value + Visitors []ast.Visitor + err error +} + +func New(env interface{}) *Config { + var mapEnv bool + var mapValueType reflect.Type + if _, ok := env.(map[string]interface{}); ok { + mapEnv = true + } else { + if reflect.ValueOf(env).Kind() == reflect.Map { + mapValueType = reflect.TypeOf(env).Elem() + } + } + + return &Config{ + Env: env, + MapEnv: mapEnv, + Types: CreateTypesTable(env), + Optimize: true, + Strict: true, + DefaultType: mapValueType, + ConstExprFns: make(map[string]reflect.Value), + } +} + +// Check validates the compiler configuration. +func (c *Config) Check() error { + // Check that all functions that define operator overloading + // exist in environment and have correct signatures. + for op, fns := range c.Operators { + for _, fn := range fns { + fnType, ok := c.Types[fn] + if !ok || fnType.Type.Kind() != reflect.Func { + return fmt.Errorf("function %s for %s operator does not exist in environment", fn, op) + } + requiredNumIn := 2 + if fnType.Method { + requiredNumIn = 3 // As first argument of method is receiver. + } + if fnType.Type.NumIn() != requiredNumIn || fnType.Type.NumOut() != 1 { + return fmt.Errorf("function %s for %s operator does not have a correct signature", fn, op) + } + } + } + + // Check that all ConstExprFns are functions. + for name, fn := range c.ConstExprFns { + if fn.Kind() != reflect.Func { + return fmt.Errorf("const expression %q must be a function", name) + } + } + + return c.err +} + +func (c *Config) ConstExpr(name string) { + if c.Env == nil { + c.Error(fmt.Errorf("no environment for const expression: %v", name)) + return + } + c.ConstExprFns[name] = vm.FetchFn(c.Env, name) +} + +func (c *Config) Error(err error) { + if c.err == nil { + c.err = err + } +} diff --git a/vendor/github.com/antonmedv/expr/conf/operators_table.go b/vendor/github.com/antonmedv/expr/conf/operators_table.go new file mode 100644 index 00000000000..0ceb844002f --- /dev/null +++ b/vendor/github.com/antonmedv/expr/conf/operators_table.go @@ -0,0 +1,26 @@ +package conf + +import "reflect" + +// OperatorsTable maps binary operators to corresponding list of functions. +// Functions should be provided in the environment to allow operator overloading. +type OperatorsTable map[string][]string + +func FindSuitableOperatorOverload(fns []string, types TypesTable, l, r reflect.Type) (reflect.Type, string, bool) { + for _, fn := range fns { + fnType := types[fn] + firstInIndex := 0 + if fnType.Method { + firstInIndex = 1 // As first argument to method is receiver. + } + firstArgType := fnType.Type.In(firstInIndex) + secondArgType := fnType.Type.In(firstInIndex + 1) + + firstArgumentFit := l == firstArgType || (firstArgType.Kind() == reflect.Interface && (l == nil || l.Implements(firstArgType))) + secondArgumentFit := r == secondArgType || (secondArgType.Kind() == reflect.Interface && (r == nil || r.Implements(secondArgType))) + if firstArgumentFit && secondArgumentFit { + return fnType.Type.Out(0), fn, true + } + } + return nil, "", false +} diff --git a/vendor/github.com/antonmedv/expr/conf/types_table.go b/vendor/github.com/antonmedv/expr/conf/types_table.go new file mode 100644 index 00000000000..d5539da4ae7 --- /dev/null +++ b/vendor/github.com/antonmedv/expr/conf/types_table.go @@ -0,0 +1,100 @@ +package conf + +import "reflect" + +type Tag struct { + Type reflect.Type + Method bool + Ambiguous bool +} + +type TypesTable map[string]Tag + +// CreateTypesTable creates types table for type checks during parsing. +// If struct is passed, all fields will be treated as variables, +// as well as all fields of embedded structs and struct itself. +// +// If map is passed, all items will be treated as variables +// (key as name, value as type). +func CreateTypesTable(i interface{}) TypesTable { + if i == nil { + return nil + } + + types := make(TypesTable) + v := reflect.ValueOf(i) + t := reflect.TypeOf(i) + + d := t + if t.Kind() == reflect.Ptr { + d = t.Elem() + } + + switch d.Kind() { + case reflect.Struct: + types = FieldsFromStruct(d) + + // Methods of struct should be gathered from original struct with pointer, + // as methods maybe declared on pointer receiver. Also this method retrieves + // all embedded structs methods as well, no need to recursion. + for i := 0; i < t.NumMethod(); i++ { + m := t.Method(i) + types[m.Name] = Tag{Type: m.Type, Method: true} + } + + case reflect.Map: + for _, key := range v.MapKeys() { + value := v.MapIndex(key) + if key.Kind() == reflect.String && value.IsValid() && value.CanInterface() { + types[key.String()] = Tag{Type: reflect.TypeOf(value.Interface())} + } + } + + // A map may have method too. + for i := 0; i < t.NumMethod(); i++ { + m := t.Method(i) + types[m.Name] = Tag{Type: m.Type, Method: true} + } + } + + return types +} + +func FieldsFromStruct(t reflect.Type) TypesTable { + types := make(TypesTable) + t = dereference(t) + if t == nil { + return types + } + + switch t.Kind() { + case reflect.Struct: + for i := 0; i < t.NumField(); i++ { + f := t.Field(i) + + if f.Anonymous { + for name, typ := range FieldsFromStruct(f.Type) { + if _, ok := types[name]; ok { + types[name] = Tag{Ambiguous: true} + } else { + types[name] = typ + } + } + } + + types[f.Name] = Tag{Type: f.Type} + } + } + + return types +} + +func dereference(t reflect.Type) reflect.Type { + if t == nil { + return nil + } + if t.Kind() == reflect.Ptr { + t = dereference(t.Elem()) + } + return t +} diff --git a/vendor/github.com/antonmedv/expr/expr.go b/vendor/github.com/antonmedv/expr/expr.go new file mode 100644 index 00000000000..05c54adb180 --- /dev/null +++ b/vendor/github.com/antonmedv/expr/expr.go @@ -0,0 +1,187 @@ +package expr + +import ( + "fmt" + "github.com/antonmedv/expr/ast" + "github.com/antonmedv/expr/file" + "reflect" + + "github.com/antonmedv/expr/checker" + "github.com/antonmedv/expr/compiler" + "github.com/antonmedv/expr/conf" + "github.com/antonmedv/expr/optimizer" + "github.com/antonmedv/expr/parser" + "github.com/antonmedv/expr/vm" +) + +// Option for configuring config. +type Option func(c *conf.Config) + +// Eval parses, compiles and runs given input. +func Eval(input string, env interface{}) (interface{}, error) { + if _, ok := env.(Option); ok { + return nil, fmt.Errorf("misused expr.Eval: second argument (env) should be passed without expr.Env") + } + + tree, err := parser.Parse(input) + if err != nil { + return nil, err + } + + program, err := compiler.Compile(tree, nil) + if err != nil { + return nil, err + } + + output, err := vm.Run(program, env) + if err != nil { + return nil, err + } + + return output, nil +} + +// Env specifies expected input of env for type checks. +// If struct is passed, all fields will be treated as variables, +// as well as all fields of embedded structs and struct itself. +// If map is passed, all items will be treated as variables. +// Methods defined on this type will be available as functions. +func Env(env interface{}) Option { + return func(c *conf.Config) { + if _, ok := env.(map[string]interface{}); ok { + c.MapEnv = true + } else { + if reflect.ValueOf(env).Kind() == reflect.Map { + c.DefaultType = reflect.TypeOf(env).Elem() + } + } + c.Strict = true + c.Types = conf.CreateTypesTable(env) + c.Env = env + } +} + +// AllowUndefinedVariables allows to use undefined variables inside expressions. +// This can be used with expr.Env option to partially define a few variables. +// Note what this option is only works in map environment are used, otherwise +// runtime.fetch will panic as there is no way to get missing field zero value. +func AllowUndefinedVariables() Option { + return func(c *conf.Config) { + c.Strict = false + } +} + +// Operator allows to override binary operator with function. +func Operator(operator string, fn ...string) Option { + return func(c *conf.Config) { + c.Operators[operator] = append(c.Operators[operator], fn...) + } +} + +// ConstExpr defines func expression as constant. If all argument to this function is constants, +// then it can be replaced by result of this func call on compile step. +func ConstExpr(fn string) Option { + return func(c *conf.Config) { + c.ConstExpr(fn) + } +} + +// AsBool tells the compiler to expect boolean result. +func AsBool() Option { + return func(c *conf.Config) { + c.Expect = reflect.Bool + } +} + +// AsInt64 tells the compiler to expect int64 result. +func AsInt64() Option { + return func(c *conf.Config) { + c.Expect = reflect.Int64 + } +} + +// AsFloat64 tells the compiler to expect float64 result. +func AsFloat64() Option { + return func(c *conf.Config) { + c.Expect = reflect.Float64 + } +} + +// Optimize turns optimizations on or off. +func Optimize(b bool) Option { + return func(c *conf.Config) { + c.Optimize = b + } +} + +// Patch adds visitor to list of visitors what will be applied before compiling AST to bytecode. +func Patch(visitor ast.Visitor) Option { + return func(c *conf.Config) { + c.Visitors = append(c.Visitors, visitor) + } +} + +// Compile parses and compiles given input expression to bytecode program. +func Compile(input string, ops ...Option) (*vm.Program, error) { + config := &conf.Config{ + Operators: make(map[string][]string), + ConstExprFns: make(map[string]reflect.Value), + Optimize: true, + } + + for _, op := range ops { + op(config) + } + + if err := config.Check(); err != nil { + return nil, err + } + + tree, err := parser.Parse(input) + if err != nil { + return nil, err + } + + _, err = checker.Check(tree, config) + + // If we have a patch to apply, it may fix out error and + // second type check is needed. Otherwise it is an error. + if err != nil && len(config.Visitors) == 0 { + return nil, err + } + + // Patch operators before Optimize, as we may also mark it as ConstExpr. + compiler.PatchOperators(&tree.Node, config) + + if len(config.Visitors) >= 0 { + for _, v := range config.Visitors { + ast.Walk(&tree.Node, v) + } + _, err = checker.Check(tree, config) + if err != nil { + return nil, err + } + } + + if config.Optimize { + err = optimizer.Optimize(&tree.Node, config) + if err != nil { + if fileError, ok := err.(*file.Error); ok { + return nil, fileError.Bind(tree.Source) + } + return nil, err + } + } + + program, err := compiler.Compile(tree, config) + if err != nil { + return nil, err + } + + return program, nil +} + +// Run evaluates given bytecode program. +func Run(program *vm.Program, env interface{}) (interface{}, error) { + return vm.Run(program, env) +} diff --git a/vendor/github.com/antonmedv/expr/file/error.go b/vendor/github.com/antonmedv/expr/file/error.go new file mode 100644 index 00000000000..b7af3e6e24a --- /dev/null +++ b/vendor/github.com/antonmedv/expr/file/error.go @@ -0,0 +1,58 @@ +package file + +import ( + "fmt" + "strings" + "unicode/utf8" +) + +type Error struct { + Location + Message string + Snippet string +} + +func (e *Error) Error() string { + return e.format() +} + +func (e *Error) Bind(source *Source) *Error { + if snippet, found := source.Snippet(e.Location.Line); found { + snippet := strings.Replace(snippet, "\t", " ", -1) + srcLine := "\n | " + snippet + var bytes = []byte(snippet) + var indLine = "\n | " + for i := 0; i < e.Location.Column && len(bytes) > 0; i++ { + _, sz := utf8.DecodeRune(bytes) + bytes = bytes[sz:] + if sz > 1 { + goto noind + } else { + indLine += "." + } + } + if _, sz := utf8.DecodeRune(bytes); sz > 1 { + goto noind + } else { + indLine += "^" + } + srcLine += indLine + + noind: + e.Snippet = srcLine + } + return e +} + +func (e *Error) format() string { + if e.Location.Empty() { + return e.Message + } + return fmt.Sprintf( + "%s (%d:%d)%s", + e.Message, + e.Line, + e.Column+1, // add one to the 0-based column for display + e.Snippet, + ) +} diff --git a/vendor/github.com/antonmedv/expr/file/location.go b/vendor/github.com/antonmedv/expr/file/location.go new file mode 100644 index 00000000000..a92e27f0b1c --- /dev/null +++ b/vendor/github.com/antonmedv/expr/file/location.go @@ -0,0 +1,10 @@ +package file + +type Location struct { + Line int // The 1-based line of the location. + Column int // The 0-based column number of the location. +} + +func (l Location) Empty() bool { + return l.Column == 0 && l.Line == 0 +} diff --git a/vendor/github.com/antonmedv/expr/file/source.go b/vendor/github.com/antonmedv/expr/file/source.go new file mode 100644 index 00000000000..185d1568ad6 --- /dev/null +++ b/vendor/github.com/antonmedv/expr/file/source.go @@ -0,0 +1,95 @@ +package file + +import ( + "encoding/json" + "strings" + "unicode/utf8" +) + +type Source struct { + contents []rune + lineOffsets []int32 +} + +func NewSource(contents string) *Source { + s := &Source{ + contents: []rune(contents), + } + s.updateOffsets() + return s +} + +func (s *Source) MarshalJSON() ([]byte, error) { + return json.Marshal(s.contents) +} + +func (s *Source) UnmarshalJSON(b []byte) error { + contents := make([]rune, 0) + err := json.Unmarshal(b, &contents) + if err != nil { + return err + } + + s.contents = contents + s.updateOffsets() + return nil +} + +func (s *Source) Content() string { + return string(s.contents) +} + +func (s *Source) Snippet(line int) (string, bool) { + charStart, found := s.findLineOffset(line) + if !found || len(s.contents) == 0 { + return "", false + } + charEnd, found := s.findLineOffset(line + 1) + if found { + return string(s.contents[charStart : charEnd-1]), true + } + return string(s.contents[charStart:]), true +} + +// updateOffsets compute line offsets up front as they are referred to frequently. +func (s *Source) updateOffsets() { + lines := strings.Split(string(s.contents), "\n") + offsets := make([]int32, len(lines)) + var offset int32 + for i, line := range lines { + offset = offset + int32(utf8.RuneCountInString(line)) + 1 + offsets[int32(i)] = offset + } + s.lineOffsets = offsets +} + +// findLineOffset returns the offset where the (1-indexed) line begins, +// or false if line doesn't exist. +func (s *Source) findLineOffset(line int) (int32, bool) { + if line == 1 { + return 0, true + } else if line > 1 && line <= len(s.lineOffsets) { + offset := s.lineOffsets[line-2] + return offset, true + } + return -1, false +} + +// findLine finds the line that contains the given character offset and +// returns the line number and offset of the beginning of that line. +// Note that the last line is treated as if it contains all offsets +// beyond the end of the actual source. +func (s *Source) findLine(characterOffset int32) (int32, int32) { + var line int32 = 1 + for _, lineOffset := range s.lineOffsets { + if lineOffset > characterOffset { + break + } else { + line++ + } + } + if line == 1 { + return line, 0 + } + return line, s.lineOffsets[line-2] +} diff --git a/vendor/github.com/antonmedv/expr/go.mod b/vendor/github.com/antonmedv/expr/go.mod new file mode 100644 index 00000000000..55483600d0e --- /dev/null +++ b/vendor/github.com/antonmedv/expr/go.mod @@ -0,0 +1,10 @@ +module github.com/antonmedv/expr + +go 1.13 + +require ( + github.com/gdamore/tcell v1.3.0 + github.com/rivo/tview v0.0.0-20200219210816-cd38d7432498 + github.com/sanity-io/litter v1.2.0 + github.com/stretchr/testify v1.5.1 +) diff --git a/vendor/github.com/antonmedv/expr/go.sum b/vendor/github.com/antonmedv/expr/go.sum new file mode 100644 index 00000000000..a43e72bf7d5 --- /dev/null +++ b/vendor/github.com/antonmedv/expr/go.sum @@ -0,0 +1,37 @@ +github.com/DATA-DOG/go-sqlmock v1.3.3/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q5eFN3EC/SaM= +github.com/davecgh/go-spew v0.0.0-20161028175848-04cdfd42973b/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +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/gdamore/encoding v1.0.0 h1:+7OoQ1Bc6eTm5niUzBa0Ctsh6JbMW6Ra+YNuAtDBdko= +github.com/gdamore/encoding v1.0.0/go.mod h1:alR0ol34c49FCSBLjhosxzcPHQbf2trDkoo5dl+VrEg= +github.com/gdamore/tcell v1.3.0 h1:r35w0JBADPZCVQijYebl6YMWWtHRqVEGt7kL2eBADRM= +github.com/gdamore/tcell v1.3.0/go.mod h1:Hjvr+Ofd+gLglo7RYKxxnzCBmev3BzsS67MebKS4zMM= +github.com/lucasb-eyer/go-colorful v1.0.2/go.mod h1:0MS4r+7BZKSJ5mw4/S5MPN+qHFF1fYclkSPilDOKW0s= +github.com/lucasb-eyer/go-colorful v1.0.3 h1:QIbQXiugsb+q10B+MI+7DI1oQLdmnep86tWFlaaUAac= +github.com/lucasb-eyer/go-colorful v1.0.3/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i7ruzyGqttikkLy0= +github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= +github.com/mattn/go-runewidth v0.0.8 h1:3tS41NlGYSmhhe/8fhGRzc+z3AYCw1Fe1WAyLuujKs0= +github.com/mattn/go-runewidth v0.0.8/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= +github.com/pmezard/go-difflib v0.0.0-20151028094244-d8ed2627bdf0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/rivo/tview v0.0.0-20200219210816-cd38d7432498 h1:4CFNy7/q7P06AsIONZzuWy7jcdqEmYQvOZ9FAFZdbls= +github.com/rivo/tview v0.0.0-20200219210816-cd38d7432498/go.mod h1:6lkG1x+13OShEf0EaOCaTQYyB7d5nSbb181KtjlS+84= +github.com/rivo/uniseg v0.1.0 h1:+2KBaVoUmb9XzDsrx/Ct0W/EYOSFf/nWTauy++DprtY= +github.com/rivo/uniseg v0.1.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= +github.com/sanity-io/litter v1.2.0 h1:DGJO0bxH/+C2EukzOSBmAlxmkhVMGqzvcx/rvySYw9M= +github.com/sanity-io/litter v1.2.0/go.mod h1:JF6pZUFgu2Q0sBZ+HSV35P8TVPI1TTzEwyu9FXAw2W4= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v0.0.0-20161117074351-18a02ba4a312/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= +github.com/stretchr/testify v1.5.1 h1:nOGnQDM7FYENwehXlg/kFVnos3rEvtKTjRvOWSzb6H4= +github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= +golang.org/x/sys v0.0.0-20190626150813-e07cf5db2756/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4 h1:sfkvUWPNGwSV+8/fNqctR5lS2AqCSqYwXdrjCxp/dXo= +golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs= +golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= diff --git a/vendor/github.com/antonmedv/expr/optimizer/const_expr.go b/vendor/github.com/antonmedv/expr/optimizer/const_expr.go new file mode 100644 index 00000000000..85fcc337f0f --- /dev/null +++ b/vendor/github.com/antonmedv/expr/optimizer/const_expr.go @@ -0,0 +1,77 @@ +package optimizer + +import ( + "fmt" + . "github.com/antonmedv/expr/ast" + "github.com/antonmedv/expr/file" + "reflect" + "strings" +) + +type constExpr struct { + applied bool + err error + fns map[string]reflect.Value +} + +func (*constExpr) Enter(*Node) {} +func (c *constExpr) Exit(node *Node) { + defer func() { + if r := recover(); r != nil { + msg := fmt.Sprintf("%v", r) + // Make message more actual, it's a runtime error, but at compile step. + msg = strings.Replace(msg, "runtime error:", "compile error:", 1) + c.err = &file.Error{ + Location: (*node).Location(), + Message: msg, + } + } + }() + + patch := func(newNode Node) { + c.applied = true + Patch(node, newNode) + } + + switch n := (*node).(type) { + case *FunctionNode: + fn, ok := c.fns[n.Name] + if ok { + in := make([]reflect.Value, len(n.Arguments)) + for i := 0; i < len(n.Arguments); i++ { + arg := n.Arguments[i] + var param interface{} + + switch a := arg.(type) { + case *NilNode: + param = nil + case *IntegerNode: + param = a.Value + case *FloatNode: + param = a.Value + case *BoolNode: + param = a.Value + case *StringNode: + param = a.Value + case *ConstantNode: + param = a.Value + + default: + return // Const expr optimization not applicable. + } + + if param == nil && reflect.TypeOf(param) == nil { + // In case of nil value and nil type use this hack, + // otherwise reflect.Call will panic on zero value. + in[i] = reflect.ValueOf(¶m).Elem() + } else { + in[i] = reflect.ValueOf(param) + } + } + + out := fn.Call(in) + constNode := &ConstantNode{Value: out[0].Interface()} + patch(constNode) + } + } +} diff --git a/vendor/github.com/antonmedv/expr/optimizer/const_range.go b/vendor/github.com/antonmedv/expr/optimizer/const_range.go new file mode 100644 index 00000000000..50723b6b4c0 --- /dev/null +++ b/vendor/github.com/antonmedv/expr/optimizer/const_range.go @@ -0,0 +1,33 @@ +package optimizer + +import ( + . "github.com/antonmedv/expr/ast" +) + +type constRange struct{} + +func (*constRange) Enter(*Node) {} +func (*constRange) Exit(node *Node) { + switch n := (*node).(type) { + case *BinaryNode: + if n.Operator == ".." { + if min, ok := n.Left.(*IntegerNode); ok { + if max, ok := n.Right.(*IntegerNode); ok { + size := max.Value - min.Value + 1 + // In this case array is too big. Skip generation, + // and wait for memory budget detection on runtime. + if size > 1e6 { + return + } + value := make([]int, size) + for i := range value { + value[i] = min.Value + i + } + Patch(node, &ConstantNode{ + Value: value, + }) + } + } + } + } +} diff --git a/vendor/github.com/antonmedv/expr/optimizer/fold.go b/vendor/github.com/antonmedv/expr/optimizer/fold.go new file mode 100644 index 00000000000..666912541e4 --- /dev/null +++ b/vendor/github.com/antonmedv/expr/optimizer/fold.go @@ -0,0 +1,133 @@ +package optimizer + +import ( + "math" + "reflect" + + . "github.com/antonmedv/expr/ast" + "github.com/antonmedv/expr/file" +) + +type fold struct { + applied bool + err *file.Error +} + +func (*fold) Enter(*Node) {} +func (fold *fold) Exit(node *Node) { + patch := func(newNode Node) { + fold.applied = true + Patch(node, newNode) + } + // for IntegerNode the type may have been changed from int->float + // preserve this information by setting the type after the Patch + patchWithType := func(newNode Node, leafType reflect.Type) { + patch(newNode) + newNode.SetType(leafType) + } + + switch n := (*node).(type) { + case *UnaryNode: + switch n.Operator { + case "-": + if i, ok := n.Node.(*IntegerNode); ok { + patchWithType(&IntegerNode{Value: -i.Value}, n.Node.Type()) + } + case "+": + if i, ok := n.Node.(*IntegerNode); ok { + patchWithType(&IntegerNode{Value: i.Value}, n.Node.Type()) + } + } + + case *BinaryNode: + switch n.Operator { + case "+": + if a, ok := n.Left.(*IntegerNode); ok { + if b, ok := n.Right.(*IntegerNode); ok { + patchWithType(&IntegerNode{Value: a.Value + b.Value}, a.Type()) + } + } + if a, ok := n.Left.(*StringNode); ok { + if b, ok := n.Right.(*StringNode); ok { + patch(&StringNode{Value: a.Value + b.Value}) + } + } + case "-": + if a, ok := n.Left.(*IntegerNode); ok { + if b, ok := n.Right.(*IntegerNode); ok { + patchWithType(&IntegerNode{Value: a.Value - b.Value}, a.Type()) + } + } + case "*": + if a, ok := n.Left.(*IntegerNode); ok { + if b, ok := n.Right.(*IntegerNode); ok { + patchWithType(&IntegerNode{Value: a.Value * b.Value}, a.Type()) + } + } + case "/": + if a, ok := n.Left.(*IntegerNode); ok { + if b, ok := n.Right.(*IntegerNode); ok { + if b.Value == 0 { + fold.err = &file.Error{ + Location: (*node).Location(), + Message: "integer divide by zero", + } + return + } + patchWithType(&IntegerNode{Value: a.Value / b.Value}, a.Type()) + } + } + case "%": + if a, ok := n.Left.(*IntegerNode); ok { + if b, ok := n.Right.(*IntegerNode); ok { + if b.Value == 0 { + fold.err = &file.Error{ + Location: (*node).Location(), + Message: "integer divide by zero", + } + return + } + patch(&IntegerNode{Value: a.Value % b.Value}) + } + } + case "**": + if a, ok := n.Left.(*IntegerNode); ok { + if b, ok := n.Right.(*IntegerNode); ok { + patch(&FloatNode{Value: math.Pow(float64(a.Value), float64(b.Value))}) + } + } + } + + case *ArrayNode: + if len(n.Nodes) > 0 { + + for _, a := range n.Nodes { + if _, ok := a.(*IntegerNode); !ok { + goto string + } + } + { + value := make([]int, len(n.Nodes)) + for i, a := range n.Nodes { + value[i] = a.(*IntegerNode).Value + } + patch(&ConstantNode{Value: value}) + } + + string: + for _, a := range n.Nodes { + if _, ok := a.(*StringNode); !ok { + return + } + } + { + value := make([]string, len(n.Nodes)) + for i, a := range n.Nodes { + value[i] = a.(*StringNode).Value + } + patch(&ConstantNode{Value: value}) + } + + } + } +} diff --git a/vendor/github.com/antonmedv/expr/optimizer/in_array.go b/vendor/github.com/antonmedv/expr/optimizer/in_array.go new file mode 100644 index 00000000000..8156faa5e0a --- /dev/null +++ b/vendor/github.com/antonmedv/expr/optimizer/in_array.go @@ -0,0 +1,65 @@ +package optimizer + +import ( + "reflect" + + . "github.com/antonmedv/expr/ast" +) + +type inArray struct{} + +func (*inArray) Enter(*Node) {} +func (*inArray) Exit(node *Node) { + switch n := (*node).(type) { + case *BinaryNode: + if n.Operator == "in" || n.Operator == "not in" { + if array, ok := n.Right.(*ArrayNode); ok { + if len(array.Nodes) > 0 { + t := n.Left.Type() + if t == nil || t.Kind() != reflect.Int { + // This optimization can be only performed if left side is int type, + // as runtime.in func uses reflect.Map.MapIndex and keys of map must, + // be same as checked value type. + goto string + } + + for _, a := range array.Nodes { + if _, ok := a.(*IntegerNode); !ok { + goto string + } + } + { + value := make(map[int]struct{}) + for _, a := range array.Nodes { + value[a.(*IntegerNode).Value] = struct{}{} + } + Patch(node, &BinaryNode{ + Operator: n.Operator, + Left: n.Left, + Right: &ConstantNode{Value: value}, + }) + } + + string: + for _, a := range array.Nodes { + if _, ok := a.(*StringNode); !ok { + return + } + } + { + value := make(map[string]struct{}) + for _, a := range array.Nodes { + value[a.(*StringNode).Value] = struct{}{} + } + Patch(node, &BinaryNode{ + Operator: n.Operator, + Left: n.Left, + Right: &ConstantNode{Value: value}, + }) + } + + } + } + } + } +} diff --git a/vendor/github.com/antonmedv/expr/optimizer/in_range.go b/vendor/github.com/antonmedv/expr/optimizer/in_range.go new file mode 100644 index 00000000000..177c91933d2 --- /dev/null +++ b/vendor/github.com/antonmedv/expr/optimizer/in_range.go @@ -0,0 +1,41 @@ +package optimizer + +import ( + . "github.com/antonmedv/expr/ast" +) + +type inRange struct{} + +func (*inRange) Enter(*Node) {} +func (*inRange) Exit(node *Node) { + switch n := (*node).(type) { + case *BinaryNode: + if n.Operator == "in" || n.Operator == "not in" { + if rng, ok := n.Right.(*BinaryNode); ok && rng.Operator == ".." { + if from, ok := rng.Left.(*IntegerNode); ok { + if to, ok := rng.Right.(*IntegerNode); ok { + Patch(node, &BinaryNode{ + Operator: "and", + Left: &BinaryNode{ + Operator: ">=", + Left: n.Left, + Right: from, + }, + Right: &BinaryNode{ + Operator: "<=", + Left: n.Left, + Right: to, + }, + }) + if n.Operator == "not in" { + Patch(node, &UnaryNode{ + Operator: "not", + Node: *node, + }) + } + } + } + } + } + } +} diff --git a/vendor/github.com/antonmedv/expr/optimizer/optimizer.go b/vendor/github.com/antonmedv/expr/optimizer/optimizer.go new file mode 100644 index 00000000000..738348dc365 --- /dev/null +++ b/vendor/github.com/antonmedv/expr/optimizer/optimizer.go @@ -0,0 +1,37 @@ +package optimizer + +import ( + . "github.com/antonmedv/expr/ast" + "github.com/antonmedv/expr/conf" +) + +func Optimize(node *Node, config *conf.Config) error { + Walk(node, &inArray{}) + for limit := 1000; limit >= 0; limit-- { + fold := &fold{} + Walk(node, fold) + if fold.err != nil { + return fold.err + } + if !fold.applied { + break + } + } + if config != nil && len(config.ConstExprFns) > 0 { + for limit := 100; limit >= 0; limit-- { + constExpr := &constExpr{ + fns: config.ConstExprFns, + } + Walk(node, constExpr) + if constExpr.err != nil { + return constExpr.err + } + if !constExpr.applied { + break + } + } + } + Walk(node, &inRange{}) + Walk(node, &constRange{}) + return nil +} diff --git a/vendor/github.com/antonmedv/expr/parser/lexer/lexer.go b/vendor/github.com/antonmedv/expr/parser/lexer/lexer.go new file mode 100644 index 00000000000..5bf7324971b --- /dev/null +++ b/vendor/github.com/antonmedv/expr/parser/lexer/lexer.go @@ -0,0 +1,205 @@ +package lexer + +import ( + "fmt" + "strings" + "unicode/utf8" + + "github.com/antonmedv/expr/file" +) + +func Lex(source *file.Source) ([]Token, error) { + l := &lexer{ + input: source.Content(), + tokens: make([]Token, 0), + } + + l.loc = file.Location{1, 0} + l.prev = l.loc + l.startLoc = l.loc + + for state := root; state != nil; { + state = state(l) + } + + if l.err != nil { + return nil, l.err.Bind(source) + } + + return l.tokens, nil +} + +type lexer struct { + input string + state stateFn + tokens []Token + start, end int // current position in input + width int // last rune with + startLoc file.Location // start location + prev, loc file.Location // prev location of end location, end location + err *file.Error +} + +const eof rune = -1 + +func (l *lexer) next() rune { + if l.end >= len(l.input) { + l.width = 0 + return eof + } + r, w := utf8.DecodeRuneInString(l.input[l.end:]) + l.width = w + l.end += w + + l.prev = l.loc + if r == '\n' { + l.loc.Line++ + l.loc.Column = 0 + } else { + l.loc.Column++ + } + + return r +} + +func (l *lexer) peek() rune { + r := l.next() + l.backup() + return r +} + +func (l *lexer) backup() { + l.end -= l.width + l.loc = l.prev +} + +func (l *lexer) emit(t Kind) { + l.emitValue(t, l.word()) +} + +func (l *lexer) emitValue(t Kind, value string) { + l.tokens = append(l.tokens, Token{ + Location: l.startLoc, + Kind: t, + Value: value, + }) + l.start = l.end + l.startLoc = l.loc +} + +func (l *lexer) emitEOF() { + l.tokens = append(l.tokens, Token{ + Location: l.prev, // Point to previous position for better error messages. + Kind: EOF, + }) + l.start = l.end + l.startLoc = l.loc +} + +func (l *lexer) word() string { + return l.input[l.start:l.end] +} + +func (l *lexer) ignore() { + l.start = l.end + l.startLoc = l.loc +} + +func (l *lexer) accept(valid string) bool { + if strings.ContainsRune(valid, l.next()) { + return true + } + l.backup() + return false +} + +func (l *lexer) acceptRun(valid string) { + for strings.ContainsRune(valid, l.next()) { + } + l.backup() +} + +func (l *lexer) acceptWord(word string) bool { + pos := l.end + loc := l.loc + prev := l.prev + for _, ch := range word { + if l.next() != ch { + l.end = pos + l.loc = loc + l.prev = prev + return false + } + } + return true +} + +func (l *lexer) error(format string, args ...interface{}) stateFn { + if l.err == nil { // show first error + l.err = &file.Error{ + Location: l.loc, + Message: fmt.Sprintf(format, args...), + } + } + return nil +} + +func digitVal(ch rune) int { + switch { + case '0' <= ch && ch <= '9': + return int(ch - '0') + case 'a' <= lower(ch) && lower(ch) <= 'f': + return int(lower(ch) - 'a' + 10) + } + return 16 // larger than any legal digit val +} + +func lower(ch rune) rune { return ('a' - 'A') | ch } // returns lower-case ch iff ch is ASCII letter + +func (l *lexer) scanDigits(ch rune, base, n int) rune { + for n > 0 && digitVal(ch) < base { + ch = l.next() + n-- + } + if n > 0 { + l.error("invalid char escape") + } + return ch +} + +func (l *lexer) scanEscape(quote rune) rune { + ch := l.next() // read character after '/' + switch ch { + case 'a', 'b', 'f', 'n', 'r', 't', 'v', '\\', quote: + // nothing to do + ch = l.next() + case '0', '1', '2', '3', '4', '5', '6', '7': + ch = l.scanDigits(ch, 8, 3) + case 'x': + ch = l.scanDigits(l.next(), 16, 2) + case 'u': + ch = l.scanDigits(l.next(), 16, 4) + case 'U': + ch = l.scanDigits(l.next(), 16, 8) + default: + l.error("invalid char escape") + } + return ch +} + +func (l *lexer) scanString(quote rune) (n int) { + ch := l.next() // read character after quote + for ch != quote { + if ch == '\n' || ch == eof { + l.error("literal not terminated") + return + } + if ch == '\\' { + ch = l.scanEscape(quote) + } else { + ch = l.next() + } + n++ + } + return +} diff --git a/vendor/github.com/antonmedv/expr/parser/lexer/state.go b/vendor/github.com/antonmedv/expr/parser/lexer/state.go new file mode 100644 index 00000000000..ccc67779d46 --- /dev/null +++ b/vendor/github.com/antonmedv/expr/parser/lexer/state.go @@ -0,0 +1,134 @@ +package lexer + +import ( + "strings" +) + +type stateFn func(*lexer) stateFn + +func root(l *lexer) stateFn { + switch r := l.next(); { + case r == eof: + l.emitEOF() + return nil + case IsSpace(r): + l.ignore() + return root + case r == '\'' || r == '"': + l.scanString(r) + str, err := unescape(l.word()) + if err != nil { + l.error("%v", err) + } + l.emitValue(String, str) + case '0' <= r && r <= '9': + l.backup() + return number + case strings.ContainsRune("([{", r): + l.emit(Bracket) + case strings.ContainsRune(")]}", r): + l.emit(Bracket) + case strings.ContainsRune("#,?:%+-/", r): // single rune operator + l.emit(Operator) + case strings.ContainsRune("&|!=*<>", r): // possible double rune operator + l.accept("&|=*") + l.emit(Operator) + case r == '.': + l.backup() + return dot + case IsAlphaNumeric(r): + l.backup() + return identifier + default: + return l.error("unrecognized character: %#U", r) + } + return root +} + +func number(l *lexer) stateFn { + if !l.scanNumber() { + return l.error("bad number syntax: %q", l.word()) + } + l.emit(Number) + return root +} + +func (l *lexer) scanNumber() bool { + digits := "0123456789_" + // Is it hex? + if l.accept("0") { + // Note: Leading 0 does not mean octal in floats. + if l.accept("xX") { + digits = "0123456789abcdefABCDEF_" + } else if l.accept("oO") { + digits = "01234567_" + } else if l.accept("bB") { + digits = "01_" + } + } + l.acceptRun(digits) + loc, prev, end := l.loc, l.prev, l.end + if l.accept(".") { + // Lookup for .. operator: if after dot there is another dot (1..2), it maybe a range operator. + if l.peek() == '.' { + // We can't backup() here, as it would require two backups, + // and backup() func supports only one for now. So, save and + // restore it here. + l.loc, l.prev, l.end = loc, prev, end + return true + } + l.acceptRun(digits) + } + if l.accept("eE") { + l.accept("+-") + l.acceptRun(digits) + } + // Next thing mustn't be alphanumeric. + if IsAlphaNumeric(l.peek()) { + l.next() + return false + } + return true +} + +func dot(l *lexer) stateFn { + l.next() + if l.accept("0123456789") { + l.backup() + return number + } + l.accept(".") + l.emit(Operator) + return root +} + +func identifier(l *lexer) stateFn { +loop: + for { + switch r := l.next(); { + case IsAlphaNumeric(r): + // absorb + default: + l.backup() + switch l.word() { + case "not": + return not + case "in", "or", "and", "matches", "contains", "startsWith", "endsWith": + l.emit(Operator) + default: + l.emit(Identifier) + } + break loop + } + } + return root +} + +func not(l *lexer) stateFn { + if l.acceptWord(" in") { + l.emit(Operator) + } else { + l.emit(Operator) + } + return root +} diff --git a/vendor/github.com/antonmedv/expr/parser/lexer/token.go b/vendor/github.com/antonmedv/expr/parser/lexer/token.go new file mode 100644 index 00000000000..cb9eb815bdc --- /dev/null +++ b/vendor/github.com/antonmedv/expr/parser/lexer/token.go @@ -0,0 +1,47 @@ +package lexer + +import ( + "fmt" + + "github.com/antonmedv/expr/file" +) + +type Kind string + +const ( + Identifier Kind = "Identifier" + Number = "Number" + String = "String" + Operator = "Operator" + Bracket = "Bracket" + EOF = "EOF" +) + +type Token struct { + file.Location + Kind Kind + Value string +} + +func (t Token) String() string { + if t.Value == "" { + return string(t.Kind) + } + return fmt.Sprintf("%s(%#v)", t.Kind, t.Value) +} + +func (t Token) Is(kind Kind, values ...string) bool { + if len(values) == 0 { + return kind == t.Kind + } + + for _, v := range values { + if v == t.Value { + goto found + } + } + return false + +found: + return kind == t.Kind +} diff --git a/vendor/github.com/antonmedv/expr/parser/lexer/utils.go b/vendor/github.com/antonmedv/expr/parser/lexer/utils.go new file mode 100644 index 00000000000..72e3cf20c97 --- /dev/null +++ b/vendor/github.com/antonmedv/expr/parser/lexer/utils.go @@ -0,0 +1,194 @@ +package lexer + +import ( + "fmt" + "strings" + "unicode" + "unicode/utf8" +) + +func IsSpace(r rune) bool { + return unicode.IsSpace(r) +} + +func IsAlphaNumeric(r rune) bool { + return IsAlphabetic(r) || unicode.IsDigit(r) +} + +func IsAlphabetic(r rune) bool { + return r == '_' || r == '$' || unicode.IsLetter(r) +} + +var ( + newlineNormalizer = strings.NewReplacer("\r\n", "\n", "\r", "\n") +) + +// Unescape takes a quoted string, unquotes, and unescapes it. +func unescape(value string) (string, error) { + // All strings normalize newlines to the \n representation. + value = newlineNormalizer.Replace(value) + n := len(value) + + // Nothing to unescape / decode. + if n < 2 { + return value, fmt.Errorf("unable to unescape string") + } + + // Quoted string of some form, must have same first and last char. + if value[0] != value[n-1] || (value[0] != '"' && value[0] != '\'') { + return value, fmt.Errorf("unable to unescape string") + } + + value = value[1 : n-1] + + // The string contains escape characters. + // The following logic is adapted from `strconv/quote.go` + var runeTmp [utf8.UTFMax]byte + buf := make([]byte, 0, 3*n/2) + for len(value) > 0 { + c, multibyte, rest, err := unescapeChar(value) + if err != nil { + return "", err + } + value = rest + if c < utf8.RuneSelf || !multibyte { + buf = append(buf, byte(c)) + } else { + n := utf8.EncodeRune(runeTmp[:], c) + buf = append(buf, runeTmp[:n]...) + } + } + return string(buf), nil +} + +// unescapeChar takes a string input and returns the following info: +// +// value - the escaped unicode rune at the front of the string. +// multibyte - whether the rune value might require multiple bytes to represent. +// tail - the remainder of the input string. +// err - error value, if the character could not be unescaped. +// +// When multibyte is true the return value may still fit within a single byte, +// but a multibyte conversion is attempted which is more expensive than when the +// value is known to fit within one byte. +func unescapeChar(s string) (value rune, multibyte bool, tail string, err error) { + // 1. Character is not an escape sequence. + switch c := s[0]; { + case c >= utf8.RuneSelf: + r, size := utf8.DecodeRuneInString(s) + return r, true, s[size:], nil + case c != '\\': + return rune(s[0]), false, s[1:], nil + } + + // 2. Last character is the start of an escape sequence. + if len(s) <= 1 { + err = fmt.Errorf("unable to unescape string, found '\\' as last character") + return + } + + c := s[1] + s = s[2:] + // 3. Common escape sequences shared with Google SQL + switch c { + case 'a': + value = '\a' + case 'b': + value = '\b' + case 'f': + value = '\f' + case 'n': + value = '\n' + case 'r': + value = '\r' + case 't': + value = '\t' + case 'v': + value = '\v' + case '\\': + value = '\\' + case '\'': + value = '\'' + case '"': + value = '"' + case '`': + value = '`' + case '?': + value = '?' + + // 4. Unicode escape sequences, reproduced from `strconv/quote.go` + case 'x', 'X', 'u', 'U': + n := 0 + switch c { + case 'x', 'X': + n = 2 + case 'u': + n = 4 + case 'U': + n = 8 + } + var v rune + if len(s) < n { + err = fmt.Errorf("unable to unescape string") + return + } + for j := 0; j < n; j++ { + x, ok := unhex(s[j]) + if !ok { + err = fmt.Errorf("unable to unescape string") + return + } + v = v<<4 | x + } + s = s[n:] + if v > utf8.MaxRune { + err = fmt.Errorf("unable to unescape string") + return + } + value = v + multibyte = true + + // 5. Octal escape sequences, must be three digits \[0-3][0-7][0-7] + case '0', '1', '2', '3': + if len(s) < 2 { + err = fmt.Errorf("unable to unescape octal sequence in string") + return + } + v := rune(c - '0') + for j := 0; j < 2; j++ { + x := s[j] + if x < '0' || x > '7' { + err = fmt.Errorf("unable to unescape octal sequence in string") + return + } + v = v*8 + rune(x-'0') + } + if v > utf8.MaxRune { + err = fmt.Errorf("unable to unescape string") + return + } + value = v + s = s[2:] + multibyte = true + + // Unknown escape sequence. + default: + err = fmt.Errorf("unable to unescape string") + } + + tail = s + return +} + +func unhex(b byte) (rune, bool) { + c := rune(b) + switch { + case '0' <= c && c <= '9': + return c - '0', true + case 'a' <= c && c <= 'f': + return c - 'a' + 10, true + case 'A' <= c && c <= 'F': + return c - 'A' + 10, true + } + return 0, false +} diff --git a/vendor/github.com/antonmedv/expr/parser/parser.go b/vendor/github.com/antonmedv/expr/parser/parser.go new file mode 100644 index 00000000000..5b640817ebc --- /dev/null +++ b/vendor/github.com/antonmedv/expr/parser/parser.go @@ -0,0 +1,579 @@ +package parser + +import ( + "fmt" + "regexp" + "strconv" + "strings" + "unicode/utf8" + + . "github.com/antonmedv/expr/ast" + "github.com/antonmedv/expr/file" + . "github.com/antonmedv/expr/parser/lexer" +) + +type associativity int + +const ( + left associativity = iota + 1 + right +) + +type operator struct { + precedence int + associativity associativity +} + +type builtin struct { + arity int +} + +var unaryOperators = map[string]operator{ + "not": {50, left}, + "!": {50, left}, + "-": {500, left}, + "+": {500, left}, +} + +var binaryOperators = map[string]operator{ + "or": {10, left}, + "||": {10, left}, + "and": {15, left}, + "&&": {15, left}, + "==": {20, left}, + "!=": {20, left}, + "<": {20, left}, + ">": {20, left}, + ">=": {20, left}, + "<=": {20, left}, + "not in": {20, left}, + "in": {20, left}, + "matches": {20, left}, + "contains": {20, left}, + "startsWith": {20, left}, + "endsWith": {20, left}, + "..": {25, left}, + "+": {30, left}, + "-": {30, left}, + "*": {60, left}, + "/": {60, left}, + "%": {60, left}, + "**": {70, right}, +} + +var builtins = map[string]builtin{ + "len": {1}, + "all": {2}, + "none": {2}, + "any": {2}, + "one": {2}, + "filter": {2}, + "map": {2}, + "count": {2}, +} + +type parser struct { + tokens []Token + current Token + pos int + err *file.Error + depth int // closure call depth +} + +type Tree struct { + Node Node + Source *file.Source +} + +func Parse(input string) (*Tree, error) { + source := file.NewSource(input) + + tokens, err := Lex(source) + if err != nil { + return nil, err + } + + p := &parser{ + tokens: tokens, + current: tokens[0], + } + + node := p.parseExpression(0) + + if !p.current.Is(EOF) { + p.error("unexpected token %v", p.current) + } + + if p.err != nil { + return nil, p.err.Bind(source) + } + + return &Tree{ + Node: node, + Source: source, + }, nil +} + +func (p *parser) error(format string, args ...interface{}) { + if p.err == nil { // show first error + p.err = &file.Error{ + Location: p.current.Location, + Message: fmt.Sprintf(format, args...), + } + } +} + +func (p *parser) next() { + p.pos++ + if p.pos >= len(p.tokens) { + p.error("unexpected end of expression") + return + } + p.current = p.tokens[p.pos] +} + +func (p *parser) expect(kind Kind, values ...string) { + if p.current.Is(kind, values...) { + p.next() + return + } + p.error("unexpected token %v", p.current) +} + +// parse functions + +func (p *parser) parseExpression(precedence int) Node { + nodeLeft := p.parsePrimary() + + token := p.current + for token.Is(Operator) && p.err == nil { + if op, ok := binaryOperators[token.Value]; ok { + if op.precedence >= precedence { + p.next() + + var nodeRight Node + if op.associativity == left { + nodeRight = p.parseExpression(op.precedence + 1) + } else { + nodeRight = p.parseExpression(op.precedence) + } + + if token.Is(Operator, "matches") { + var r *regexp.Regexp + var err error + + if s, ok := nodeRight.(*StringNode); ok { + r, err = regexp.Compile(s.Value) + if err != nil { + p.error("%v", err) + } + } + nodeLeft = &MatchesNode{ + Regexp: r, + Left: nodeLeft, + Right: nodeRight, + } + nodeLeft.SetLocation(token.Location) + } else { + nodeLeft = &BinaryNode{ + Operator: token.Value, + Left: nodeLeft, + Right: nodeRight, + } + nodeLeft.SetLocation(token.Location) + } + token = p.current + continue + } + } + break + } + + if precedence == 0 { + nodeLeft = p.parseConditionalExpression(nodeLeft) + } + + return nodeLeft +} + +func (p *parser) parsePrimary() Node { + token := p.current + + if token.Is(Operator) { + if op, ok := unaryOperators[token.Value]; ok { + p.next() + expr := p.parseExpression(op.precedence) + node := &UnaryNode{ + Operator: token.Value, + Node: expr, + } + node.SetLocation(token.Location) + return p.parsePostfixExpression(node) + } + } + + if token.Is(Bracket, "(") { + p.next() + expr := p.parseExpression(0) + p.expect(Bracket, ")") // "an opened parenthesis is not properly closed" + return p.parsePostfixExpression(expr) + } + + if p.depth > 0 { + if token.Is(Operator, "#") || token.Is(Operator, ".") { + if token.Is(Operator, "#") { + p.next() + } + node := &PointerNode{} + node.SetLocation(token.Location) + return p.parsePostfixExpression(node) + } + } else { + if token.Is(Operator, "#") || token.Is(Operator, ".") { + p.error("cannot use pointer accessor outside closure") + } + } + + return p.parsePrimaryExpression() +} + +func (p *parser) parseConditionalExpression(node Node) Node { + var expr1, expr2 Node + for p.current.Is(Operator, "?") && p.err == nil { + p.next() + + if !p.current.Is(Operator, ":") { + expr1 = p.parseExpression(0) + p.expect(Operator, ":") + expr2 = p.parseExpression(0) + } else { + p.next() + expr1 = node + expr2 = p.parseExpression(0) + } + + node = &ConditionalNode{ + Cond: node, + Exp1: expr1, + Exp2: expr2, + } + } + return node +} + +func (p *parser) parsePrimaryExpression() Node { + var node Node + token := p.current + + switch token.Kind { + + case Identifier: + p.next() + switch token.Value { + case "true": + node := &BoolNode{Value: true} + node.SetLocation(token.Location) + return node + case "false": + node := &BoolNode{Value: false} + node.SetLocation(token.Location) + return node + case "nil": + node := &NilNode{} + node.SetLocation(token.Location) + return node + default: + node = p.parseIdentifierExpression(token) + } + + case Number: + p.next() + value := strings.Replace(token.Value, "_", "", -1) + if strings.ContainsAny(value, ".eE") { + number, err := strconv.ParseFloat(value, 64) + if err != nil { + p.error("invalid float literal: %v", err) + } + node := &FloatNode{Value: number} + node.SetLocation(token.Location) + return node + } else if strings.Contains(value, "x") { + number, err := strconv.ParseInt(value, 0, 64) + if err != nil { + p.error("invalid hex literal: %v", err) + } + node := &IntegerNode{Value: int(number)} + node.SetLocation(token.Location) + return node + } else { + number, err := strconv.ParseInt(value, 10, 64) + if err != nil { + p.error("invalid integer literal: %v", err) + } + node := &IntegerNode{Value: int(number)} + node.SetLocation(token.Location) + return node + } + + case String: + p.next() + node := &StringNode{Value: token.Value} + node.SetLocation(token.Location) + return node + + default: + if token.Is(Bracket, "[") { + node = p.parseArrayExpression(token) + } else if token.Is(Bracket, "{") { + node = p.parseMapExpression(token) + } else { + p.error("unexpected token %v", token) + } + } + + return p.parsePostfixExpression(node) +} + +func (p *parser) parseIdentifierExpression(token Token) Node { + var node Node + if p.current.Is(Bracket, "(") { + var arguments []Node + + if b, ok := builtins[token.Value]; ok { + p.expect(Bracket, "(") + // TODO: Add builtins signatures. + if b.arity == 1 { + arguments = make([]Node, 1) + arguments[0] = p.parseExpression(0) + } else if b.arity == 2 { + arguments = make([]Node, 2) + arguments[0] = p.parseExpression(0) + p.expect(Operator, ",") + arguments[1] = p.parseClosure() + } + p.expect(Bracket, ")") + + node = &BuiltinNode{ + Name: token.Value, + Arguments: arguments, + } + node.SetLocation(token.Location) + } else { + arguments = p.parseArguments() + node = &FunctionNode{ + Name: token.Value, + Arguments: arguments, + } + node.SetLocation(token.Location) + } + } else { + node = &IdentifierNode{Value: token.Value} + node.SetLocation(token.Location) + } + return node +} + +func (p *parser) parseClosure() Node { + token := p.current + p.expect(Bracket, "{") + + p.depth++ + node := p.parseExpression(0) + p.depth-- + + p.expect(Bracket, "}") + closure := &ClosureNode{ + Node: node, + } + closure.SetLocation(token.Location) + return closure +} + +func (p *parser) parseArrayExpression(token Token) Node { + nodes := make([]Node, 0) + + p.expect(Bracket, "[") + for !p.current.Is(Bracket, "]") && p.err == nil { + if len(nodes) > 0 { + p.expect(Operator, ",") + if p.current.Is(Bracket, "]") { + goto end + } + } + node := p.parseExpression(0) + nodes = append(nodes, node) + } +end: + p.expect(Bracket, "]") + + node := &ArrayNode{Nodes: nodes} + node.SetLocation(token.Location) + return node +} + +func (p *parser) parseMapExpression(token Token) Node { + p.expect(Bracket, "{") + + nodes := make([]Node, 0) + for !p.current.Is(Bracket, "}") && p.err == nil { + if len(nodes) > 0 { + p.expect(Operator, ",") + if p.current.Is(Bracket, "}") { + goto end + } + if p.current.Is(Operator, ",") { + p.error("unexpected token %v", p.current) + } + } + + var key Node + // a map key can be: + // * a number + // * a string + // * a identifier, which is equivalent to a string + // * an expression, which must be enclosed in parentheses -- (1 + 2) + if p.current.Is(Number) || p.current.Is(String) || p.current.Is(Identifier) { + key = &StringNode{Value: p.current.Value} + key.SetLocation(token.Location) + p.next() + } else if p.current.Is(Bracket, "(") { + key = p.parseExpression(0) + } else { + p.error("a map key must be a quoted string, a number, a identifier, or an expression enclosed in parentheses (unexpected token %v)", p.current) + } + + p.expect(Operator, ":") + + node := p.parseExpression(0) + pair := &PairNode{Key: key, Value: node} + pair.SetLocation(token.Location) + nodes = append(nodes, pair) + } + +end: + p.expect(Bracket, "}") + + node := &MapNode{Pairs: nodes} + node.SetLocation(token.Location) + return node +} + +func (p *parser) parsePostfixExpression(node Node) Node { + token := p.current + for (token.Is(Operator) || token.Is(Bracket)) && p.err == nil { + if token.Value == "." { + p.next() + + token = p.current + p.next() + + if token.Kind != Identifier && + // Operators like "not" and "matches" are valid methods or property names. + (token.Kind != Operator || !isValidIdentifier(token.Value)) { + p.error("expected name") + } + + if p.current.Is(Bracket, "(") { + arguments := p.parseArguments() + node = &MethodNode{ + Node: node, + Method: token.Value, + Arguments: arguments, + } + node.SetLocation(token.Location) + } else { + node = &PropertyNode{ + Node: node, + Property: token.Value, + } + node.SetLocation(token.Location) + } + + } else if token.Value == "[" { + p.next() + var from, to Node + + if p.current.Is(Operator, ":") { // slice without from [:1] + p.next() + + if !p.current.Is(Bracket, "]") { // slice without from and to [:] + to = p.parseExpression(0) + } + + node = &SliceNode{ + Node: node, + To: to, + } + node.SetLocation(token.Location) + p.expect(Bracket, "]") + + } else { + + from = p.parseExpression(0) + + if p.current.Is(Operator, ":") { + p.next() + + if !p.current.Is(Bracket, "]") { // slice without to [1:] + to = p.parseExpression(0) + } + + node = &SliceNode{ + Node: node, + From: from, + To: to, + } + node.SetLocation(token.Location) + p.expect(Bracket, "]") + + } else { + // Slice operator [:] was not found, it should by just index node. + + node = &IndexNode{ + Node: node, + Index: from, + } + node.SetLocation(token.Location) + p.expect(Bracket, "]") + } + } + + } else { + break + } + + token = p.current + } + return node +} + +func isValidIdentifier(str string) bool { + if len(str) == 0 { + return false + } + h, w := utf8.DecodeRuneInString(str) + if !IsAlphabetic(h) { + return false + } + for _, r := range str[w:] { + if !IsAlphaNumeric(r) { + return false + } + } + return true +} + +func (p *parser) parseArguments() []Node { + p.expect(Bracket, "(") + nodes := make([]Node, 0) + for !p.current.Is(Bracket, ")") && p.err == nil { + if len(nodes) > 0 { + p.expect(Operator, ",") + } + node := p.parseExpression(0) + nodes = append(nodes, node) + } + p.expect(Bracket, ")") + + return nodes +} diff --git a/vendor/github.com/antonmedv/expr/vm/helpers.go b/vendor/github.com/antonmedv/expr/vm/helpers.go new file mode 100644 index 00000000000..775b0e759fa --- /dev/null +++ b/vendor/github.com/antonmedv/expr/vm/helpers.go @@ -0,0 +1,3247 @@ +// Code generated by vm/generate/main.go. DO NOT EDIT. + +package vm + +import ( + "fmt" + "reflect" +) + +func equal(a, b interface{}) interface{} { + switch x := a.(type) { + case uint: + switch y := b.(type) { + case uint: + return x == y + case uint8: + return uint8(x) == y + case uint16: + return uint16(x) == y + case uint32: + return uint32(x) == y + case uint64: + return uint64(x) == y + case int: + return int(x) == y + case int8: + return int8(x) == y + case int16: + return int16(x) == y + case int32: + return int32(x) == y + case int64: + return int64(x) == y + case float32: + return float32(x) == y + case float64: + return float64(x) == y + } + case uint8: + switch y := b.(type) { + case uint: + return x == uint8(y) + case uint8: + return x == y + case uint16: + return uint16(x) == y + case uint32: + return uint32(x) == y + case uint64: + return uint64(x) == y + case int: + return int(x) == y + case int8: + return int8(x) == y + case int16: + return int16(x) == y + case int32: + return int32(x) == y + case int64: + return int64(x) == y + case float32: + return float32(x) == y + case float64: + return float64(x) == y + } + case uint16: + switch y := b.(type) { + case uint: + return x == uint16(y) + case uint8: + return x == uint16(y) + case uint16: + return x == y + case uint32: + return uint32(x) == y + case uint64: + return uint64(x) == y + case int: + return int(x) == y + case int8: + return int8(x) == y + case int16: + return int16(x) == y + case int32: + return int32(x) == y + case int64: + return int64(x) == y + case float32: + return float32(x) == y + case float64: + return float64(x) == y + } + case uint32: + switch y := b.(type) { + case uint: + return x == uint32(y) + case uint8: + return x == uint32(y) + case uint16: + return x == uint32(y) + case uint32: + return x == y + case uint64: + return uint64(x) == y + case int: + return int(x) == y + case int8: + return int8(x) == y + case int16: + return int16(x) == y + case int32: + return int32(x) == y + case int64: + return int64(x) == y + case float32: + return float32(x) == y + case float64: + return float64(x) == y + } + case uint64: + switch y := b.(type) { + case uint: + return x == uint64(y) + case uint8: + return x == uint64(y) + case uint16: + return x == uint64(y) + case uint32: + return x == uint64(y) + case uint64: + return x == y + case int: + return int(x) == y + case int8: + return int8(x) == y + case int16: + return int16(x) == y + case int32: + return int32(x) == y + case int64: + return int64(x) == y + case float32: + return float32(x) == y + case float64: + return float64(x) == y + } + case int: + switch y := b.(type) { + case uint: + return x == int(y) + case uint8: + return x == int(y) + case uint16: + return x == int(y) + case uint32: + return x == int(y) + case uint64: + return x == int(y) + case int: + return x == y + case int8: + return int8(x) == y + case int16: + return int16(x) == y + case int32: + return int32(x) == y + case int64: + return int64(x) == y + case float32: + return float32(x) == y + case float64: + return float64(x) == y + } + case int8: + switch y := b.(type) { + case uint: + return x == int8(y) + case uint8: + return x == int8(y) + case uint16: + return x == int8(y) + case uint32: + return x == int8(y) + case uint64: + return x == int8(y) + case int: + return x == int8(y) + case int8: + return x == y + case int16: + return int16(x) == y + case int32: + return int32(x) == y + case int64: + return int64(x) == y + case float32: + return float32(x) == y + case float64: + return float64(x) == y + } + case int16: + switch y := b.(type) { + case uint: + return x == int16(y) + case uint8: + return x == int16(y) + case uint16: + return x == int16(y) + case uint32: + return x == int16(y) + case uint64: + return x == int16(y) + case int: + return x == int16(y) + case int8: + return x == int16(y) + case int16: + return x == y + case int32: + return int32(x) == y + case int64: + return int64(x) == y + case float32: + return float32(x) == y + case float64: + return float64(x) == y + } + case int32: + switch y := b.(type) { + case uint: + return x == int32(y) + case uint8: + return x == int32(y) + case uint16: + return x == int32(y) + case uint32: + return x == int32(y) + case uint64: + return x == int32(y) + case int: + return x == int32(y) + case int8: + return x == int32(y) + case int16: + return x == int32(y) + case int32: + return x == y + case int64: + return int64(x) == y + case float32: + return float32(x) == y + case float64: + return float64(x) == y + } + case int64: + switch y := b.(type) { + case uint: + return x == int64(y) + case uint8: + return x == int64(y) + case uint16: + return x == int64(y) + case uint32: + return x == int64(y) + case uint64: + return x == int64(y) + case int: + return x == int64(y) + case int8: + return x == int64(y) + case int16: + return x == int64(y) + case int32: + return x == int64(y) + case int64: + return x == y + case float32: + return float32(x) == y + case float64: + return float64(x) == y + } + case float32: + switch y := b.(type) { + case uint: + return x == float32(y) + case uint8: + return x == float32(y) + case uint16: + return x == float32(y) + case uint32: + return x == float32(y) + case uint64: + return x == float32(y) + case int: + return x == float32(y) + case int8: + return x == float32(y) + case int16: + return x == float32(y) + case int32: + return x == float32(y) + case int64: + return x == float32(y) + case float32: + return x == y + case float64: + return float64(x) == y + } + case float64: + switch y := b.(type) { + case uint: + return x == float64(y) + case uint8: + return x == float64(y) + case uint16: + return x == float64(y) + case uint32: + return x == float64(y) + case uint64: + return x == float64(y) + case int: + return x == float64(y) + case int8: + return x == float64(y) + case int16: + return x == float64(y) + case int32: + return x == float64(y) + case int64: + return x == float64(y) + case float32: + return x == float64(y) + case float64: + return x == y + } + case string: + switch y := b.(type) { + case string: + return x == y + } + } + if isNil(a) && isNil(b) { + return true + } + return reflect.DeepEqual(a, b) +} + +func less(a, b interface{}) interface{} { + switch x := a.(type) { + case uint: + switch y := b.(type) { + case uint: + return x < y + case uint8: + return uint8(x) < y + case uint16: + return uint16(x) < y + case uint32: + return uint32(x) < y + case uint64: + return uint64(x) < y + case int: + return int(x) < y + case int8: + return int8(x) < y + case int16: + return int16(x) < y + case int32: + return int32(x) < y + case int64: + return int64(x) < y + case float32: + return float32(x) < y + case float64: + return float64(x) < y + } + case uint8: + switch y := b.(type) { + case uint: + return x < uint8(y) + case uint8: + return x < y + case uint16: + return uint16(x) < y + case uint32: + return uint32(x) < y + case uint64: + return uint64(x) < y + case int: + return int(x) < y + case int8: + return int8(x) < y + case int16: + return int16(x) < y + case int32: + return int32(x) < y + case int64: + return int64(x) < y + case float32: + return float32(x) < y + case float64: + return float64(x) < y + } + case uint16: + switch y := b.(type) { + case uint: + return x < uint16(y) + case uint8: + return x < uint16(y) + case uint16: + return x < y + case uint32: + return uint32(x) < y + case uint64: + return uint64(x) < y + case int: + return int(x) < y + case int8: + return int8(x) < y + case int16: + return int16(x) < y + case int32: + return int32(x) < y + case int64: + return int64(x) < y + case float32: + return float32(x) < y + case float64: + return float64(x) < y + } + case uint32: + switch y := b.(type) { + case uint: + return x < uint32(y) + case uint8: + return x < uint32(y) + case uint16: + return x < uint32(y) + case uint32: + return x < y + case uint64: + return uint64(x) < y + case int: + return int(x) < y + case int8: + return int8(x) < y + case int16: + return int16(x) < y + case int32: + return int32(x) < y + case int64: + return int64(x) < y + case float32: + return float32(x) < y + case float64: + return float64(x) < y + } + case uint64: + switch y := b.(type) { + case uint: + return x < uint64(y) + case uint8: + return x < uint64(y) + case uint16: + return x < uint64(y) + case uint32: + return x < uint64(y) + case uint64: + return x < y + case int: + return int(x) < y + case int8: + return int8(x) < y + case int16: + return int16(x) < y + case int32: + return int32(x) < y + case int64: + return int64(x) < y + case float32: + return float32(x) < y + case float64: + return float64(x) < y + } + case int: + switch y := b.(type) { + case uint: + return x < int(y) + case uint8: + return x < int(y) + case uint16: + return x < int(y) + case uint32: + return x < int(y) + case uint64: + return x < int(y) + case int: + return x < y + case int8: + return int8(x) < y + case int16: + return int16(x) < y + case int32: + return int32(x) < y + case int64: + return int64(x) < y + case float32: + return float32(x) < y + case float64: + return float64(x) < y + } + case int8: + switch y := b.(type) { + case uint: + return x < int8(y) + case uint8: + return x < int8(y) + case uint16: + return x < int8(y) + case uint32: + return x < int8(y) + case uint64: + return x < int8(y) + case int: + return x < int8(y) + case int8: + return x < y + case int16: + return int16(x) < y + case int32: + return int32(x) < y + case int64: + return int64(x) < y + case float32: + return float32(x) < y + case float64: + return float64(x) < y + } + case int16: + switch y := b.(type) { + case uint: + return x < int16(y) + case uint8: + return x < int16(y) + case uint16: + return x < int16(y) + case uint32: + return x < int16(y) + case uint64: + return x < int16(y) + case int: + return x < int16(y) + case int8: + return x < int16(y) + case int16: + return x < y + case int32: + return int32(x) < y + case int64: + return int64(x) < y + case float32: + return float32(x) < y + case float64: + return float64(x) < y + } + case int32: + switch y := b.(type) { + case uint: + return x < int32(y) + case uint8: + return x < int32(y) + case uint16: + return x < int32(y) + case uint32: + return x < int32(y) + case uint64: + return x < int32(y) + case int: + return x < int32(y) + case int8: + return x < int32(y) + case int16: + return x < int32(y) + case int32: + return x < y + case int64: + return int64(x) < y + case float32: + return float32(x) < y + case float64: + return float64(x) < y + } + case int64: + switch y := b.(type) { + case uint: + return x < int64(y) + case uint8: + return x < int64(y) + case uint16: + return x < int64(y) + case uint32: + return x < int64(y) + case uint64: + return x < int64(y) + case int: + return x < int64(y) + case int8: + return x < int64(y) + case int16: + return x < int64(y) + case int32: + return x < int64(y) + case int64: + return x < y + case float32: + return float32(x) < y + case float64: + return float64(x) < y + } + case float32: + switch y := b.(type) { + case uint: + return x < float32(y) + case uint8: + return x < float32(y) + case uint16: + return x < float32(y) + case uint32: + return x < float32(y) + case uint64: + return x < float32(y) + case int: + return x < float32(y) + case int8: + return x < float32(y) + case int16: + return x < float32(y) + case int32: + return x < float32(y) + case int64: + return x < float32(y) + case float32: + return x < y + case float64: + return float64(x) < y + } + case float64: + switch y := b.(type) { + case uint: + return x < float64(y) + case uint8: + return x < float64(y) + case uint16: + return x < float64(y) + case uint32: + return x < float64(y) + case uint64: + return x < float64(y) + case int: + return x < float64(y) + case int8: + return x < float64(y) + case int16: + return x < float64(y) + case int32: + return x < float64(y) + case int64: + return x < float64(y) + case float32: + return x < float64(y) + case float64: + return x < y + } + case string: + switch y := b.(type) { + case string: + return x < y + } + } + panic(fmt.Sprintf("invalid operation: %T %v %T", a, "<", b)) +} + +func more(a, b interface{}) interface{} { + switch x := a.(type) { + case uint: + switch y := b.(type) { + case uint: + return x > y + case uint8: + return uint8(x) > y + case uint16: + return uint16(x) > y + case uint32: + return uint32(x) > y + case uint64: + return uint64(x) > y + case int: + return int(x) > y + case int8: + return int8(x) > y + case int16: + return int16(x) > y + case int32: + return int32(x) > y + case int64: + return int64(x) > y + case float32: + return float32(x) > y + case float64: + return float64(x) > y + } + case uint8: + switch y := b.(type) { + case uint: + return x > uint8(y) + case uint8: + return x > y + case uint16: + return uint16(x) > y + case uint32: + return uint32(x) > y + case uint64: + return uint64(x) > y + case int: + return int(x) > y + case int8: + return int8(x) > y + case int16: + return int16(x) > y + case int32: + return int32(x) > y + case int64: + return int64(x) > y + case float32: + return float32(x) > y + case float64: + return float64(x) > y + } + case uint16: + switch y := b.(type) { + case uint: + return x > uint16(y) + case uint8: + return x > uint16(y) + case uint16: + return x > y + case uint32: + return uint32(x) > y + case uint64: + return uint64(x) > y + case int: + return int(x) > y + case int8: + return int8(x) > y + case int16: + return int16(x) > y + case int32: + return int32(x) > y + case int64: + return int64(x) > y + case float32: + return float32(x) > y + case float64: + return float64(x) > y + } + case uint32: + switch y := b.(type) { + case uint: + return x > uint32(y) + case uint8: + return x > uint32(y) + case uint16: + return x > uint32(y) + case uint32: + return x > y + case uint64: + return uint64(x) > y + case int: + return int(x) > y + case int8: + return int8(x) > y + case int16: + return int16(x) > y + case int32: + return int32(x) > y + case int64: + return int64(x) > y + case float32: + return float32(x) > y + case float64: + return float64(x) > y + } + case uint64: + switch y := b.(type) { + case uint: + return x > uint64(y) + case uint8: + return x > uint64(y) + case uint16: + return x > uint64(y) + case uint32: + return x > uint64(y) + case uint64: + return x > y + case int: + return int(x) > y + case int8: + return int8(x) > y + case int16: + return int16(x) > y + case int32: + return int32(x) > y + case int64: + return int64(x) > y + case float32: + return float32(x) > y + case float64: + return float64(x) > y + } + case int: + switch y := b.(type) { + case uint: + return x > int(y) + case uint8: + return x > int(y) + case uint16: + return x > int(y) + case uint32: + return x > int(y) + case uint64: + return x > int(y) + case int: + return x > y + case int8: + return int8(x) > y + case int16: + return int16(x) > y + case int32: + return int32(x) > y + case int64: + return int64(x) > y + case float32: + return float32(x) > y + case float64: + return float64(x) > y + } + case int8: + switch y := b.(type) { + case uint: + return x > int8(y) + case uint8: + return x > int8(y) + case uint16: + return x > int8(y) + case uint32: + return x > int8(y) + case uint64: + return x > int8(y) + case int: + return x > int8(y) + case int8: + return x > y + case int16: + return int16(x) > y + case int32: + return int32(x) > y + case int64: + return int64(x) > y + case float32: + return float32(x) > y + case float64: + return float64(x) > y + } + case int16: + switch y := b.(type) { + case uint: + return x > int16(y) + case uint8: + return x > int16(y) + case uint16: + return x > int16(y) + case uint32: + return x > int16(y) + case uint64: + return x > int16(y) + case int: + return x > int16(y) + case int8: + return x > int16(y) + case int16: + return x > y + case int32: + return int32(x) > y + case int64: + return int64(x) > y + case float32: + return float32(x) > y + case float64: + return float64(x) > y + } + case int32: + switch y := b.(type) { + case uint: + return x > int32(y) + case uint8: + return x > int32(y) + case uint16: + return x > int32(y) + case uint32: + return x > int32(y) + case uint64: + return x > int32(y) + case int: + return x > int32(y) + case int8: + return x > int32(y) + case int16: + return x > int32(y) + case int32: + return x > y + case int64: + return int64(x) > y + case float32: + return float32(x) > y + case float64: + return float64(x) > y + } + case int64: + switch y := b.(type) { + case uint: + return x > int64(y) + case uint8: + return x > int64(y) + case uint16: + return x > int64(y) + case uint32: + return x > int64(y) + case uint64: + return x > int64(y) + case int: + return x > int64(y) + case int8: + return x > int64(y) + case int16: + return x > int64(y) + case int32: + return x > int64(y) + case int64: + return x > y + case float32: + return float32(x) > y + case float64: + return float64(x) > y + } + case float32: + switch y := b.(type) { + case uint: + return x > float32(y) + case uint8: + return x > float32(y) + case uint16: + return x > float32(y) + case uint32: + return x > float32(y) + case uint64: + return x > float32(y) + case int: + return x > float32(y) + case int8: + return x > float32(y) + case int16: + return x > float32(y) + case int32: + return x > float32(y) + case int64: + return x > float32(y) + case float32: + return x > y + case float64: + return float64(x) > y + } + case float64: + switch y := b.(type) { + case uint: + return x > float64(y) + case uint8: + return x > float64(y) + case uint16: + return x > float64(y) + case uint32: + return x > float64(y) + case uint64: + return x > float64(y) + case int: + return x > float64(y) + case int8: + return x > float64(y) + case int16: + return x > float64(y) + case int32: + return x > float64(y) + case int64: + return x > float64(y) + case float32: + return x > float64(y) + case float64: + return x > y + } + case string: + switch y := b.(type) { + case string: + return x > y + } + } + panic(fmt.Sprintf("invalid operation: %T %v %T", a, ">", b)) +} + +func lessOrEqual(a, b interface{}) interface{} { + switch x := a.(type) { + case uint: + switch y := b.(type) { + case uint: + return x <= y + case uint8: + return uint8(x) <= y + case uint16: + return uint16(x) <= y + case uint32: + return uint32(x) <= y + case uint64: + return uint64(x) <= y + case int: + return int(x) <= y + case int8: + return int8(x) <= y + case int16: + return int16(x) <= y + case int32: + return int32(x) <= y + case int64: + return int64(x) <= y + case float32: + return float32(x) <= y + case float64: + return float64(x) <= y + } + case uint8: + switch y := b.(type) { + case uint: + return x <= uint8(y) + case uint8: + return x <= y + case uint16: + return uint16(x) <= y + case uint32: + return uint32(x) <= y + case uint64: + return uint64(x) <= y + case int: + return int(x) <= y + case int8: + return int8(x) <= y + case int16: + return int16(x) <= y + case int32: + return int32(x) <= y + case int64: + return int64(x) <= y + case float32: + return float32(x) <= y + case float64: + return float64(x) <= y + } + case uint16: + switch y := b.(type) { + case uint: + return x <= uint16(y) + case uint8: + return x <= uint16(y) + case uint16: + return x <= y + case uint32: + return uint32(x) <= y + case uint64: + return uint64(x) <= y + case int: + return int(x) <= y + case int8: + return int8(x) <= y + case int16: + return int16(x) <= y + case int32: + return int32(x) <= y + case int64: + return int64(x) <= y + case float32: + return float32(x) <= y + case float64: + return float64(x) <= y + } + case uint32: + switch y := b.(type) { + case uint: + return x <= uint32(y) + case uint8: + return x <= uint32(y) + case uint16: + return x <= uint32(y) + case uint32: + return x <= y + case uint64: + return uint64(x) <= y + case int: + return int(x) <= y + case int8: + return int8(x) <= y + case int16: + return int16(x) <= y + case int32: + return int32(x) <= y + case int64: + return int64(x) <= y + case float32: + return float32(x) <= y + case float64: + return float64(x) <= y + } + case uint64: + switch y := b.(type) { + case uint: + return x <= uint64(y) + case uint8: + return x <= uint64(y) + case uint16: + return x <= uint64(y) + case uint32: + return x <= uint64(y) + case uint64: + return x <= y + case int: + return int(x) <= y + case int8: + return int8(x) <= y + case int16: + return int16(x) <= y + case int32: + return int32(x) <= y + case int64: + return int64(x) <= y + case float32: + return float32(x) <= y + case float64: + return float64(x) <= y + } + case int: + switch y := b.(type) { + case uint: + return x <= int(y) + case uint8: + return x <= int(y) + case uint16: + return x <= int(y) + case uint32: + return x <= int(y) + case uint64: + return x <= int(y) + case int: + return x <= y + case int8: + return int8(x) <= y + case int16: + return int16(x) <= y + case int32: + return int32(x) <= y + case int64: + return int64(x) <= y + case float32: + return float32(x) <= y + case float64: + return float64(x) <= y + } + case int8: + switch y := b.(type) { + case uint: + return x <= int8(y) + case uint8: + return x <= int8(y) + case uint16: + return x <= int8(y) + case uint32: + return x <= int8(y) + case uint64: + return x <= int8(y) + case int: + return x <= int8(y) + case int8: + return x <= y + case int16: + return int16(x) <= y + case int32: + return int32(x) <= y + case int64: + return int64(x) <= y + case float32: + return float32(x) <= y + case float64: + return float64(x) <= y + } + case int16: + switch y := b.(type) { + case uint: + return x <= int16(y) + case uint8: + return x <= int16(y) + case uint16: + return x <= int16(y) + case uint32: + return x <= int16(y) + case uint64: + return x <= int16(y) + case int: + return x <= int16(y) + case int8: + return x <= int16(y) + case int16: + return x <= y + case int32: + return int32(x) <= y + case int64: + return int64(x) <= y + case float32: + return float32(x) <= y + case float64: + return float64(x) <= y + } + case int32: + switch y := b.(type) { + case uint: + return x <= int32(y) + case uint8: + return x <= int32(y) + case uint16: + return x <= int32(y) + case uint32: + return x <= int32(y) + case uint64: + return x <= int32(y) + case int: + return x <= int32(y) + case int8: + return x <= int32(y) + case int16: + return x <= int32(y) + case int32: + return x <= y + case int64: + return int64(x) <= y + case float32: + return float32(x) <= y + case float64: + return float64(x) <= y + } + case int64: + switch y := b.(type) { + case uint: + return x <= int64(y) + case uint8: + return x <= int64(y) + case uint16: + return x <= int64(y) + case uint32: + return x <= int64(y) + case uint64: + return x <= int64(y) + case int: + return x <= int64(y) + case int8: + return x <= int64(y) + case int16: + return x <= int64(y) + case int32: + return x <= int64(y) + case int64: + return x <= y + case float32: + return float32(x) <= y + case float64: + return float64(x) <= y + } + case float32: + switch y := b.(type) { + case uint: + return x <= float32(y) + case uint8: + return x <= float32(y) + case uint16: + return x <= float32(y) + case uint32: + return x <= float32(y) + case uint64: + return x <= float32(y) + case int: + return x <= float32(y) + case int8: + return x <= float32(y) + case int16: + return x <= float32(y) + case int32: + return x <= float32(y) + case int64: + return x <= float32(y) + case float32: + return x <= y + case float64: + return float64(x) <= y + } + case float64: + switch y := b.(type) { + case uint: + return x <= float64(y) + case uint8: + return x <= float64(y) + case uint16: + return x <= float64(y) + case uint32: + return x <= float64(y) + case uint64: + return x <= float64(y) + case int: + return x <= float64(y) + case int8: + return x <= float64(y) + case int16: + return x <= float64(y) + case int32: + return x <= float64(y) + case int64: + return x <= float64(y) + case float32: + return x <= float64(y) + case float64: + return x <= y + } + case string: + switch y := b.(type) { + case string: + return x <= y + } + } + panic(fmt.Sprintf("invalid operation: %T %v %T", a, "<=", b)) +} + +func moreOrEqual(a, b interface{}) interface{} { + switch x := a.(type) { + case uint: + switch y := b.(type) { + case uint: + return x >= y + case uint8: + return uint8(x) >= y + case uint16: + return uint16(x) >= y + case uint32: + return uint32(x) >= y + case uint64: + return uint64(x) >= y + case int: + return int(x) >= y + case int8: + return int8(x) >= y + case int16: + return int16(x) >= y + case int32: + return int32(x) >= y + case int64: + return int64(x) >= y + case float32: + return float32(x) >= y + case float64: + return float64(x) >= y + } + case uint8: + switch y := b.(type) { + case uint: + return x >= uint8(y) + case uint8: + return x >= y + case uint16: + return uint16(x) >= y + case uint32: + return uint32(x) >= y + case uint64: + return uint64(x) >= y + case int: + return int(x) >= y + case int8: + return int8(x) >= y + case int16: + return int16(x) >= y + case int32: + return int32(x) >= y + case int64: + return int64(x) >= y + case float32: + return float32(x) >= y + case float64: + return float64(x) >= y + } + case uint16: + switch y := b.(type) { + case uint: + return x >= uint16(y) + case uint8: + return x >= uint16(y) + case uint16: + return x >= y + case uint32: + return uint32(x) >= y + case uint64: + return uint64(x) >= y + case int: + return int(x) >= y + case int8: + return int8(x) >= y + case int16: + return int16(x) >= y + case int32: + return int32(x) >= y + case int64: + return int64(x) >= y + case float32: + return float32(x) >= y + case float64: + return float64(x) >= y + } + case uint32: + switch y := b.(type) { + case uint: + return x >= uint32(y) + case uint8: + return x >= uint32(y) + case uint16: + return x >= uint32(y) + case uint32: + return x >= y + case uint64: + return uint64(x) >= y + case int: + return int(x) >= y + case int8: + return int8(x) >= y + case int16: + return int16(x) >= y + case int32: + return int32(x) >= y + case int64: + return int64(x) >= y + case float32: + return float32(x) >= y + case float64: + return float64(x) >= y + } + case uint64: + switch y := b.(type) { + case uint: + return x >= uint64(y) + case uint8: + return x >= uint64(y) + case uint16: + return x >= uint64(y) + case uint32: + return x >= uint64(y) + case uint64: + return x >= y + case int: + return int(x) >= y + case int8: + return int8(x) >= y + case int16: + return int16(x) >= y + case int32: + return int32(x) >= y + case int64: + return int64(x) >= y + case float32: + return float32(x) >= y + case float64: + return float64(x) >= y + } + case int: + switch y := b.(type) { + case uint: + return x >= int(y) + case uint8: + return x >= int(y) + case uint16: + return x >= int(y) + case uint32: + return x >= int(y) + case uint64: + return x >= int(y) + case int: + return x >= y + case int8: + return int8(x) >= y + case int16: + return int16(x) >= y + case int32: + return int32(x) >= y + case int64: + return int64(x) >= y + case float32: + return float32(x) >= y + case float64: + return float64(x) >= y + } + case int8: + switch y := b.(type) { + case uint: + return x >= int8(y) + case uint8: + return x >= int8(y) + case uint16: + return x >= int8(y) + case uint32: + return x >= int8(y) + case uint64: + return x >= int8(y) + case int: + return x >= int8(y) + case int8: + return x >= y + case int16: + return int16(x) >= y + case int32: + return int32(x) >= y + case int64: + return int64(x) >= y + case float32: + return float32(x) >= y + case float64: + return float64(x) >= y + } + case int16: + switch y := b.(type) { + case uint: + return x >= int16(y) + case uint8: + return x >= int16(y) + case uint16: + return x >= int16(y) + case uint32: + return x >= int16(y) + case uint64: + return x >= int16(y) + case int: + return x >= int16(y) + case int8: + return x >= int16(y) + case int16: + return x >= y + case int32: + return int32(x) >= y + case int64: + return int64(x) >= y + case float32: + return float32(x) >= y + case float64: + return float64(x) >= y + } + case int32: + switch y := b.(type) { + case uint: + return x >= int32(y) + case uint8: + return x >= int32(y) + case uint16: + return x >= int32(y) + case uint32: + return x >= int32(y) + case uint64: + return x >= int32(y) + case int: + return x >= int32(y) + case int8: + return x >= int32(y) + case int16: + return x >= int32(y) + case int32: + return x >= y + case int64: + return int64(x) >= y + case float32: + return float32(x) >= y + case float64: + return float64(x) >= y + } + case int64: + switch y := b.(type) { + case uint: + return x >= int64(y) + case uint8: + return x >= int64(y) + case uint16: + return x >= int64(y) + case uint32: + return x >= int64(y) + case uint64: + return x >= int64(y) + case int: + return x >= int64(y) + case int8: + return x >= int64(y) + case int16: + return x >= int64(y) + case int32: + return x >= int64(y) + case int64: + return x >= y + case float32: + return float32(x) >= y + case float64: + return float64(x) >= y + } + case float32: + switch y := b.(type) { + case uint: + return x >= float32(y) + case uint8: + return x >= float32(y) + case uint16: + return x >= float32(y) + case uint32: + return x >= float32(y) + case uint64: + return x >= float32(y) + case int: + return x >= float32(y) + case int8: + return x >= float32(y) + case int16: + return x >= float32(y) + case int32: + return x >= float32(y) + case int64: + return x >= float32(y) + case float32: + return x >= y + case float64: + return float64(x) >= y + } + case float64: + switch y := b.(type) { + case uint: + return x >= float64(y) + case uint8: + return x >= float64(y) + case uint16: + return x >= float64(y) + case uint32: + return x >= float64(y) + case uint64: + return x >= float64(y) + case int: + return x >= float64(y) + case int8: + return x >= float64(y) + case int16: + return x >= float64(y) + case int32: + return x >= float64(y) + case int64: + return x >= float64(y) + case float32: + return x >= float64(y) + case float64: + return x >= y + } + case string: + switch y := b.(type) { + case string: + return x >= y + } + } + panic(fmt.Sprintf("invalid operation: %T %v %T", a, ">=", b)) +} + +func add(a, b interface{}) interface{} { + switch x := a.(type) { + case uint: + switch y := b.(type) { + case uint: + return x + y + case uint8: + return uint8(x) + y + case uint16: + return uint16(x) + y + case uint32: + return uint32(x) + y + case uint64: + return uint64(x) + y + case int: + return int(x) + y + case int8: + return int8(x) + y + case int16: + return int16(x) + y + case int32: + return int32(x) + y + case int64: + return int64(x) + y + case float32: + return float32(x) + y + case float64: + return float64(x) + y + } + case uint8: + switch y := b.(type) { + case uint: + return x + uint8(y) + case uint8: + return x + y + case uint16: + return uint16(x) + y + case uint32: + return uint32(x) + y + case uint64: + return uint64(x) + y + case int: + return int(x) + y + case int8: + return int8(x) + y + case int16: + return int16(x) + y + case int32: + return int32(x) + y + case int64: + return int64(x) + y + case float32: + return float32(x) + y + case float64: + return float64(x) + y + } + case uint16: + switch y := b.(type) { + case uint: + return x + uint16(y) + case uint8: + return x + uint16(y) + case uint16: + return x + y + case uint32: + return uint32(x) + y + case uint64: + return uint64(x) + y + case int: + return int(x) + y + case int8: + return int8(x) + y + case int16: + return int16(x) + y + case int32: + return int32(x) + y + case int64: + return int64(x) + y + case float32: + return float32(x) + y + case float64: + return float64(x) + y + } + case uint32: + switch y := b.(type) { + case uint: + return x + uint32(y) + case uint8: + return x + uint32(y) + case uint16: + return x + uint32(y) + case uint32: + return x + y + case uint64: + return uint64(x) + y + case int: + return int(x) + y + case int8: + return int8(x) + y + case int16: + return int16(x) + y + case int32: + return int32(x) + y + case int64: + return int64(x) + y + case float32: + return float32(x) + y + case float64: + return float64(x) + y + } + case uint64: + switch y := b.(type) { + case uint: + return x + uint64(y) + case uint8: + return x + uint64(y) + case uint16: + return x + uint64(y) + case uint32: + return x + uint64(y) + case uint64: + return x + y + case int: + return int(x) + y + case int8: + return int8(x) + y + case int16: + return int16(x) + y + case int32: + return int32(x) + y + case int64: + return int64(x) + y + case float32: + return float32(x) + y + case float64: + return float64(x) + y + } + case int: + switch y := b.(type) { + case uint: + return x + int(y) + case uint8: + return x + int(y) + case uint16: + return x + int(y) + case uint32: + return x + int(y) + case uint64: + return x + int(y) + case int: + return x + y + case int8: + return int8(x) + y + case int16: + return int16(x) + y + case int32: + return int32(x) + y + case int64: + return int64(x) + y + case float32: + return float32(x) + y + case float64: + return float64(x) + y + } + case int8: + switch y := b.(type) { + case uint: + return x + int8(y) + case uint8: + return x + int8(y) + case uint16: + return x + int8(y) + case uint32: + return x + int8(y) + case uint64: + return x + int8(y) + case int: + return x + int8(y) + case int8: + return x + y + case int16: + return int16(x) + y + case int32: + return int32(x) + y + case int64: + return int64(x) + y + case float32: + return float32(x) + y + case float64: + return float64(x) + y + } + case int16: + switch y := b.(type) { + case uint: + return x + int16(y) + case uint8: + return x + int16(y) + case uint16: + return x + int16(y) + case uint32: + return x + int16(y) + case uint64: + return x + int16(y) + case int: + return x + int16(y) + case int8: + return x + int16(y) + case int16: + return x + y + case int32: + return int32(x) + y + case int64: + return int64(x) + y + case float32: + return float32(x) + y + case float64: + return float64(x) + y + } + case int32: + switch y := b.(type) { + case uint: + return x + int32(y) + case uint8: + return x + int32(y) + case uint16: + return x + int32(y) + case uint32: + return x + int32(y) + case uint64: + return x + int32(y) + case int: + return x + int32(y) + case int8: + return x + int32(y) + case int16: + return x + int32(y) + case int32: + return x + y + case int64: + return int64(x) + y + case float32: + return float32(x) + y + case float64: + return float64(x) + y + } + case int64: + switch y := b.(type) { + case uint: + return x + int64(y) + case uint8: + return x + int64(y) + case uint16: + return x + int64(y) + case uint32: + return x + int64(y) + case uint64: + return x + int64(y) + case int: + return x + int64(y) + case int8: + return x + int64(y) + case int16: + return x + int64(y) + case int32: + return x + int64(y) + case int64: + return x + y + case float32: + return float32(x) + y + case float64: + return float64(x) + y + } + case float32: + switch y := b.(type) { + case uint: + return x + float32(y) + case uint8: + return x + float32(y) + case uint16: + return x + float32(y) + case uint32: + return x + float32(y) + case uint64: + return x + float32(y) + case int: + return x + float32(y) + case int8: + return x + float32(y) + case int16: + return x + float32(y) + case int32: + return x + float32(y) + case int64: + return x + float32(y) + case float32: + return x + y + case float64: + return float64(x) + y + } + case float64: + switch y := b.(type) { + case uint: + return x + float64(y) + case uint8: + return x + float64(y) + case uint16: + return x + float64(y) + case uint32: + return x + float64(y) + case uint64: + return x + float64(y) + case int: + return x + float64(y) + case int8: + return x + float64(y) + case int16: + return x + float64(y) + case int32: + return x + float64(y) + case int64: + return x + float64(y) + case float32: + return x + float64(y) + case float64: + return x + y + } + case string: + switch y := b.(type) { + case string: + return x + y + } + } + panic(fmt.Sprintf("invalid operation: %T %v %T", a, "+", b)) +} + +func subtract(a, b interface{}) interface{} { + switch x := a.(type) { + case uint: + switch y := b.(type) { + case uint: + return x - y + case uint8: + return uint8(x) - y + case uint16: + return uint16(x) - y + case uint32: + return uint32(x) - y + case uint64: + return uint64(x) - y + case int: + return int(x) - y + case int8: + return int8(x) - y + case int16: + return int16(x) - y + case int32: + return int32(x) - y + case int64: + return int64(x) - y + case float32: + return float32(x) - y + case float64: + return float64(x) - y + } + case uint8: + switch y := b.(type) { + case uint: + return x - uint8(y) + case uint8: + return x - y + case uint16: + return uint16(x) - y + case uint32: + return uint32(x) - y + case uint64: + return uint64(x) - y + case int: + return int(x) - y + case int8: + return int8(x) - y + case int16: + return int16(x) - y + case int32: + return int32(x) - y + case int64: + return int64(x) - y + case float32: + return float32(x) - y + case float64: + return float64(x) - y + } + case uint16: + switch y := b.(type) { + case uint: + return x - uint16(y) + case uint8: + return x - uint16(y) + case uint16: + return x - y + case uint32: + return uint32(x) - y + case uint64: + return uint64(x) - y + case int: + return int(x) - y + case int8: + return int8(x) - y + case int16: + return int16(x) - y + case int32: + return int32(x) - y + case int64: + return int64(x) - y + case float32: + return float32(x) - y + case float64: + return float64(x) - y + } + case uint32: + switch y := b.(type) { + case uint: + return x - uint32(y) + case uint8: + return x - uint32(y) + case uint16: + return x - uint32(y) + case uint32: + return x - y + case uint64: + return uint64(x) - y + case int: + return int(x) - y + case int8: + return int8(x) - y + case int16: + return int16(x) - y + case int32: + return int32(x) - y + case int64: + return int64(x) - y + case float32: + return float32(x) - y + case float64: + return float64(x) - y + } + case uint64: + switch y := b.(type) { + case uint: + return x - uint64(y) + case uint8: + return x - uint64(y) + case uint16: + return x - uint64(y) + case uint32: + return x - uint64(y) + case uint64: + return x - y + case int: + return int(x) - y + case int8: + return int8(x) - y + case int16: + return int16(x) - y + case int32: + return int32(x) - y + case int64: + return int64(x) - y + case float32: + return float32(x) - y + case float64: + return float64(x) - y + } + case int: + switch y := b.(type) { + case uint: + return x - int(y) + case uint8: + return x - int(y) + case uint16: + return x - int(y) + case uint32: + return x - int(y) + case uint64: + return x - int(y) + case int: + return x - y + case int8: + return int8(x) - y + case int16: + return int16(x) - y + case int32: + return int32(x) - y + case int64: + return int64(x) - y + case float32: + return float32(x) - y + case float64: + return float64(x) - y + } + case int8: + switch y := b.(type) { + case uint: + return x - int8(y) + case uint8: + return x - int8(y) + case uint16: + return x - int8(y) + case uint32: + return x - int8(y) + case uint64: + return x - int8(y) + case int: + return x - int8(y) + case int8: + return x - y + case int16: + return int16(x) - y + case int32: + return int32(x) - y + case int64: + return int64(x) - y + case float32: + return float32(x) - y + case float64: + return float64(x) - y + } + case int16: + switch y := b.(type) { + case uint: + return x - int16(y) + case uint8: + return x - int16(y) + case uint16: + return x - int16(y) + case uint32: + return x - int16(y) + case uint64: + return x - int16(y) + case int: + return x - int16(y) + case int8: + return x - int16(y) + case int16: + return x - y + case int32: + return int32(x) - y + case int64: + return int64(x) - y + case float32: + return float32(x) - y + case float64: + return float64(x) - y + } + case int32: + switch y := b.(type) { + case uint: + return x - int32(y) + case uint8: + return x - int32(y) + case uint16: + return x - int32(y) + case uint32: + return x - int32(y) + case uint64: + return x - int32(y) + case int: + return x - int32(y) + case int8: + return x - int32(y) + case int16: + return x - int32(y) + case int32: + return x - y + case int64: + return int64(x) - y + case float32: + return float32(x) - y + case float64: + return float64(x) - y + } + case int64: + switch y := b.(type) { + case uint: + return x - int64(y) + case uint8: + return x - int64(y) + case uint16: + return x - int64(y) + case uint32: + return x - int64(y) + case uint64: + return x - int64(y) + case int: + return x - int64(y) + case int8: + return x - int64(y) + case int16: + return x - int64(y) + case int32: + return x - int64(y) + case int64: + return x - y + case float32: + return float32(x) - y + case float64: + return float64(x) - y + } + case float32: + switch y := b.(type) { + case uint: + return x - float32(y) + case uint8: + return x - float32(y) + case uint16: + return x - float32(y) + case uint32: + return x - float32(y) + case uint64: + return x - float32(y) + case int: + return x - float32(y) + case int8: + return x - float32(y) + case int16: + return x - float32(y) + case int32: + return x - float32(y) + case int64: + return x - float32(y) + case float32: + return x - y + case float64: + return float64(x) - y + } + case float64: + switch y := b.(type) { + case uint: + return x - float64(y) + case uint8: + return x - float64(y) + case uint16: + return x - float64(y) + case uint32: + return x - float64(y) + case uint64: + return x - float64(y) + case int: + return x - float64(y) + case int8: + return x - float64(y) + case int16: + return x - float64(y) + case int32: + return x - float64(y) + case int64: + return x - float64(y) + case float32: + return x - float64(y) + case float64: + return x - y + } + } + panic(fmt.Sprintf("invalid operation: %T %v %T", a, "-", b)) +} + +func multiply(a, b interface{}) interface{} { + switch x := a.(type) { + case uint: + switch y := b.(type) { + case uint: + return x * y + case uint8: + return uint8(x) * y + case uint16: + return uint16(x) * y + case uint32: + return uint32(x) * y + case uint64: + return uint64(x) * y + case int: + return int(x) * y + case int8: + return int8(x) * y + case int16: + return int16(x) * y + case int32: + return int32(x) * y + case int64: + return int64(x) * y + case float32: + return float32(x) * y + case float64: + return float64(x) * y + } + case uint8: + switch y := b.(type) { + case uint: + return x * uint8(y) + case uint8: + return x * y + case uint16: + return uint16(x) * y + case uint32: + return uint32(x) * y + case uint64: + return uint64(x) * y + case int: + return int(x) * y + case int8: + return int8(x) * y + case int16: + return int16(x) * y + case int32: + return int32(x) * y + case int64: + return int64(x) * y + case float32: + return float32(x) * y + case float64: + return float64(x) * y + } + case uint16: + switch y := b.(type) { + case uint: + return x * uint16(y) + case uint8: + return x * uint16(y) + case uint16: + return x * y + case uint32: + return uint32(x) * y + case uint64: + return uint64(x) * y + case int: + return int(x) * y + case int8: + return int8(x) * y + case int16: + return int16(x) * y + case int32: + return int32(x) * y + case int64: + return int64(x) * y + case float32: + return float32(x) * y + case float64: + return float64(x) * y + } + case uint32: + switch y := b.(type) { + case uint: + return x * uint32(y) + case uint8: + return x * uint32(y) + case uint16: + return x * uint32(y) + case uint32: + return x * y + case uint64: + return uint64(x) * y + case int: + return int(x) * y + case int8: + return int8(x) * y + case int16: + return int16(x) * y + case int32: + return int32(x) * y + case int64: + return int64(x) * y + case float32: + return float32(x) * y + case float64: + return float64(x) * y + } + case uint64: + switch y := b.(type) { + case uint: + return x * uint64(y) + case uint8: + return x * uint64(y) + case uint16: + return x * uint64(y) + case uint32: + return x * uint64(y) + case uint64: + return x * y + case int: + return int(x) * y + case int8: + return int8(x) * y + case int16: + return int16(x) * y + case int32: + return int32(x) * y + case int64: + return int64(x) * y + case float32: + return float32(x) * y + case float64: + return float64(x) * y + } + case int: + switch y := b.(type) { + case uint: + return x * int(y) + case uint8: + return x * int(y) + case uint16: + return x * int(y) + case uint32: + return x * int(y) + case uint64: + return x * int(y) + case int: + return x * y + case int8: + return int8(x) * y + case int16: + return int16(x) * y + case int32: + return int32(x) * y + case int64: + return int64(x) * y + case float32: + return float32(x) * y + case float64: + return float64(x) * y + } + case int8: + switch y := b.(type) { + case uint: + return x * int8(y) + case uint8: + return x * int8(y) + case uint16: + return x * int8(y) + case uint32: + return x * int8(y) + case uint64: + return x * int8(y) + case int: + return x * int8(y) + case int8: + return x * y + case int16: + return int16(x) * y + case int32: + return int32(x) * y + case int64: + return int64(x) * y + case float32: + return float32(x) * y + case float64: + return float64(x) * y + } + case int16: + switch y := b.(type) { + case uint: + return x * int16(y) + case uint8: + return x * int16(y) + case uint16: + return x * int16(y) + case uint32: + return x * int16(y) + case uint64: + return x * int16(y) + case int: + return x * int16(y) + case int8: + return x * int16(y) + case int16: + return x * y + case int32: + return int32(x) * y + case int64: + return int64(x) * y + case float32: + return float32(x) * y + case float64: + return float64(x) * y + } + case int32: + switch y := b.(type) { + case uint: + return x * int32(y) + case uint8: + return x * int32(y) + case uint16: + return x * int32(y) + case uint32: + return x * int32(y) + case uint64: + return x * int32(y) + case int: + return x * int32(y) + case int8: + return x * int32(y) + case int16: + return x * int32(y) + case int32: + return x * y + case int64: + return int64(x) * y + case float32: + return float32(x) * y + case float64: + return float64(x) * y + } + case int64: + switch y := b.(type) { + case uint: + return x * int64(y) + case uint8: + return x * int64(y) + case uint16: + return x * int64(y) + case uint32: + return x * int64(y) + case uint64: + return x * int64(y) + case int: + return x * int64(y) + case int8: + return x * int64(y) + case int16: + return x * int64(y) + case int32: + return x * int64(y) + case int64: + return x * y + case float32: + return float32(x) * y + case float64: + return float64(x) * y + } + case float32: + switch y := b.(type) { + case uint: + return x * float32(y) + case uint8: + return x * float32(y) + case uint16: + return x * float32(y) + case uint32: + return x * float32(y) + case uint64: + return x * float32(y) + case int: + return x * float32(y) + case int8: + return x * float32(y) + case int16: + return x * float32(y) + case int32: + return x * float32(y) + case int64: + return x * float32(y) + case float32: + return x * y + case float64: + return float64(x) * y + } + case float64: + switch y := b.(type) { + case uint: + return x * float64(y) + case uint8: + return x * float64(y) + case uint16: + return x * float64(y) + case uint32: + return x * float64(y) + case uint64: + return x * float64(y) + case int: + return x * float64(y) + case int8: + return x * float64(y) + case int16: + return x * float64(y) + case int32: + return x * float64(y) + case int64: + return x * float64(y) + case float32: + return x * float64(y) + case float64: + return x * y + } + } + panic(fmt.Sprintf("invalid operation: %T %v %T", a, "*", b)) +} + +func divide(a, b interface{}) interface{} { + switch x := a.(type) { + case uint: + switch y := b.(type) { + case uint: + return x / y + case uint8: + return uint8(x) / y + case uint16: + return uint16(x) / y + case uint32: + return uint32(x) / y + case uint64: + return uint64(x) / y + case int: + return int(x) / y + case int8: + return int8(x) / y + case int16: + return int16(x) / y + case int32: + return int32(x) / y + case int64: + return int64(x) / y + case float32: + return float32(x) / y + case float64: + return float64(x) / y + } + case uint8: + switch y := b.(type) { + case uint: + return x / uint8(y) + case uint8: + return x / y + case uint16: + return uint16(x) / y + case uint32: + return uint32(x) / y + case uint64: + return uint64(x) / y + case int: + return int(x) / y + case int8: + return int8(x) / y + case int16: + return int16(x) / y + case int32: + return int32(x) / y + case int64: + return int64(x) / y + case float32: + return float32(x) / y + case float64: + return float64(x) / y + } + case uint16: + switch y := b.(type) { + case uint: + return x / uint16(y) + case uint8: + return x / uint16(y) + case uint16: + return x / y + case uint32: + return uint32(x) / y + case uint64: + return uint64(x) / y + case int: + return int(x) / y + case int8: + return int8(x) / y + case int16: + return int16(x) / y + case int32: + return int32(x) / y + case int64: + return int64(x) / y + case float32: + return float32(x) / y + case float64: + return float64(x) / y + } + case uint32: + switch y := b.(type) { + case uint: + return x / uint32(y) + case uint8: + return x / uint32(y) + case uint16: + return x / uint32(y) + case uint32: + return x / y + case uint64: + return uint64(x) / y + case int: + return int(x) / y + case int8: + return int8(x) / y + case int16: + return int16(x) / y + case int32: + return int32(x) / y + case int64: + return int64(x) / y + case float32: + return float32(x) / y + case float64: + return float64(x) / y + } + case uint64: + switch y := b.(type) { + case uint: + return x / uint64(y) + case uint8: + return x / uint64(y) + case uint16: + return x / uint64(y) + case uint32: + return x / uint64(y) + case uint64: + return x / y + case int: + return int(x) / y + case int8: + return int8(x) / y + case int16: + return int16(x) / y + case int32: + return int32(x) / y + case int64: + return int64(x) / y + case float32: + return float32(x) / y + case float64: + return float64(x) / y + } + case int: + switch y := b.(type) { + case uint: + return x / int(y) + case uint8: + return x / int(y) + case uint16: + return x / int(y) + case uint32: + return x / int(y) + case uint64: + return x / int(y) + case int: + return x / y + case int8: + return int8(x) / y + case int16: + return int16(x) / y + case int32: + return int32(x) / y + case int64: + return int64(x) / y + case float32: + return float32(x) / y + case float64: + return float64(x) / y + } + case int8: + switch y := b.(type) { + case uint: + return x / int8(y) + case uint8: + return x / int8(y) + case uint16: + return x / int8(y) + case uint32: + return x / int8(y) + case uint64: + return x / int8(y) + case int: + return x / int8(y) + case int8: + return x / y + case int16: + return int16(x) / y + case int32: + return int32(x) / y + case int64: + return int64(x) / y + case float32: + return float32(x) / y + case float64: + return float64(x) / y + } + case int16: + switch y := b.(type) { + case uint: + return x / int16(y) + case uint8: + return x / int16(y) + case uint16: + return x / int16(y) + case uint32: + return x / int16(y) + case uint64: + return x / int16(y) + case int: + return x / int16(y) + case int8: + return x / int16(y) + case int16: + return x / y + case int32: + return int32(x) / y + case int64: + return int64(x) / y + case float32: + return float32(x) / y + case float64: + return float64(x) / y + } + case int32: + switch y := b.(type) { + case uint: + return x / int32(y) + case uint8: + return x / int32(y) + case uint16: + return x / int32(y) + case uint32: + return x / int32(y) + case uint64: + return x / int32(y) + case int: + return x / int32(y) + case int8: + return x / int32(y) + case int16: + return x / int32(y) + case int32: + return x / y + case int64: + return int64(x) / y + case float32: + return float32(x) / y + case float64: + return float64(x) / y + } + case int64: + switch y := b.(type) { + case uint: + return x / int64(y) + case uint8: + return x / int64(y) + case uint16: + return x / int64(y) + case uint32: + return x / int64(y) + case uint64: + return x / int64(y) + case int: + return x / int64(y) + case int8: + return x / int64(y) + case int16: + return x / int64(y) + case int32: + return x / int64(y) + case int64: + return x / y + case float32: + return float32(x) / y + case float64: + return float64(x) / y + } + case float32: + switch y := b.(type) { + case uint: + return x / float32(y) + case uint8: + return x / float32(y) + case uint16: + return x / float32(y) + case uint32: + return x / float32(y) + case uint64: + return x / float32(y) + case int: + return x / float32(y) + case int8: + return x / float32(y) + case int16: + return x / float32(y) + case int32: + return x / float32(y) + case int64: + return x / float32(y) + case float32: + return x / y + case float64: + return float64(x) / y + } + case float64: + switch y := b.(type) { + case uint: + return x / float64(y) + case uint8: + return x / float64(y) + case uint16: + return x / float64(y) + case uint32: + return x / float64(y) + case uint64: + return x / float64(y) + case int: + return x / float64(y) + case int8: + return x / float64(y) + case int16: + return x / float64(y) + case int32: + return x / float64(y) + case int64: + return x / float64(y) + case float32: + return x / float64(y) + case float64: + return x / y + } + } + panic(fmt.Sprintf("invalid operation: %T %v %T", a, "/", b)) +} + +func modulo(a, b interface{}) interface{} { + switch x := a.(type) { + case uint: + switch y := b.(type) { + case uint: + return x % y + case uint8: + return uint8(x) % y + case uint16: + return uint16(x) % y + case uint32: + return uint32(x) % y + case uint64: + return uint64(x) % y + case int: + return int(x) % y + case int8: + return int8(x) % y + case int16: + return int16(x) % y + case int32: + return int32(x) % y + case int64: + return int64(x) % y + } + case uint8: + switch y := b.(type) { + case uint: + return x % uint8(y) + case uint8: + return x % y + case uint16: + return uint16(x) % y + case uint32: + return uint32(x) % y + case uint64: + return uint64(x) % y + case int: + return int(x) % y + case int8: + return int8(x) % y + case int16: + return int16(x) % y + case int32: + return int32(x) % y + case int64: + return int64(x) % y + } + case uint16: + switch y := b.(type) { + case uint: + return x % uint16(y) + case uint8: + return x % uint16(y) + case uint16: + return x % y + case uint32: + return uint32(x) % y + case uint64: + return uint64(x) % y + case int: + return int(x) % y + case int8: + return int8(x) % y + case int16: + return int16(x) % y + case int32: + return int32(x) % y + case int64: + return int64(x) % y + } + case uint32: + switch y := b.(type) { + case uint: + return x % uint32(y) + case uint8: + return x % uint32(y) + case uint16: + return x % uint32(y) + case uint32: + return x % y + case uint64: + return uint64(x) % y + case int: + return int(x) % y + case int8: + return int8(x) % y + case int16: + return int16(x) % y + case int32: + return int32(x) % y + case int64: + return int64(x) % y + } + case uint64: + switch y := b.(type) { + case uint: + return x % uint64(y) + case uint8: + return x % uint64(y) + case uint16: + return x % uint64(y) + case uint32: + return x % uint64(y) + case uint64: + return x % y + case int: + return int(x) % y + case int8: + return int8(x) % y + case int16: + return int16(x) % y + case int32: + return int32(x) % y + case int64: + return int64(x) % y + } + case int: + switch y := b.(type) { + case uint: + return x % int(y) + case uint8: + return x % int(y) + case uint16: + return x % int(y) + case uint32: + return x % int(y) + case uint64: + return x % int(y) + case int: + return x % y + case int8: + return int8(x) % y + case int16: + return int16(x) % y + case int32: + return int32(x) % y + case int64: + return int64(x) % y + } + case int8: + switch y := b.(type) { + case uint: + return x % int8(y) + case uint8: + return x % int8(y) + case uint16: + return x % int8(y) + case uint32: + return x % int8(y) + case uint64: + return x % int8(y) + case int: + return x % int8(y) + case int8: + return x % y + case int16: + return int16(x) % y + case int32: + return int32(x) % y + case int64: + return int64(x) % y + } + case int16: + switch y := b.(type) { + case uint: + return x % int16(y) + case uint8: + return x % int16(y) + case uint16: + return x % int16(y) + case uint32: + return x % int16(y) + case uint64: + return x % int16(y) + case int: + return x % int16(y) + case int8: + return x % int16(y) + case int16: + return x % y + case int32: + return int32(x) % y + case int64: + return int64(x) % y + } + case int32: + switch y := b.(type) { + case uint: + return x % int32(y) + case uint8: + return x % int32(y) + case uint16: + return x % int32(y) + case uint32: + return x % int32(y) + case uint64: + return x % int32(y) + case int: + return x % int32(y) + case int8: + return x % int32(y) + case int16: + return x % int32(y) + case int32: + return x % y + case int64: + return int64(x) % y + } + case int64: + switch y := b.(type) { + case uint: + return x % int64(y) + case uint8: + return x % int64(y) + case uint16: + return x % int64(y) + case uint32: + return x % int64(y) + case uint64: + return x % int64(y) + case int: + return x % int64(y) + case int8: + return x % int64(y) + case int16: + return x % int64(y) + case int32: + return x % int64(y) + case int64: + return x % y + } + } + panic(fmt.Sprintf("invalid operation: %T %v %T", a, "%", b)) +} diff --git a/vendor/github.com/antonmedv/expr/vm/opcodes.go b/vendor/github.com/antonmedv/expr/vm/opcodes.go new file mode 100644 index 00000000000..a5f5a0a534e --- /dev/null +++ b/vendor/github.com/antonmedv/expr/vm/opcodes.go @@ -0,0 +1,53 @@ +package vm + +const ( + OpPush byte = iota + OpPop + OpRot + OpFetch + OpFetchMap + OpTrue + OpFalse + OpNil + OpNegate + OpNot + OpEqual + OpEqualInt + OpEqualString + OpJump + OpJumpIfTrue + OpJumpIfFalse + OpJumpBackward + OpIn + OpLess + OpMore + OpLessOrEqual + OpMoreOrEqual + OpAdd + OpSubtract + OpMultiply + OpDivide + OpModulo + OpExponent + OpRange + OpMatches + OpMatchesConst + OpContains + OpStartsWith + OpEndsWith + OpIndex + OpSlice + OpProperty + OpCall + OpCallFast + OpMethod + OpArray + OpMap + OpLen + OpCast + OpStore + OpLoad + OpInc + OpBegin + OpEnd // This opcode must be at the end of this list. +) diff --git a/vendor/github.com/antonmedv/expr/vm/program.go b/vendor/github.com/antonmedv/expr/vm/program.go new file mode 100644 index 00000000000..d49be8e738d --- /dev/null +++ b/vendor/github.com/antonmedv/expr/vm/program.go @@ -0,0 +1,216 @@ +package vm + +import ( + "encoding/binary" + "fmt" + "regexp" + + "github.com/antonmedv/expr/file" +) + +type Program struct { + Source *file.Source + Locations map[int]file.Location + Constants []interface{} + Bytecode []byte +} + +func (program *Program) Disassemble() string { + out := "" + ip := 0 + for ip < len(program.Bytecode) { + pp := ip + op := program.Bytecode[ip] + ip++ + + readArg := func() uint16 { + if ip+1 >= len(program.Bytecode) { + return 0 + } + + i := binary.LittleEndian.Uint16([]byte{program.Bytecode[ip], program.Bytecode[ip+1]}) + ip += 2 + return i + } + + code := func(label string) { + out += fmt.Sprintf("%v\t%v\n", pp, label) + } + jump := func(label string) { + a := readArg() + out += fmt.Sprintf("%v\t%v\t%v\t(%v)\n", pp, label, a, ip+int(a)) + } + back := func(label string) { + a := readArg() + out += fmt.Sprintf("%v\t%v\t%v\t(%v)\n", pp, label, a, ip-int(a)) + } + argument := func(label string) { + a := readArg() + out += fmt.Sprintf("%v\t%v\t%v\n", pp, label, a) + } + constant := func(label string) { + a := readArg() + var c interface{} + if int(a) < len(program.Constants) { + c = program.Constants[a] + } + if r, ok := c.(*regexp.Regexp); ok { + c = r.String() + } + out += fmt.Sprintf("%v\t%v\t%v\t%#v\n", pp, label, a, c) + } + + switch op { + case OpPush: + constant("OpPush") + + case OpPop: + code("OpPop") + + case OpRot: + code("OpRot") + + case OpFetch: + constant("OpFetch") + + case OpFetchMap: + constant("OpFetchMap") + + case OpTrue: + code("OpTrue") + + case OpFalse: + code("OpFalse") + + case OpNil: + code("OpNil") + + case OpNegate: + code("OpNegate") + + case OpNot: + code("OpNot") + + case OpEqual: + code("OpEqual") + + case OpEqualInt: + code("OpEqualInt") + + case OpEqualString: + code("OpEqualString") + + case OpJump: + jump("OpJump") + + case OpJumpIfTrue: + jump("OpJumpIfTrue") + + case OpJumpIfFalse: + jump("OpJumpIfFalse") + + case OpJumpBackward: + back("OpJumpBackward") + + case OpIn: + code("OpIn") + + case OpLess: + code("OpLess") + + case OpMore: + code("OpMore") + + case OpLessOrEqual: + code("OpLessOrEqual") + + case OpMoreOrEqual: + code("OpMoreOrEqual") + + case OpAdd: + code("OpAdd") + + case OpSubtract: + code("OpSubtract") + + case OpMultiply: + code("OpMultiply") + + case OpDivide: + code("OpDivide") + + case OpModulo: + code("OpModulo") + + case OpExponent: + code("OpExponent") + + case OpRange: + code("OpRange") + + case OpMatches: + code("OpMatches") + + case OpMatchesConst: + constant("OpMatchesConst") + + case OpContains: + code("OpContains") + + case OpStartsWith: + code("OpStartsWith") + + case OpEndsWith: + code("OpEndsWith") + + case OpIndex: + code("OpIndex") + + case OpSlice: + code("OpSlice") + + case OpProperty: + constant("OpProperty") + + case OpCall: + constant("OpCall") + + case OpCallFast: + constant("OpCallFast") + + case OpMethod: + constant("OpMethod") + + case OpArray: + code("OpArray") + + case OpMap: + code("OpMap") + + case OpLen: + code("OpLen") + + case OpCast: + argument("OpCast") + + case OpStore: + constant("OpStore") + + case OpLoad: + constant("OpLoad") + + case OpInc: + constant("OpInc") + + case OpBegin: + code("OpBegin") + + case OpEnd: + code("OpEnd") + + default: + out += fmt.Sprintf("%v\t%#x\n", pp, op) + } + } + return out +} diff --git a/vendor/github.com/antonmedv/expr/vm/runtime.go b/vendor/github.com/antonmedv/expr/vm/runtime.go new file mode 100644 index 00000000000..2dd11ac94ac --- /dev/null +++ b/vendor/github.com/antonmedv/expr/vm/runtime.go @@ -0,0 +1,343 @@ +package vm + +//go:generate go run ./generate + +import ( + "fmt" + "math" + "reflect" +) + +type Call struct { + Name string + Size int +} + +type Scope map[string]interface{} + +func fetch(from interface{}, i interface{}) interface{} { + v := reflect.ValueOf(from) + kind := v.Kind() + + // Structures can be access through a pointer or through a value, when they + // are accessed through a pointer we don't want to copy them to a value. + if kind == reflect.Ptr && reflect.Indirect(v).Kind() == reflect.Struct { + v = reflect.Indirect(v) + kind = v.Kind() + } + + switch kind { + + case reflect.Array, reflect.Slice, reflect.String: + value := v.Index(toInt(i)) + if value.IsValid() && value.CanInterface() { + return value.Interface() + } + + case reflect.Map: + value := v.MapIndex(reflect.ValueOf(i)) + if value.IsValid() { + if value.CanInterface() { + return value.Interface() + } + } else { + elem := reflect.TypeOf(from).Elem() + return reflect.Zero(elem).Interface() + } + + case reflect.Struct: + value := v.FieldByName(reflect.ValueOf(i).String()) + if value.IsValid() && value.CanInterface() { + return value.Interface() + } + } + + panic(fmt.Sprintf("cannot fetch %v from %T", i, from)) +} + +func slice(array, from, to interface{}) interface{} { + v := reflect.ValueOf(array) + + switch v.Kind() { + case reflect.Array, reflect.Slice, reflect.String: + length := v.Len() + a, b := toInt(from), toInt(to) + + if b > length { + b = length + } + if a > b { + a = b + } + + value := v.Slice(a, b) + if value.IsValid() && value.CanInterface() { + return value.Interface() + } + + case reflect.Ptr: + value := v.Elem() + if value.IsValid() && value.CanInterface() { + return slice(value.Interface(), from, to) + } + + } + panic(fmt.Sprintf("cannot slice %v", from)) +} + +func FetchFn(from interface{}, name string) reflect.Value { + v := reflect.ValueOf(from) + + // Methods can be defined on any type. + if v.NumMethod() > 0 { + method := v.MethodByName(name) + if method.IsValid() { + return method + } + } + + d := v + if v.Kind() == reflect.Ptr { + d = v.Elem() + } + + switch d.Kind() { + case reflect.Map: + value := d.MapIndex(reflect.ValueOf(name)) + if value.IsValid() && value.CanInterface() { + return value.Elem() + } + case reflect.Struct: + // If struct has not method, maybe it has func field. + // To access this field we need dereference value. + value := d.FieldByName(name) + if value.IsValid() { + return value + } + } + panic(fmt.Sprintf(`cannot get "%v" from %T`, name, from)) +} + +func in(needle interface{}, array interface{}) bool { + if array == nil { + return false + } + v := reflect.ValueOf(array) + + switch v.Kind() { + + case reflect.Array, reflect.Slice: + for i := 0; i < v.Len(); i++ { + value := v.Index(i) + if value.IsValid() && value.CanInterface() { + if equal(value.Interface(), needle).(bool) { + return true + } + } + } + return false + + case reflect.Map: + n := reflect.ValueOf(needle) + if !n.IsValid() { + panic(fmt.Sprintf("cannot use %T as index to %T", needle, array)) + } + value := v.MapIndex(n) + if value.IsValid() { + return true + } + return false + + case reflect.Struct: + n := reflect.ValueOf(needle) + if !n.IsValid() || n.Kind() != reflect.String { + panic(fmt.Sprintf("cannot use %T as field name of %T", needle, array)) + } + value := v.FieldByName(n.String()) + if value.IsValid() { + return true + } + return false + + case reflect.Ptr: + value := v.Elem() + if value.IsValid() && value.CanInterface() { + return in(needle, value.Interface()) + } + return false + } + + panic(fmt.Sprintf(`operator "in"" not defined on %T`, array)) +} + +func length(a interface{}) int { + v := reflect.ValueOf(a) + switch v.Kind() { + case reflect.Array, reflect.Slice, reflect.Map, reflect.String: + return v.Len() + default: + panic(fmt.Sprintf("invalid argument for len (type %T)", a)) + } +} + +func negate(i interface{}) interface{} { + switch v := i.(type) { + case float32: + return -v + case float64: + return -v + + case int: + return -v + case int8: + return -v + case int16: + return -v + case int32: + return -v + case int64: + return -v + + case uint: + return -v + case uint8: + return -v + case uint16: + return -v + case uint32: + return -v + case uint64: + return -v + + default: + panic(fmt.Sprintf("invalid operation: - %T", v)) + } +} + +func exponent(a, b interface{}) float64 { + return math.Pow(toFloat64(a), toFloat64(b)) +} + +func makeRange(min, max int) []int { + size := max - min + 1 + rng := make([]int, size) + for i := range rng { + rng[i] = min + i + } + return rng +} + +func toInt(a interface{}) int { + switch x := a.(type) { + case float32: + return int(x) + case float64: + return int(x) + + case int: + return x + case int8: + return int(x) + case int16: + return int(x) + case int32: + return int(x) + case int64: + return int(x) + + case uint: + return int(x) + case uint8: + return int(x) + case uint16: + return int(x) + case uint32: + return int(x) + case uint64: + return int(x) + + default: + panic(fmt.Sprintf("invalid operation: int(%T)", x)) + } +} + +func toInt64(a interface{}) int64 { + switch x := a.(type) { + case float32: + return int64(x) + case float64: + return int64(x) + + case int: + return int64(x) + case int8: + return int64(x) + case int16: + return int64(x) + case int32: + return int64(x) + case int64: + return x + + case uint: + return int64(x) + case uint8: + return int64(x) + case uint16: + return int64(x) + case uint32: + return int64(x) + case uint64: + return int64(x) + + default: + panic(fmt.Sprintf("invalid operation: int64(%T)", x)) + } +} + +func toFloat64(a interface{}) float64 { + switch x := a.(type) { + case float32: + return float64(x) + case float64: + return x + + case int: + return float64(x) + case int8: + return float64(x) + case int16: + return float64(x) + case int32: + return float64(x) + case int64: + return float64(x) + + case uint: + return float64(x) + case uint8: + return float64(x) + case uint16: + return float64(x) + case uint32: + return float64(x) + case uint64: + return float64(x) + + default: + panic(fmt.Sprintf("invalid operation: float64(%T)", x)) + } +} + +func isNil(v interface{}) bool { + if v == nil { + return true + } + r := reflect.ValueOf(v) + switch r.Kind() { + case reflect.Chan, reflect.Func, reflect.Map, reflect.Ptr, reflect.Interface, reflect.Slice: + return r.IsNil() + default: + return false + } +} diff --git a/vendor/github.com/antonmedv/expr/vm/vm.go b/vendor/github.com/antonmedv/expr/vm/vm.go new file mode 100644 index 00000000000..1ce4a72bdbb --- /dev/null +++ b/vendor/github.com/antonmedv/expr/vm/vm.go @@ -0,0 +1,439 @@ +package vm + +import ( + "fmt" + "reflect" + "regexp" + "strings" + + "github.com/antonmedv/expr/file" +) + +var ( + MemoryBudget int = 1e6 +) + +func Run(program *Program, env interface{}) (interface{}, error) { + if program == nil { + return nil, fmt.Errorf("program is nil") + } + + vm := VM{} + return vm.Run(program, env) +} + +type VM struct { + stack []interface{} + constants []interface{} + bytecode []byte + ip int + pp int + scopes []Scope + debug bool + step chan struct{} + curr chan int + memory int + limit int +} + +func Debug() *VM { + vm := &VM{ + debug: true, + step: make(chan struct{}, 0), + curr: make(chan int, 0), + } + return vm +} + +func (vm *VM) Run(program *Program, env interface{}) (out interface{}, err error) { + defer func() { + if r := recover(); r != nil { + f := &file.Error{ + Location: program.Locations[vm.pp], + Message: fmt.Sprintf("%v", r), + } + err = f.Bind(program.Source) + } + }() + + vm.limit = MemoryBudget + vm.ip = 0 + vm.pp = 0 + + if vm.stack == nil { + vm.stack = make([]interface{}, 0, 2) + } else { + vm.stack = vm.stack[0:0] + } + + if vm.scopes != nil { + vm.scopes = vm.scopes[0:0] + } + + vm.bytecode = program.Bytecode + vm.constants = program.Constants + + for vm.ip < len(vm.bytecode) { + + if vm.debug { + <-vm.step + } + + vm.pp = vm.ip + vm.ip++ + op := vm.bytecode[vm.pp] + + switch op { + + case OpPush: + vm.push(vm.constant()) + + case OpPop: + vm.pop() + + case OpRot: + b := vm.pop() + a := vm.pop() + vm.push(b) + vm.push(a) + + case OpFetch: + vm.push(fetch(env, vm.constant())) + + case OpFetchMap: + vm.push(env.(map[string]interface{})[vm.constant().(string)]) + + case OpTrue: + vm.push(true) + + case OpFalse: + vm.push(false) + + case OpNil: + vm.push(nil) + + case OpNegate: + v := negate(vm.pop()) + vm.push(v) + + case OpNot: + v := vm.pop().(bool) + vm.push(!v) + + case OpEqual: + b := vm.pop() + a := vm.pop() + vm.push(equal(a, b)) + + case OpEqualInt: + b := vm.pop() + a := vm.pop() + vm.push(a.(int) == b.(int)) + + case OpEqualString: + b := vm.pop() + a := vm.pop() + vm.push(a.(string) == b.(string)) + + case OpJump: + offset := vm.arg() + vm.ip += int(offset) + + case OpJumpIfTrue: + offset := vm.arg() + if vm.current().(bool) { + vm.ip += int(offset) + } + + case OpJumpIfFalse: + offset := vm.arg() + if !vm.current().(bool) { + vm.ip += int(offset) + } + + case OpJumpBackward: + offset := vm.arg() + vm.ip -= int(offset) + + case OpIn: + b := vm.pop() + a := vm.pop() + vm.push(in(a, b)) + + case OpLess: + b := vm.pop() + a := vm.pop() + vm.push(less(a, b)) + + case OpMore: + b := vm.pop() + a := vm.pop() + vm.push(more(a, b)) + + case OpLessOrEqual: + b := vm.pop() + a := vm.pop() + vm.push(lessOrEqual(a, b)) + + case OpMoreOrEqual: + b := vm.pop() + a := vm.pop() + vm.push(moreOrEqual(a, b)) + + case OpAdd: + b := vm.pop() + a := vm.pop() + vm.push(add(a, b)) + + case OpSubtract: + b := vm.pop() + a := vm.pop() + vm.push(subtract(a, b)) + + case OpMultiply: + b := vm.pop() + a := vm.pop() + vm.push(multiply(a, b)) + + case OpDivide: + b := vm.pop() + a := vm.pop() + vm.push(divide(a, b)) + + case OpModulo: + b := vm.pop() + a := vm.pop() + vm.push(modulo(a, b)) + + case OpExponent: + b := vm.pop() + a := vm.pop() + vm.push(exponent(a, b)) + + case OpRange: + b := vm.pop() + a := vm.pop() + min := toInt(a) + max := toInt(b) + size := max - min + 1 + if vm.memory+size >= vm.limit { + panic("memory budget exceeded") + } + vm.push(makeRange(min, max)) + vm.memory += size + + case OpMatches: + b := vm.pop() + a := vm.pop() + match, err := regexp.MatchString(b.(string), a.(string)) + if err != nil { + panic(err) + } + + vm.push(match) + + case OpMatchesConst: + a := vm.pop() + r := vm.constant().(*regexp.Regexp) + vm.push(r.MatchString(a.(string))) + + case OpContains: + b := vm.pop() + a := vm.pop() + vm.push(strings.Contains(a.(string), b.(string))) + + case OpStartsWith: + b := vm.pop() + a := vm.pop() + vm.push(strings.HasPrefix(a.(string), b.(string))) + + case OpEndsWith: + b := vm.pop() + a := vm.pop() + vm.push(strings.HasSuffix(a.(string), b.(string))) + + case OpIndex: + b := vm.pop() + a := vm.pop() + vm.push(fetch(a, b)) + + case OpSlice: + from := vm.pop() + to := vm.pop() + node := vm.pop() + vm.push(slice(node, from, to)) + + case OpProperty: + a := vm.pop() + b := vm.constant() + vm.push(fetch(a, b)) + + case OpCall: + call := vm.constant().(Call) + in := make([]reflect.Value, call.Size) + for i := call.Size - 1; i >= 0; i-- { + param := vm.pop() + if param == nil && reflect.TypeOf(param) == nil { + // In case of nil value and nil type use this hack, + // otherwise reflect.Call will panic on zero value. + in[i] = reflect.ValueOf(¶m).Elem() + } else { + in[i] = reflect.ValueOf(param) + } + } + out := FetchFn(env, call.Name).Call(in) + vm.push(out[0].Interface()) + + case OpCallFast: + call := vm.constant().(Call) + in := make([]interface{}, call.Size) + for i := call.Size - 1; i >= 0; i-- { + in[i] = vm.pop() + } + fn := FetchFn(env, call.Name).Interface() + vm.push(fn.(func(...interface{}) interface{})(in...)) + + case OpMethod: + call := vm.constants[vm.arg()].(Call) + in := make([]reflect.Value, call.Size) + for i := call.Size - 1; i >= 0; i-- { + param := vm.pop() + if param == nil && reflect.TypeOf(param) == nil { + // In case of nil value and nil type use this hack, + // otherwise reflect.Call will panic on zero value. + in[i] = reflect.ValueOf(¶m).Elem() + } else { + in[i] = reflect.ValueOf(param) + } + } + out := FetchFn(vm.pop(), call.Name).Call(in) + vm.push(out[0].Interface()) + + case OpArray: + size := vm.pop().(int) + array := make([]interface{}, size) + for i := size - 1; i >= 0; i-- { + array[i] = vm.pop() + } + vm.push(array) + vm.memory += size + if vm.memory >= vm.limit { + panic("memory budget exceeded") + } + + case OpMap: + size := vm.pop().(int) + m := make(map[string]interface{}) + for i := size - 1; i >= 0; i-- { + value := vm.pop() + key := vm.pop() + m[key.(string)] = value + } + vm.push(m) + vm.memory += size + if vm.memory >= vm.limit { + panic("memory budget exceeded") + } + + case OpLen: + vm.push(length(vm.current())) + + case OpCast: + t := vm.arg() + switch t { + case 0: + vm.push(toInt64(vm.pop())) + case 1: + vm.push(toFloat64(vm.pop())) + } + + case OpStore: + scope := vm.Scope() + key := vm.constant().(string) + value := vm.pop() + scope[key] = value + + case OpLoad: + scope := vm.Scope() + key := vm.constant().(string) + vm.push(scope[key]) + + case OpInc: + scope := vm.Scope() + key := vm.constant().(string) + i := scope[key].(int) + i++ + scope[key] = i + + case OpBegin: + scope := make(Scope) + vm.scopes = append(vm.scopes, scope) + + case OpEnd: + vm.scopes = vm.scopes[:len(vm.scopes)-1] + + default: + panic(fmt.Sprintf("unknown bytecode %#x", op)) + } + + if vm.debug { + vm.curr <- vm.ip + } + } + + if vm.debug { + close(vm.curr) + close(vm.step) + } + + if len(vm.stack) > 0 { + return vm.pop(), nil + } + + return nil, nil +} + +func (vm *VM) push(value interface{}) { + vm.stack = append(vm.stack, value) +} + +func (vm *VM) current() interface{} { + return vm.stack[len(vm.stack)-1] +} + +func (vm *VM) pop() interface{} { + value := vm.stack[len(vm.stack)-1] + vm.stack = vm.stack[:len(vm.stack)-1] + return value +} + +func (vm *VM) arg() uint16 { + b0, b1 := vm.bytecode[vm.ip], vm.bytecode[vm.ip+1] + vm.ip += 2 + return uint16(b0) | uint16(b1)<<8 +} + +func (vm *VM) constant() interface{} { + return vm.constants[vm.arg()] +} + +func (vm *VM) Stack() []interface{} { + return vm.stack +} + +func (vm *VM) Scope() Scope { + if len(vm.scopes) > 0 { + return vm.scopes[len(vm.scopes)-1] + } + return nil +} + +func (vm *VM) Step() { + if vm.ip < len(vm.bytecode) { + vm.step <- struct{}{} + } +} + +func (vm *VM) Position() chan int { + return vm.curr +} diff --git a/vendor/github.com/mattn/go-runewidth/.travis.yml b/vendor/github.com/mattn/go-runewidth/.travis.yml index 5c9c2a30f07..6a21813a3e3 100644 --- a/vendor/github.com/mattn/go-runewidth/.travis.yml +++ b/vendor/github.com/mattn/go-runewidth/.travis.yml @@ -1,8 +1,16 @@ language: go +sudo: false go: + - 1.13.x - tip + before_install: - - go get github.com/mattn/goveralls - - go get golang.org/x/tools/cmd/cover + - go get -t -v ./... + script: - - $HOME/gopath/bin/goveralls -repotoken lAKAWPzcGsD3A8yBX3BGGtRUdJ6CaGERL + - go generate + - git diff --cached --exit-code + - ./go.test.sh + +after_success: + - bash <(curl -s https://codecov.io/bash) diff --git a/vendor/github.com/mattn/go-runewidth/README.mkd b/vendor/github.com/mattn/go-runewidth/README.md similarity index 82% rename from vendor/github.com/mattn/go-runewidth/README.mkd rename to vendor/github.com/mattn/go-runewidth/README.md index 66663a94b0b..aa56ab96c2b 100644 --- a/vendor/github.com/mattn/go-runewidth/README.mkd +++ b/vendor/github.com/mattn/go-runewidth/README.md @@ -2,7 +2,7 @@ go-runewidth ============ [![Build Status](https://travis-ci.org/mattn/go-runewidth.png?branch=master)](https://travis-ci.org/mattn/go-runewidth) -[![Coverage Status](https://coveralls.io/repos/mattn/go-runewidth/badge.png?branch=HEAD)](https://coveralls.io/r/mattn/go-runewidth?branch=HEAD) +[![Codecov](https://codecov.io/gh/mattn/go-runewidth/branch/master/graph/badge.svg)](https://codecov.io/gh/mattn/go-runewidth) [![GoDoc](https://godoc.org/github.com/mattn/go-runewidth?status.svg)](http://godoc.org/github.com/mattn/go-runewidth) [![Go Report Card](https://goreportcard.com/badge/github.com/mattn/go-runewidth)](https://goreportcard.com/report/github.com/mattn/go-runewidth) diff --git a/vendor/github.com/mattn/go-runewidth/go.mod b/vendor/github.com/mattn/go-runewidth/go.mod new file mode 100644 index 00000000000..fa7f4d864e4 --- /dev/null +++ b/vendor/github.com/mattn/go-runewidth/go.mod @@ -0,0 +1,3 @@ +module github.com/mattn/go-runewidth + +go 1.9 diff --git a/vendor/github.com/mattn/go-runewidth/go.test.sh b/vendor/github.com/mattn/go-runewidth/go.test.sh new file mode 100644 index 00000000000..012162b077c --- /dev/null +++ b/vendor/github.com/mattn/go-runewidth/go.test.sh @@ -0,0 +1,12 @@ +#!/usr/bin/env bash + +set -e +echo "" > coverage.txt + +for d in $(go list ./... | grep -v vendor); do + go test -race -coverprofile=profile.out -covermode=atomic "$d" + if [ -f profile.out ]; then + cat profile.out >> coverage.txt + rm profile.out + fi +done diff --git a/vendor/github.com/mattn/go-runewidth/runewidth.go b/vendor/github.com/mattn/go-runewidth/runewidth.go index 2164497ad95..19f8e0449b7 100644 --- a/vendor/github.com/mattn/go-runewidth/runewidth.go +++ b/vendor/github.com/mattn/go-runewidth/runewidth.go @@ -1,13 +1,38 @@ package runewidth +import ( + "os" +) + +//go:generate go run script/generate.go + var ( // EastAsianWidth will be set true if the current locale is CJK - EastAsianWidth = IsEastAsian() + EastAsianWidth bool + + // ZeroWidthJoiner is flag to set to use UTR#51 ZWJ + ZeroWidthJoiner bool // DefaultCondition is a condition in current locale - DefaultCondition = &Condition{EastAsianWidth} + DefaultCondition = &Condition{} ) +func init() { + handleEnv() +} + +func handleEnv() { + env := os.Getenv("RUNEWIDTH_EASTASIAN") + if env == "" { + EastAsianWidth = IsEastAsian() + } else { + EastAsianWidth = env == "1" + } + // update DefaultCondition + DefaultCondition.EastAsianWidth = EastAsianWidth + DefaultCondition.ZeroWidthJoiner = ZeroWidthJoiner +} + type interval struct { first rune last rune @@ -25,7 +50,6 @@ func inTables(r rune, ts ...table) bool { } func inTable(r rune, t table) bool { - // func (t table) IncludesRune(r rune) bool { if r < t[0].first { return false } @@ -33,7 +57,7 @@ func inTable(r rune, t table) bool { bot := 0 top := len(t) - 1 for top >= bot { - mid := (bot + top) / 2 + mid := (bot + top) >> 1 switch { case t[mid].last < r: @@ -55,1061 +79,71 @@ var private = table{ var nonprint = table{ {0x0000, 0x001F}, {0x007F, 0x009F}, {0x00AD, 0x00AD}, {0x070F, 0x070F}, {0x180B, 0x180E}, {0x200B, 0x200F}, - {0x202A, 0x202E}, {0x206A, 0x206F}, {0xD800, 0xDFFF}, + {0x2028, 0x202E}, {0x206A, 0x206F}, {0xD800, 0xDFFF}, {0xFEFF, 0xFEFF}, {0xFFF9, 0xFFFB}, {0xFFFE, 0xFFFF}, } -var combining = table{ - {0x0300, 0x036F}, {0x0483, 0x0489}, {0x0591, 0x05BD}, - {0x05BF, 0x05BF}, {0x05C1, 0x05C2}, {0x05C4, 0x05C5}, - {0x05C7, 0x05C7}, {0x0610, 0x061A}, {0x064B, 0x065F}, - {0x0670, 0x0670}, {0x06D6, 0x06DC}, {0x06DF, 0x06E4}, - {0x06E7, 0x06E8}, {0x06EA, 0x06ED}, {0x0711, 0x0711}, - {0x0730, 0x074A}, {0x07A6, 0x07B0}, {0x07EB, 0x07F3}, - {0x0816, 0x0819}, {0x081B, 0x0823}, {0x0825, 0x0827}, - {0x0829, 0x082D}, {0x0859, 0x085B}, {0x08D4, 0x08E1}, - {0x08E3, 0x0903}, {0x093A, 0x093C}, {0x093E, 0x094F}, - {0x0951, 0x0957}, {0x0962, 0x0963}, {0x0981, 0x0983}, - {0x09BC, 0x09BC}, {0x09BE, 0x09C4}, {0x09C7, 0x09C8}, - {0x09CB, 0x09CD}, {0x09D7, 0x09D7}, {0x09E2, 0x09E3}, - {0x0A01, 0x0A03}, {0x0A3C, 0x0A3C}, {0x0A3E, 0x0A42}, - {0x0A47, 0x0A48}, {0x0A4B, 0x0A4D}, {0x0A51, 0x0A51}, - {0x0A70, 0x0A71}, {0x0A75, 0x0A75}, {0x0A81, 0x0A83}, - {0x0ABC, 0x0ABC}, {0x0ABE, 0x0AC5}, {0x0AC7, 0x0AC9}, - {0x0ACB, 0x0ACD}, {0x0AE2, 0x0AE3}, {0x0B01, 0x0B03}, - {0x0B3C, 0x0B3C}, {0x0B3E, 0x0B44}, {0x0B47, 0x0B48}, - {0x0B4B, 0x0B4D}, {0x0B56, 0x0B57}, {0x0B62, 0x0B63}, - {0x0B82, 0x0B82}, {0x0BBE, 0x0BC2}, {0x0BC6, 0x0BC8}, - {0x0BCA, 0x0BCD}, {0x0BD7, 0x0BD7}, {0x0C00, 0x0C03}, - {0x0C3E, 0x0C44}, {0x0C46, 0x0C48}, {0x0C4A, 0x0C4D}, - {0x0C55, 0x0C56}, {0x0C62, 0x0C63}, {0x0C81, 0x0C83}, - {0x0CBC, 0x0CBC}, {0x0CBE, 0x0CC4}, {0x0CC6, 0x0CC8}, - {0x0CCA, 0x0CCD}, {0x0CD5, 0x0CD6}, {0x0CE2, 0x0CE3}, - {0x0D01, 0x0D03}, {0x0D3E, 0x0D44}, {0x0D46, 0x0D48}, - {0x0D4A, 0x0D4D}, {0x0D57, 0x0D57}, {0x0D62, 0x0D63}, - {0x0D82, 0x0D83}, {0x0DCA, 0x0DCA}, {0x0DCF, 0x0DD4}, - {0x0DD6, 0x0DD6}, {0x0DD8, 0x0DDF}, {0x0DF2, 0x0DF3}, - {0x0E31, 0x0E31}, {0x0E34, 0x0E3A}, {0x0E47, 0x0E4E}, - {0x0EB1, 0x0EB1}, {0x0EB4, 0x0EB9}, {0x0EBB, 0x0EBC}, - {0x0EC8, 0x0ECD}, {0x0F18, 0x0F19}, {0x0F35, 0x0F35}, - {0x0F37, 0x0F37}, {0x0F39, 0x0F39}, {0x0F3E, 0x0F3F}, - {0x0F71, 0x0F84}, {0x0F86, 0x0F87}, {0x0F8D, 0x0F97}, - {0x0F99, 0x0FBC}, {0x0FC6, 0x0FC6}, {0x102B, 0x103E}, - {0x1056, 0x1059}, {0x105E, 0x1060}, {0x1062, 0x1064}, - {0x1067, 0x106D}, {0x1071, 0x1074}, {0x1082, 0x108D}, - {0x108F, 0x108F}, {0x109A, 0x109D}, {0x135D, 0x135F}, - {0x1712, 0x1714}, {0x1732, 0x1734}, {0x1752, 0x1753}, - {0x1772, 0x1773}, {0x17B4, 0x17D3}, {0x17DD, 0x17DD}, - {0x180B, 0x180D}, {0x1885, 0x1886}, {0x18A9, 0x18A9}, - {0x1920, 0x192B}, {0x1930, 0x193B}, {0x1A17, 0x1A1B}, - {0x1A55, 0x1A5E}, {0x1A60, 0x1A7C}, {0x1A7F, 0x1A7F}, - {0x1AB0, 0x1ABE}, {0x1B00, 0x1B04}, {0x1B34, 0x1B44}, - {0x1B6B, 0x1B73}, {0x1B80, 0x1B82}, {0x1BA1, 0x1BAD}, - {0x1BE6, 0x1BF3}, {0x1C24, 0x1C37}, {0x1CD0, 0x1CD2}, - {0x1CD4, 0x1CE8}, {0x1CED, 0x1CED}, {0x1CF2, 0x1CF4}, - {0x1CF8, 0x1CF9}, {0x1DC0, 0x1DF5}, {0x1DFB, 0x1DFF}, - {0x20D0, 0x20F0}, {0x2CEF, 0x2CF1}, {0x2D7F, 0x2D7F}, - {0x2DE0, 0x2DFF}, {0x302A, 0x302F}, {0x3099, 0x309A}, - {0xA66F, 0xA672}, {0xA674, 0xA67D}, {0xA69E, 0xA69F}, - {0xA6F0, 0xA6F1}, {0xA802, 0xA802}, {0xA806, 0xA806}, - {0xA80B, 0xA80B}, {0xA823, 0xA827}, {0xA880, 0xA881}, - {0xA8B4, 0xA8C5}, {0xA8E0, 0xA8F1}, {0xA926, 0xA92D}, - {0xA947, 0xA953}, {0xA980, 0xA983}, {0xA9B3, 0xA9C0}, - {0xA9E5, 0xA9E5}, {0xAA29, 0xAA36}, {0xAA43, 0xAA43}, - {0xAA4C, 0xAA4D}, {0xAA7B, 0xAA7D}, {0xAAB0, 0xAAB0}, - {0xAAB2, 0xAAB4}, {0xAAB7, 0xAAB8}, {0xAABE, 0xAABF}, - {0xAAC1, 0xAAC1}, {0xAAEB, 0xAAEF}, {0xAAF5, 0xAAF6}, - {0xABE3, 0xABEA}, {0xABEC, 0xABED}, {0xFB1E, 0xFB1E}, - {0xFE00, 0xFE0F}, {0xFE20, 0xFE2F}, {0x101FD, 0x101FD}, - {0x102E0, 0x102E0}, {0x10376, 0x1037A}, {0x10A01, 0x10A03}, - {0x10A05, 0x10A06}, {0x10A0C, 0x10A0F}, {0x10A38, 0x10A3A}, - {0x10A3F, 0x10A3F}, {0x10AE5, 0x10AE6}, {0x11000, 0x11002}, - {0x11038, 0x11046}, {0x1107F, 0x11082}, {0x110B0, 0x110BA}, - {0x11100, 0x11102}, {0x11127, 0x11134}, {0x11173, 0x11173}, - {0x11180, 0x11182}, {0x111B3, 0x111C0}, {0x111CA, 0x111CC}, - {0x1122C, 0x11237}, {0x1123E, 0x1123E}, {0x112DF, 0x112EA}, - {0x11300, 0x11303}, {0x1133C, 0x1133C}, {0x1133E, 0x11344}, - {0x11347, 0x11348}, {0x1134B, 0x1134D}, {0x11357, 0x11357}, - {0x11362, 0x11363}, {0x11366, 0x1136C}, {0x11370, 0x11374}, - {0x11435, 0x11446}, {0x114B0, 0x114C3}, {0x115AF, 0x115B5}, - {0x115B8, 0x115C0}, {0x115DC, 0x115DD}, {0x11630, 0x11640}, - {0x116AB, 0x116B7}, {0x1171D, 0x1172B}, {0x11C2F, 0x11C36}, - {0x11C38, 0x11C3F}, {0x11C92, 0x11CA7}, {0x11CA9, 0x11CB6}, - {0x16AF0, 0x16AF4}, {0x16B30, 0x16B36}, {0x16F51, 0x16F7E}, - {0x16F8F, 0x16F92}, {0x1BC9D, 0x1BC9E}, {0x1D165, 0x1D169}, - {0x1D16D, 0x1D172}, {0x1D17B, 0x1D182}, {0x1D185, 0x1D18B}, - {0x1D1AA, 0x1D1AD}, {0x1D242, 0x1D244}, {0x1DA00, 0x1DA36}, - {0x1DA3B, 0x1DA6C}, {0x1DA75, 0x1DA75}, {0x1DA84, 0x1DA84}, - {0x1DA9B, 0x1DA9F}, {0x1DAA1, 0x1DAAF}, {0x1E000, 0x1E006}, - {0x1E008, 0x1E018}, {0x1E01B, 0x1E021}, {0x1E023, 0x1E024}, - {0x1E026, 0x1E02A}, {0x1E8D0, 0x1E8D6}, {0x1E944, 0x1E94A}, - {0xE0100, 0xE01EF}, -} - -var doublewidth = table{ - {0x1100, 0x115F}, {0x231A, 0x231B}, {0x2329, 0x232A}, - {0x23E9, 0x23EC}, {0x23F0, 0x23F0}, {0x23F3, 0x23F3}, - {0x25FD, 0x25FE}, {0x2614, 0x2615}, {0x2648, 0x2653}, - {0x267F, 0x267F}, {0x2693, 0x2693}, {0x26A1, 0x26A1}, - {0x26AA, 0x26AB}, {0x26BD, 0x26BE}, {0x26C4, 0x26C5}, - {0x26CE, 0x26CE}, {0x26D4, 0x26D4}, {0x26EA, 0x26EA}, - {0x26F2, 0x26F3}, {0x26F5, 0x26F5}, {0x26FA, 0x26FA}, - {0x26FD, 0x26FD}, {0x2705, 0x2705}, {0x270A, 0x270B}, - {0x2728, 0x2728}, {0x274C, 0x274C}, {0x274E, 0x274E}, - {0x2753, 0x2755}, {0x2757, 0x2757}, {0x2795, 0x2797}, - {0x27B0, 0x27B0}, {0x27BF, 0x27BF}, {0x2B1B, 0x2B1C}, - {0x2B50, 0x2B50}, {0x2B55, 0x2B55}, {0x2E80, 0x2E99}, - {0x2E9B, 0x2EF3}, {0x2F00, 0x2FD5}, {0x2FF0, 0x2FFB}, - {0x3000, 0x303E}, {0x3041, 0x3096}, {0x3099, 0x30FF}, - {0x3105, 0x312D}, {0x3131, 0x318E}, {0x3190, 0x31BA}, - {0x31C0, 0x31E3}, {0x31F0, 0x321E}, {0x3220, 0x3247}, - {0x3250, 0x32FE}, {0x3300, 0x4DBF}, {0x4E00, 0xA48C}, - {0xA490, 0xA4C6}, {0xA960, 0xA97C}, {0xAC00, 0xD7A3}, - {0xF900, 0xFAFF}, {0xFE10, 0xFE19}, {0xFE30, 0xFE52}, - {0xFE54, 0xFE66}, {0xFE68, 0xFE6B}, {0xFF01, 0xFF60}, - {0xFFE0, 0xFFE6}, {0x16FE0, 0x16FE0}, {0x17000, 0x187EC}, - {0x18800, 0x18AF2}, {0x1B000, 0x1B001}, {0x1F004, 0x1F004}, - {0x1F0CF, 0x1F0CF}, {0x1F18E, 0x1F18E}, {0x1F191, 0x1F19A}, - {0x1F200, 0x1F202}, {0x1F210, 0x1F23B}, {0x1F240, 0x1F248}, - {0x1F250, 0x1F251}, {0x1F300, 0x1F320}, {0x1F32D, 0x1F335}, - {0x1F337, 0x1F37C}, {0x1F37E, 0x1F393}, {0x1F3A0, 0x1F3CA}, - {0x1F3CF, 0x1F3D3}, {0x1F3E0, 0x1F3F0}, {0x1F3F4, 0x1F3F4}, - {0x1F3F8, 0x1F43E}, {0x1F440, 0x1F440}, {0x1F442, 0x1F4FC}, - {0x1F4FF, 0x1F53D}, {0x1F54B, 0x1F54E}, {0x1F550, 0x1F567}, - {0x1F57A, 0x1F57A}, {0x1F595, 0x1F596}, {0x1F5A4, 0x1F5A4}, - {0x1F5FB, 0x1F64F}, {0x1F680, 0x1F6C5}, {0x1F6CC, 0x1F6CC}, - {0x1F6D0, 0x1F6D2}, {0x1F6EB, 0x1F6EC}, {0x1F6F4, 0x1F6F6}, - {0x1F910, 0x1F91E}, {0x1F920, 0x1F927}, {0x1F930, 0x1F930}, - {0x1F933, 0x1F93E}, {0x1F940, 0x1F94B}, {0x1F950, 0x1F95E}, - {0x1F980, 0x1F991}, {0x1F9C0, 0x1F9C0}, {0x20000, 0x2FFFD}, - {0x30000, 0x3FFFD}, -} - -var ambiguous = table{ - {0x00A1, 0x00A1}, {0x00A4, 0x00A4}, {0x00A7, 0x00A8}, - {0x00AA, 0x00AA}, {0x00AD, 0x00AE}, {0x00B0, 0x00B4}, - {0x00B6, 0x00BA}, {0x00BC, 0x00BF}, {0x00C6, 0x00C6}, - {0x00D0, 0x00D0}, {0x00D7, 0x00D8}, {0x00DE, 0x00E1}, - {0x00E6, 0x00E6}, {0x00E8, 0x00EA}, {0x00EC, 0x00ED}, - {0x00F0, 0x00F0}, {0x00F2, 0x00F3}, {0x00F7, 0x00FA}, - {0x00FC, 0x00FC}, {0x00FE, 0x00FE}, {0x0101, 0x0101}, - {0x0111, 0x0111}, {0x0113, 0x0113}, {0x011B, 0x011B}, - {0x0126, 0x0127}, {0x012B, 0x012B}, {0x0131, 0x0133}, - {0x0138, 0x0138}, {0x013F, 0x0142}, {0x0144, 0x0144}, - {0x0148, 0x014B}, {0x014D, 0x014D}, {0x0152, 0x0153}, - {0x0166, 0x0167}, {0x016B, 0x016B}, {0x01CE, 0x01CE}, - {0x01D0, 0x01D0}, {0x01D2, 0x01D2}, {0x01D4, 0x01D4}, - {0x01D6, 0x01D6}, {0x01D8, 0x01D8}, {0x01DA, 0x01DA}, - {0x01DC, 0x01DC}, {0x0251, 0x0251}, {0x0261, 0x0261}, - {0x02C4, 0x02C4}, {0x02C7, 0x02C7}, {0x02C9, 0x02CB}, - {0x02CD, 0x02CD}, {0x02D0, 0x02D0}, {0x02D8, 0x02DB}, - {0x02DD, 0x02DD}, {0x02DF, 0x02DF}, {0x0300, 0x036F}, - {0x0391, 0x03A1}, {0x03A3, 0x03A9}, {0x03B1, 0x03C1}, - {0x03C3, 0x03C9}, {0x0401, 0x0401}, {0x0410, 0x044F}, - {0x0451, 0x0451}, {0x2010, 0x2010}, {0x2013, 0x2016}, - {0x2018, 0x2019}, {0x201C, 0x201D}, {0x2020, 0x2022}, - {0x2024, 0x2027}, {0x2030, 0x2030}, {0x2032, 0x2033}, - {0x2035, 0x2035}, {0x203B, 0x203B}, {0x203E, 0x203E}, - {0x2074, 0x2074}, {0x207F, 0x207F}, {0x2081, 0x2084}, - {0x20AC, 0x20AC}, {0x2103, 0x2103}, {0x2105, 0x2105}, - {0x2109, 0x2109}, {0x2113, 0x2113}, {0x2116, 0x2116}, - {0x2121, 0x2122}, {0x2126, 0x2126}, {0x212B, 0x212B}, - {0x2153, 0x2154}, {0x215B, 0x215E}, {0x2160, 0x216B}, - {0x2170, 0x2179}, {0x2189, 0x2189}, {0x2190, 0x2199}, - {0x21B8, 0x21B9}, {0x21D2, 0x21D2}, {0x21D4, 0x21D4}, - {0x21E7, 0x21E7}, {0x2200, 0x2200}, {0x2202, 0x2203}, - {0x2207, 0x2208}, {0x220B, 0x220B}, {0x220F, 0x220F}, - {0x2211, 0x2211}, {0x2215, 0x2215}, {0x221A, 0x221A}, - {0x221D, 0x2220}, {0x2223, 0x2223}, {0x2225, 0x2225}, - {0x2227, 0x222C}, {0x222E, 0x222E}, {0x2234, 0x2237}, - {0x223C, 0x223D}, {0x2248, 0x2248}, {0x224C, 0x224C}, - {0x2252, 0x2252}, {0x2260, 0x2261}, {0x2264, 0x2267}, - {0x226A, 0x226B}, {0x226E, 0x226F}, {0x2282, 0x2283}, - {0x2286, 0x2287}, {0x2295, 0x2295}, {0x2299, 0x2299}, - {0x22A5, 0x22A5}, {0x22BF, 0x22BF}, {0x2312, 0x2312}, - {0x2460, 0x24E9}, {0x24EB, 0x254B}, {0x2550, 0x2573}, - {0x2580, 0x258F}, {0x2592, 0x2595}, {0x25A0, 0x25A1}, - {0x25A3, 0x25A9}, {0x25B2, 0x25B3}, {0x25B6, 0x25B7}, - {0x25BC, 0x25BD}, {0x25C0, 0x25C1}, {0x25C6, 0x25C8}, - {0x25CB, 0x25CB}, {0x25CE, 0x25D1}, {0x25E2, 0x25E5}, - {0x25EF, 0x25EF}, {0x2605, 0x2606}, {0x2609, 0x2609}, - {0x260E, 0x260F}, {0x261C, 0x261C}, {0x261E, 0x261E}, - {0x2640, 0x2640}, {0x2642, 0x2642}, {0x2660, 0x2661}, - {0x2663, 0x2665}, {0x2667, 0x266A}, {0x266C, 0x266D}, - {0x266F, 0x266F}, {0x269E, 0x269F}, {0x26BF, 0x26BF}, - {0x26C6, 0x26CD}, {0x26CF, 0x26D3}, {0x26D5, 0x26E1}, - {0x26E3, 0x26E3}, {0x26E8, 0x26E9}, {0x26EB, 0x26F1}, - {0x26F4, 0x26F4}, {0x26F6, 0x26F9}, {0x26FB, 0x26FC}, - {0x26FE, 0x26FF}, {0x273D, 0x273D}, {0x2776, 0x277F}, - {0x2B56, 0x2B59}, {0x3248, 0x324F}, {0xE000, 0xF8FF}, - {0xFE00, 0xFE0F}, {0xFFFD, 0xFFFD}, {0x1F100, 0x1F10A}, - {0x1F110, 0x1F12D}, {0x1F130, 0x1F169}, {0x1F170, 0x1F18D}, - {0x1F18F, 0x1F190}, {0x1F19B, 0x1F1AC}, {0xE0100, 0xE01EF}, - {0xF0000, 0xFFFFD}, {0x100000, 0x10FFFD}, -} - -var emoji = table{ - {0x1F1E6, 0x1F1FF}, {0x1F321, 0x1F321}, {0x1F324, 0x1F32C}, - {0x1F336, 0x1F336}, {0x1F37D, 0x1F37D}, {0x1F396, 0x1F397}, - {0x1F399, 0x1F39B}, {0x1F39E, 0x1F39F}, {0x1F3CB, 0x1F3CE}, - {0x1F3D4, 0x1F3DF}, {0x1F3F3, 0x1F3F5}, {0x1F3F7, 0x1F3F7}, - {0x1F43F, 0x1F43F}, {0x1F441, 0x1F441}, {0x1F4FD, 0x1F4FD}, - {0x1F549, 0x1F54A}, {0x1F56F, 0x1F570}, {0x1F573, 0x1F579}, - {0x1F587, 0x1F587}, {0x1F58A, 0x1F58D}, {0x1F590, 0x1F590}, - {0x1F5A5, 0x1F5A5}, {0x1F5A8, 0x1F5A8}, {0x1F5B1, 0x1F5B2}, - {0x1F5BC, 0x1F5BC}, {0x1F5C2, 0x1F5C4}, {0x1F5D1, 0x1F5D3}, - {0x1F5DC, 0x1F5DE}, {0x1F5E1, 0x1F5E1}, {0x1F5E3, 0x1F5E3}, - {0x1F5E8, 0x1F5E8}, {0x1F5EF, 0x1F5EF}, {0x1F5F3, 0x1F5F3}, - {0x1F5FA, 0x1F5FA}, {0x1F6CB, 0x1F6CF}, {0x1F6E0, 0x1F6E5}, - {0x1F6E9, 0x1F6E9}, {0x1F6F0, 0x1F6F0}, {0x1F6F3, 0x1F6F3}, -} - -var notassigned = table{ - {0x0378, 0x0379}, {0x0380, 0x0383}, {0x038B, 0x038B}, - {0x038D, 0x038D}, {0x03A2, 0x03A2}, {0x0530, 0x0530}, - {0x0557, 0x0558}, {0x0560, 0x0560}, {0x0588, 0x0588}, - {0x058B, 0x058C}, {0x0590, 0x0590}, {0x05C8, 0x05CF}, - {0x05EB, 0x05EF}, {0x05F5, 0x05FF}, {0x061D, 0x061D}, - {0x070E, 0x070E}, {0x074B, 0x074C}, {0x07B2, 0x07BF}, - {0x07FB, 0x07FF}, {0x082E, 0x082F}, {0x083F, 0x083F}, - {0x085C, 0x085D}, {0x085F, 0x089F}, {0x08B5, 0x08B5}, - {0x08BE, 0x08D3}, {0x0984, 0x0984}, {0x098D, 0x098E}, - {0x0991, 0x0992}, {0x09A9, 0x09A9}, {0x09B1, 0x09B1}, - {0x09B3, 0x09B5}, {0x09BA, 0x09BB}, {0x09C5, 0x09C6}, - {0x09C9, 0x09CA}, {0x09CF, 0x09D6}, {0x09D8, 0x09DB}, - {0x09DE, 0x09DE}, {0x09E4, 0x09E5}, {0x09FC, 0x0A00}, - {0x0A04, 0x0A04}, {0x0A0B, 0x0A0E}, {0x0A11, 0x0A12}, - {0x0A29, 0x0A29}, {0x0A31, 0x0A31}, {0x0A34, 0x0A34}, - {0x0A37, 0x0A37}, {0x0A3A, 0x0A3B}, {0x0A3D, 0x0A3D}, - {0x0A43, 0x0A46}, {0x0A49, 0x0A4A}, {0x0A4E, 0x0A50}, - {0x0A52, 0x0A58}, {0x0A5D, 0x0A5D}, {0x0A5F, 0x0A65}, - {0x0A76, 0x0A80}, {0x0A84, 0x0A84}, {0x0A8E, 0x0A8E}, - {0x0A92, 0x0A92}, {0x0AA9, 0x0AA9}, {0x0AB1, 0x0AB1}, - {0x0AB4, 0x0AB4}, {0x0ABA, 0x0ABB}, {0x0AC6, 0x0AC6}, - {0x0ACA, 0x0ACA}, {0x0ACE, 0x0ACF}, {0x0AD1, 0x0ADF}, - {0x0AE4, 0x0AE5}, {0x0AF2, 0x0AF8}, {0x0AFA, 0x0B00}, - {0x0B04, 0x0B04}, {0x0B0D, 0x0B0E}, {0x0B11, 0x0B12}, - {0x0B29, 0x0B29}, {0x0B31, 0x0B31}, {0x0B34, 0x0B34}, - {0x0B3A, 0x0B3B}, {0x0B45, 0x0B46}, {0x0B49, 0x0B4A}, - {0x0B4E, 0x0B55}, {0x0B58, 0x0B5B}, {0x0B5E, 0x0B5E}, - {0x0B64, 0x0B65}, {0x0B78, 0x0B81}, {0x0B84, 0x0B84}, - {0x0B8B, 0x0B8D}, {0x0B91, 0x0B91}, {0x0B96, 0x0B98}, - {0x0B9B, 0x0B9B}, {0x0B9D, 0x0B9D}, {0x0BA0, 0x0BA2}, - {0x0BA5, 0x0BA7}, {0x0BAB, 0x0BAD}, {0x0BBA, 0x0BBD}, - {0x0BC3, 0x0BC5}, {0x0BC9, 0x0BC9}, {0x0BCE, 0x0BCF}, - {0x0BD1, 0x0BD6}, {0x0BD8, 0x0BE5}, {0x0BFB, 0x0BFF}, - {0x0C04, 0x0C04}, {0x0C0D, 0x0C0D}, {0x0C11, 0x0C11}, - {0x0C29, 0x0C29}, {0x0C3A, 0x0C3C}, {0x0C45, 0x0C45}, - {0x0C49, 0x0C49}, {0x0C4E, 0x0C54}, {0x0C57, 0x0C57}, - {0x0C5B, 0x0C5F}, {0x0C64, 0x0C65}, {0x0C70, 0x0C77}, - {0x0C84, 0x0C84}, {0x0C8D, 0x0C8D}, {0x0C91, 0x0C91}, - {0x0CA9, 0x0CA9}, {0x0CB4, 0x0CB4}, {0x0CBA, 0x0CBB}, - {0x0CC5, 0x0CC5}, {0x0CC9, 0x0CC9}, {0x0CCE, 0x0CD4}, - {0x0CD7, 0x0CDD}, {0x0CDF, 0x0CDF}, {0x0CE4, 0x0CE5}, - {0x0CF0, 0x0CF0}, {0x0CF3, 0x0D00}, {0x0D04, 0x0D04}, - {0x0D0D, 0x0D0D}, {0x0D11, 0x0D11}, {0x0D3B, 0x0D3C}, - {0x0D45, 0x0D45}, {0x0D49, 0x0D49}, {0x0D50, 0x0D53}, - {0x0D64, 0x0D65}, {0x0D80, 0x0D81}, {0x0D84, 0x0D84}, - {0x0D97, 0x0D99}, {0x0DB2, 0x0DB2}, {0x0DBC, 0x0DBC}, - {0x0DBE, 0x0DBF}, {0x0DC7, 0x0DC9}, {0x0DCB, 0x0DCE}, - {0x0DD5, 0x0DD5}, {0x0DD7, 0x0DD7}, {0x0DE0, 0x0DE5}, - {0x0DF0, 0x0DF1}, {0x0DF5, 0x0E00}, {0x0E3B, 0x0E3E}, - {0x0E5C, 0x0E80}, {0x0E83, 0x0E83}, {0x0E85, 0x0E86}, - {0x0E89, 0x0E89}, {0x0E8B, 0x0E8C}, {0x0E8E, 0x0E93}, - {0x0E98, 0x0E98}, {0x0EA0, 0x0EA0}, {0x0EA4, 0x0EA4}, - {0x0EA6, 0x0EA6}, {0x0EA8, 0x0EA9}, {0x0EAC, 0x0EAC}, - {0x0EBA, 0x0EBA}, {0x0EBE, 0x0EBF}, {0x0EC5, 0x0EC5}, - {0x0EC7, 0x0EC7}, {0x0ECE, 0x0ECF}, {0x0EDA, 0x0EDB}, - {0x0EE0, 0x0EFF}, {0x0F48, 0x0F48}, {0x0F6D, 0x0F70}, - {0x0F98, 0x0F98}, {0x0FBD, 0x0FBD}, {0x0FCD, 0x0FCD}, - {0x0FDB, 0x0FFF}, {0x10C6, 0x10C6}, {0x10C8, 0x10CC}, - {0x10CE, 0x10CF}, {0x1249, 0x1249}, {0x124E, 0x124F}, - {0x1257, 0x1257}, {0x1259, 0x1259}, {0x125E, 0x125F}, - {0x1289, 0x1289}, {0x128E, 0x128F}, {0x12B1, 0x12B1}, - {0x12B6, 0x12B7}, {0x12BF, 0x12BF}, {0x12C1, 0x12C1}, - {0x12C6, 0x12C7}, {0x12D7, 0x12D7}, {0x1311, 0x1311}, - {0x1316, 0x1317}, {0x135B, 0x135C}, {0x137D, 0x137F}, - {0x139A, 0x139F}, {0x13F6, 0x13F7}, {0x13FE, 0x13FF}, - {0x169D, 0x169F}, {0x16F9, 0x16FF}, {0x170D, 0x170D}, - {0x1715, 0x171F}, {0x1737, 0x173F}, {0x1754, 0x175F}, - {0x176D, 0x176D}, {0x1771, 0x1771}, {0x1774, 0x177F}, - {0x17DE, 0x17DF}, {0x17EA, 0x17EF}, {0x17FA, 0x17FF}, - {0x180F, 0x180F}, {0x181A, 0x181F}, {0x1878, 0x187F}, - {0x18AB, 0x18AF}, {0x18F6, 0x18FF}, {0x191F, 0x191F}, - {0x192C, 0x192F}, {0x193C, 0x193F}, {0x1941, 0x1943}, - {0x196E, 0x196F}, {0x1975, 0x197F}, {0x19AC, 0x19AF}, - {0x19CA, 0x19CF}, {0x19DB, 0x19DD}, {0x1A1C, 0x1A1D}, - {0x1A5F, 0x1A5F}, {0x1A7D, 0x1A7E}, {0x1A8A, 0x1A8F}, - {0x1A9A, 0x1A9F}, {0x1AAE, 0x1AAF}, {0x1ABF, 0x1AFF}, - {0x1B4C, 0x1B4F}, {0x1B7D, 0x1B7F}, {0x1BF4, 0x1BFB}, - {0x1C38, 0x1C3A}, {0x1C4A, 0x1C4C}, {0x1C89, 0x1CBF}, - {0x1CC8, 0x1CCF}, {0x1CF7, 0x1CF7}, {0x1CFA, 0x1CFF}, - {0x1DF6, 0x1DFA}, {0x1F16, 0x1F17}, {0x1F1E, 0x1F1F}, - {0x1F46, 0x1F47}, {0x1F4E, 0x1F4F}, {0x1F58, 0x1F58}, - {0x1F5A, 0x1F5A}, {0x1F5C, 0x1F5C}, {0x1F5E, 0x1F5E}, - {0x1F7E, 0x1F7F}, {0x1FB5, 0x1FB5}, {0x1FC5, 0x1FC5}, - {0x1FD4, 0x1FD5}, {0x1FDC, 0x1FDC}, {0x1FF0, 0x1FF1}, - {0x1FF5, 0x1FF5}, {0x1FFF, 0x1FFF}, {0x2065, 0x2065}, - {0x2072, 0x2073}, {0x208F, 0x208F}, {0x209D, 0x209F}, - {0x20BF, 0x20CF}, {0x20F1, 0x20FF}, {0x218C, 0x218F}, - {0x23FF, 0x23FF}, {0x2427, 0x243F}, {0x244B, 0x245F}, - {0x2B74, 0x2B75}, {0x2B96, 0x2B97}, {0x2BBA, 0x2BBC}, - {0x2BC9, 0x2BC9}, {0x2BD2, 0x2BEB}, {0x2BF0, 0x2BFF}, - {0x2C2F, 0x2C2F}, {0x2C5F, 0x2C5F}, {0x2CF4, 0x2CF8}, - {0x2D26, 0x2D26}, {0x2D28, 0x2D2C}, {0x2D2E, 0x2D2F}, - {0x2D68, 0x2D6E}, {0x2D71, 0x2D7E}, {0x2D97, 0x2D9F}, - {0x2DA7, 0x2DA7}, {0x2DAF, 0x2DAF}, {0x2DB7, 0x2DB7}, - {0x2DBF, 0x2DBF}, {0x2DC7, 0x2DC7}, {0x2DCF, 0x2DCF}, - {0x2DD7, 0x2DD7}, {0x2DDF, 0x2DDF}, {0x2E45, 0x2E7F}, - {0x2E9A, 0x2E9A}, {0x2EF4, 0x2EFF}, {0x2FD6, 0x2FEF}, - {0x2FFC, 0x2FFF}, {0x3040, 0x3040}, {0x3097, 0x3098}, - {0x3100, 0x3104}, {0x312E, 0x3130}, {0x318F, 0x318F}, - {0x31BB, 0x31BF}, {0x31E4, 0x31EF}, {0x321F, 0x321F}, - {0x32FF, 0x32FF}, {0x4DB6, 0x4DBF}, {0x9FD6, 0x9FFF}, - {0xA48D, 0xA48F}, {0xA4C7, 0xA4CF}, {0xA62C, 0xA63F}, - {0xA6F8, 0xA6FF}, {0xA7AF, 0xA7AF}, {0xA7B8, 0xA7F6}, - {0xA82C, 0xA82F}, {0xA83A, 0xA83F}, {0xA878, 0xA87F}, - {0xA8C6, 0xA8CD}, {0xA8DA, 0xA8DF}, {0xA8FE, 0xA8FF}, - {0xA954, 0xA95E}, {0xA97D, 0xA97F}, {0xA9CE, 0xA9CE}, - {0xA9DA, 0xA9DD}, {0xA9FF, 0xA9FF}, {0xAA37, 0xAA3F}, - {0xAA4E, 0xAA4F}, {0xAA5A, 0xAA5B}, {0xAAC3, 0xAADA}, - {0xAAF7, 0xAB00}, {0xAB07, 0xAB08}, {0xAB0F, 0xAB10}, - {0xAB17, 0xAB1F}, {0xAB27, 0xAB27}, {0xAB2F, 0xAB2F}, - {0xAB66, 0xAB6F}, {0xABEE, 0xABEF}, {0xABFA, 0xABFF}, - {0xD7A4, 0xD7AF}, {0xD7C7, 0xD7CA}, {0xD7FC, 0xD7FF}, - {0xFA6E, 0xFA6F}, {0xFADA, 0xFAFF}, {0xFB07, 0xFB12}, - {0xFB18, 0xFB1C}, {0xFB37, 0xFB37}, {0xFB3D, 0xFB3D}, - {0xFB3F, 0xFB3F}, {0xFB42, 0xFB42}, {0xFB45, 0xFB45}, - {0xFBC2, 0xFBD2}, {0xFD40, 0xFD4F}, {0xFD90, 0xFD91}, - {0xFDC8, 0xFDEF}, {0xFDFE, 0xFDFF}, {0xFE1A, 0xFE1F}, - {0xFE53, 0xFE53}, {0xFE67, 0xFE67}, {0xFE6C, 0xFE6F}, - {0xFE75, 0xFE75}, {0xFEFD, 0xFEFE}, {0xFF00, 0xFF00}, - {0xFFBF, 0xFFC1}, {0xFFC8, 0xFFC9}, {0xFFD0, 0xFFD1}, - {0xFFD8, 0xFFD9}, {0xFFDD, 0xFFDF}, {0xFFE7, 0xFFE7}, - {0xFFEF, 0xFFF8}, {0xFFFE, 0xFFFF}, {0x1000C, 0x1000C}, - {0x10027, 0x10027}, {0x1003B, 0x1003B}, {0x1003E, 0x1003E}, - {0x1004E, 0x1004F}, {0x1005E, 0x1007F}, {0x100FB, 0x100FF}, - {0x10103, 0x10106}, {0x10134, 0x10136}, {0x1018F, 0x1018F}, - {0x1019C, 0x1019F}, {0x101A1, 0x101CF}, {0x101FE, 0x1027F}, - {0x1029D, 0x1029F}, {0x102D1, 0x102DF}, {0x102FC, 0x102FF}, - {0x10324, 0x1032F}, {0x1034B, 0x1034F}, {0x1037B, 0x1037F}, - {0x1039E, 0x1039E}, {0x103C4, 0x103C7}, {0x103D6, 0x103FF}, - {0x1049E, 0x1049F}, {0x104AA, 0x104AF}, {0x104D4, 0x104D7}, - {0x104FC, 0x104FF}, {0x10528, 0x1052F}, {0x10564, 0x1056E}, - {0x10570, 0x105FF}, {0x10737, 0x1073F}, {0x10756, 0x1075F}, - {0x10768, 0x107FF}, {0x10806, 0x10807}, {0x10809, 0x10809}, - {0x10836, 0x10836}, {0x10839, 0x1083B}, {0x1083D, 0x1083E}, - {0x10856, 0x10856}, {0x1089F, 0x108A6}, {0x108B0, 0x108DF}, - {0x108F3, 0x108F3}, {0x108F6, 0x108FA}, {0x1091C, 0x1091E}, - {0x1093A, 0x1093E}, {0x10940, 0x1097F}, {0x109B8, 0x109BB}, - {0x109D0, 0x109D1}, {0x10A04, 0x10A04}, {0x10A07, 0x10A0B}, - {0x10A14, 0x10A14}, {0x10A18, 0x10A18}, {0x10A34, 0x10A37}, - {0x10A3B, 0x10A3E}, {0x10A48, 0x10A4F}, {0x10A59, 0x10A5F}, - {0x10AA0, 0x10ABF}, {0x10AE7, 0x10AEA}, {0x10AF7, 0x10AFF}, - {0x10B36, 0x10B38}, {0x10B56, 0x10B57}, {0x10B73, 0x10B77}, - {0x10B92, 0x10B98}, {0x10B9D, 0x10BA8}, {0x10BB0, 0x10BFF}, - {0x10C49, 0x10C7F}, {0x10CB3, 0x10CBF}, {0x10CF3, 0x10CF9}, - {0x10D00, 0x10E5F}, {0x10E7F, 0x10FFF}, {0x1104E, 0x11051}, - {0x11070, 0x1107E}, {0x110C2, 0x110CF}, {0x110E9, 0x110EF}, - {0x110FA, 0x110FF}, {0x11135, 0x11135}, {0x11144, 0x1114F}, - {0x11177, 0x1117F}, {0x111CE, 0x111CF}, {0x111E0, 0x111E0}, - {0x111F5, 0x111FF}, {0x11212, 0x11212}, {0x1123F, 0x1127F}, - {0x11287, 0x11287}, {0x11289, 0x11289}, {0x1128E, 0x1128E}, - {0x1129E, 0x1129E}, {0x112AA, 0x112AF}, {0x112EB, 0x112EF}, - {0x112FA, 0x112FF}, {0x11304, 0x11304}, {0x1130D, 0x1130E}, - {0x11311, 0x11312}, {0x11329, 0x11329}, {0x11331, 0x11331}, - {0x11334, 0x11334}, {0x1133A, 0x1133B}, {0x11345, 0x11346}, - {0x11349, 0x1134A}, {0x1134E, 0x1134F}, {0x11351, 0x11356}, - {0x11358, 0x1135C}, {0x11364, 0x11365}, {0x1136D, 0x1136F}, - {0x11375, 0x113FF}, {0x1145A, 0x1145A}, {0x1145C, 0x1145C}, - {0x1145E, 0x1147F}, {0x114C8, 0x114CF}, {0x114DA, 0x1157F}, - {0x115B6, 0x115B7}, {0x115DE, 0x115FF}, {0x11645, 0x1164F}, - {0x1165A, 0x1165F}, {0x1166D, 0x1167F}, {0x116B8, 0x116BF}, - {0x116CA, 0x116FF}, {0x1171A, 0x1171C}, {0x1172C, 0x1172F}, - {0x11740, 0x1189F}, {0x118F3, 0x118FE}, {0x11900, 0x11ABF}, - {0x11AF9, 0x11BFF}, {0x11C09, 0x11C09}, {0x11C37, 0x11C37}, - {0x11C46, 0x11C4F}, {0x11C6D, 0x11C6F}, {0x11C90, 0x11C91}, - {0x11CA8, 0x11CA8}, {0x11CB7, 0x11FFF}, {0x1239A, 0x123FF}, - {0x1246F, 0x1246F}, {0x12475, 0x1247F}, {0x12544, 0x12FFF}, - {0x1342F, 0x143FF}, {0x14647, 0x167FF}, {0x16A39, 0x16A3F}, - {0x16A5F, 0x16A5F}, {0x16A6A, 0x16A6D}, {0x16A70, 0x16ACF}, - {0x16AEE, 0x16AEF}, {0x16AF6, 0x16AFF}, {0x16B46, 0x16B4F}, - {0x16B5A, 0x16B5A}, {0x16B62, 0x16B62}, {0x16B78, 0x16B7C}, - {0x16B90, 0x16EFF}, {0x16F45, 0x16F4F}, {0x16F7F, 0x16F8E}, - {0x16FA0, 0x16FDF}, {0x16FE1, 0x16FFF}, {0x187ED, 0x187FF}, - {0x18AF3, 0x1AFFF}, {0x1B002, 0x1BBFF}, {0x1BC6B, 0x1BC6F}, - {0x1BC7D, 0x1BC7F}, {0x1BC89, 0x1BC8F}, {0x1BC9A, 0x1BC9B}, - {0x1BCA4, 0x1CFFF}, {0x1D0F6, 0x1D0FF}, {0x1D127, 0x1D128}, - {0x1D1E9, 0x1D1FF}, {0x1D246, 0x1D2FF}, {0x1D357, 0x1D35F}, - {0x1D372, 0x1D3FF}, {0x1D455, 0x1D455}, {0x1D49D, 0x1D49D}, - {0x1D4A0, 0x1D4A1}, {0x1D4A3, 0x1D4A4}, {0x1D4A7, 0x1D4A8}, - {0x1D4AD, 0x1D4AD}, {0x1D4BA, 0x1D4BA}, {0x1D4BC, 0x1D4BC}, - {0x1D4C4, 0x1D4C4}, {0x1D506, 0x1D506}, {0x1D50B, 0x1D50C}, - {0x1D515, 0x1D515}, {0x1D51D, 0x1D51D}, {0x1D53A, 0x1D53A}, - {0x1D53F, 0x1D53F}, {0x1D545, 0x1D545}, {0x1D547, 0x1D549}, - {0x1D551, 0x1D551}, {0x1D6A6, 0x1D6A7}, {0x1D7CC, 0x1D7CD}, - {0x1DA8C, 0x1DA9A}, {0x1DAA0, 0x1DAA0}, {0x1DAB0, 0x1DFFF}, - {0x1E007, 0x1E007}, {0x1E019, 0x1E01A}, {0x1E022, 0x1E022}, - {0x1E025, 0x1E025}, {0x1E02B, 0x1E7FF}, {0x1E8C5, 0x1E8C6}, - {0x1E8D7, 0x1E8FF}, {0x1E94B, 0x1E94F}, {0x1E95A, 0x1E95D}, - {0x1E960, 0x1EDFF}, {0x1EE04, 0x1EE04}, {0x1EE20, 0x1EE20}, - {0x1EE23, 0x1EE23}, {0x1EE25, 0x1EE26}, {0x1EE28, 0x1EE28}, - {0x1EE33, 0x1EE33}, {0x1EE38, 0x1EE38}, {0x1EE3A, 0x1EE3A}, - {0x1EE3C, 0x1EE41}, {0x1EE43, 0x1EE46}, {0x1EE48, 0x1EE48}, - {0x1EE4A, 0x1EE4A}, {0x1EE4C, 0x1EE4C}, {0x1EE50, 0x1EE50}, - {0x1EE53, 0x1EE53}, {0x1EE55, 0x1EE56}, {0x1EE58, 0x1EE58}, - {0x1EE5A, 0x1EE5A}, {0x1EE5C, 0x1EE5C}, {0x1EE5E, 0x1EE5E}, - {0x1EE60, 0x1EE60}, {0x1EE63, 0x1EE63}, {0x1EE65, 0x1EE66}, - {0x1EE6B, 0x1EE6B}, {0x1EE73, 0x1EE73}, {0x1EE78, 0x1EE78}, - {0x1EE7D, 0x1EE7D}, {0x1EE7F, 0x1EE7F}, {0x1EE8A, 0x1EE8A}, - {0x1EE9C, 0x1EEA0}, {0x1EEA4, 0x1EEA4}, {0x1EEAA, 0x1EEAA}, - {0x1EEBC, 0x1EEEF}, {0x1EEF2, 0x1EFFF}, {0x1F02C, 0x1F02F}, - {0x1F094, 0x1F09F}, {0x1F0AF, 0x1F0B0}, {0x1F0C0, 0x1F0C0}, - {0x1F0D0, 0x1F0D0}, {0x1F0F6, 0x1F0FF}, {0x1F10D, 0x1F10F}, - {0x1F12F, 0x1F12F}, {0x1F16C, 0x1F16F}, {0x1F1AD, 0x1F1E5}, - {0x1F203, 0x1F20F}, {0x1F23C, 0x1F23F}, {0x1F249, 0x1F24F}, - {0x1F252, 0x1F2FF}, {0x1F6D3, 0x1F6DF}, {0x1F6ED, 0x1F6EF}, - {0x1F6F7, 0x1F6FF}, {0x1F774, 0x1F77F}, {0x1F7D5, 0x1F7FF}, - {0x1F80C, 0x1F80F}, {0x1F848, 0x1F84F}, {0x1F85A, 0x1F85F}, - {0x1F888, 0x1F88F}, {0x1F8AE, 0x1F90F}, {0x1F91F, 0x1F91F}, - {0x1F928, 0x1F92F}, {0x1F931, 0x1F932}, {0x1F93F, 0x1F93F}, - {0x1F94C, 0x1F94F}, {0x1F95F, 0x1F97F}, {0x1F992, 0x1F9BF}, - {0x1F9C1, 0x1FFFF}, {0x2A6D7, 0x2A6FF}, {0x2B735, 0x2B73F}, - {0x2B81E, 0x2B81F}, {0x2CEA2, 0x2F7FF}, {0x2FA1E, 0xE0000}, - {0xE0002, 0xE001F}, {0xE0080, 0xE00FF}, {0xE01F0, 0xEFFFF}, - {0xFFFFE, 0xFFFFF}, -} - -var neutral = table{ - {0x0000, 0x001F}, {0x007F, 0x007F}, {0x0080, 0x009F}, - {0x00A0, 0x00A0}, {0x00A9, 0x00A9}, {0x00AB, 0x00AB}, - {0x00B5, 0x00B5}, {0x00BB, 0x00BB}, {0x00C0, 0x00C5}, - {0x00C7, 0x00CF}, {0x00D1, 0x00D6}, {0x00D9, 0x00DD}, - {0x00E2, 0x00E5}, {0x00E7, 0x00E7}, {0x00EB, 0x00EB}, - {0x00EE, 0x00EF}, {0x00F1, 0x00F1}, {0x00F4, 0x00F6}, - {0x00FB, 0x00FB}, {0x00FD, 0x00FD}, {0x00FF, 0x00FF}, - {0x0100, 0x0100}, {0x0102, 0x0110}, {0x0112, 0x0112}, - {0x0114, 0x011A}, {0x011C, 0x0125}, {0x0128, 0x012A}, - {0x012C, 0x0130}, {0x0134, 0x0137}, {0x0139, 0x013E}, - {0x0143, 0x0143}, {0x0145, 0x0147}, {0x014C, 0x014C}, - {0x014E, 0x0151}, {0x0154, 0x0165}, {0x0168, 0x016A}, - {0x016C, 0x017F}, {0x0180, 0x01BA}, {0x01BB, 0x01BB}, - {0x01BC, 0x01BF}, {0x01C0, 0x01C3}, {0x01C4, 0x01CD}, - {0x01CF, 0x01CF}, {0x01D1, 0x01D1}, {0x01D3, 0x01D3}, - {0x01D5, 0x01D5}, {0x01D7, 0x01D7}, {0x01D9, 0x01D9}, - {0x01DB, 0x01DB}, {0x01DD, 0x024F}, {0x0250, 0x0250}, - {0x0252, 0x0260}, {0x0262, 0x0293}, {0x0294, 0x0294}, - {0x0295, 0x02AF}, {0x02B0, 0x02C1}, {0x02C2, 0x02C3}, - {0x02C5, 0x02C5}, {0x02C6, 0x02C6}, {0x02C8, 0x02C8}, - {0x02CC, 0x02CC}, {0x02CE, 0x02CF}, {0x02D1, 0x02D1}, - {0x02D2, 0x02D7}, {0x02DC, 0x02DC}, {0x02DE, 0x02DE}, - {0x02E0, 0x02E4}, {0x02E5, 0x02EB}, {0x02EC, 0x02EC}, - {0x02ED, 0x02ED}, {0x02EE, 0x02EE}, {0x02EF, 0x02FF}, - {0x0370, 0x0373}, {0x0374, 0x0374}, {0x0375, 0x0375}, - {0x0376, 0x0377}, {0x037A, 0x037A}, {0x037B, 0x037D}, - {0x037E, 0x037E}, {0x037F, 0x037F}, {0x0384, 0x0385}, - {0x0386, 0x0386}, {0x0387, 0x0387}, {0x0388, 0x038A}, - {0x038C, 0x038C}, {0x038E, 0x0390}, {0x03AA, 0x03B0}, - {0x03C2, 0x03C2}, {0x03CA, 0x03F5}, {0x03F6, 0x03F6}, - {0x03F7, 0x03FF}, {0x0400, 0x0400}, {0x0402, 0x040F}, - {0x0450, 0x0450}, {0x0452, 0x0481}, {0x0482, 0x0482}, - {0x0483, 0x0487}, {0x0488, 0x0489}, {0x048A, 0x04FF}, - {0x0500, 0x052F}, {0x0531, 0x0556}, {0x0559, 0x0559}, - {0x055A, 0x055F}, {0x0561, 0x0587}, {0x0589, 0x0589}, - {0x058A, 0x058A}, {0x058D, 0x058E}, {0x058F, 0x058F}, - {0x0591, 0x05BD}, {0x05BE, 0x05BE}, {0x05BF, 0x05BF}, - {0x05C0, 0x05C0}, {0x05C1, 0x05C2}, {0x05C3, 0x05C3}, - {0x05C4, 0x05C5}, {0x05C6, 0x05C6}, {0x05C7, 0x05C7}, - {0x05D0, 0x05EA}, {0x05F0, 0x05F2}, {0x05F3, 0x05F4}, - {0x0600, 0x0605}, {0x0606, 0x0608}, {0x0609, 0x060A}, - {0x060B, 0x060B}, {0x060C, 0x060D}, {0x060E, 0x060F}, - {0x0610, 0x061A}, {0x061B, 0x061B}, {0x061C, 0x061C}, - {0x061E, 0x061F}, {0x0620, 0x063F}, {0x0640, 0x0640}, - {0x0641, 0x064A}, {0x064B, 0x065F}, {0x0660, 0x0669}, - {0x066A, 0x066D}, {0x066E, 0x066F}, {0x0670, 0x0670}, - {0x0671, 0x06D3}, {0x06D4, 0x06D4}, {0x06D5, 0x06D5}, - {0x06D6, 0x06DC}, {0x06DD, 0x06DD}, {0x06DE, 0x06DE}, - {0x06DF, 0x06E4}, {0x06E5, 0x06E6}, {0x06E7, 0x06E8}, - {0x06E9, 0x06E9}, {0x06EA, 0x06ED}, {0x06EE, 0x06EF}, - {0x06F0, 0x06F9}, {0x06FA, 0x06FC}, {0x06FD, 0x06FE}, - {0x06FF, 0x06FF}, {0x0700, 0x070D}, {0x070F, 0x070F}, - {0x0710, 0x0710}, {0x0711, 0x0711}, {0x0712, 0x072F}, - {0x0730, 0x074A}, {0x074D, 0x074F}, {0x0750, 0x077F}, - {0x0780, 0x07A5}, {0x07A6, 0x07B0}, {0x07B1, 0x07B1}, - {0x07C0, 0x07C9}, {0x07CA, 0x07EA}, {0x07EB, 0x07F3}, - {0x07F4, 0x07F5}, {0x07F6, 0x07F6}, {0x07F7, 0x07F9}, - {0x07FA, 0x07FA}, {0x0800, 0x0815}, {0x0816, 0x0819}, - {0x081A, 0x081A}, {0x081B, 0x0823}, {0x0824, 0x0824}, - {0x0825, 0x0827}, {0x0828, 0x0828}, {0x0829, 0x082D}, - {0x0830, 0x083E}, {0x0840, 0x0858}, {0x0859, 0x085B}, - {0x085E, 0x085E}, {0x08A0, 0x08B4}, {0x08B6, 0x08BD}, - {0x08D4, 0x08E1}, {0x08E2, 0x08E2}, {0x08E3, 0x08FF}, - {0x0900, 0x0902}, {0x0903, 0x0903}, {0x0904, 0x0939}, - {0x093A, 0x093A}, {0x093B, 0x093B}, {0x093C, 0x093C}, - {0x093D, 0x093D}, {0x093E, 0x0940}, {0x0941, 0x0948}, - {0x0949, 0x094C}, {0x094D, 0x094D}, {0x094E, 0x094F}, - {0x0950, 0x0950}, {0x0951, 0x0957}, {0x0958, 0x0961}, - {0x0962, 0x0963}, {0x0964, 0x0965}, {0x0966, 0x096F}, - {0x0970, 0x0970}, {0x0971, 0x0971}, {0x0972, 0x097F}, - {0x0980, 0x0980}, {0x0981, 0x0981}, {0x0982, 0x0983}, - {0x0985, 0x098C}, {0x098F, 0x0990}, {0x0993, 0x09A8}, - {0x09AA, 0x09B0}, {0x09B2, 0x09B2}, {0x09B6, 0x09B9}, - {0x09BC, 0x09BC}, {0x09BD, 0x09BD}, {0x09BE, 0x09C0}, - {0x09C1, 0x09C4}, {0x09C7, 0x09C8}, {0x09CB, 0x09CC}, - {0x09CD, 0x09CD}, {0x09CE, 0x09CE}, {0x09D7, 0x09D7}, - {0x09DC, 0x09DD}, {0x09DF, 0x09E1}, {0x09E2, 0x09E3}, - {0x09E6, 0x09EF}, {0x09F0, 0x09F1}, {0x09F2, 0x09F3}, - {0x09F4, 0x09F9}, {0x09FA, 0x09FA}, {0x09FB, 0x09FB}, - {0x0A01, 0x0A02}, {0x0A03, 0x0A03}, {0x0A05, 0x0A0A}, - {0x0A0F, 0x0A10}, {0x0A13, 0x0A28}, {0x0A2A, 0x0A30}, - {0x0A32, 0x0A33}, {0x0A35, 0x0A36}, {0x0A38, 0x0A39}, - {0x0A3C, 0x0A3C}, {0x0A3E, 0x0A40}, {0x0A41, 0x0A42}, - {0x0A47, 0x0A48}, {0x0A4B, 0x0A4D}, {0x0A51, 0x0A51}, - {0x0A59, 0x0A5C}, {0x0A5E, 0x0A5E}, {0x0A66, 0x0A6F}, - {0x0A70, 0x0A71}, {0x0A72, 0x0A74}, {0x0A75, 0x0A75}, - {0x0A81, 0x0A82}, {0x0A83, 0x0A83}, {0x0A85, 0x0A8D}, - {0x0A8F, 0x0A91}, {0x0A93, 0x0AA8}, {0x0AAA, 0x0AB0}, - {0x0AB2, 0x0AB3}, {0x0AB5, 0x0AB9}, {0x0ABC, 0x0ABC}, - {0x0ABD, 0x0ABD}, {0x0ABE, 0x0AC0}, {0x0AC1, 0x0AC5}, - {0x0AC7, 0x0AC8}, {0x0AC9, 0x0AC9}, {0x0ACB, 0x0ACC}, - {0x0ACD, 0x0ACD}, {0x0AD0, 0x0AD0}, {0x0AE0, 0x0AE1}, - {0x0AE2, 0x0AE3}, {0x0AE6, 0x0AEF}, {0x0AF0, 0x0AF0}, - {0x0AF1, 0x0AF1}, {0x0AF9, 0x0AF9}, {0x0B01, 0x0B01}, - {0x0B02, 0x0B03}, {0x0B05, 0x0B0C}, {0x0B0F, 0x0B10}, - {0x0B13, 0x0B28}, {0x0B2A, 0x0B30}, {0x0B32, 0x0B33}, - {0x0B35, 0x0B39}, {0x0B3C, 0x0B3C}, {0x0B3D, 0x0B3D}, - {0x0B3E, 0x0B3E}, {0x0B3F, 0x0B3F}, {0x0B40, 0x0B40}, - {0x0B41, 0x0B44}, {0x0B47, 0x0B48}, {0x0B4B, 0x0B4C}, - {0x0B4D, 0x0B4D}, {0x0B56, 0x0B56}, {0x0B57, 0x0B57}, - {0x0B5C, 0x0B5D}, {0x0B5F, 0x0B61}, {0x0B62, 0x0B63}, - {0x0B66, 0x0B6F}, {0x0B70, 0x0B70}, {0x0B71, 0x0B71}, - {0x0B72, 0x0B77}, {0x0B82, 0x0B82}, {0x0B83, 0x0B83}, - {0x0B85, 0x0B8A}, {0x0B8E, 0x0B90}, {0x0B92, 0x0B95}, - {0x0B99, 0x0B9A}, {0x0B9C, 0x0B9C}, {0x0B9E, 0x0B9F}, - {0x0BA3, 0x0BA4}, {0x0BA8, 0x0BAA}, {0x0BAE, 0x0BB9}, - {0x0BBE, 0x0BBF}, {0x0BC0, 0x0BC0}, {0x0BC1, 0x0BC2}, - {0x0BC6, 0x0BC8}, {0x0BCA, 0x0BCC}, {0x0BCD, 0x0BCD}, - {0x0BD0, 0x0BD0}, {0x0BD7, 0x0BD7}, {0x0BE6, 0x0BEF}, - {0x0BF0, 0x0BF2}, {0x0BF3, 0x0BF8}, {0x0BF9, 0x0BF9}, - {0x0BFA, 0x0BFA}, {0x0C00, 0x0C00}, {0x0C01, 0x0C03}, - {0x0C05, 0x0C0C}, {0x0C0E, 0x0C10}, {0x0C12, 0x0C28}, - {0x0C2A, 0x0C39}, {0x0C3D, 0x0C3D}, {0x0C3E, 0x0C40}, - {0x0C41, 0x0C44}, {0x0C46, 0x0C48}, {0x0C4A, 0x0C4D}, - {0x0C55, 0x0C56}, {0x0C58, 0x0C5A}, {0x0C60, 0x0C61}, - {0x0C62, 0x0C63}, {0x0C66, 0x0C6F}, {0x0C78, 0x0C7E}, - {0x0C7F, 0x0C7F}, {0x0C80, 0x0C80}, {0x0C81, 0x0C81}, - {0x0C82, 0x0C83}, {0x0C85, 0x0C8C}, {0x0C8E, 0x0C90}, - {0x0C92, 0x0CA8}, {0x0CAA, 0x0CB3}, {0x0CB5, 0x0CB9}, - {0x0CBC, 0x0CBC}, {0x0CBD, 0x0CBD}, {0x0CBE, 0x0CBE}, - {0x0CBF, 0x0CBF}, {0x0CC0, 0x0CC4}, {0x0CC6, 0x0CC6}, - {0x0CC7, 0x0CC8}, {0x0CCA, 0x0CCB}, {0x0CCC, 0x0CCD}, - {0x0CD5, 0x0CD6}, {0x0CDE, 0x0CDE}, {0x0CE0, 0x0CE1}, - {0x0CE2, 0x0CE3}, {0x0CE6, 0x0CEF}, {0x0CF1, 0x0CF2}, - {0x0D01, 0x0D01}, {0x0D02, 0x0D03}, {0x0D05, 0x0D0C}, - {0x0D0E, 0x0D10}, {0x0D12, 0x0D3A}, {0x0D3D, 0x0D3D}, - {0x0D3E, 0x0D40}, {0x0D41, 0x0D44}, {0x0D46, 0x0D48}, - {0x0D4A, 0x0D4C}, {0x0D4D, 0x0D4D}, {0x0D4E, 0x0D4E}, - {0x0D4F, 0x0D4F}, {0x0D54, 0x0D56}, {0x0D57, 0x0D57}, - {0x0D58, 0x0D5E}, {0x0D5F, 0x0D61}, {0x0D62, 0x0D63}, - {0x0D66, 0x0D6F}, {0x0D70, 0x0D78}, {0x0D79, 0x0D79}, - {0x0D7A, 0x0D7F}, {0x0D82, 0x0D83}, {0x0D85, 0x0D96}, - {0x0D9A, 0x0DB1}, {0x0DB3, 0x0DBB}, {0x0DBD, 0x0DBD}, - {0x0DC0, 0x0DC6}, {0x0DCA, 0x0DCA}, {0x0DCF, 0x0DD1}, - {0x0DD2, 0x0DD4}, {0x0DD6, 0x0DD6}, {0x0DD8, 0x0DDF}, - {0x0DE6, 0x0DEF}, {0x0DF2, 0x0DF3}, {0x0DF4, 0x0DF4}, - {0x0E01, 0x0E30}, {0x0E31, 0x0E31}, {0x0E32, 0x0E33}, - {0x0E34, 0x0E3A}, {0x0E3F, 0x0E3F}, {0x0E40, 0x0E45}, - {0x0E46, 0x0E46}, {0x0E47, 0x0E4E}, {0x0E4F, 0x0E4F}, - {0x0E50, 0x0E59}, {0x0E5A, 0x0E5B}, {0x0E81, 0x0E82}, - {0x0E84, 0x0E84}, {0x0E87, 0x0E88}, {0x0E8A, 0x0E8A}, - {0x0E8D, 0x0E8D}, {0x0E94, 0x0E97}, {0x0E99, 0x0E9F}, - {0x0EA1, 0x0EA3}, {0x0EA5, 0x0EA5}, {0x0EA7, 0x0EA7}, - {0x0EAA, 0x0EAB}, {0x0EAD, 0x0EB0}, {0x0EB1, 0x0EB1}, - {0x0EB2, 0x0EB3}, {0x0EB4, 0x0EB9}, {0x0EBB, 0x0EBC}, - {0x0EBD, 0x0EBD}, {0x0EC0, 0x0EC4}, {0x0EC6, 0x0EC6}, - {0x0EC8, 0x0ECD}, {0x0ED0, 0x0ED9}, {0x0EDC, 0x0EDF}, - {0x0F00, 0x0F00}, {0x0F01, 0x0F03}, {0x0F04, 0x0F12}, - {0x0F13, 0x0F13}, {0x0F14, 0x0F14}, {0x0F15, 0x0F17}, - {0x0F18, 0x0F19}, {0x0F1A, 0x0F1F}, {0x0F20, 0x0F29}, - {0x0F2A, 0x0F33}, {0x0F34, 0x0F34}, {0x0F35, 0x0F35}, - {0x0F36, 0x0F36}, {0x0F37, 0x0F37}, {0x0F38, 0x0F38}, - {0x0F39, 0x0F39}, {0x0F3A, 0x0F3A}, {0x0F3B, 0x0F3B}, - {0x0F3C, 0x0F3C}, {0x0F3D, 0x0F3D}, {0x0F3E, 0x0F3F}, - {0x0F40, 0x0F47}, {0x0F49, 0x0F6C}, {0x0F71, 0x0F7E}, - {0x0F7F, 0x0F7F}, {0x0F80, 0x0F84}, {0x0F85, 0x0F85}, - {0x0F86, 0x0F87}, {0x0F88, 0x0F8C}, {0x0F8D, 0x0F97}, - {0x0F99, 0x0FBC}, {0x0FBE, 0x0FC5}, {0x0FC6, 0x0FC6}, - {0x0FC7, 0x0FCC}, {0x0FCE, 0x0FCF}, {0x0FD0, 0x0FD4}, - {0x0FD5, 0x0FD8}, {0x0FD9, 0x0FDA}, {0x1000, 0x102A}, - {0x102B, 0x102C}, {0x102D, 0x1030}, {0x1031, 0x1031}, - {0x1032, 0x1037}, {0x1038, 0x1038}, {0x1039, 0x103A}, - {0x103B, 0x103C}, {0x103D, 0x103E}, {0x103F, 0x103F}, - {0x1040, 0x1049}, {0x104A, 0x104F}, {0x1050, 0x1055}, - {0x1056, 0x1057}, {0x1058, 0x1059}, {0x105A, 0x105D}, - {0x105E, 0x1060}, {0x1061, 0x1061}, {0x1062, 0x1064}, - {0x1065, 0x1066}, {0x1067, 0x106D}, {0x106E, 0x1070}, - {0x1071, 0x1074}, {0x1075, 0x1081}, {0x1082, 0x1082}, - {0x1083, 0x1084}, {0x1085, 0x1086}, {0x1087, 0x108C}, - {0x108D, 0x108D}, {0x108E, 0x108E}, {0x108F, 0x108F}, - {0x1090, 0x1099}, {0x109A, 0x109C}, {0x109D, 0x109D}, - {0x109E, 0x109F}, {0x10A0, 0x10C5}, {0x10C7, 0x10C7}, - {0x10CD, 0x10CD}, {0x10D0, 0x10FA}, {0x10FB, 0x10FB}, - {0x10FC, 0x10FC}, {0x10FD, 0x10FF}, {0x1160, 0x11FF}, - {0x1200, 0x1248}, {0x124A, 0x124D}, {0x1250, 0x1256}, - {0x1258, 0x1258}, {0x125A, 0x125D}, {0x1260, 0x1288}, - {0x128A, 0x128D}, {0x1290, 0x12B0}, {0x12B2, 0x12B5}, - {0x12B8, 0x12BE}, {0x12C0, 0x12C0}, {0x12C2, 0x12C5}, - {0x12C8, 0x12D6}, {0x12D8, 0x1310}, {0x1312, 0x1315}, - {0x1318, 0x135A}, {0x135D, 0x135F}, {0x1360, 0x1368}, - {0x1369, 0x137C}, {0x1380, 0x138F}, {0x1390, 0x1399}, - {0x13A0, 0x13F5}, {0x13F8, 0x13FD}, {0x1400, 0x1400}, - {0x1401, 0x166C}, {0x166D, 0x166E}, {0x166F, 0x167F}, - {0x1680, 0x1680}, {0x1681, 0x169A}, {0x169B, 0x169B}, - {0x169C, 0x169C}, {0x16A0, 0x16EA}, {0x16EB, 0x16ED}, - {0x16EE, 0x16F0}, {0x16F1, 0x16F8}, {0x1700, 0x170C}, - {0x170E, 0x1711}, {0x1712, 0x1714}, {0x1720, 0x1731}, - {0x1732, 0x1734}, {0x1735, 0x1736}, {0x1740, 0x1751}, - {0x1752, 0x1753}, {0x1760, 0x176C}, {0x176E, 0x1770}, - {0x1772, 0x1773}, {0x1780, 0x17B3}, {0x17B4, 0x17B5}, - {0x17B6, 0x17B6}, {0x17B7, 0x17BD}, {0x17BE, 0x17C5}, - {0x17C6, 0x17C6}, {0x17C7, 0x17C8}, {0x17C9, 0x17D3}, - {0x17D4, 0x17D6}, {0x17D7, 0x17D7}, {0x17D8, 0x17DA}, - {0x17DB, 0x17DB}, {0x17DC, 0x17DC}, {0x17DD, 0x17DD}, - {0x17E0, 0x17E9}, {0x17F0, 0x17F9}, {0x1800, 0x1805}, - {0x1806, 0x1806}, {0x1807, 0x180A}, {0x180B, 0x180D}, - {0x180E, 0x180E}, {0x1810, 0x1819}, {0x1820, 0x1842}, - {0x1843, 0x1843}, {0x1844, 0x1877}, {0x1880, 0x1884}, - {0x1885, 0x1886}, {0x1887, 0x18A8}, {0x18A9, 0x18A9}, - {0x18AA, 0x18AA}, {0x18B0, 0x18F5}, {0x1900, 0x191E}, - {0x1920, 0x1922}, {0x1923, 0x1926}, {0x1927, 0x1928}, - {0x1929, 0x192B}, {0x1930, 0x1931}, {0x1932, 0x1932}, - {0x1933, 0x1938}, {0x1939, 0x193B}, {0x1940, 0x1940}, - {0x1944, 0x1945}, {0x1946, 0x194F}, {0x1950, 0x196D}, - {0x1970, 0x1974}, {0x1980, 0x19AB}, {0x19B0, 0x19C9}, - {0x19D0, 0x19D9}, {0x19DA, 0x19DA}, {0x19DE, 0x19DF}, - {0x19E0, 0x19FF}, {0x1A00, 0x1A16}, {0x1A17, 0x1A18}, - {0x1A19, 0x1A1A}, {0x1A1B, 0x1A1B}, {0x1A1E, 0x1A1F}, - {0x1A20, 0x1A54}, {0x1A55, 0x1A55}, {0x1A56, 0x1A56}, - {0x1A57, 0x1A57}, {0x1A58, 0x1A5E}, {0x1A60, 0x1A60}, - {0x1A61, 0x1A61}, {0x1A62, 0x1A62}, {0x1A63, 0x1A64}, - {0x1A65, 0x1A6C}, {0x1A6D, 0x1A72}, {0x1A73, 0x1A7C}, - {0x1A7F, 0x1A7F}, {0x1A80, 0x1A89}, {0x1A90, 0x1A99}, - {0x1AA0, 0x1AA6}, {0x1AA7, 0x1AA7}, {0x1AA8, 0x1AAD}, - {0x1AB0, 0x1ABD}, {0x1ABE, 0x1ABE}, {0x1B00, 0x1B03}, - {0x1B04, 0x1B04}, {0x1B05, 0x1B33}, {0x1B34, 0x1B34}, - {0x1B35, 0x1B35}, {0x1B36, 0x1B3A}, {0x1B3B, 0x1B3B}, - {0x1B3C, 0x1B3C}, {0x1B3D, 0x1B41}, {0x1B42, 0x1B42}, - {0x1B43, 0x1B44}, {0x1B45, 0x1B4B}, {0x1B50, 0x1B59}, - {0x1B5A, 0x1B60}, {0x1B61, 0x1B6A}, {0x1B6B, 0x1B73}, - {0x1B74, 0x1B7C}, {0x1B80, 0x1B81}, {0x1B82, 0x1B82}, - {0x1B83, 0x1BA0}, {0x1BA1, 0x1BA1}, {0x1BA2, 0x1BA5}, - {0x1BA6, 0x1BA7}, {0x1BA8, 0x1BA9}, {0x1BAA, 0x1BAA}, - {0x1BAB, 0x1BAD}, {0x1BAE, 0x1BAF}, {0x1BB0, 0x1BB9}, - {0x1BBA, 0x1BBF}, {0x1BC0, 0x1BE5}, {0x1BE6, 0x1BE6}, - {0x1BE7, 0x1BE7}, {0x1BE8, 0x1BE9}, {0x1BEA, 0x1BEC}, - {0x1BED, 0x1BED}, {0x1BEE, 0x1BEE}, {0x1BEF, 0x1BF1}, - {0x1BF2, 0x1BF3}, {0x1BFC, 0x1BFF}, {0x1C00, 0x1C23}, - {0x1C24, 0x1C2B}, {0x1C2C, 0x1C33}, {0x1C34, 0x1C35}, - {0x1C36, 0x1C37}, {0x1C3B, 0x1C3F}, {0x1C40, 0x1C49}, - {0x1C4D, 0x1C4F}, {0x1C50, 0x1C59}, {0x1C5A, 0x1C77}, - {0x1C78, 0x1C7D}, {0x1C7E, 0x1C7F}, {0x1C80, 0x1C88}, - {0x1CC0, 0x1CC7}, {0x1CD0, 0x1CD2}, {0x1CD3, 0x1CD3}, - {0x1CD4, 0x1CE0}, {0x1CE1, 0x1CE1}, {0x1CE2, 0x1CE8}, - {0x1CE9, 0x1CEC}, {0x1CED, 0x1CED}, {0x1CEE, 0x1CF1}, - {0x1CF2, 0x1CF3}, {0x1CF4, 0x1CF4}, {0x1CF5, 0x1CF6}, - {0x1CF8, 0x1CF9}, {0x1D00, 0x1D2B}, {0x1D2C, 0x1D6A}, - {0x1D6B, 0x1D77}, {0x1D78, 0x1D78}, {0x1D79, 0x1D7F}, - {0x1D80, 0x1D9A}, {0x1D9B, 0x1DBF}, {0x1DC0, 0x1DF5}, - {0x1DFB, 0x1DFF}, {0x1E00, 0x1EFF}, {0x1F00, 0x1F15}, - {0x1F18, 0x1F1D}, {0x1F20, 0x1F45}, {0x1F48, 0x1F4D}, - {0x1F50, 0x1F57}, {0x1F59, 0x1F59}, {0x1F5B, 0x1F5B}, - {0x1F5D, 0x1F5D}, {0x1F5F, 0x1F7D}, {0x1F80, 0x1FB4}, - {0x1FB6, 0x1FBC}, {0x1FBD, 0x1FBD}, {0x1FBE, 0x1FBE}, - {0x1FBF, 0x1FC1}, {0x1FC2, 0x1FC4}, {0x1FC6, 0x1FCC}, - {0x1FCD, 0x1FCF}, {0x1FD0, 0x1FD3}, {0x1FD6, 0x1FDB}, - {0x1FDD, 0x1FDF}, {0x1FE0, 0x1FEC}, {0x1FED, 0x1FEF}, - {0x1FF2, 0x1FF4}, {0x1FF6, 0x1FFC}, {0x1FFD, 0x1FFE}, - {0x2000, 0x200A}, {0x200B, 0x200F}, {0x2011, 0x2012}, - {0x2017, 0x2017}, {0x201A, 0x201A}, {0x201B, 0x201B}, - {0x201E, 0x201E}, {0x201F, 0x201F}, {0x2023, 0x2023}, - {0x2028, 0x2028}, {0x2029, 0x2029}, {0x202A, 0x202E}, - {0x202F, 0x202F}, {0x2031, 0x2031}, {0x2034, 0x2034}, - {0x2036, 0x2038}, {0x2039, 0x2039}, {0x203A, 0x203A}, - {0x203C, 0x203D}, {0x203F, 0x2040}, {0x2041, 0x2043}, - {0x2044, 0x2044}, {0x2045, 0x2045}, {0x2046, 0x2046}, - {0x2047, 0x2051}, {0x2052, 0x2052}, {0x2053, 0x2053}, - {0x2054, 0x2054}, {0x2055, 0x205E}, {0x205F, 0x205F}, - {0x2060, 0x2064}, {0x2066, 0x206F}, {0x2070, 0x2070}, - {0x2071, 0x2071}, {0x2075, 0x2079}, {0x207A, 0x207C}, - {0x207D, 0x207D}, {0x207E, 0x207E}, {0x2080, 0x2080}, - {0x2085, 0x2089}, {0x208A, 0x208C}, {0x208D, 0x208D}, - {0x208E, 0x208E}, {0x2090, 0x209C}, {0x20A0, 0x20A8}, - {0x20AA, 0x20AB}, {0x20AD, 0x20BE}, {0x20D0, 0x20DC}, - {0x20DD, 0x20E0}, {0x20E1, 0x20E1}, {0x20E2, 0x20E4}, - {0x20E5, 0x20F0}, {0x2100, 0x2101}, {0x2102, 0x2102}, - {0x2104, 0x2104}, {0x2106, 0x2106}, {0x2107, 0x2107}, - {0x2108, 0x2108}, {0x210A, 0x2112}, {0x2114, 0x2114}, - {0x2115, 0x2115}, {0x2117, 0x2117}, {0x2118, 0x2118}, - {0x2119, 0x211D}, {0x211E, 0x2120}, {0x2123, 0x2123}, - {0x2124, 0x2124}, {0x2125, 0x2125}, {0x2127, 0x2127}, - {0x2128, 0x2128}, {0x2129, 0x2129}, {0x212A, 0x212A}, - {0x212C, 0x212D}, {0x212E, 0x212E}, {0x212F, 0x2134}, - {0x2135, 0x2138}, {0x2139, 0x2139}, {0x213A, 0x213B}, - {0x213C, 0x213F}, {0x2140, 0x2144}, {0x2145, 0x2149}, - {0x214A, 0x214A}, {0x214B, 0x214B}, {0x214C, 0x214D}, - {0x214E, 0x214E}, {0x214F, 0x214F}, {0x2150, 0x2152}, - {0x2155, 0x215A}, {0x215F, 0x215F}, {0x216C, 0x216F}, - {0x217A, 0x2182}, {0x2183, 0x2184}, {0x2185, 0x2188}, - {0x218A, 0x218B}, {0x219A, 0x219B}, {0x219C, 0x219F}, - {0x21A0, 0x21A0}, {0x21A1, 0x21A2}, {0x21A3, 0x21A3}, - {0x21A4, 0x21A5}, {0x21A6, 0x21A6}, {0x21A7, 0x21AD}, - {0x21AE, 0x21AE}, {0x21AF, 0x21B7}, {0x21BA, 0x21CD}, - {0x21CE, 0x21CF}, {0x21D0, 0x21D1}, {0x21D3, 0x21D3}, - {0x21D5, 0x21E6}, {0x21E8, 0x21F3}, {0x21F4, 0x21FF}, - {0x2201, 0x2201}, {0x2204, 0x2206}, {0x2209, 0x220A}, - {0x220C, 0x220E}, {0x2210, 0x2210}, {0x2212, 0x2214}, - {0x2216, 0x2219}, {0x221B, 0x221C}, {0x2221, 0x2222}, - {0x2224, 0x2224}, {0x2226, 0x2226}, {0x222D, 0x222D}, - {0x222F, 0x2233}, {0x2238, 0x223B}, {0x223E, 0x2247}, - {0x2249, 0x224B}, {0x224D, 0x2251}, {0x2253, 0x225F}, - {0x2262, 0x2263}, {0x2268, 0x2269}, {0x226C, 0x226D}, - {0x2270, 0x2281}, {0x2284, 0x2285}, {0x2288, 0x2294}, - {0x2296, 0x2298}, {0x229A, 0x22A4}, {0x22A6, 0x22BE}, - {0x22C0, 0x22FF}, {0x2300, 0x2307}, {0x2308, 0x2308}, - {0x2309, 0x2309}, {0x230A, 0x230A}, {0x230B, 0x230B}, - {0x230C, 0x2311}, {0x2313, 0x2319}, {0x231C, 0x231F}, - {0x2320, 0x2321}, {0x2322, 0x2328}, {0x232B, 0x237B}, - {0x237C, 0x237C}, {0x237D, 0x239A}, {0x239B, 0x23B3}, - {0x23B4, 0x23DB}, {0x23DC, 0x23E1}, {0x23E2, 0x23E8}, - {0x23ED, 0x23EF}, {0x23F1, 0x23F2}, {0x23F4, 0x23FE}, - {0x2400, 0x2426}, {0x2440, 0x244A}, {0x24EA, 0x24EA}, - {0x254C, 0x254F}, {0x2574, 0x257F}, {0x2590, 0x2591}, - {0x2596, 0x259F}, {0x25A2, 0x25A2}, {0x25AA, 0x25B1}, - {0x25B4, 0x25B5}, {0x25B8, 0x25BB}, {0x25BE, 0x25BF}, - {0x25C2, 0x25C5}, {0x25C9, 0x25CA}, {0x25CC, 0x25CD}, - {0x25D2, 0x25E1}, {0x25E6, 0x25EE}, {0x25F0, 0x25F7}, - {0x25F8, 0x25FC}, {0x25FF, 0x25FF}, {0x2600, 0x2604}, - {0x2607, 0x2608}, {0x260A, 0x260D}, {0x2610, 0x2613}, - {0x2616, 0x261B}, {0x261D, 0x261D}, {0x261F, 0x263F}, - {0x2641, 0x2641}, {0x2643, 0x2647}, {0x2654, 0x265F}, - {0x2662, 0x2662}, {0x2666, 0x2666}, {0x266B, 0x266B}, - {0x266E, 0x266E}, {0x2670, 0x267E}, {0x2680, 0x2692}, - {0x2694, 0x269D}, {0x26A0, 0x26A0}, {0x26A2, 0x26A9}, - {0x26AC, 0x26BC}, {0x26C0, 0x26C3}, {0x26E2, 0x26E2}, - {0x26E4, 0x26E7}, {0x2700, 0x2704}, {0x2706, 0x2709}, - {0x270C, 0x2727}, {0x2729, 0x273C}, {0x273E, 0x274B}, - {0x274D, 0x274D}, {0x274F, 0x2752}, {0x2756, 0x2756}, - {0x2758, 0x2767}, {0x2768, 0x2768}, {0x2769, 0x2769}, - {0x276A, 0x276A}, {0x276B, 0x276B}, {0x276C, 0x276C}, - {0x276D, 0x276D}, {0x276E, 0x276E}, {0x276F, 0x276F}, - {0x2770, 0x2770}, {0x2771, 0x2771}, {0x2772, 0x2772}, - {0x2773, 0x2773}, {0x2774, 0x2774}, {0x2775, 0x2775}, - {0x2780, 0x2793}, {0x2794, 0x2794}, {0x2798, 0x27AF}, - {0x27B1, 0x27BE}, {0x27C0, 0x27C4}, {0x27C5, 0x27C5}, - {0x27C6, 0x27C6}, {0x27C7, 0x27E5}, {0x27EE, 0x27EE}, - {0x27EF, 0x27EF}, {0x27F0, 0x27FF}, {0x2800, 0x28FF}, - {0x2900, 0x297F}, {0x2980, 0x2982}, {0x2983, 0x2983}, - {0x2984, 0x2984}, {0x2987, 0x2987}, {0x2988, 0x2988}, - {0x2989, 0x2989}, {0x298A, 0x298A}, {0x298B, 0x298B}, - {0x298C, 0x298C}, {0x298D, 0x298D}, {0x298E, 0x298E}, - {0x298F, 0x298F}, {0x2990, 0x2990}, {0x2991, 0x2991}, - {0x2992, 0x2992}, {0x2993, 0x2993}, {0x2994, 0x2994}, - {0x2995, 0x2995}, {0x2996, 0x2996}, {0x2997, 0x2997}, - {0x2998, 0x2998}, {0x2999, 0x29D7}, {0x29D8, 0x29D8}, - {0x29D9, 0x29D9}, {0x29DA, 0x29DA}, {0x29DB, 0x29DB}, - {0x29DC, 0x29FB}, {0x29FC, 0x29FC}, {0x29FD, 0x29FD}, - {0x29FE, 0x29FF}, {0x2A00, 0x2AFF}, {0x2B00, 0x2B1A}, - {0x2B1D, 0x2B2F}, {0x2B30, 0x2B44}, {0x2B45, 0x2B46}, - {0x2B47, 0x2B4C}, {0x2B4D, 0x2B4F}, {0x2B51, 0x2B54}, - {0x2B5A, 0x2B73}, {0x2B76, 0x2B95}, {0x2B98, 0x2BB9}, - {0x2BBD, 0x2BC8}, {0x2BCA, 0x2BD1}, {0x2BEC, 0x2BEF}, - {0x2C00, 0x2C2E}, {0x2C30, 0x2C5E}, {0x2C60, 0x2C7B}, - {0x2C7C, 0x2C7D}, {0x2C7E, 0x2C7F}, {0x2C80, 0x2CE4}, - {0x2CE5, 0x2CEA}, {0x2CEB, 0x2CEE}, {0x2CEF, 0x2CF1}, - {0x2CF2, 0x2CF3}, {0x2CF9, 0x2CFC}, {0x2CFD, 0x2CFD}, - {0x2CFE, 0x2CFF}, {0x2D00, 0x2D25}, {0x2D27, 0x2D27}, - {0x2D2D, 0x2D2D}, {0x2D30, 0x2D67}, {0x2D6F, 0x2D6F}, - {0x2D70, 0x2D70}, {0x2D7F, 0x2D7F}, {0x2D80, 0x2D96}, - {0x2DA0, 0x2DA6}, {0x2DA8, 0x2DAE}, {0x2DB0, 0x2DB6}, - {0x2DB8, 0x2DBE}, {0x2DC0, 0x2DC6}, {0x2DC8, 0x2DCE}, - {0x2DD0, 0x2DD6}, {0x2DD8, 0x2DDE}, {0x2DE0, 0x2DFF}, - {0x2E00, 0x2E01}, {0x2E02, 0x2E02}, {0x2E03, 0x2E03}, - {0x2E04, 0x2E04}, {0x2E05, 0x2E05}, {0x2E06, 0x2E08}, - {0x2E09, 0x2E09}, {0x2E0A, 0x2E0A}, {0x2E0B, 0x2E0B}, - {0x2E0C, 0x2E0C}, {0x2E0D, 0x2E0D}, {0x2E0E, 0x2E16}, - {0x2E17, 0x2E17}, {0x2E18, 0x2E19}, {0x2E1A, 0x2E1A}, - {0x2E1B, 0x2E1B}, {0x2E1C, 0x2E1C}, {0x2E1D, 0x2E1D}, - {0x2E1E, 0x2E1F}, {0x2E20, 0x2E20}, {0x2E21, 0x2E21}, - {0x2E22, 0x2E22}, {0x2E23, 0x2E23}, {0x2E24, 0x2E24}, - {0x2E25, 0x2E25}, {0x2E26, 0x2E26}, {0x2E27, 0x2E27}, - {0x2E28, 0x2E28}, {0x2E29, 0x2E29}, {0x2E2A, 0x2E2E}, - {0x2E2F, 0x2E2F}, {0x2E30, 0x2E39}, {0x2E3A, 0x2E3B}, - {0x2E3C, 0x2E3F}, {0x2E40, 0x2E40}, {0x2E41, 0x2E41}, - {0x2E42, 0x2E42}, {0x2E43, 0x2E44}, {0x303F, 0x303F}, - {0x4DC0, 0x4DFF}, {0xA4D0, 0xA4F7}, {0xA4F8, 0xA4FD}, - {0xA4FE, 0xA4FF}, {0xA500, 0xA60B}, {0xA60C, 0xA60C}, - {0xA60D, 0xA60F}, {0xA610, 0xA61F}, {0xA620, 0xA629}, - {0xA62A, 0xA62B}, {0xA640, 0xA66D}, {0xA66E, 0xA66E}, - {0xA66F, 0xA66F}, {0xA670, 0xA672}, {0xA673, 0xA673}, - {0xA674, 0xA67D}, {0xA67E, 0xA67E}, {0xA67F, 0xA67F}, - {0xA680, 0xA69B}, {0xA69C, 0xA69D}, {0xA69E, 0xA69F}, - {0xA6A0, 0xA6E5}, {0xA6E6, 0xA6EF}, {0xA6F0, 0xA6F1}, - {0xA6F2, 0xA6F7}, {0xA700, 0xA716}, {0xA717, 0xA71F}, - {0xA720, 0xA721}, {0xA722, 0xA76F}, {0xA770, 0xA770}, - {0xA771, 0xA787}, {0xA788, 0xA788}, {0xA789, 0xA78A}, - {0xA78B, 0xA78E}, {0xA78F, 0xA78F}, {0xA790, 0xA7AE}, - {0xA7B0, 0xA7B7}, {0xA7F7, 0xA7F7}, {0xA7F8, 0xA7F9}, - {0xA7FA, 0xA7FA}, {0xA7FB, 0xA7FF}, {0xA800, 0xA801}, - {0xA802, 0xA802}, {0xA803, 0xA805}, {0xA806, 0xA806}, - {0xA807, 0xA80A}, {0xA80B, 0xA80B}, {0xA80C, 0xA822}, - {0xA823, 0xA824}, {0xA825, 0xA826}, {0xA827, 0xA827}, - {0xA828, 0xA82B}, {0xA830, 0xA835}, {0xA836, 0xA837}, - {0xA838, 0xA838}, {0xA839, 0xA839}, {0xA840, 0xA873}, - {0xA874, 0xA877}, {0xA880, 0xA881}, {0xA882, 0xA8B3}, - {0xA8B4, 0xA8C3}, {0xA8C4, 0xA8C5}, {0xA8CE, 0xA8CF}, - {0xA8D0, 0xA8D9}, {0xA8E0, 0xA8F1}, {0xA8F2, 0xA8F7}, - {0xA8F8, 0xA8FA}, {0xA8FB, 0xA8FB}, {0xA8FC, 0xA8FC}, - {0xA8FD, 0xA8FD}, {0xA900, 0xA909}, {0xA90A, 0xA925}, - {0xA926, 0xA92D}, {0xA92E, 0xA92F}, {0xA930, 0xA946}, - {0xA947, 0xA951}, {0xA952, 0xA953}, {0xA95F, 0xA95F}, - {0xA980, 0xA982}, {0xA983, 0xA983}, {0xA984, 0xA9B2}, - {0xA9B3, 0xA9B3}, {0xA9B4, 0xA9B5}, {0xA9B6, 0xA9B9}, - {0xA9BA, 0xA9BB}, {0xA9BC, 0xA9BC}, {0xA9BD, 0xA9C0}, - {0xA9C1, 0xA9CD}, {0xA9CF, 0xA9CF}, {0xA9D0, 0xA9D9}, - {0xA9DE, 0xA9DF}, {0xA9E0, 0xA9E4}, {0xA9E5, 0xA9E5}, - {0xA9E6, 0xA9E6}, {0xA9E7, 0xA9EF}, {0xA9F0, 0xA9F9}, - {0xA9FA, 0xA9FE}, {0xAA00, 0xAA28}, {0xAA29, 0xAA2E}, - {0xAA2F, 0xAA30}, {0xAA31, 0xAA32}, {0xAA33, 0xAA34}, - {0xAA35, 0xAA36}, {0xAA40, 0xAA42}, {0xAA43, 0xAA43}, - {0xAA44, 0xAA4B}, {0xAA4C, 0xAA4C}, {0xAA4D, 0xAA4D}, - {0xAA50, 0xAA59}, {0xAA5C, 0xAA5F}, {0xAA60, 0xAA6F}, - {0xAA70, 0xAA70}, {0xAA71, 0xAA76}, {0xAA77, 0xAA79}, - {0xAA7A, 0xAA7A}, {0xAA7B, 0xAA7B}, {0xAA7C, 0xAA7C}, - {0xAA7D, 0xAA7D}, {0xAA7E, 0xAA7F}, {0xAA80, 0xAAAF}, - {0xAAB0, 0xAAB0}, {0xAAB1, 0xAAB1}, {0xAAB2, 0xAAB4}, - {0xAAB5, 0xAAB6}, {0xAAB7, 0xAAB8}, {0xAAB9, 0xAABD}, - {0xAABE, 0xAABF}, {0xAAC0, 0xAAC0}, {0xAAC1, 0xAAC1}, - {0xAAC2, 0xAAC2}, {0xAADB, 0xAADC}, {0xAADD, 0xAADD}, - {0xAADE, 0xAADF}, {0xAAE0, 0xAAEA}, {0xAAEB, 0xAAEB}, - {0xAAEC, 0xAAED}, {0xAAEE, 0xAAEF}, {0xAAF0, 0xAAF1}, - {0xAAF2, 0xAAF2}, {0xAAF3, 0xAAF4}, {0xAAF5, 0xAAF5}, - {0xAAF6, 0xAAF6}, {0xAB01, 0xAB06}, {0xAB09, 0xAB0E}, - {0xAB11, 0xAB16}, {0xAB20, 0xAB26}, {0xAB28, 0xAB2E}, - {0xAB30, 0xAB5A}, {0xAB5B, 0xAB5B}, {0xAB5C, 0xAB5F}, - {0xAB60, 0xAB65}, {0xAB70, 0xABBF}, {0xABC0, 0xABE2}, - {0xABE3, 0xABE4}, {0xABE5, 0xABE5}, {0xABE6, 0xABE7}, - {0xABE8, 0xABE8}, {0xABE9, 0xABEA}, {0xABEB, 0xABEB}, - {0xABEC, 0xABEC}, {0xABED, 0xABED}, {0xABF0, 0xABF9}, - {0xD7B0, 0xD7C6}, {0xD7CB, 0xD7FB}, {0xD800, 0xDB7F}, - {0xDB80, 0xDBFF}, {0xDC00, 0xDFFF}, {0xFB00, 0xFB06}, - {0xFB13, 0xFB17}, {0xFB1D, 0xFB1D}, {0xFB1E, 0xFB1E}, - {0xFB1F, 0xFB28}, {0xFB29, 0xFB29}, {0xFB2A, 0xFB36}, - {0xFB38, 0xFB3C}, {0xFB3E, 0xFB3E}, {0xFB40, 0xFB41}, - {0xFB43, 0xFB44}, {0xFB46, 0xFB4F}, {0xFB50, 0xFBB1}, - {0xFBB2, 0xFBC1}, {0xFBD3, 0xFD3D}, {0xFD3E, 0xFD3E}, - {0xFD3F, 0xFD3F}, {0xFD50, 0xFD8F}, {0xFD92, 0xFDC7}, - {0xFDF0, 0xFDFB}, {0xFDFC, 0xFDFC}, {0xFDFD, 0xFDFD}, - {0xFE20, 0xFE2F}, {0xFE70, 0xFE74}, {0xFE76, 0xFEFC}, - {0xFEFF, 0xFEFF}, {0xFFF9, 0xFFFB}, {0xFFFC, 0xFFFC}, - {0x10000, 0x1000B}, {0x1000D, 0x10026}, {0x10028, 0x1003A}, - {0x1003C, 0x1003D}, {0x1003F, 0x1004D}, {0x10050, 0x1005D}, - {0x10080, 0x100FA}, {0x10100, 0x10102}, {0x10107, 0x10133}, - {0x10137, 0x1013F}, {0x10140, 0x10174}, {0x10175, 0x10178}, - {0x10179, 0x10189}, {0x1018A, 0x1018B}, {0x1018C, 0x1018E}, - {0x10190, 0x1019B}, {0x101A0, 0x101A0}, {0x101D0, 0x101FC}, - {0x101FD, 0x101FD}, {0x10280, 0x1029C}, {0x102A0, 0x102D0}, - {0x102E0, 0x102E0}, {0x102E1, 0x102FB}, {0x10300, 0x1031F}, - {0x10320, 0x10323}, {0x10330, 0x10340}, {0x10341, 0x10341}, - {0x10342, 0x10349}, {0x1034A, 0x1034A}, {0x10350, 0x10375}, - {0x10376, 0x1037A}, {0x10380, 0x1039D}, {0x1039F, 0x1039F}, - {0x103A0, 0x103C3}, {0x103C8, 0x103CF}, {0x103D0, 0x103D0}, - {0x103D1, 0x103D5}, {0x10400, 0x1044F}, {0x10450, 0x1047F}, - {0x10480, 0x1049D}, {0x104A0, 0x104A9}, {0x104B0, 0x104D3}, - {0x104D8, 0x104FB}, {0x10500, 0x10527}, {0x10530, 0x10563}, - {0x1056F, 0x1056F}, {0x10600, 0x10736}, {0x10740, 0x10755}, - {0x10760, 0x10767}, {0x10800, 0x10805}, {0x10808, 0x10808}, - {0x1080A, 0x10835}, {0x10837, 0x10838}, {0x1083C, 0x1083C}, - {0x1083F, 0x1083F}, {0x10840, 0x10855}, {0x10857, 0x10857}, - {0x10858, 0x1085F}, {0x10860, 0x10876}, {0x10877, 0x10878}, - {0x10879, 0x1087F}, {0x10880, 0x1089E}, {0x108A7, 0x108AF}, - {0x108E0, 0x108F2}, {0x108F4, 0x108F5}, {0x108FB, 0x108FF}, - {0x10900, 0x10915}, {0x10916, 0x1091B}, {0x1091F, 0x1091F}, - {0x10920, 0x10939}, {0x1093F, 0x1093F}, {0x10980, 0x1099F}, - {0x109A0, 0x109B7}, {0x109BC, 0x109BD}, {0x109BE, 0x109BF}, - {0x109C0, 0x109CF}, {0x109D2, 0x109FF}, {0x10A00, 0x10A00}, - {0x10A01, 0x10A03}, {0x10A05, 0x10A06}, {0x10A0C, 0x10A0F}, - {0x10A10, 0x10A13}, {0x10A15, 0x10A17}, {0x10A19, 0x10A33}, - {0x10A38, 0x10A3A}, {0x10A3F, 0x10A3F}, {0x10A40, 0x10A47}, - {0x10A50, 0x10A58}, {0x10A60, 0x10A7C}, {0x10A7D, 0x10A7E}, - {0x10A7F, 0x10A7F}, {0x10A80, 0x10A9C}, {0x10A9D, 0x10A9F}, - {0x10AC0, 0x10AC7}, {0x10AC8, 0x10AC8}, {0x10AC9, 0x10AE4}, - {0x10AE5, 0x10AE6}, {0x10AEB, 0x10AEF}, {0x10AF0, 0x10AF6}, - {0x10B00, 0x10B35}, {0x10B39, 0x10B3F}, {0x10B40, 0x10B55}, - {0x10B58, 0x10B5F}, {0x10B60, 0x10B72}, {0x10B78, 0x10B7F}, - {0x10B80, 0x10B91}, {0x10B99, 0x10B9C}, {0x10BA9, 0x10BAF}, - {0x10C00, 0x10C48}, {0x10C80, 0x10CB2}, {0x10CC0, 0x10CF2}, - {0x10CFA, 0x10CFF}, {0x10E60, 0x10E7E}, {0x11000, 0x11000}, - {0x11001, 0x11001}, {0x11002, 0x11002}, {0x11003, 0x11037}, - {0x11038, 0x11046}, {0x11047, 0x1104D}, {0x11052, 0x11065}, - {0x11066, 0x1106F}, {0x1107F, 0x1107F}, {0x11080, 0x11081}, - {0x11082, 0x11082}, {0x11083, 0x110AF}, {0x110B0, 0x110B2}, - {0x110B3, 0x110B6}, {0x110B7, 0x110B8}, {0x110B9, 0x110BA}, - {0x110BB, 0x110BC}, {0x110BD, 0x110BD}, {0x110BE, 0x110C1}, - {0x110D0, 0x110E8}, {0x110F0, 0x110F9}, {0x11100, 0x11102}, - {0x11103, 0x11126}, {0x11127, 0x1112B}, {0x1112C, 0x1112C}, - {0x1112D, 0x11134}, {0x11136, 0x1113F}, {0x11140, 0x11143}, - {0x11150, 0x11172}, {0x11173, 0x11173}, {0x11174, 0x11175}, - {0x11176, 0x11176}, {0x11180, 0x11181}, {0x11182, 0x11182}, - {0x11183, 0x111B2}, {0x111B3, 0x111B5}, {0x111B6, 0x111BE}, - {0x111BF, 0x111C0}, {0x111C1, 0x111C4}, {0x111C5, 0x111C9}, - {0x111CA, 0x111CC}, {0x111CD, 0x111CD}, {0x111D0, 0x111D9}, - {0x111DA, 0x111DA}, {0x111DB, 0x111DB}, {0x111DC, 0x111DC}, - {0x111DD, 0x111DF}, {0x111E1, 0x111F4}, {0x11200, 0x11211}, - {0x11213, 0x1122B}, {0x1122C, 0x1122E}, {0x1122F, 0x11231}, - {0x11232, 0x11233}, {0x11234, 0x11234}, {0x11235, 0x11235}, - {0x11236, 0x11237}, {0x11238, 0x1123D}, {0x1123E, 0x1123E}, - {0x11280, 0x11286}, {0x11288, 0x11288}, {0x1128A, 0x1128D}, - {0x1128F, 0x1129D}, {0x1129F, 0x112A8}, {0x112A9, 0x112A9}, - {0x112B0, 0x112DE}, {0x112DF, 0x112DF}, {0x112E0, 0x112E2}, - {0x112E3, 0x112EA}, {0x112F0, 0x112F9}, {0x11300, 0x11301}, - {0x11302, 0x11303}, {0x11305, 0x1130C}, {0x1130F, 0x11310}, - {0x11313, 0x11328}, {0x1132A, 0x11330}, {0x11332, 0x11333}, - {0x11335, 0x11339}, {0x1133C, 0x1133C}, {0x1133D, 0x1133D}, - {0x1133E, 0x1133F}, {0x11340, 0x11340}, {0x11341, 0x11344}, - {0x11347, 0x11348}, {0x1134B, 0x1134D}, {0x11350, 0x11350}, - {0x11357, 0x11357}, {0x1135D, 0x11361}, {0x11362, 0x11363}, - {0x11366, 0x1136C}, {0x11370, 0x11374}, {0x11400, 0x11434}, - {0x11435, 0x11437}, {0x11438, 0x1143F}, {0x11440, 0x11441}, - {0x11442, 0x11444}, {0x11445, 0x11445}, {0x11446, 0x11446}, - {0x11447, 0x1144A}, {0x1144B, 0x1144F}, {0x11450, 0x11459}, - {0x1145B, 0x1145B}, {0x1145D, 0x1145D}, {0x11480, 0x114AF}, - {0x114B0, 0x114B2}, {0x114B3, 0x114B8}, {0x114B9, 0x114B9}, - {0x114BA, 0x114BA}, {0x114BB, 0x114BE}, {0x114BF, 0x114C0}, - {0x114C1, 0x114C1}, {0x114C2, 0x114C3}, {0x114C4, 0x114C5}, - {0x114C6, 0x114C6}, {0x114C7, 0x114C7}, {0x114D0, 0x114D9}, - {0x11580, 0x115AE}, {0x115AF, 0x115B1}, {0x115B2, 0x115B5}, - {0x115B8, 0x115BB}, {0x115BC, 0x115BD}, {0x115BE, 0x115BE}, - {0x115BF, 0x115C0}, {0x115C1, 0x115D7}, {0x115D8, 0x115DB}, - {0x115DC, 0x115DD}, {0x11600, 0x1162F}, {0x11630, 0x11632}, - {0x11633, 0x1163A}, {0x1163B, 0x1163C}, {0x1163D, 0x1163D}, - {0x1163E, 0x1163E}, {0x1163F, 0x11640}, {0x11641, 0x11643}, - {0x11644, 0x11644}, {0x11650, 0x11659}, {0x11660, 0x1166C}, - {0x11680, 0x116AA}, {0x116AB, 0x116AB}, {0x116AC, 0x116AC}, - {0x116AD, 0x116AD}, {0x116AE, 0x116AF}, {0x116B0, 0x116B5}, - {0x116B6, 0x116B6}, {0x116B7, 0x116B7}, {0x116C0, 0x116C9}, - {0x11700, 0x11719}, {0x1171D, 0x1171F}, {0x11720, 0x11721}, - {0x11722, 0x11725}, {0x11726, 0x11726}, {0x11727, 0x1172B}, - {0x11730, 0x11739}, {0x1173A, 0x1173B}, {0x1173C, 0x1173E}, - {0x1173F, 0x1173F}, {0x118A0, 0x118DF}, {0x118E0, 0x118E9}, - {0x118EA, 0x118F2}, {0x118FF, 0x118FF}, {0x11AC0, 0x11AF8}, - {0x11C00, 0x11C08}, {0x11C0A, 0x11C2E}, {0x11C2F, 0x11C2F}, - {0x11C30, 0x11C36}, {0x11C38, 0x11C3D}, {0x11C3E, 0x11C3E}, - {0x11C3F, 0x11C3F}, {0x11C40, 0x11C40}, {0x11C41, 0x11C45}, - {0x11C50, 0x11C59}, {0x11C5A, 0x11C6C}, {0x11C70, 0x11C71}, - {0x11C72, 0x11C8F}, {0x11C92, 0x11CA7}, {0x11CA9, 0x11CA9}, - {0x11CAA, 0x11CB0}, {0x11CB1, 0x11CB1}, {0x11CB2, 0x11CB3}, - {0x11CB4, 0x11CB4}, {0x11CB5, 0x11CB6}, {0x12000, 0x12399}, - {0x12400, 0x1246E}, {0x12470, 0x12474}, {0x12480, 0x12543}, - {0x13000, 0x1342E}, {0x14400, 0x14646}, {0x16800, 0x16A38}, - {0x16A40, 0x16A5E}, {0x16A60, 0x16A69}, {0x16A6E, 0x16A6F}, - {0x16AD0, 0x16AED}, {0x16AF0, 0x16AF4}, {0x16AF5, 0x16AF5}, - {0x16B00, 0x16B2F}, {0x16B30, 0x16B36}, {0x16B37, 0x16B3B}, - {0x16B3C, 0x16B3F}, {0x16B40, 0x16B43}, {0x16B44, 0x16B44}, - {0x16B45, 0x16B45}, {0x16B50, 0x16B59}, {0x16B5B, 0x16B61}, - {0x16B63, 0x16B77}, {0x16B7D, 0x16B8F}, {0x16F00, 0x16F44}, - {0x16F50, 0x16F50}, {0x16F51, 0x16F7E}, {0x16F8F, 0x16F92}, - {0x16F93, 0x16F9F}, {0x1BC00, 0x1BC6A}, {0x1BC70, 0x1BC7C}, - {0x1BC80, 0x1BC88}, {0x1BC90, 0x1BC99}, {0x1BC9C, 0x1BC9C}, - {0x1BC9D, 0x1BC9E}, {0x1BC9F, 0x1BC9F}, {0x1BCA0, 0x1BCA3}, - {0x1D000, 0x1D0F5}, {0x1D100, 0x1D126}, {0x1D129, 0x1D164}, - {0x1D165, 0x1D166}, {0x1D167, 0x1D169}, {0x1D16A, 0x1D16C}, - {0x1D16D, 0x1D172}, {0x1D173, 0x1D17A}, {0x1D17B, 0x1D182}, - {0x1D183, 0x1D184}, {0x1D185, 0x1D18B}, {0x1D18C, 0x1D1A9}, - {0x1D1AA, 0x1D1AD}, {0x1D1AE, 0x1D1E8}, {0x1D200, 0x1D241}, - {0x1D242, 0x1D244}, {0x1D245, 0x1D245}, {0x1D300, 0x1D356}, - {0x1D360, 0x1D371}, {0x1D400, 0x1D454}, {0x1D456, 0x1D49C}, - {0x1D49E, 0x1D49F}, {0x1D4A2, 0x1D4A2}, {0x1D4A5, 0x1D4A6}, - {0x1D4A9, 0x1D4AC}, {0x1D4AE, 0x1D4B9}, {0x1D4BB, 0x1D4BB}, - {0x1D4BD, 0x1D4C3}, {0x1D4C5, 0x1D505}, {0x1D507, 0x1D50A}, - {0x1D50D, 0x1D514}, {0x1D516, 0x1D51C}, {0x1D51E, 0x1D539}, - {0x1D53B, 0x1D53E}, {0x1D540, 0x1D544}, {0x1D546, 0x1D546}, - {0x1D54A, 0x1D550}, {0x1D552, 0x1D6A5}, {0x1D6A8, 0x1D6C0}, - {0x1D6C1, 0x1D6C1}, {0x1D6C2, 0x1D6DA}, {0x1D6DB, 0x1D6DB}, - {0x1D6DC, 0x1D6FA}, {0x1D6FB, 0x1D6FB}, {0x1D6FC, 0x1D714}, - {0x1D715, 0x1D715}, {0x1D716, 0x1D734}, {0x1D735, 0x1D735}, - {0x1D736, 0x1D74E}, {0x1D74F, 0x1D74F}, {0x1D750, 0x1D76E}, - {0x1D76F, 0x1D76F}, {0x1D770, 0x1D788}, {0x1D789, 0x1D789}, - {0x1D78A, 0x1D7A8}, {0x1D7A9, 0x1D7A9}, {0x1D7AA, 0x1D7C2}, - {0x1D7C3, 0x1D7C3}, {0x1D7C4, 0x1D7CB}, {0x1D7CE, 0x1D7FF}, - {0x1D800, 0x1D9FF}, {0x1DA00, 0x1DA36}, {0x1DA37, 0x1DA3A}, - {0x1DA3B, 0x1DA6C}, {0x1DA6D, 0x1DA74}, {0x1DA75, 0x1DA75}, - {0x1DA76, 0x1DA83}, {0x1DA84, 0x1DA84}, {0x1DA85, 0x1DA86}, - {0x1DA87, 0x1DA8B}, {0x1DA9B, 0x1DA9F}, {0x1DAA1, 0x1DAAF}, - {0x1E000, 0x1E006}, {0x1E008, 0x1E018}, {0x1E01B, 0x1E021}, - {0x1E023, 0x1E024}, {0x1E026, 0x1E02A}, {0x1E800, 0x1E8C4}, - {0x1E8C7, 0x1E8CF}, {0x1E8D0, 0x1E8D6}, {0x1E900, 0x1E943}, - {0x1E944, 0x1E94A}, {0x1E950, 0x1E959}, {0x1E95E, 0x1E95F}, - {0x1EE00, 0x1EE03}, {0x1EE05, 0x1EE1F}, {0x1EE21, 0x1EE22}, - {0x1EE24, 0x1EE24}, {0x1EE27, 0x1EE27}, {0x1EE29, 0x1EE32}, - {0x1EE34, 0x1EE37}, {0x1EE39, 0x1EE39}, {0x1EE3B, 0x1EE3B}, - {0x1EE42, 0x1EE42}, {0x1EE47, 0x1EE47}, {0x1EE49, 0x1EE49}, - {0x1EE4B, 0x1EE4B}, {0x1EE4D, 0x1EE4F}, {0x1EE51, 0x1EE52}, - {0x1EE54, 0x1EE54}, {0x1EE57, 0x1EE57}, {0x1EE59, 0x1EE59}, - {0x1EE5B, 0x1EE5B}, {0x1EE5D, 0x1EE5D}, {0x1EE5F, 0x1EE5F}, - {0x1EE61, 0x1EE62}, {0x1EE64, 0x1EE64}, {0x1EE67, 0x1EE6A}, - {0x1EE6C, 0x1EE72}, {0x1EE74, 0x1EE77}, {0x1EE79, 0x1EE7C}, - {0x1EE7E, 0x1EE7E}, {0x1EE80, 0x1EE89}, {0x1EE8B, 0x1EE9B}, - {0x1EEA1, 0x1EEA3}, {0x1EEA5, 0x1EEA9}, {0x1EEAB, 0x1EEBB}, - {0x1EEF0, 0x1EEF1}, {0x1F000, 0x1F003}, {0x1F005, 0x1F02B}, - {0x1F030, 0x1F093}, {0x1F0A0, 0x1F0AE}, {0x1F0B1, 0x1F0BF}, - {0x1F0C1, 0x1F0CE}, {0x1F0D1, 0x1F0F5}, {0x1F10B, 0x1F10C}, - {0x1F12E, 0x1F12E}, {0x1F16A, 0x1F16B}, {0x1F1E6, 0x1F1FF}, - {0x1F321, 0x1F32C}, {0x1F336, 0x1F336}, {0x1F37D, 0x1F37D}, - {0x1F394, 0x1F39F}, {0x1F3CB, 0x1F3CE}, {0x1F3D4, 0x1F3DF}, - {0x1F3F1, 0x1F3F3}, {0x1F3F5, 0x1F3F7}, {0x1F43F, 0x1F43F}, - {0x1F441, 0x1F441}, {0x1F4FD, 0x1F4FE}, {0x1F53E, 0x1F54A}, - {0x1F54F, 0x1F54F}, {0x1F568, 0x1F579}, {0x1F57B, 0x1F594}, - {0x1F597, 0x1F5A3}, {0x1F5A5, 0x1F5FA}, {0x1F650, 0x1F67F}, - {0x1F6C6, 0x1F6CB}, {0x1F6CD, 0x1F6CF}, {0x1F6E0, 0x1F6EA}, - {0x1F6F0, 0x1F6F3}, {0x1F700, 0x1F773}, {0x1F780, 0x1F7D4}, - {0x1F800, 0x1F80B}, {0x1F810, 0x1F847}, {0x1F850, 0x1F859}, - {0x1F860, 0x1F887}, {0x1F890, 0x1F8AD}, {0xE0001, 0xE0001}, - {0xE0020, 0xE007F}, -} - // Condition have flag EastAsianWidth whether the current locale is CJK or not. type Condition struct { - EastAsianWidth bool + EastAsianWidth bool + ZeroWidthJoiner bool } // NewCondition return new instance of Condition which is current locale. func NewCondition() *Condition { - return &Condition{EastAsianWidth} + return &Condition{ + EastAsianWidth: EastAsianWidth, + ZeroWidthJoiner: ZeroWidthJoiner, + } } // RuneWidth returns the number of cells in r. // See http://www.unicode.org/reports/tr11/ func (c *Condition) RuneWidth(r rune) int { switch { - case r < 0 || r > 0x10FFFF || - inTables(r, nonprint, combining, notassigned): + case r < 0 || r > 0x10FFFF || inTables(r, nonprint, combining, notassigned): return 0 - case (c.EastAsianWidth && IsAmbiguousWidth(r)) || - inTables(r, doublewidth, emoji): + case (c.EastAsianWidth && IsAmbiguousWidth(r)) || inTables(r, doublewidth): return 2 default: return 1 } } -// StringWidth return width as you can see -func (c *Condition) StringWidth(s string) (width int) { +func (c *Condition) stringWidth(s string) (width int) { for _, r := range []rune(s) { width += c.RuneWidth(r) } return width } +func (c *Condition) stringWidthZeroJoiner(s string) (width int) { + r1, r2 := rune(0), rune(0) + for _, r := range []rune(s) { + if r == 0xFE0E || r == 0xFE0F { + continue + } + w := c.RuneWidth(r) + if r2 == 0x200D && inTables(r, emoji) && inTables(r1, emoji) { + if width < w { + width = w + } + } else { + width += w + } + r1, r2 = r2, r + } + return width +} + +// StringWidth return width as you can see +func (c *Condition) StringWidth(s string) (width int) { + if c.ZeroWidthJoiner { + return c.stringWidthZeroJoiner(s) + } + return c.stringWidth(s) +} + // Truncate return string truncated with w cells func (c *Condition) Truncate(s string, w int, tail string) string { if c.StringWidth(s) <= w { diff --git a/vendor/github.com/mattn/go-runewidth/runewidth_appengine.go b/vendor/github.com/mattn/go-runewidth/runewidth_appengine.go new file mode 100644 index 00000000000..7d99f6e5210 --- /dev/null +++ b/vendor/github.com/mattn/go-runewidth/runewidth_appengine.go @@ -0,0 +1,8 @@ +// +build appengine + +package runewidth + +// IsEastAsian return true if the current locale is CJK +func IsEastAsian() bool { + return false +} diff --git a/vendor/github.com/mattn/go-runewidth/runewidth_js.go b/vendor/github.com/mattn/go-runewidth/runewidth_js.go index 0ce32c5e7b7..c5fdf40baa0 100644 --- a/vendor/github.com/mattn/go-runewidth/runewidth_js.go +++ b/vendor/github.com/mattn/go-runewidth/runewidth_js.go @@ -1,4 +1,5 @@ // +build js +// +build !appengine package runewidth diff --git a/vendor/github.com/mattn/go-runewidth/runewidth_posix.go b/vendor/github.com/mattn/go-runewidth/runewidth_posix.go index c579e9a3144..66a58b5d873 100644 --- a/vendor/github.com/mattn/go-runewidth/runewidth_posix.go +++ b/vendor/github.com/mattn/go-runewidth/runewidth_posix.go @@ -1,4 +1,6 @@ -// +build !windows,!js +// +build !windows +// +build !js +// +build !appengine package runewidth diff --git a/vendor/github.com/mattn/go-runewidth/runewidth_table.go b/vendor/github.com/mattn/go-runewidth/runewidth_table.go new file mode 100644 index 00000000000..a8ccee5b198 --- /dev/null +++ b/vendor/github.com/mattn/go-runewidth/runewidth_table.go @@ -0,0 +1,429 @@ +// Code generated by script/generate.go. DO NOT EDIT. + +package runewidth + +var combining = table{ + {0x0300, 0x036F}, {0x0483, 0x0489}, {0x07EB, 0x07F3}, + {0x0C00, 0x0C00}, {0x0C04, 0x0C04}, {0x0D00, 0x0D01}, + {0x135D, 0x135F}, {0x1A7F, 0x1A7F}, {0x1AB0, 0x1ABE}, + {0x1B6B, 0x1B73}, {0x1DC0, 0x1DF9}, {0x1DFB, 0x1DFF}, + {0x20D0, 0x20F0}, {0x2CEF, 0x2CF1}, {0x2DE0, 0x2DFF}, + {0x3099, 0x309A}, {0xA66F, 0xA672}, {0xA674, 0xA67D}, + {0xA69E, 0xA69F}, {0xA6F0, 0xA6F1}, {0xA8E0, 0xA8F1}, + {0xFE20, 0xFE2F}, {0x101FD, 0x101FD}, {0x10376, 0x1037A}, + {0x10F46, 0x10F50}, {0x11300, 0x11301}, {0x1133B, 0x1133C}, + {0x11366, 0x1136C}, {0x11370, 0x11374}, {0x16AF0, 0x16AF4}, + {0x1D165, 0x1D169}, {0x1D16D, 0x1D172}, {0x1D17B, 0x1D182}, + {0x1D185, 0x1D18B}, {0x1D1AA, 0x1D1AD}, {0x1D242, 0x1D244}, + {0x1E000, 0x1E006}, {0x1E008, 0x1E018}, {0x1E01B, 0x1E021}, + {0x1E023, 0x1E024}, {0x1E026, 0x1E02A}, {0x1E8D0, 0x1E8D6}, +} + +var doublewidth = table{ + {0x1100, 0x115F}, {0x231A, 0x231B}, {0x2329, 0x232A}, + {0x23E9, 0x23EC}, {0x23F0, 0x23F0}, {0x23F3, 0x23F3}, + {0x25FD, 0x25FE}, {0x2614, 0x2615}, {0x2648, 0x2653}, + {0x267F, 0x267F}, {0x2693, 0x2693}, {0x26A1, 0x26A1}, + {0x26AA, 0x26AB}, {0x26BD, 0x26BE}, {0x26C4, 0x26C5}, + {0x26CE, 0x26CE}, {0x26D4, 0x26D4}, {0x26EA, 0x26EA}, + {0x26F2, 0x26F3}, {0x26F5, 0x26F5}, {0x26FA, 0x26FA}, + {0x26FD, 0x26FD}, {0x2705, 0x2705}, {0x270A, 0x270B}, + {0x2728, 0x2728}, {0x274C, 0x274C}, {0x274E, 0x274E}, + {0x2753, 0x2755}, {0x2757, 0x2757}, {0x2795, 0x2797}, + {0x27B0, 0x27B0}, {0x27BF, 0x27BF}, {0x2B1B, 0x2B1C}, + {0x2B50, 0x2B50}, {0x2B55, 0x2B55}, {0x2E80, 0x2E99}, + {0x2E9B, 0x2EF3}, {0x2F00, 0x2FD5}, {0x2FF0, 0x2FFB}, + {0x3000, 0x303E}, {0x3041, 0x3096}, {0x3099, 0x30FF}, + {0x3105, 0x312F}, {0x3131, 0x318E}, {0x3190, 0x31BA}, + {0x31C0, 0x31E3}, {0x31F0, 0x321E}, {0x3220, 0x3247}, + {0x3250, 0x4DBF}, {0x4E00, 0xA48C}, {0xA490, 0xA4C6}, + {0xA960, 0xA97C}, {0xAC00, 0xD7A3}, {0xF900, 0xFAFF}, + {0xFE10, 0xFE19}, {0xFE30, 0xFE52}, {0xFE54, 0xFE66}, + {0xFE68, 0xFE6B}, {0xFF01, 0xFF60}, {0xFFE0, 0xFFE6}, + {0x16FE0, 0x16FE3}, {0x17000, 0x187F7}, {0x18800, 0x18AF2}, + {0x1B000, 0x1B11E}, {0x1B150, 0x1B152}, {0x1B164, 0x1B167}, + {0x1B170, 0x1B2FB}, {0x1F004, 0x1F004}, {0x1F0CF, 0x1F0CF}, + {0x1F18E, 0x1F18E}, {0x1F191, 0x1F19A}, {0x1F200, 0x1F202}, + {0x1F210, 0x1F23B}, {0x1F240, 0x1F248}, {0x1F250, 0x1F251}, + {0x1F260, 0x1F265}, {0x1F300, 0x1F320}, {0x1F32D, 0x1F335}, + {0x1F337, 0x1F37C}, {0x1F37E, 0x1F393}, {0x1F3A0, 0x1F3CA}, + {0x1F3CF, 0x1F3D3}, {0x1F3E0, 0x1F3F0}, {0x1F3F4, 0x1F3F4}, + {0x1F3F8, 0x1F43E}, {0x1F440, 0x1F440}, {0x1F442, 0x1F4FC}, + {0x1F4FF, 0x1F53D}, {0x1F54B, 0x1F54E}, {0x1F550, 0x1F567}, + {0x1F57A, 0x1F57A}, {0x1F595, 0x1F596}, {0x1F5A4, 0x1F5A4}, + {0x1F5FB, 0x1F64F}, {0x1F680, 0x1F6C5}, {0x1F6CC, 0x1F6CC}, + {0x1F6D0, 0x1F6D2}, {0x1F6D5, 0x1F6D5}, {0x1F6EB, 0x1F6EC}, + {0x1F6F4, 0x1F6FA}, {0x1F7E0, 0x1F7EB}, {0x1F90D, 0x1F971}, + {0x1F973, 0x1F976}, {0x1F97A, 0x1F9A2}, {0x1F9A5, 0x1F9AA}, + {0x1F9AE, 0x1F9CA}, {0x1F9CD, 0x1F9FF}, {0x1FA70, 0x1FA73}, + {0x1FA78, 0x1FA7A}, {0x1FA80, 0x1FA82}, {0x1FA90, 0x1FA95}, + {0x20000, 0x2FFFD}, {0x30000, 0x3FFFD}, +} + +var ambiguous = table{ + {0x00A1, 0x00A1}, {0x00A4, 0x00A4}, {0x00A7, 0x00A8}, + {0x00AA, 0x00AA}, {0x00AD, 0x00AE}, {0x00B0, 0x00B4}, + {0x00B6, 0x00BA}, {0x00BC, 0x00BF}, {0x00C6, 0x00C6}, + {0x00D0, 0x00D0}, {0x00D7, 0x00D8}, {0x00DE, 0x00E1}, + {0x00E6, 0x00E6}, {0x00E8, 0x00EA}, {0x00EC, 0x00ED}, + {0x00F0, 0x00F0}, {0x00F2, 0x00F3}, {0x00F7, 0x00FA}, + {0x00FC, 0x00FC}, {0x00FE, 0x00FE}, {0x0101, 0x0101}, + {0x0111, 0x0111}, {0x0113, 0x0113}, {0x011B, 0x011B}, + {0x0126, 0x0127}, {0x012B, 0x012B}, {0x0131, 0x0133}, + {0x0138, 0x0138}, {0x013F, 0x0142}, {0x0144, 0x0144}, + {0x0148, 0x014B}, {0x014D, 0x014D}, {0x0152, 0x0153}, + {0x0166, 0x0167}, {0x016B, 0x016B}, {0x01CE, 0x01CE}, + {0x01D0, 0x01D0}, {0x01D2, 0x01D2}, {0x01D4, 0x01D4}, + {0x01D6, 0x01D6}, {0x01D8, 0x01D8}, {0x01DA, 0x01DA}, + {0x01DC, 0x01DC}, {0x0251, 0x0251}, {0x0261, 0x0261}, + {0x02C4, 0x02C4}, {0x02C7, 0x02C7}, {0x02C9, 0x02CB}, + {0x02CD, 0x02CD}, {0x02D0, 0x02D0}, {0x02D8, 0x02DB}, + {0x02DD, 0x02DD}, {0x02DF, 0x02DF}, {0x0300, 0x036F}, + {0x0391, 0x03A1}, {0x03A3, 0x03A9}, {0x03B1, 0x03C1}, + {0x03C3, 0x03C9}, {0x0401, 0x0401}, {0x0410, 0x044F}, + {0x0451, 0x0451}, {0x2010, 0x2010}, {0x2013, 0x2016}, + {0x2018, 0x2019}, {0x201C, 0x201D}, {0x2020, 0x2022}, + {0x2024, 0x2027}, {0x2030, 0x2030}, {0x2032, 0x2033}, + {0x2035, 0x2035}, {0x203B, 0x203B}, {0x203E, 0x203E}, + {0x2074, 0x2074}, {0x207F, 0x207F}, {0x2081, 0x2084}, + {0x20AC, 0x20AC}, {0x2103, 0x2103}, {0x2105, 0x2105}, + {0x2109, 0x2109}, {0x2113, 0x2113}, {0x2116, 0x2116}, + {0x2121, 0x2122}, {0x2126, 0x2126}, {0x212B, 0x212B}, + {0x2153, 0x2154}, {0x215B, 0x215E}, {0x2160, 0x216B}, + {0x2170, 0x2179}, {0x2189, 0x2189}, {0x2190, 0x2199}, + {0x21B8, 0x21B9}, {0x21D2, 0x21D2}, {0x21D4, 0x21D4}, + {0x21E7, 0x21E7}, {0x2200, 0x2200}, {0x2202, 0x2203}, + {0x2207, 0x2208}, {0x220B, 0x220B}, {0x220F, 0x220F}, + {0x2211, 0x2211}, {0x2215, 0x2215}, {0x221A, 0x221A}, + {0x221D, 0x2220}, {0x2223, 0x2223}, {0x2225, 0x2225}, + {0x2227, 0x222C}, {0x222E, 0x222E}, {0x2234, 0x2237}, + {0x223C, 0x223D}, {0x2248, 0x2248}, {0x224C, 0x224C}, + {0x2252, 0x2252}, {0x2260, 0x2261}, {0x2264, 0x2267}, + {0x226A, 0x226B}, {0x226E, 0x226F}, {0x2282, 0x2283}, + {0x2286, 0x2287}, {0x2295, 0x2295}, {0x2299, 0x2299}, + {0x22A5, 0x22A5}, {0x22BF, 0x22BF}, {0x2312, 0x2312}, + {0x2460, 0x24E9}, {0x24EB, 0x254B}, {0x2550, 0x2573}, + {0x2580, 0x258F}, {0x2592, 0x2595}, {0x25A0, 0x25A1}, + {0x25A3, 0x25A9}, {0x25B2, 0x25B3}, {0x25B6, 0x25B7}, + {0x25BC, 0x25BD}, {0x25C0, 0x25C1}, {0x25C6, 0x25C8}, + {0x25CB, 0x25CB}, {0x25CE, 0x25D1}, {0x25E2, 0x25E5}, + {0x25EF, 0x25EF}, {0x2605, 0x2606}, {0x2609, 0x2609}, + {0x260E, 0x260F}, {0x261C, 0x261C}, {0x261E, 0x261E}, + {0x2640, 0x2640}, {0x2642, 0x2642}, {0x2660, 0x2661}, + {0x2663, 0x2665}, {0x2667, 0x266A}, {0x266C, 0x266D}, + {0x266F, 0x266F}, {0x269E, 0x269F}, {0x26BF, 0x26BF}, + {0x26C6, 0x26CD}, {0x26CF, 0x26D3}, {0x26D5, 0x26E1}, + {0x26E3, 0x26E3}, {0x26E8, 0x26E9}, {0x26EB, 0x26F1}, + {0x26F4, 0x26F4}, {0x26F6, 0x26F9}, {0x26FB, 0x26FC}, + {0x26FE, 0x26FF}, {0x273D, 0x273D}, {0x2776, 0x277F}, + {0x2B56, 0x2B59}, {0x3248, 0x324F}, {0xE000, 0xF8FF}, + {0xFE00, 0xFE0F}, {0xFFFD, 0xFFFD}, {0x1F100, 0x1F10A}, + {0x1F110, 0x1F12D}, {0x1F130, 0x1F169}, {0x1F170, 0x1F18D}, + {0x1F18F, 0x1F190}, {0x1F19B, 0x1F1AC}, {0xE0100, 0xE01EF}, + {0xF0000, 0xFFFFD}, {0x100000, 0x10FFFD}, +} +var notassigned = table{ + {0x27E6, 0x27ED}, {0x2985, 0x2986}, +} + +var neutral = table{ + {0x0000, 0x001F}, {0x007F, 0x00A0}, {0x00A9, 0x00A9}, + {0x00AB, 0x00AB}, {0x00B5, 0x00B5}, {0x00BB, 0x00BB}, + {0x00C0, 0x00C5}, {0x00C7, 0x00CF}, {0x00D1, 0x00D6}, + {0x00D9, 0x00DD}, {0x00E2, 0x00E5}, {0x00E7, 0x00E7}, + {0x00EB, 0x00EB}, {0x00EE, 0x00EF}, {0x00F1, 0x00F1}, + {0x00F4, 0x00F6}, {0x00FB, 0x00FB}, {0x00FD, 0x00FD}, + {0x00FF, 0x0100}, {0x0102, 0x0110}, {0x0112, 0x0112}, + {0x0114, 0x011A}, {0x011C, 0x0125}, {0x0128, 0x012A}, + {0x012C, 0x0130}, {0x0134, 0x0137}, {0x0139, 0x013E}, + {0x0143, 0x0143}, {0x0145, 0x0147}, {0x014C, 0x014C}, + {0x014E, 0x0151}, {0x0154, 0x0165}, {0x0168, 0x016A}, + {0x016C, 0x01CD}, {0x01CF, 0x01CF}, {0x01D1, 0x01D1}, + {0x01D3, 0x01D3}, {0x01D5, 0x01D5}, {0x01D7, 0x01D7}, + {0x01D9, 0x01D9}, {0x01DB, 0x01DB}, {0x01DD, 0x0250}, + {0x0252, 0x0260}, {0x0262, 0x02C3}, {0x02C5, 0x02C6}, + {0x02C8, 0x02C8}, {0x02CC, 0x02CC}, {0x02CE, 0x02CF}, + {0x02D1, 0x02D7}, {0x02DC, 0x02DC}, {0x02DE, 0x02DE}, + {0x02E0, 0x02FF}, {0x0370, 0x0377}, {0x037A, 0x037F}, + {0x0384, 0x038A}, {0x038C, 0x038C}, {0x038E, 0x0390}, + {0x03AA, 0x03B0}, {0x03C2, 0x03C2}, {0x03CA, 0x0400}, + {0x0402, 0x040F}, {0x0450, 0x0450}, {0x0452, 0x052F}, + {0x0531, 0x0556}, {0x0559, 0x058A}, {0x058D, 0x058F}, + {0x0591, 0x05C7}, {0x05D0, 0x05EA}, {0x05EF, 0x05F4}, + {0x0600, 0x061C}, {0x061E, 0x070D}, {0x070F, 0x074A}, + {0x074D, 0x07B1}, {0x07C0, 0x07FA}, {0x07FD, 0x082D}, + {0x0830, 0x083E}, {0x0840, 0x085B}, {0x085E, 0x085E}, + {0x0860, 0x086A}, {0x08A0, 0x08B4}, {0x08B6, 0x08BD}, + {0x08D3, 0x0983}, {0x0985, 0x098C}, {0x098F, 0x0990}, + {0x0993, 0x09A8}, {0x09AA, 0x09B0}, {0x09B2, 0x09B2}, + {0x09B6, 0x09B9}, {0x09BC, 0x09C4}, {0x09C7, 0x09C8}, + {0x09CB, 0x09CE}, {0x09D7, 0x09D7}, {0x09DC, 0x09DD}, + {0x09DF, 0x09E3}, {0x09E6, 0x09FE}, {0x0A01, 0x0A03}, + {0x0A05, 0x0A0A}, {0x0A0F, 0x0A10}, {0x0A13, 0x0A28}, + {0x0A2A, 0x0A30}, {0x0A32, 0x0A33}, {0x0A35, 0x0A36}, + {0x0A38, 0x0A39}, {0x0A3C, 0x0A3C}, {0x0A3E, 0x0A42}, + {0x0A47, 0x0A48}, {0x0A4B, 0x0A4D}, {0x0A51, 0x0A51}, + {0x0A59, 0x0A5C}, {0x0A5E, 0x0A5E}, {0x0A66, 0x0A76}, + {0x0A81, 0x0A83}, {0x0A85, 0x0A8D}, {0x0A8F, 0x0A91}, + {0x0A93, 0x0AA8}, {0x0AAA, 0x0AB0}, {0x0AB2, 0x0AB3}, + {0x0AB5, 0x0AB9}, {0x0ABC, 0x0AC5}, {0x0AC7, 0x0AC9}, + {0x0ACB, 0x0ACD}, {0x0AD0, 0x0AD0}, {0x0AE0, 0x0AE3}, + {0x0AE6, 0x0AF1}, {0x0AF9, 0x0AFF}, {0x0B01, 0x0B03}, + {0x0B05, 0x0B0C}, {0x0B0F, 0x0B10}, {0x0B13, 0x0B28}, + {0x0B2A, 0x0B30}, {0x0B32, 0x0B33}, {0x0B35, 0x0B39}, + {0x0B3C, 0x0B44}, {0x0B47, 0x0B48}, {0x0B4B, 0x0B4D}, + {0x0B56, 0x0B57}, {0x0B5C, 0x0B5D}, {0x0B5F, 0x0B63}, + {0x0B66, 0x0B77}, {0x0B82, 0x0B83}, {0x0B85, 0x0B8A}, + {0x0B8E, 0x0B90}, {0x0B92, 0x0B95}, {0x0B99, 0x0B9A}, + {0x0B9C, 0x0B9C}, {0x0B9E, 0x0B9F}, {0x0BA3, 0x0BA4}, + {0x0BA8, 0x0BAA}, {0x0BAE, 0x0BB9}, {0x0BBE, 0x0BC2}, + {0x0BC6, 0x0BC8}, {0x0BCA, 0x0BCD}, {0x0BD0, 0x0BD0}, + {0x0BD7, 0x0BD7}, {0x0BE6, 0x0BFA}, {0x0C00, 0x0C0C}, + {0x0C0E, 0x0C10}, {0x0C12, 0x0C28}, {0x0C2A, 0x0C39}, + {0x0C3D, 0x0C44}, {0x0C46, 0x0C48}, {0x0C4A, 0x0C4D}, + {0x0C55, 0x0C56}, {0x0C58, 0x0C5A}, {0x0C60, 0x0C63}, + {0x0C66, 0x0C6F}, {0x0C77, 0x0C8C}, {0x0C8E, 0x0C90}, + {0x0C92, 0x0CA8}, {0x0CAA, 0x0CB3}, {0x0CB5, 0x0CB9}, + {0x0CBC, 0x0CC4}, {0x0CC6, 0x0CC8}, {0x0CCA, 0x0CCD}, + {0x0CD5, 0x0CD6}, {0x0CDE, 0x0CDE}, {0x0CE0, 0x0CE3}, + {0x0CE6, 0x0CEF}, {0x0CF1, 0x0CF2}, {0x0D00, 0x0D03}, + {0x0D05, 0x0D0C}, {0x0D0E, 0x0D10}, {0x0D12, 0x0D44}, + {0x0D46, 0x0D48}, {0x0D4A, 0x0D4F}, {0x0D54, 0x0D63}, + {0x0D66, 0x0D7F}, {0x0D82, 0x0D83}, {0x0D85, 0x0D96}, + {0x0D9A, 0x0DB1}, {0x0DB3, 0x0DBB}, {0x0DBD, 0x0DBD}, + {0x0DC0, 0x0DC6}, {0x0DCA, 0x0DCA}, {0x0DCF, 0x0DD4}, + {0x0DD6, 0x0DD6}, {0x0DD8, 0x0DDF}, {0x0DE6, 0x0DEF}, + {0x0DF2, 0x0DF4}, {0x0E01, 0x0E3A}, {0x0E3F, 0x0E5B}, + {0x0E81, 0x0E82}, {0x0E84, 0x0E84}, {0x0E86, 0x0E8A}, + {0x0E8C, 0x0EA3}, {0x0EA5, 0x0EA5}, {0x0EA7, 0x0EBD}, + {0x0EC0, 0x0EC4}, {0x0EC6, 0x0EC6}, {0x0EC8, 0x0ECD}, + {0x0ED0, 0x0ED9}, {0x0EDC, 0x0EDF}, {0x0F00, 0x0F47}, + {0x0F49, 0x0F6C}, {0x0F71, 0x0F97}, {0x0F99, 0x0FBC}, + {0x0FBE, 0x0FCC}, {0x0FCE, 0x0FDA}, {0x1000, 0x10C5}, + {0x10C7, 0x10C7}, {0x10CD, 0x10CD}, {0x10D0, 0x10FF}, + {0x1160, 0x1248}, {0x124A, 0x124D}, {0x1250, 0x1256}, + {0x1258, 0x1258}, {0x125A, 0x125D}, {0x1260, 0x1288}, + {0x128A, 0x128D}, {0x1290, 0x12B0}, {0x12B2, 0x12B5}, + {0x12B8, 0x12BE}, {0x12C0, 0x12C0}, {0x12C2, 0x12C5}, + {0x12C8, 0x12D6}, {0x12D8, 0x1310}, {0x1312, 0x1315}, + {0x1318, 0x135A}, {0x135D, 0x137C}, {0x1380, 0x1399}, + {0x13A0, 0x13F5}, {0x13F8, 0x13FD}, {0x1400, 0x169C}, + {0x16A0, 0x16F8}, {0x1700, 0x170C}, {0x170E, 0x1714}, + {0x1720, 0x1736}, {0x1740, 0x1753}, {0x1760, 0x176C}, + {0x176E, 0x1770}, {0x1772, 0x1773}, {0x1780, 0x17DD}, + {0x17E0, 0x17E9}, {0x17F0, 0x17F9}, {0x1800, 0x180E}, + {0x1810, 0x1819}, {0x1820, 0x1878}, {0x1880, 0x18AA}, + {0x18B0, 0x18F5}, {0x1900, 0x191E}, {0x1920, 0x192B}, + {0x1930, 0x193B}, {0x1940, 0x1940}, {0x1944, 0x196D}, + {0x1970, 0x1974}, {0x1980, 0x19AB}, {0x19B0, 0x19C9}, + {0x19D0, 0x19DA}, {0x19DE, 0x1A1B}, {0x1A1E, 0x1A5E}, + {0x1A60, 0x1A7C}, {0x1A7F, 0x1A89}, {0x1A90, 0x1A99}, + {0x1AA0, 0x1AAD}, {0x1AB0, 0x1ABE}, {0x1B00, 0x1B4B}, + {0x1B50, 0x1B7C}, {0x1B80, 0x1BF3}, {0x1BFC, 0x1C37}, + {0x1C3B, 0x1C49}, {0x1C4D, 0x1C88}, {0x1C90, 0x1CBA}, + {0x1CBD, 0x1CC7}, {0x1CD0, 0x1CFA}, {0x1D00, 0x1DF9}, + {0x1DFB, 0x1F15}, {0x1F18, 0x1F1D}, {0x1F20, 0x1F45}, + {0x1F48, 0x1F4D}, {0x1F50, 0x1F57}, {0x1F59, 0x1F59}, + {0x1F5B, 0x1F5B}, {0x1F5D, 0x1F5D}, {0x1F5F, 0x1F7D}, + {0x1F80, 0x1FB4}, {0x1FB6, 0x1FC4}, {0x1FC6, 0x1FD3}, + {0x1FD6, 0x1FDB}, {0x1FDD, 0x1FEF}, {0x1FF2, 0x1FF4}, + {0x1FF6, 0x1FFE}, {0x2000, 0x200F}, {0x2011, 0x2012}, + {0x2017, 0x2017}, {0x201A, 0x201B}, {0x201E, 0x201F}, + {0x2023, 0x2023}, {0x2028, 0x202F}, {0x2031, 0x2031}, + {0x2034, 0x2034}, {0x2036, 0x203A}, {0x203C, 0x203D}, + {0x203F, 0x2064}, {0x2066, 0x2071}, {0x2075, 0x207E}, + {0x2080, 0x2080}, {0x2085, 0x208E}, {0x2090, 0x209C}, + {0x20A0, 0x20A8}, {0x20AA, 0x20AB}, {0x20AD, 0x20BF}, + {0x20D0, 0x20F0}, {0x2100, 0x2102}, {0x2104, 0x2104}, + {0x2106, 0x2108}, {0x210A, 0x2112}, {0x2114, 0x2115}, + {0x2117, 0x2120}, {0x2123, 0x2125}, {0x2127, 0x212A}, + {0x212C, 0x2152}, {0x2155, 0x215A}, {0x215F, 0x215F}, + {0x216C, 0x216F}, {0x217A, 0x2188}, {0x218A, 0x218B}, + {0x219A, 0x21B7}, {0x21BA, 0x21D1}, {0x21D3, 0x21D3}, + {0x21D5, 0x21E6}, {0x21E8, 0x21FF}, {0x2201, 0x2201}, + {0x2204, 0x2206}, {0x2209, 0x220A}, {0x220C, 0x220E}, + {0x2210, 0x2210}, {0x2212, 0x2214}, {0x2216, 0x2219}, + {0x221B, 0x221C}, {0x2221, 0x2222}, {0x2224, 0x2224}, + {0x2226, 0x2226}, {0x222D, 0x222D}, {0x222F, 0x2233}, + {0x2238, 0x223B}, {0x223E, 0x2247}, {0x2249, 0x224B}, + {0x224D, 0x2251}, {0x2253, 0x225F}, {0x2262, 0x2263}, + {0x2268, 0x2269}, {0x226C, 0x226D}, {0x2270, 0x2281}, + {0x2284, 0x2285}, {0x2288, 0x2294}, {0x2296, 0x2298}, + {0x229A, 0x22A4}, {0x22A6, 0x22BE}, {0x22C0, 0x2311}, + {0x2313, 0x2319}, {0x231C, 0x2328}, {0x232B, 0x23E8}, + {0x23ED, 0x23EF}, {0x23F1, 0x23F2}, {0x23F4, 0x2426}, + {0x2440, 0x244A}, {0x24EA, 0x24EA}, {0x254C, 0x254F}, + {0x2574, 0x257F}, {0x2590, 0x2591}, {0x2596, 0x259F}, + {0x25A2, 0x25A2}, {0x25AA, 0x25B1}, {0x25B4, 0x25B5}, + {0x25B8, 0x25BB}, {0x25BE, 0x25BF}, {0x25C2, 0x25C5}, + {0x25C9, 0x25CA}, {0x25CC, 0x25CD}, {0x25D2, 0x25E1}, + {0x25E6, 0x25EE}, {0x25F0, 0x25FC}, {0x25FF, 0x2604}, + {0x2607, 0x2608}, {0x260A, 0x260D}, {0x2610, 0x2613}, + {0x2616, 0x261B}, {0x261D, 0x261D}, {0x261F, 0x263F}, + {0x2641, 0x2641}, {0x2643, 0x2647}, {0x2654, 0x265F}, + {0x2662, 0x2662}, {0x2666, 0x2666}, {0x266B, 0x266B}, + {0x266E, 0x266E}, {0x2670, 0x267E}, {0x2680, 0x2692}, + {0x2694, 0x269D}, {0x26A0, 0x26A0}, {0x26A2, 0x26A9}, + {0x26AC, 0x26BC}, {0x26C0, 0x26C3}, {0x26E2, 0x26E2}, + {0x26E4, 0x26E7}, {0x2700, 0x2704}, {0x2706, 0x2709}, + {0x270C, 0x2727}, {0x2729, 0x273C}, {0x273E, 0x274B}, + {0x274D, 0x274D}, {0x274F, 0x2752}, {0x2756, 0x2756}, + {0x2758, 0x2775}, {0x2780, 0x2794}, {0x2798, 0x27AF}, + {0x27B1, 0x27BE}, {0x27C0, 0x27E5}, {0x27EE, 0x2984}, + {0x2987, 0x2B1A}, {0x2B1D, 0x2B4F}, {0x2B51, 0x2B54}, + {0x2B5A, 0x2B73}, {0x2B76, 0x2B95}, {0x2B98, 0x2C2E}, + {0x2C30, 0x2C5E}, {0x2C60, 0x2CF3}, {0x2CF9, 0x2D25}, + {0x2D27, 0x2D27}, {0x2D2D, 0x2D2D}, {0x2D30, 0x2D67}, + {0x2D6F, 0x2D70}, {0x2D7F, 0x2D96}, {0x2DA0, 0x2DA6}, + {0x2DA8, 0x2DAE}, {0x2DB0, 0x2DB6}, {0x2DB8, 0x2DBE}, + {0x2DC0, 0x2DC6}, {0x2DC8, 0x2DCE}, {0x2DD0, 0x2DD6}, + {0x2DD8, 0x2DDE}, {0x2DE0, 0x2E4F}, {0x303F, 0x303F}, + {0x4DC0, 0x4DFF}, {0xA4D0, 0xA62B}, {0xA640, 0xA6F7}, + {0xA700, 0xA7BF}, {0xA7C2, 0xA7C6}, {0xA7F7, 0xA82B}, + {0xA830, 0xA839}, {0xA840, 0xA877}, {0xA880, 0xA8C5}, + {0xA8CE, 0xA8D9}, {0xA8E0, 0xA953}, {0xA95F, 0xA95F}, + {0xA980, 0xA9CD}, {0xA9CF, 0xA9D9}, {0xA9DE, 0xA9FE}, + {0xAA00, 0xAA36}, {0xAA40, 0xAA4D}, {0xAA50, 0xAA59}, + {0xAA5C, 0xAAC2}, {0xAADB, 0xAAF6}, {0xAB01, 0xAB06}, + {0xAB09, 0xAB0E}, {0xAB11, 0xAB16}, {0xAB20, 0xAB26}, + {0xAB28, 0xAB2E}, {0xAB30, 0xAB67}, {0xAB70, 0xABED}, + {0xABF0, 0xABF9}, {0xD7B0, 0xD7C6}, {0xD7CB, 0xD7FB}, + {0xD800, 0xDFFF}, {0xFB00, 0xFB06}, {0xFB13, 0xFB17}, + {0xFB1D, 0xFB36}, {0xFB38, 0xFB3C}, {0xFB3E, 0xFB3E}, + {0xFB40, 0xFB41}, {0xFB43, 0xFB44}, {0xFB46, 0xFBC1}, + {0xFBD3, 0xFD3F}, {0xFD50, 0xFD8F}, {0xFD92, 0xFDC7}, + {0xFDF0, 0xFDFD}, {0xFE20, 0xFE2F}, {0xFE70, 0xFE74}, + {0xFE76, 0xFEFC}, {0xFEFF, 0xFEFF}, {0xFFF9, 0xFFFC}, + {0x10000, 0x1000B}, {0x1000D, 0x10026}, {0x10028, 0x1003A}, + {0x1003C, 0x1003D}, {0x1003F, 0x1004D}, {0x10050, 0x1005D}, + {0x10080, 0x100FA}, {0x10100, 0x10102}, {0x10107, 0x10133}, + {0x10137, 0x1018E}, {0x10190, 0x1019B}, {0x101A0, 0x101A0}, + {0x101D0, 0x101FD}, {0x10280, 0x1029C}, {0x102A0, 0x102D0}, + {0x102E0, 0x102FB}, {0x10300, 0x10323}, {0x1032D, 0x1034A}, + {0x10350, 0x1037A}, {0x10380, 0x1039D}, {0x1039F, 0x103C3}, + {0x103C8, 0x103D5}, {0x10400, 0x1049D}, {0x104A0, 0x104A9}, + {0x104B0, 0x104D3}, {0x104D8, 0x104FB}, {0x10500, 0x10527}, + {0x10530, 0x10563}, {0x1056F, 0x1056F}, {0x10600, 0x10736}, + {0x10740, 0x10755}, {0x10760, 0x10767}, {0x10800, 0x10805}, + {0x10808, 0x10808}, {0x1080A, 0x10835}, {0x10837, 0x10838}, + {0x1083C, 0x1083C}, {0x1083F, 0x10855}, {0x10857, 0x1089E}, + {0x108A7, 0x108AF}, {0x108E0, 0x108F2}, {0x108F4, 0x108F5}, + {0x108FB, 0x1091B}, {0x1091F, 0x10939}, {0x1093F, 0x1093F}, + {0x10980, 0x109B7}, {0x109BC, 0x109CF}, {0x109D2, 0x10A03}, + {0x10A05, 0x10A06}, {0x10A0C, 0x10A13}, {0x10A15, 0x10A17}, + {0x10A19, 0x10A35}, {0x10A38, 0x10A3A}, {0x10A3F, 0x10A48}, + {0x10A50, 0x10A58}, {0x10A60, 0x10A9F}, {0x10AC0, 0x10AE6}, + {0x10AEB, 0x10AF6}, {0x10B00, 0x10B35}, {0x10B39, 0x10B55}, + {0x10B58, 0x10B72}, {0x10B78, 0x10B91}, {0x10B99, 0x10B9C}, + {0x10BA9, 0x10BAF}, {0x10C00, 0x10C48}, {0x10C80, 0x10CB2}, + {0x10CC0, 0x10CF2}, {0x10CFA, 0x10D27}, {0x10D30, 0x10D39}, + {0x10E60, 0x10E7E}, {0x10F00, 0x10F27}, {0x10F30, 0x10F59}, + {0x10FE0, 0x10FF6}, {0x11000, 0x1104D}, {0x11052, 0x1106F}, + {0x1107F, 0x110C1}, {0x110CD, 0x110CD}, {0x110D0, 0x110E8}, + {0x110F0, 0x110F9}, {0x11100, 0x11134}, {0x11136, 0x11146}, + {0x11150, 0x11176}, {0x11180, 0x111CD}, {0x111D0, 0x111DF}, + {0x111E1, 0x111F4}, {0x11200, 0x11211}, {0x11213, 0x1123E}, + {0x11280, 0x11286}, {0x11288, 0x11288}, {0x1128A, 0x1128D}, + {0x1128F, 0x1129D}, {0x1129F, 0x112A9}, {0x112B0, 0x112EA}, + {0x112F0, 0x112F9}, {0x11300, 0x11303}, {0x11305, 0x1130C}, + {0x1130F, 0x11310}, {0x11313, 0x11328}, {0x1132A, 0x11330}, + {0x11332, 0x11333}, {0x11335, 0x11339}, {0x1133B, 0x11344}, + {0x11347, 0x11348}, {0x1134B, 0x1134D}, {0x11350, 0x11350}, + {0x11357, 0x11357}, {0x1135D, 0x11363}, {0x11366, 0x1136C}, + {0x11370, 0x11374}, {0x11400, 0x11459}, {0x1145B, 0x1145B}, + {0x1145D, 0x1145F}, {0x11480, 0x114C7}, {0x114D0, 0x114D9}, + {0x11580, 0x115B5}, {0x115B8, 0x115DD}, {0x11600, 0x11644}, + {0x11650, 0x11659}, {0x11660, 0x1166C}, {0x11680, 0x116B8}, + {0x116C0, 0x116C9}, {0x11700, 0x1171A}, {0x1171D, 0x1172B}, + {0x11730, 0x1173F}, {0x11800, 0x1183B}, {0x118A0, 0x118F2}, + {0x118FF, 0x118FF}, {0x119A0, 0x119A7}, {0x119AA, 0x119D7}, + {0x119DA, 0x119E4}, {0x11A00, 0x11A47}, {0x11A50, 0x11AA2}, + {0x11AC0, 0x11AF8}, {0x11C00, 0x11C08}, {0x11C0A, 0x11C36}, + {0x11C38, 0x11C45}, {0x11C50, 0x11C6C}, {0x11C70, 0x11C8F}, + {0x11C92, 0x11CA7}, {0x11CA9, 0x11CB6}, {0x11D00, 0x11D06}, + {0x11D08, 0x11D09}, {0x11D0B, 0x11D36}, {0x11D3A, 0x11D3A}, + {0x11D3C, 0x11D3D}, {0x11D3F, 0x11D47}, {0x11D50, 0x11D59}, + {0x11D60, 0x11D65}, {0x11D67, 0x11D68}, {0x11D6A, 0x11D8E}, + {0x11D90, 0x11D91}, {0x11D93, 0x11D98}, {0x11DA0, 0x11DA9}, + {0x11EE0, 0x11EF8}, {0x11FC0, 0x11FF1}, {0x11FFF, 0x12399}, + {0x12400, 0x1246E}, {0x12470, 0x12474}, {0x12480, 0x12543}, + {0x13000, 0x1342E}, {0x13430, 0x13438}, {0x14400, 0x14646}, + {0x16800, 0x16A38}, {0x16A40, 0x16A5E}, {0x16A60, 0x16A69}, + {0x16A6E, 0x16A6F}, {0x16AD0, 0x16AED}, {0x16AF0, 0x16AF5}, + {0x16B00, 0x16B45}, {0x16B50, 0x16B59}, {0x16B5B, 0x16B61}, + {0x16B63, 0x16B77}, {0x16B7D, 0x16B8F}, {0x16E40, 0x16E9A}, + {0x16F00, 0x16F4A}, {0x16F4F, 0x16F87}, {0x16F8F, 0x16F9F}, + {0x1BC00, 0x1BC6A}, {0x1BC70, 0x1BC7C}, {0x1BC80, 0x1BC88}, + {0x1BC90, 0x1BC99}, {0x1BC9C, 0x1BCA3}, {0x1D000, 0x1D0F5}, + {0x1D100, 0x1D126}, {0x1D129, 0x1D1E8}, {0x1D200, 0x1D245}, + {0x1D2E0, 0x1D2F3}, {0x1D300, 0x1D356}, {0x1D360, 0x1D378}, + {0x1D400, 0x1D454}, {0x1D456, 0x1D49C}, {0x1D49E, 0x1D49F}, + {0x1D4A2, 0x1D4A2}, {0x1D4A5, 0x1D4A6}, {0x1D4A9, 0x1D4AC}, + {0x1D4AE, 0x1D4B9}, {0x1D4BB, 0x1D4BB}, {0x1D4BD, 0x1D4C3}, + {0x1D4C5, 0x1D505}, {0x1D507, 0x1D50A}, {0x1D50D, 0x1D514}, + {0x1D516, 0x1D51C}, {0x1D51E, 0x1D539}, {0x1D53B, 0x1D53E}, + {0x1D540, 0x1D544}, {0x1D546, 0x1D546}, {0x1D54A, 0x1D550}, + {0x1D552, 0x1D6A5}, {0x1D6A8, 0x1D7CB}, {0x1D7CE, 0x1DA8B}, + {0x1DA9B, 0x1DA9F}, {0x1DAA1, 0x1DAAF}, {0x1E000, 0x1E006}, + {0x1E008, 0x1E018}, {0x1E01B, 0x1E021}, {0x1E023, 0x1E024}, + {0x1E026, 0x1E02A}, {0x1E100, 0x1E12C}, {0x1E130, 0x1E13D}, + {0x1E140, 0x1E149}, {0x1E14E, 0x1E14F}, {0x1E2C0, 0x1E2F9}, + {0x1E2FF, 0x1E2FF}, {0x1E800, 0x1E8C4}, {0x1E8C7, 0x1E8D6}, + {0x1E900, 0x1E94B}, {0x1E950, 0x1E959}, {0x1E95E, 0x1E95F}, + {0x1EC71, 0x1ECB4}, {0x1ED01, 0x1ED3D}, {0x1EE00, 0x1EE03}, + {0x1EE05, 0x1EE1F}, {0x1EE21, 0x1EE22}, {0x1EE24, 0x1EE24}, + {0x1EE27, 0x1EE27}, {0x1EE29, 0x1EE32}, {0x1EE34, 0x1EE37}, + {0x1EE39, 0x1EE39}, {0x1EE3B, 0x1EE3B}, {0x1EE42, 0x1EE42}, + {0x1EE47, 0x1EE47}, {0x1EE49, 0x1EE49}, {0x1EE4B, 0x1EE4B}, + {0x1EE4D, 0x1EE4F}, {0x1EE51, 0x1EE52}, {0x1EE54, 0x1EE54}, + {0x1EE57, 0x1EE57}, {0x1EE59, 0x1EE59}, {0x1EE5B, 0x1EE5B}, + {0x1EE5D, 0x1EE5D}, {0x1EE5F, 0x1EE5F}, {0x1EE61, 0x1EE62}, + {0x1EE64, 0x1EE64}, {0x1EE67, 0x1EE6A}, {0x1EE6C, 0x1EE72}, + {0x1EE74, 0x1EE77}, {0x1EE79, 0x1EE7C}, {0x1EE7E, 0x1EE7E}, + {0x1EE80, 0x1EE89}, {0x1EE8B, 0x1EE9B}, {0x1EEA1, 0x1EEA3}, + {0x1EEA5, 0x1EEA9}, {0x1EEAB, 0x1EEBB}, {0x1EEF0, 0x1EEF1}, + {0x1F000, 0x1F003}, {0x1F005, 0x1F02B}, {0x1F030, 0x1F093}, + {0x1F0A0, 0x1F0AE}, {0x1F0B1, 0x1F0BF}, {0x1F0C1, 0x1F0CE}, + {0x1F0D1, 0x1F0F5}, {0x1F10B, 0x1F10C}, {0x1F12E, 0x1F12F}, + {0x1F16A, 0x1F16C}, {0x1F1E6, 0x1F1FF}, {0x1F321, 0x1F32C}, + {0x1F336, 0x1F336}, {0x1F37D, 0x1F37D}, {0x1F394, 0x1F39F}, + {0x1F3CB, 0x1F3CE}, {0x1F3D4, 0x1F3DF}, {0x1F3F1, 0x1F3F3}, + {0x1F3F5, 0x1F3F7}, {0x1F43F, 0x1F43F}, {0x1F441, 0x1F441}, + {0x1F4FD, 0x1F4FE}, {0x1F53E, 0x1F54A}, {0x1F54F, 0x1F54F}, + {0x1F568, 0x1F579}, {0x1F57B, 0x1F594}, {0x1F597, 0x1F5A3}, + {0x1F5A5, 0x1F5FA}, {0x1F650, 0x1F67F}, {0x1F6C6, 0x1F6CB}, + {0x1F6CD, 0x1F6CF}, {0x1F6D3, 0x1F6D4}, {0x1F6E0, 0x1F6EA}, + {0x1F6F0, 0x1F6F3}, {0x1F700, 0x1F773}, {0x1F780, 0x1F7D8}, + {0x1F800, 0x1F80B}, {0x1F810, 0x1F847}, {0x1F850, 0x1F859}, + {0x1F860, 0x1F887}, {0x1F890, 0x1F8AD}, {0x1F900, 0x1F90B}, + {0x1FA00, 0x1FA53}, {0x1FA60, 0x1FA6D}, {0xE0001, 0xE0001}, + {0xE0020, 0xE007F}, +} + +var emoji = table{ + {0x203C, 0x203C}, {0x2049, 0x2049}, {0x2122, 0x2122}, + {0x2139, 0x2139}, {0x2194, 0x2199}, {0x21A9, 0x21AA}, + {0x231A, 0x231B}, {0x2328, 0x2328}, {0x2388, 0x2388}, + {0x23CF, 0x23CF}, {0x23E9, 0x23F3}, {0x23F8, 0x23FA}, + {0x24C2, 0x24C2}, {0x25AA, 0x25AB}, {0x25B6, 0x25B6}, + {0x25C0, 0x25C0}, {0x25FB, 0x25FE}, {0x2600, 0x2605}, + {0x2607, 0x2612}, {0x2614, 0x2685}, {0x2690, 0x2705}, + {0x2708, 0x2712}, {0x2714, 0x2714}, {0x2716, 0x2716}, + {0x271D, 0x271D}, {0x2721, 0x2721}, {0x2728, 0x2728}, + {0x2733, 0x2734}, {0x2744, 0x2744}, {0x2747, 0x2747}, + {0x274C, 0x274C}, {0x274E, 0x274E}, {0x2753, 0x2755}, + {0x2757, 0x2757}, {0x2763, 0x2767}, {0x2795, 0x2797}, + {0x27A1, 0x27A1}, {0x27B0, 0x27B0}, {0x27BF, 0x27BF}, + {0x2934, 0x2935}, {0x2B05, 0x2B07}, {0x2B1B, 0x2B1C}, + {0x2B50, 0x2B50}, {0x2B55, 0x2B55}, {0x3030, 0x3030}, + {0x303D, 0x303D}, {0x3297, 0x3297}, {0x3299, 0x3299}, + {0x1F000, 0x1F0FF}, {0x1F10D, 0x1F10F}, {0x1F12F, 0x1F12F}, + {0x1F16C, 0x1F171}, {0x1F17E, 0x1F17F}, {0x1F18E, 0x1F18E}, + {0x1F191, 0x1F19A}, {0x1F1AD, 0x1F1E5}, {0x1F201, 0x1F20F}, + {0x1F21A, 0x1F21A}, {0x1F22F, 0x1F22F}, {0x1F232, 0x1F23A}, + {0x1F23C, 0x1F23F}, {0x1F249, 0x1F3FA}, {0x1F400, 0x1F53D}, + {0x1F546, 0x1F64F}, {0x1F680, 0x1F6FF}, {0x1F774, 0x1F77F}, + {0x1F7D5, 0x1F7FF}, {0x1F80C, 0x1F80F}, {0x1F848, 0x1F84F}, + {0x1F85A, 0x1F85F}, {0x1F888, 0x1F88F}, {0x1F8AE, 0x1F8FF}, + {0x1F90C, 0x1F93A}, {0x1F93C, 0x1F945}, {0x1F947, 0x1FFFD}, +} diff --git a/vendor/github.com/mattn/go-runewidth/runewidth_windows.go b/vendor/github.com/mattn/go-runewidth/runewidth_windows.go index 0258876b99d..d6a61777d7b 100644 --- a/vendor/github.com/mattn/go-runewidth/runewidth_windows.go +++ b/vendor/github.com/mattn/go-runewidth/runewidth_windows.go @@ -1,3 +1,6 @@ +// +build windows +// +build !appengine + package runewidth import ( diff --git a/vendor/golang.org/x/sys/unix/syscall_linux_mips64x.go b/vendor/golang.org/x/sys/unix/syscall_linux_mips64x.go index e9d2f1d7152..85a872d6e4b 100644 --- a/vendor/golang.org/x/sys/unix/syscall_linux_mips64x.go +++ b/vendor/golang.org/x/sys/unix/syscall_linux_mips64x.go @@ -224,3 +224,8 @@ func Poll(fds []PollFd, timeout int) (n int, err error) { } return poll(&fds[0], len(fds), timeout) } + +func InotifyInit() (fd int, err error) { + return InotifyInit1(0) +} + diff --git a/vendor/modules.txt b/vendor/modules.txt index b924089da8f..fde4861ff8e 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -1,3 +1,15 @@ +# github.com/antonmedv/expr v1.8.9 +## explicit +github.com/antonmedv/expr +github.com/antonmedv/expr/ast +github.com/antonmedv/expr/checker +github.com/antonmedv/expr/compiler +github.com/antonmedv/expr/conf +github.com/antonmedv/expr/file +github.com/antonmedv/expr/optimizer +github.com/antonmedv/expr/parser +github.com/antonmedv/expr/parser/lexer +github.com/antonmedv/expr/vm # github.com/beorn7/perks v1.0.0 github.com/beorn7/perks/quantile # github.com/bgentry/speakeasy v0.1.0 @@ -84,8 +96,7 @@ github.com/konsorten/go-windows-terminal-sequences ## explicit # github.com/mattn/go-isatty v0.0.4 ## explicit -# github.com/mattn/go-runewidth v0.0.2 -## explicit +# github.com/mattn/go-runewidth v0.0.8 github.com/mattn/go-runewidth # github.com/matttproud/golang_protobuf_extensions v1.0.1 github.com/matttproud/golang_protobuf_extensions/pbutil @@ -161,7 +172,7 @@ golang.org/x/net/http2/hpack golang.org/x/net/idna golang.org/x/net/internal/timeseries golang.org/x/net/trace -# golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5 +# golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4 golang.org/x/sys/unix golang.org/x/sys/windows # golang.org/x/text v0.3.3