Documentation
¶
Overview ¶
Package testing is a generated protocol buffer package.
It is generated from these files:
test.proto
It has these top-level messages:
EchoRequest EchoResponse
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterTestServiceServer ¶
func RegisterTestServiceServer(s *grpc.Server, srv TestServiceServer)
Types ¶
type EchoRequest ¶
type EchoRequest struct {
Message string `protobuf:"bytes,1,opt,name=message" json:"message,omitempty"`
}
func (*EchoRequest) Descriptor ¶
func (*EchoRequest) Descriptor() ([]byte, []int)
func (*EchoRequest) GetMessage ¶
func (m *EchoRequest) GetMessage() string
func (*EchoRequest) ProtoMessage ¶
func (*EchoRequest) ProtoMessage()
func (*EchoRequest) Reset ¶
func (m *EchoRequest) Reset()
func (*EchoRequest) String ¶
func (m *EchoRequest) String() string
type EchoResponse ¶
type EchoResponse struct {
Message string `protobuf:"bytes,1,opt,name=message" json:"message,omitempty"`
}
func (*EchoResponse) Descriptor ¶
func (*EchoResponse) Descriptor() ([]byte, []int)
func (*EchoResponse) GetMessage ¶
func (m *EchoResponse) GetMessage() string
func (*EchoResponse) ProtoMessage ¶
func (*EchoResponse) ProtoMessage()
func (*EchoResponse) Reset ¶
func (m *EchoResponse) Reset()
func (*EchoResponse) String ¶
func (m *EchoResponse) String() string
type TestContext ¶
type TestContext struct { ServerOpts []grpc.ServerOption ClientOpts []grpc.DialOption Service TestServiceServer Client TestServiceClient // contains filtered or unexported fields }
TestContext is a testing helper for generating a gRPC server and a gRPC client.
func CreateTestContext ¶
func CreateTestContext(t *testing.T) *TestContext
CreateTestContext returns a new TestContext object.
func (*TestContext) SetClientStatsHandler ¶
func (c *TestContext) SetClientStatsHandler(h stats.Handler)
SetClientStatsHandler sets stats.Handler to a test client.
func (*TestContext) SetServerStatsHandler ¶
func (c *TestContext) SetServerStatsHandler(h stats.Handler)
SetServerStatsHandler sets stats.Handler to a test server.
func (*TestContext) Setup ¶
func (c *TestContext) Setup()
Setup starts a server and creates a client connection.
func (*TestContext) Teardown ¶
func (c *TestContext) Teardown()
Teardown disconnects a client connection and stops a server
type TestServiceClient ¶
type TestServiceClient interface { Echo(ctx context.Context, in *EchoRequest, opts ...grpc.CallOption) (*EchoResponse, error) Empty(ctx context.Context, in *google_protobuf.Empty, opts ...grpc.CallOption) (*google_protobuf.Empty, error) Error(ctx context.Context, in *google_protobuf.Empty, opts ...grpc.CallOption) (*google_protobuf.Empty, error) }
func NewTestServiceClient ¶
func NewTestServiceClient(cc *grpc.ClientConn) TestServiceClient
type TestServiceServer ¶
type TestServiceServer interface { Echo(context.Context, *EchoRequest) (*EchoResponse, error) Empty(context.Context, *google_protobuf.Empty) (*google_protobuf.Empty, error) Error(context.Context, *google_protobuf.Empty) (*google_protobuf.Empty, error) }
Click to show internal directories.
Click to hide internal directories.