File: unannotated_echo_service.proto

package info (click to toggle)
golang-github-grpc-ecosystem-grpc-gateway.v2 2.11.3-2
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 6,148 kB
  • sloc: javascript: 352; makefile: 136; sh: 26
file content (55 lines) | stat: -rw-r--r-- 1,736 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
syntax = "proto3";

// Unannotated Echo Service
// Similar to echo_service.proto but without annotations. See
// unannotated_echo_service.yaml for the equivalent of the annotations in
// gRPC API configuration format.
//
// Echo Service API consists of a single service which returns
// a message.
package grpc.gateway.examples.internal.proto.examplepb;

// Do not need annotations.proto, can still use well known types as usual
import "google/protobuf/duration.proto";

option go_package = "github.com/grpc-ecosystem/grpc-gateway/v2/examples/internal/proto/examplepb;examplepb";

// Embedded represents a message embedded in SimpleMessage.
message UnannotatedEmbedded {
  oneof mark {
    int64 progress = 1;
    string note = 2;
  }
}

// UnannotatedSimpleMessage represents a simple message sent to the unannotated Echo service.
message UnannotatedSimpleMessage {
  // Id represents the message identifier.
  string id = 1;
  int64 num = 2;
  google.protobuf.Duration duration = 3;
  oneof code {
    int64 line_num = 4;
    string lang = 5;
  }
  UnannotatedEmbedded status = 6;
  oneof ext {
    int64 en = 7;
    UnannotatedEmbedded no = 8;
  }
}

// Echo service responds to incoming echo requests.
service UnannotatedEchoService {
  // Echo method receives a simple message and returns it.
  //
  // The message posted as the id parameter will also be
  // returned.
  rpc Echo(UnannotatedSimpleMessage) returns (UnannotatedSimpleMessage);

  // EchoBody method receives a simple message and returns it.
  rpc EchoBody(UnannotatedSimpleMessage) returns (UnannotatedSimpleMessage);

  // EchoDelete method receives a simple message and returns it.
  rpc EchoDelete(UnannotatedSimpleMessage) returns (UnannotatedSimpleMessage);
}