...

Text file src/github.com/grpc-ecosystem/grpc-gateway/examples/internal/proto/examplepb/swagger_merge_a.proto

Documentation: github.com/grpc-ecosystem/grpc-gateway/examples/internal/proto/examplepb

     1syntax = "proto3";
     2option go_package = "examplepb";
     3
     4// Merging Services
     5//
     6// This is an example of merging two proto files.
     7package grpc.gateway.examples.internal.examplepb;
     8
     9import "google/api/annotations.proto";
    10
    11// InMessageA represents a message to ServiceA and ServiceC.
    12message InMessageA {
    13	// Here is the explanation about InMessageA.values
    14	repeated string values = 1;
    15}
    16
    17// OutMessageA represents a message returned from ServiceA.
    18message OutMessageA {
    19	// Here is the explanation about OutMessageA.value
    20	string value = 1;
    21}
    22
    23// OutMessageC represents a message returned from ServiceC.
    24message OutMessageC {
    25	// Here is the explanation about OutMessageC.value
    26	string value = 1;
    27}
    28
    29// ServiceA provices MethodOne and MethodTwo
    30service ServiceA {
    31	// ServiceA.MethodOne receives InMessageA and returns OutMessageA
    32	//
    33	// Here is the detail explanation about ServiceA.MethodOne.
    34	rpc MethodOne(InMessageA) returns (OutMessageA) {
    35		option (google.api.http) = {
    36            post: "/v1/example/a/1"
    37            body: "*"
    38		};
    39	}
    40	// ServiceA.MethodTwo receives OutMessageA and returns InMessageA
    41	//
    42	// Here is the detail explanation about ServiceA.MethodTwo.
    43	rpc MethodTwo(OutMessageA) returns (InMessageA) {
    44		option (google.api.http) = {
    45            post: "/v1/example/a/2"
    46            body: "*"
    47		};
    48	}
    49}
    50
    51// ServiceC service responds to incoming merge requests.
    52service ServiceC {
    53	// ServiceC.MethodOne receives InMessageA and returns OutMessageC
    54	//
    55	// Here is the detail explanation about ServiceC.MethodOne.
    56	rpc MethodOne(InMessageA) returns (OutMessageC) {
    57		option (google.api.http) = {
    58            post: "/v1/example/c/1"
    59            body: "*"
    60		};
    61	}
    62	// ServiceC.MethodTwo receives OutMessageA and returns InMessageA
    63	//
    64	// Here is the detail explanation about ServiceC.MethodTwo.
    65	rpc MethodTwo(OutMessageA) returns (InMessageA) {
    66		option (google.api.http) = {
    67            post: "/v1/example/c/2"
    68            body: "*"
    69		};
    70	}
    71}

View as plain text