`
leonzhx
  • 浏览: 768728 次
  • 性别: Icon_minigender_1
  • 来自: 上海
社区版块
存档分类
最新评论

Style Guide

 
阅读更多

1.   Use CamelCase (with an initial capital) for message names:

 

 

message SongServerRequest {

  required string song_name = 1;

} 
 

Using this naming convention for field names gives you accessors like the following:

 

 

public String getSongName() { ... }
public Builder setSongName(String v) { ... }
 

2.   Use CamelCase (with an initial capital) for enum type names and CAPITALS_WITH_UNDERSCORES for value names:

enum Foo {
  FIRST_VALUE = 1;
  SECOND_VALUE = 2;
}

 

 

 

3.  f your .proto defines an RPC service, you should use CamelCase (with an initial capital) for both the service name and any RPC method names:

 

service FooService {

  rpc GetSomething(FooRequest) returns (FooResponse);

} 
 
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics