From 2bf5dda3f2192b082c73d329ea1f34f37bc982ce Mon Sep 17 00:00:00 2001 From: Johan Brandhorst Date: Thu, 31 May 2018 10:29:20 +0100 Subject: [PATCH] Examples: Consistently use tabs in a_bit_of_everything --- .../proto/examplepb/a_bit_of_everything.pb.go | 16 +- .../proto/examplepb/a_bit_of_everything.proto | 216 +++++++++--------- 2 files changed, 116 insertions(+), 116 deletions(-) diff --git a/examples/proto/examplepb/a_bit_of_everything.pb.go b/examples/proto/examplepb/a_bit_of_everything.pb.go index 520dae9c337..91b403c1bca 100644 --- a/examples/proto/examplepb/a_bit_of_everything.pb.go +++ b/examples/proto/examplepb/a_bit_of_everything.pb.go @@ -53,7 +53,7 @@ func (x NumericEnum) String() string { return proto.EnumName(NumericEnum_name, int32(x)) } func (NumericEnum) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_a_bit_of_everything_f27080d9602a5f10, []int{0} + return fileDescriptor_a_bit_of_everything_06ded4cf666009ee, []int{0} } // DeepEnum is one or zero. @@ -79,7 +79,7 @@ func (x ABitOfEverything_Nested_DeepEnum) String() string { return proto.EnumName(ABitOfEverything_Nested_DeepEnum_name, int32(x)) } func (ABitOfEverything_Nested_DeepEnum) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_a_bit_of_everything_f27080d9602a5f10, []int{0, 0, 0} + return fileDescriptor_a_bit_of_everything_06ded4cf666009ee, []int{0, 0, 0} } // Intentionaly complicated message type to cover much features of Protobuf. @@ -125,7 +125,7 @@ func (m *ABitOfEverything) Reset() { *m = ABitOfEverything{} } func (m *ABitOfEverything) String() string { return proto.CompactTextString(m) } func (*ABitOfEverything) ProtoMessage() {} func (*ABitOfEverything) Descriptor() ([]byte, []int) { - return fileDescriptor_a_bit_of_everything_f27080d9602a5f10, []int{0} + return fileDescriptor_a_bit_of_everything_06ded4cf666009ee, []int{0} } func (m *ABitOfEverything) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_ABitOfEverything.Unmarshal(m, b) @@ -447,7 +447,7 @@ func (m *ABitOfEverything_Nested) Reset() { *m = ABitOfEverything_Nested func (m *ABitOfEverything_Nested) String() string { return proto.CompactTextString(m) } func (*ABitOfEverything_Nested) ProtoMessage() {} func (*ABitOfEverything_Nested) Descriptor() ([]byte, []int) { - return fileDescriptor_a_bit_of_everything_f27080d9602a5f10, []int{0, 0} + return fileDescriptor_a_bit_of_everything_06ded4cf666009ee, []int{0, 0} } func (m *ABitOfEverything_Nested) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_ABitOfEverything_Nested.Unmarshal(m, b) @@ -499,7 +499,7 @@ func (m *Body) Reset() { *m = Body{} } func (m *Body) String() string { return proto.CompactTextString(m) } func (*Body) ProtoMessage() {} func (*Body) Descriptor() ([]byte, []int) { - return fileDescriptor_a_bit_of_everything_f27080d9602a5f10, []int{1} + return fileDescriptor_a_bit_of_everything_06ded4cf666009ee, []int{1} } func (m *Body) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_Body.Unmarshal(m, b) @@ -538,7 +538,7 @@ func (m *MessageWithBody) Reset() { *m = MessageWithBody{} } func (m *MessageWithBody) String() string { return proto.CompactTextString(m) } func (*MessageWithBody) ProtoMessage() {} func (*MessageWithBody) Descriptor() ([]byte, []int) { - return fileDescriptor_a_bit_of_everything_f27080d9602a5f10, []int{2} + return fileDescriptor_a_bit_of_everything_06ded4cf666009ee, []int{2} } func (m *MessageWithBody) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_MessageWithBody.Unmarshal(m, b) @@ -1195,10 +1195,10 @@ var _AnotherServiceWithNoBindings_serviceDesc = grpc.ServiceDesc{ } func init() { - proto.RegisterFile("examples/proto/examplepb/a_bit_of_everything.proto", fileDescriptor_a_bit_of_everything_f27080d9602a5f10) + proto.RegisterFile("examples/proto/examplepb/a_bit_of_everything.proto", fileDescriptor_a_bit_of_everything_06ded4cf666009ee) } -var fileDescriptor_a_bit_of_everything_f27080d9602a5f10 = []byte{ +var fileDescriptor_a_bit_of_everything_06ded4cf666009ee = []byte{ // 2019 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x58, 0xcd, 0x6f, 0xdb, 0xc8, 0x15, 0xf7, 0x48, 0xb2, 0x22, 0x3d, 0xf9, 0x43, 0x1e, 0xe7, 0xc3, 0x51, 0x9c, 0xf5, 0x44, 0xc9, diff --git a/examples/proto/examplepb/a_bit_of_everything.proto b/examples/proto/examplepb/a_bit_of_everything.proto index 6eaa7d8fd9a..c7d5d597317 100644 --- a/examples/proto/examplepb/a_bit_of_everything.proto +++ b/examples/proto/examplepb/a_bit_of_everything.proto @@ -11,89 +11,89 @@ import "google/protobuf/timestamp.proto"; import "protoc-gen-swagger/options/annotations.proto"; option (grpc.gateway.protoc_gen_swagger.options.openapiv2_swagger) = { - info: { - title: "A Bit of Everything"; - version: "1.0"; - contact: { - name: "gRPC-Gateway project"; - url: "https://github.com/grpc-ecosystem/grpc-gateway"; - email: "none@example.com"; - }; - }; - // Overwriting host entry breaks tests, so this is not done here. - external_docs: { - url: "https://github.com/grpc-ecosystem/grpc-gateway"; - description: "More about gRPC-Gateway"; - } - schemes: HTTP; - schemes: HTTPS; - schemes: WSS; - consumes: "application/json"; - consumes: "application/x-foo-mime"; - produces: "application/json"; - produces: "application/x-foo-mime"; - security_definitions: { - security: { - key: "BasicAuth"; - value: { - type: TYPE_BASIC; - } - } - security: { - key: "ApiKeyAuth"; - value: { - type: TYPE_API_KEY; - in: IN_HEADER; - name: "X-API-Key"; - } - } - security: { - key: "OAuth2"; - value: { - type: TYPE_OAUTH2; - flow: FLOW_ACCESS_CODE; - authorization_url: "https://example.com/oauth/authorize"; - token_url: "https://example.com/oauth/token"; - scopes: { - scope: { - key: "read"; - value: "Grants read access"; - } - scope: { - key: "write"; - value: "Grants write access"; - } - scope: { - key: "admin"; - value: "Grants read and write access to administrative information"; - } + info: { + title: "A Bit of Everything"; + version: "1.0"; + contact: { + name: "gRPC-Gateway project"; + url: "https://github.com/grpc-ecosystem/grpc-gateway"; + email: "none@example.com"; + }; + }; + // Overwriting host entry breaks tests, so this is not done here. + external_docs: { + url: "https://github.com/grpc-ecosystem/grpc-gateway"; + description: "More about gRPC-Gateway"; + } + schemes: HTTP; + schemes: HTTPS; + schemes: WSS; + consumes: "application/json"; + consumes: "application/x-foo-mime"; + produces: "application/json"; + produces: "application/x-foo-mime"; + security_definitions: { + security: { + key: "BasicAuth"; + value: { + type: TYPE_BASIC; + } + } + security: { + key: "ApiKeyAuth"; + value: { + type: TYPE_API_KEY; + in: IN_HEADER; + name: "X-API-Key"; + } + } + security: { + key: "OAuth2"; + value: { + type: TYPE_OAUTH2; + flow: FLOW_ACCESS_CODE; + authorization_url: "https://example.com/oauth/authorize"; + token_url: "https://example.com/oauth/token"; + scopes: { + scope: { + key: "read"; + value: "Grants read access"; + } + scope: { + key: "write"; + value: "Grants write access"; + } + scope: { + key: "admin"; + value: "Grants read and write access to administrative information"; + } + } + } + } + } + security: { + security_requirement: { + key: "BasicAuth"; + value: {}; + } + security_requirement: { + key: "ApiKeyAuth"; + value: {}; + } + } + security: { + security_requirement: { + key: "OAuth2"; + value: { + scope: "read"; + scope: "write"; + } + } + security_requirement: { + key: "ApiKeyAuth"; + value: {}; + } } - } - } - } - security: { - security_requirement: { - key: "BasicAuth"; - value: {}; - } - security_requirement: { - key: "ApiKeyAuth"; - value: {}; - } - } - security: { - security_requirement: { - key: "OAuth2"; - value: { - scope: "read"; - scope: "write"; - } - } - security_requirement: { - key: "ApiKeyAuth"; - value: {}; - } - } }; @@ -155,7 +155,7 @@ message ABitOfEverything { google.protobuf.Timestamp timestamp_value = 27; - // repeated enum value. it is comma-separated in query + // repeated enum value. it is comma-separated in query repeated NumericEnum repeated_enum_value = 28; } @@ -174,7 +174,7 @@ enum NumericEnum { // ZERO means 0 ZERO = 0; // ONE means 1 - ONE = 1; + ONE = 1; } // ABitOfEverything service is used to validate that APIs with complicated @@ -217,19 +217,19 @@ service ABitOfEverythingService { delete: "/v1/example/a_bit_of_everything/{uuid}" }; option (grpc.gateway.protoc_gen_swagger.options.openapiv2_operation) = { - security: { - security_requirement: { - key: "ApiKeyAuth"; - value: {} - } - security_requirement: { - key: "OAuth2"; - value: { - scope: "read"; - scope: "write"; - } - } - } + security: { + security_requirement: { + key: "ApiKeyAuth"; + value: {} + } + security_requirement: { + key: "OAuth2"; + value: { + scope: "read"; + scope: "write"; + } + } + } }; } rpc GetQuery(ABitOfEverything) returns (google.protobuf.Empty) { @@ -237,11 +237,11 @@ service ABitOfEverythingService { get: "/v1/example/a_bit_of_everything/query/{uuid}" }; option (grpc.gateway.protoc_gen_swagger.options.openapiv2_operation) = { - deprecated: true // For testing purposes. - external_docs: { - url: "https://github.com/grpc-ecosystem/grpc-gateway"; - description: "Find out more about GetQuery"; - } + deprecated: true // For testing purposes. + external_docs: { + url: "https://github.com/grpc-ecosystem/grpc-gateway"; + description: "Find out more about GetQuery"; + } }; } // Echo allows posting a StringMessage value. @@ -296,20 +296,20 @@ service ABitOfEverythingService { body: "data" }; } - rpc PostWithEmptyBody(Body) returns (google.protobuf.Empty) { - option (google.api.http) = { + rpc PostWithEmptyBody(Body) returns (google.protobuf.Empty) { + option (google.api.http) = { post: "/v2/example/postwithemptybody/{name}", body: "*" }; - } + } } // camelCase and lowercase service names are valid but not recommended (use TitleCase instead) service camelCaseServiceName { - rpc Empty(google.protobuf.Empty) returns (google.protobuf.Empty) { - option (google.api.http) = { + rpc Empty(google.protobuf.Empty) returns (google.protobuf.Empty) { + option (google.api.http) = { get: "/v2/example/empty", }; - } + } } service AnotherServiceWithNoBindings { rpc NoBindings(google.protobuf.Empty) returns (google.protobuf.Empty) {}