testpb

package
v0.0.0-...-9eda336 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 22, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package testpb contains protobufs used by server's unit tests.

Index

Constants

View Source
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

View Source
var File_go_chromium_org_luci_server_internal_testpb_test_proto protoreflect.FileDescriptor
View Source
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) Descriptor() ([]byte, []int)

Deprecated: Use Request.ProtoReflect.Descriptor instead.

func (*Request) GetText

func (x *Request) GetText() string

func (*Request) ProtoMessage

func (*Request) ProtoMessage()

func (*Request) ProtoReflect

func (x *Request) ProtoReflect() protoreflect.Message

func (*Request) Reset

func (x *Request) Reset()

func (*Request) String

func (x *Request) String() string

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) Descriptor() ([]byte, []int)

Deprecated: Use Response.ProtoReflect.Descriptor instead.

func (*Response) GetText

func (x *Response) GetText() string

func (*Response) ProtoMessage

func (*Response) ProtoMessage()

func (*Response) ProtoReflect

func (x *Response) ProtoReflect() protoreflect.Message

func (*Response) Reset

func (x *Response) Reset()

func (*Response) String

func (x *Response) String() string

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) ClientStream

func (UnimplementedTestServer) ServerStream

func (UnimplementedTestServer) Unary

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL