GreetingService.proto 772 Bytes
Newer Older
Gabriele Civitarese's avatar
Gabriele Civitarese committed
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
syntax = "proto3";
package com.example.grpc;

// Request payload
message HelloRequest {
    // Each message attribute is strongly typed.
    // You also must assign a "tag" number.
    // Each tag number is unique within the message.
    string name = 1;

    // This defines a strongly typed list of String
    repeated string hobbies = 2;

    // There are many more basics types, like Enum, Map
    // See https://developers.google.com/protocol-buffers/docs/proto3
    // for more information.
}

message HelloResponse {
    string greeting = 1;
}

// Defining a Service, a Service can have multiple RPC operations
service GreetingService {

    rpc greeting(HelloRequest) returns (HelloResponse);

    rpc streamGreeting(HelloRequest) returns (stream HelloResponse);
}