Skip to content

Commit

Permalink
upgrade grpc-gateway from v1 to v2
Browse files Browse the repository at this point in the history
Signed-off-by: Wei Fu <[email protected]>
Signed-off-by: Benjamin Wang <[email protected]>
  • Loading branch information
ahrtr committed Aug 21, 2023
1 parent e2e17c7 commit c19711f
Show file tree
Hide file tree
Showing 18 changed files with 484 additions and 122 deletions.
2 changes: 2 additions & 0 deletions api/authpb/auth.proto
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ package authpb;

import "gogoproto/gogo.proto";

option go_package = "go.etcd.io/etcd/api/v3/authpb";

option (gogoproto.marshaler_all) = true;
option (gogoproto.sizer_all) = true;
option (gogoproto.unmarshaler_all) = true;
Expand Down
2 changes: 2 additions & 0 deletions api/etcdserverpb/etcdserver.proto
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ package etcdserverpb;

import "gogoproto/gogo.proto";

option go_package = "go.etcd.io/etcd/api/v3/etcdserverpb";

option (gogoproto.marshaler_all) = true;
option (gogoproto.sizer_all) = true;
option (gogoproto.unmarshaler_all) = true;
Expand Down
2 changes: 2 additions & 0 deletions api/etcdserverpb/raft_internal.proto
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import "rpc.proto";
import "etcd/api/versionpb/version.proto";
import "etcd/api/membershippb/membership.proto";

option go_package = "go.etcd.io/etcd/api/v3/etcdserverpb";

option (gogoproto.marshaler_all) = true;
option (gogoproto.sizer_all) = true;
option (gogoproto.unmarshaler_all) = true;
Expand Down
8 changes: 5 additions & 3 deletions api/etcdserverpb/rpc.proto
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,14 @@ import "etcd/api/versionpb/version.proto";

// for grpc-gateway
import "google/api/annotations.proto";
import "protoc-gen-swagger/options/annotations.proto";
import "protoc-gen-openapiv2/options/annotations.proto";

option go_package = "go.etcd.io/etcd/api/v3/etcdserverpb";

option (gogoproto.marshaler_all) = true;
option (gogoproto.unmarshaler_all) = true;

option (grpc.gateway.protoc_gen_swagger.options.openapiv2_swagger) = {
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = {
security_definitions: {
security: {
key: "ApiKey";
Expand Down Expand Up @@ -238,7 +240,7 @@ service Maintenance {
// It only iterates "key" bucket in backend storage.
rpc HashKV(HashKVRequest) returns (HashKVResponse) {
option (google.api.http) = {
post: "/v3/maintenance/hash"
post: "/v3/maintenance/hashkv"
body: "*"
};
}
Expand Down
2 changes: 2 additions & 0 deletions api/membershippb/membership.proto
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ package membershippb;
import "gogoproto/gogo.proto";
import "etcd/api/versionpb/version.proto";

option go_package = "go.etcd.io/etcd/api/v3/membershippb";

option (gogoproto.marshaler_all) = true;
option (gogoproto.sizer_all) = true;
option (gogoproto.unmarshaler_all) = true;
Expand Down
2 changes: 2 additions & 0 deletions api/mvccpb/kv.proto
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ package mvccpb;

import "gogoproto/gogo.proto";

option go_package = "go.etcd.io/etcd/api/v3/mvccpb";

option (gogoproto.marshaler_all) = true;
option (gogoproto.sizer_all) = true;
option (gogoproto.unmarshaler_all) = true;
Expand Down
2 changes: 2 additions & 0 deletions api/versionpb/version.proto
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ package versionpb;
import "gogoproto/gogo.proto";
import "google/protobuf/descriptor.proto";

option go_package = "go.etcd.io/etcd/api/v3/versionpb";

option (gogoproto.marshaler_all) = true;
option (gogoproto.unmarshaler_all) = true;

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
// Copyright (c) 2015, Google Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

syntax = "proto3";

package google.api;

import "google/api/http.proto";
import "google/protobuf/descriptor.proto";

option go_package = "google.golang.org/genproto/googleapis/api/annotations;annotations";
option java_multiple_files = true;
option java_outer_classname = "AnnotationsProto";
option java_package = "com.google.api";
option objc_class_prefix = "GAPI";

extend google.protobuf.MethodOptions {
// See `HttpRule`.
HttpRule http = 72295728;
}
Loading

0 comments on commit c19711f

Please sign in to comment.