Documentation ¶
Overview ¶
Package testpb contains protobufs used by server's unit tests.
Index ¶
- Constants
- Variables
- func RegisterTestServer(s grpc.ServiceRegistrar, srv TestServer)
- type Request
- type Response
- type TestClient
- type TestServer
- type Test_ClientServerStreamClient
- type Test_ClientServerStreamServer
- type Test_ClientStreamClient
- type Test_ClientStreamServer
- type Test_ServerStreamClient
- type Test_ServerStreamServer
- type UnimplementedTestServer
- func (UnimplementedTestServer) ClientServerStream(grpc.BidiStreamingServer[Request, Response]) error
- func (UnimplementedTestServer) ClientStream(grpc.ClientStreamingServer[Request, Response]) error
- func (UnimplementedTestServer) ServerStream(*Request, grpc.ServerStreamingServer[Response]) error
- func (UnimplementedTestServer) Unary(context.Context, *Request) (*Response, error)
- type UnsafeTestServer
Constants ¶
const ( Test_Unary_FullMethodName = "/testpb.Test/Unary" Test_ServerStream_FullMethodName = "/testpb.Test/ServerStream" Test_ClientStream_FullMethodName = "/testpb.Test/ClientStream" Test_ClientServerStream_FullMethodName = "/testpb.Test/ClientServerStream" )
Variables ¶
var File_go_chromium_org_luci_server_internal_testpb_test_proto protoreflect.FileDescriptor
var Test_ServiceDesc = grpc.ServiceDesc{ ServiceName: "testpb.Test", HandlerType: (*TestServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Unary", Handler: _Test_Unary_Handler, }, }, Streams: []grpc.StreamDesc{ { StreamName: "ServerStream", Handler: _Test_ServerStream_Handler, ServerStreams: true, }, { StreamName: "ClientStream", Handler: _Test_ClientStream_Handler, ClientStreams: true, }, { StreamName: "ClientServerStream", Handler: _Test_ClientServerStream_Handler, ServerStreams: true, ClientStreams: true, }, }, Metadata: "go.chromium.org/luci/server/internal/testpb/test.proto", }
Test_ServiceDesc is the grpc.ServiceDesc for Test service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterTestServer ¶
func RegisterTestServer(s grpc.ServiceRegistrar, srv TestServer)
Types ¶
type Request ¶
type Request struct { Text string `protobuf:"bytes,1,opt,name=text,proto3" json:"text,omitempty"` // contains filtered or unexported fields }
func (*Request) Descriptor
deprecated
func (*Request) ProtoMessage ¶
func (*Request) ProtoMessage()
func (*Request) ProtoReflect ¶
func (x *Request) ProtoReflect() protoreflect.Message
type Response ¶
type Response struct { Text string `protobuf:"bytes,1,opt,name=text,proto3" json:"text,omitempty"` // contains filtered or unexported fields }
func (*Response) Descriptor
deprecated
func (*Response) ProtoMessage ¶
func (*Response) ProtoMessage()
func (*Response) ProtoReflect ¶
func (x *Response) ProtoReflect() protoreflect.Message
type TestClient ¶
type TestClient interface { Unary(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error) ServerStream(ctx context.Context, in *Request, opts ...grpc.CallOption) (grpc.ServerStreamingClient[Response], error) ClientStream(ctx context.Context, opts ...grpc.CallOption) (grpc.ClientStreamingClient[Request, Response], error) ClientServerStream(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[Request, Response], error) }
TestClient is the client API for Test service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
func NewTestClient ¶
func NewTestClient(cc grpc.ClientConnInterface) TestClient
type TestServer ¶
type TestServer interface { Unary(context.Context, *Request) (*Response, error) ServerStream(*Request, grpc.ServerStreamingServer[Response]) error ClientStream(grpc.ClientStreamingServer[Request, Response]) error ClientServerStream(grpc.BidiStreamingServer[Request, Response]) error // contains filtered or unexported methods }
TestServer is the server API for Test service. All implementations must embed UnimplementedTestServer for forward compatibility.
type Test_ClientServerStreamClient ¶
type Test_ClientServerStreamClient = grpc.BidiStreamingClient[Request, Response]
This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type Test_ClientServerStreamServer ¶
type Test_ClientServerStreamServer = grpc.BidiStreamingServer[Request, Response]
This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type Test_ClientStreamClient ¶
type Test_ClientStreamClient = grpc.ClientStreamingClient[Request, Response]
This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type Test_ClientStreamServer ¶
type Test_ClientStreamServer = grpc.ClientStreamingServer[Request, Response]
This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type Test_ServerStreamClient ¶
type Test_ServerStreamClient = grpc.ServerStreamingClient[Response]
This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type Test_ServerStreamServer ¶
type Test_ServerStreamServer = grpc.ServerStreamingServer[Response]
This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type UnimplementedTestServer ¶
type UnimplementedTestServer struct{}
UnimplementedTestServer must be embedded to have forward compatible implementations.
NOTE: this should be embedded by value instead of pointer to avoid a nil pointer dereference when methods are called.
func (UnimplementedTestServer) ClientServerStream ¶
func (UnimplementedTestServer) ClientServerStream(grpc.BidiStreamingServer[Request, Response]) error
func (UnimplementedTestServer) ClientStream ¶
func (UnimplementedTestServer) ClientStream(grpc.ClientStreamingServer[Request, Response]) error
func (UnimplementedTestServer) ServerStream ¶
func (UnimplementedTestServer) ServerStream(*Request, grpc.ServerStreamingServer[Response]) error
type UnsafeTestServer ¶
type UnsafeTestServer interface {
// contains filtered or unexported methods
}
UnsafeTestServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to TestServer will result in compilation errors.