Documentation
¶
Overview ¶
Package pb provides test protobuf definitions for integration tests. This file is manually created for testing (not generated by protoc).
本包提供集成测试用的 protobuf 定义。 本文件手动创建用于测试(非 protoc 生成的代码)。
Index ¶
- func RegisterTestServiceServer(s grpc.ServiceRegistrar, srv TestServiceServer)
- type EchoRequest
- type EchoResponse
- type HelloRequest
- type HelloResponse
- type StreamRequest
- type StreamResponse
- type TestServiceClient
- type TestServiceServer
- type TestService_StreamTestServer
- type UnimplementedTestServiceServer
- func (UnimplementedTestServiceServer) Echo(context.Context, *EchoRequest) (*EchoResponse, error)
- func (UnimplementedTestServiceServer) SayHello(context.Context, *HelloRequest) (*HelloResponse, error)
- func (UnimplementedTestServiceServer) StreamTest(*StreamRequest, TestService_StreamTestServer) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterTestServiceServer ¶
func RegisterTestServiceServer(s grpc.ServiceRegistrar, srv TestServiceServer)
RegisterTestServiceServer registers TestServiceServer.
RegisterTestServiceServer 注册 TestServiceServer。
Types ¶
type EchoRequest ¶
type EchoRequest struct {
Body string
}
EchoRequest represents an echo request.
EchoRequest 表示 echo 请求。
type HelloRequest ¶
type HelloRequest struct {
// 名字
Name string
}
HelloRequest represents a simple hello request.
HelloRequest 表示简单的 hello 请求。
type StreamRequest ¶
type StreamRequest struct {
Count int32
}
StreamRequest represents a stream request.
StreamRequest 表示 stream 请求。
type TestServiceClient ¶
type TestServiceClient interface {
SayHello(ctx context.Context, in *HelloRequest, opts ...grpc.CallOption) (*HelloResponse, error)
Echo(ctx context.Context, in *EchoRequest, opts ...grpc.CallOption) (*EchoResponse, error)
StreamTest(ctx context.Context, in *StreamRequest, opts ...grpc.CallOption) (grpc.ClientStream, error)
}
TestServiceClient is the client API for TestService.
TestServiceClient 是 TestService 的客户端 API。
func NewTestServiceClient ¶
func NewTestServiceClient(cc grpc.ClientConnInterface) TestServiceClient
NewTestServiceClient creates a new TestServiceClient.
NewTestServiceClient 创建新的 TestServiceClient。
type TestServiceServer ¶
type TestServiceServer interface {
SayHello(context.Context, *HelloRequest) (*HelloResponse, error)
Echo(context.Context, *EchoRequest) (*EchoResponse, error)
StreamTest(*StreamRequest, TestService_StreamTestServer) error
}
TestServiceServer is the server API for TestService.
TestServiceServer 是 TestService 的服务端 API。
type TestService_StreamTestServer ¶
type TestService_StreamTestServer interface {
Send(*StreamResponse) error
grpc.ServerStream
}
TestService_StreamTestServer is the server stream for StreamTest.
TestService_StreamTestServer 是 StreamTest 的服务端 stream。
type UnimplementedTestServiceServer ¶
type UnimplementedTestServiceServer struct{}
UnimplementedTestServiceServer must be embedded for forward compatibility.
UnimplementedTestServiceServer 必须嵌入以保持向前兼容。
func (UnimplementedTestServiceServer) Echo ¶
func (UnimplementedTestServiceServer) Echo(context.Context, *EchoRequest) (*EchoResponse, error)
func (UnimplementedTestServiceServer) SayHello ¶
func (UnimplementedTestServiceServer) SayHello(context.Context, *HelloRequest) (*HelloResponse, error)
func (UnimplementedTestServiceServer) StreamTest ¶
func (UnimplementedTestServiceServer) StreamTest(*StreamRequest, TestService_StreamTestServer) error