github.com/harvey-h-yu/prototool@v1.3.0/example/idl/uber/foo/foo.proto (about)

     1  syntax = "proto3";
     2  
     3  package foo;
     4  
     5  option go_package = "foopb";
     6  option java_multiple_files = true;
     7  option java_outer_classname = "FooProto";
     8  option java_package = "com.foo";
     9  
    10  import "foo/dep.proto";
    11  import "google/api/annotations.proto";
    12  import "google/protobuf/duration.proto";
    13  import "google/protobuf/timestamp.proto";
    14  import "sub/sub.proto";
    15  
    16  // Hello is a hello.
    17  enum Hello {
    18    HELLO_INVALID = 0;
    19    HELLO_UNSET = 1;
    20    HELLO_TREE = 2;
    21    HELLO_BALLOON = 3;
    22  }
    23  
    24  // Foo is a foo.
    25  message Foo {
    26    // Bar is a bar.
    27    message Bar {
    28      // Baz is a baz.
    29      enum Baz {
    30        FOO_BAR_BAZ_INVALID = 0;
    31      }
    32      // Bat is a bat.
    33      enum Bat {
    34        FOO_BAR_BAT_INVALID = 0;
    35      }
    36      Baz baz = 1;
    37      Bat bat = 2;
    38    }
    39    Bar bar = 1;
    40  }
    41  
    42  // Bar is a bar.
    43  enum Bar {
    44    BAR_INVALID = 0;
    45  }
    46  
    47  // Barr is a barr.
    48  message Barr {
    49    int64 hello = 1;
    50    foo.Dep dep = 2;
    51    google.protobuf.Timestamp timestamp = 3;
    52  }
    53  
    54  // Another is another message.
    55  message Another {
    56    int64 one = 1;
    57    string two = 2;
    58    Another another = 3;
    59    repeated string four = 4;
    60    Hello hello = 5;
    61    map<string, int64> m = 6;
    62    oneof oneof_oneof {
    63      int64 seven = 7;
    64      string eight = 8;
    65    }
    66    repeated Another nine = 9;
    67    google.protobuf.Duration duration = 10;
    68  }
    69  
    70  // HasWKT has Well-Known Types.
    71  message HasWKT {
    72    google.protobuf.Duration duration = 1;
    73  }
    74  
    75  // Bazz is a bazzzz.
    76  message Bazz {}
    77  
    78  // BarRequest is a bar request.
    79  message BarRequest {
    80    int64 id = 1;
    81  }
    82  
    83  // FooResponse is an foo response.
    84  message FooResponse {
    85    foo.Dep dep = 1;
    86  }
    87  
    88  // HelloService is a service.
    89  service HelloService {
    90    // Foo does a foo.
    91    rpc Foo(sub.Dep) returns (FooResponse);
    92    // Bar does a bar.
    93    rpc Bar(BarRequest) returns (foo.Dep) {
    94      option (google.api.http) = {
    95        get: "/bar/{id}"
    96      };
    97    }
    98  }
    99  
   100  message ExclamationRequest {
   101    string value = 1;
   102  }
   103  
   104  message ExclamationResponse {
   105    string value = 1;
   106  }
   107  
   108  // ExcitedService is a service with exciting transformations.
   109  service ExcitedService {
   110    // Exclamation adds an exclamation to the request value.
   111    rpc Exclamation(ExclamationRequest) returns (ExclamationResponse);
   112    // ExclamationClientStream adds an exclamation to the combined request values.
   113    rpc ExclamationClientStream(stream ExclamationRequest) returns (ExclamationResponse);
   114    // ExclamationServerStream adds an exclamation to the request value
   115    // and streams each character as a response.
   116    rpc ExclamationServerStream(ExclamationRequest) returns (stream ExclamationResponse);
   117    // ExclamationBidiStream adds an exclamation to the each request value.
   118    rpc ExclamationBidiStream(stream ExclamationRequest) returns (stream ExclamationResponse);
   119  }