Skip to content

gRPC API Reference

Contents

HelloGreeter

The greeting service definition.

SayHello

rpc SayHello(HelloGreeterSayHelloRequest) HelloGreeterSayHelloResponse

Sends a greeting

HelloIdentity

Version

rpc Version(HelloIdentityVersionRequest) HelloIdentityVersionResponse

Messages

HelloGreeterSayHelloRequest

The request message containing the user's name.

Field Type Description
name string none

HelloGreeterSayHelloResponse

The response message containing the greetings

Field Type Description
message string none

HelloIdentityVersionRequest

Empty request

HelloIdentityVersionResponse

Defines the response to version

Field Type Description
hello_version HelloVersion Hello application version

HelloVersion

Hello version in Major.Minor.Patch format. The goal of this message is to provide clients a method to determine the server and client versions.

Field Type Description
major int32 Version major number
minor int32 Version minor number
patch int32 Version patch number
version string String representation of the version. Must be in major.minor.patch format.

Enums

HelloVersion.Version

These values are constants that can be used by the client and server applications

Name Number Description
MUST_HAVE_ZERO_VALUE 0 Must be set in the proto file; ignore.
MAJOR 0 Version major value of this specification
MINOR 0 Version minor value of this specification
PATCH 1 Version patch value of this specification

Scalar Value Types

.proto Type Notes C++ Type Java Type Python Type

double
double double float

float
float float float

int32
Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint32 instead. int32 int int

int64
Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint64 instead. int64 long int/long

uint32
Uses variable-length encoding. uint32 int int/long

uint64
Uses variable-length encoding. uint64 long int/long

sint32
Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int32s. int32 int int

sint64
Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int64s. int64 long int/long

fixed32
Always four bytes. More efficient than uint32 if values are often greater than 2^28. uint32 int int

fixed64
Always eight bytes. More efficient than uint64 if values are often greater than 2^56. uint64 long int/long

sfixed32
Always four bytes. int32 int int

sfixed64
Always eight bytes. int64 long int/long

bool
bool boolean boolean

string
A string must always contain UTF-8 encoded or 7-bit ASCII text. string String str/unicode

bytes
May contain any arbitrary sequence of bytes. string ByteString str