Documentation ¶
Overview ¶
Package test is a generated protocol buffer package.
It is generated from these files:
test.proto
It has these top-level messages:
Request Response Test
Index ¶
- Variables
- func RegisterTestServiceServer(s *grpc.Server, srv TestServiceServer)
- type Request
- type Response
- type Test
- func (*Test) Descriptor() ([]byte, []int)
- func (m *Test) GetAge() int32
- func (m *Test) GetChar() []byte
- func (m *Test) GetChild() *Test_Child
- func (m *Test) GetCount() int64
- func (m *Test) GetDict() map[string]string
- func (m *Test) GetFat() bool
- func (m *Test) GetMoney() float64
- func (m *Test) GetName() string
- func (m *Test) GetScore() float32
- func (m *Test) GetStatus() Test_Status
- func (*Test) ProtoMessage()
- func (m *Test) Reset()
- func (m *Test) String() string
- type TestServiceClient
- type TestServiceServer
- type Test_Child
- type Test_Status
Constants ¶
This section is empty.
Variables ¶
View Source
var Test_Status_name = map[int32]string{
0: "OK",
1: "FAIL",
}
View Source
var Test_Status_value = map[string]int32{
"OK": 0,
"FAIL": 1,
}
Functions ¶
func RegisterTestServiceServer ¶
func RegisterTestServiceServer(s *grpc.Server, srv TestServiceServer)
Types ¶
type Request ¶
type Request struct {
Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"`
}
Request 请求结构
func (*Request) Descriptor ¶
func (*Request) ProtoMessage ¶
func (*Request) ProtoMessage()
type Response ¶
type Response struct {
Message string `protobuf:"bytes,1,opt,name=message" json:"message,omitempty"`
}
Response 响应结构
func (*Response) Descriptor ¶
func (*Response) GetMessage ¶
func (*Response) ProtoMessage ¶
func (*Response) ProtoMessage()
type Test ¶
type Test struct { Age int32 `protobuf:"varint,1,opt,name=age" json:"age,omitempty"` Count int64 `protobuf:"varint,2,opt,name=count" json:"count,omitempty"` Money float64 `protobuf:"fixed64,3,opt,name=money" json:"money,omitempty"` Score float32 `protobuf:"fixed32,4,opt,name=score" json:"score,omitempty"` Name string `protobuf:"bytes,5,opt,name=name" json:"name,omitempty"` Fat bool `protobuf:"varint,6,opt,name=fat" json:"fat,omitempty"` Char []byte `protobuf:"bytes,7,opt,name=char,proto3" json:"char,omitempty"` Status Test_Status `protobuf:"varint,8,opt,name=status,enum=test.Test_Status" json:"status,omitempty"` Child *Test_Child `protobuf:"bytes,9,opt,name=child" json:"child,omitempty"` Dict map[string]string `` /* 129-byte string literal not displayed */ }
Test 测试
func (*Test) Descriptor ¶
func (*Test) GetChild ¶
func (m *Test) GetChild() *Test_Child
func (*Test) GetStatus ¶
func (m *Test) GetStatus() Test_Status
func (*Test) ProtoMessage ¶
func (*Test) ProtoMessage()
type TestServiceClient ¶
type TestServiceClient interface { // Test 测试方法 Test(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error) }
func NewTestServiceClient ¶
func NewTestServiceClient(cc *grpc.ClientConn) TestServiceClient
type TestServiceServer ¶
type Test_Child ¶
type Test_Child struct {
Sex string `protobuf:"bytes,1,opt,name=sex" json:"sex,omitempty"`
}
Child 子结构
func (*Test_Child) Descriptor ¶
func (*Test_Child) Descriptor() ([]byte, []int)
func (*Test_Child) GetSex ¶
func (m *Test_Child) GetSex() string
func (*Test_Child) ProtoMessage ¶
func (*Test_Child) ProtoMessage()
func (*Test_Child) Reset ¶
func (m *Test_Child) Reset()
func (*Test_Child) String ¶
func (m *Test_Child) String() string
type Test_Status ¶
type Test_Status int32
Status 枚举状态
const ( Test_OK Test_Status = 0 Test_FAIL Test_Status = 1 )
func (Test_Status) EnumDescriptor ¶
func (Test_Status) EnumDescriptor() ([]byte, []int)
func (Test_Status) String ¶
func (x Test_Status) String() string
Click to show internal directories.
Click to hide internal directories.