echo

package
v0.0.0-...-e957825 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2024 License: Apache-2.0 Imports: 8 Imported by: 514

Documentation

Index

Constants

View Source
const (
	Echo_UnaryEcho_FullMethodName                  = "/grpc.examples.echo.Echo/UnaryEcho"
	Echo_ServerStreamingEcho_FullMethodName        = "/grpc.examples.echo.Echo/ServerStreamingEcho"
	Echo_ClientStreamingEcho_FullMethodName        = "/grpc.examples.echo.Echo/ClientStreamingEcho"
	Echo_BidirectionalStreamingEcho_FullMethodName = "/grpc.examples.echo.Echo/BidirectionalStreamingEcho"
)

Variables

View Source
var Echo_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "grpc.examples.echo.Echo",
	HandlerType: (*EchoServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "UnaryEcho",
			Handler:    _Echo_UnaryEcho_Handler,
		},
	},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "ServerStreamingEcho",
			Handler:       _Echo_ServerStreamingEcho_Handler,
			ServerStreams: true,
		},
		{
			StreamName:    "ClientStreamingEcho",
			Handler:       _Echo_ClientStreamingEcho_Handler,
			ClientStreams: true,
		},
		{
			StreamName:    "BidirectionalStreamingEcho",
			Handler:       _Echo_BidirectionalStreamingEcho_Handler,
			ServerStreams: true,
			ClientStreams: true,
		},
	},
	Metadata: "examples/features/proto/echo/echo.proto",
}

Echo_ServiceDesc is the grpc.ServiceDesc for Echo service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

View Source
var File_examples_features_proto_echo_echo_proto protoreflect.FileDescriptor

Functions

func RegisterEchoServer

func RegisterEchoServer(s grpc.ServiceRegistrar, srv EchoServer)

Types

type EchoClient

type EchoClient interface {
	// UnaryEcho is unary echo.
	UnaryEcho(ctx context.Context, in *EchoRequest, opts ...grpc.CallOption) (*EchoResponse, error)
	// ServerStreamingEcho is server side streaming.
	ServerStreamingEcho(ctx context.Context, in *EchoRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[EchoResponse], error)
	// ClientStreamingEcho is client side streaming.
	ClientStreamingEcho(ctx context.Context, opts ...grpc.CallOption) (grpc.ClientStreamingClient[EchoRequest, EchoResponse], error)
	// BidirectionalStreamingEcho is bidi streaming.
	BidirectionalStreamingEcho(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[EchoRequest, EchoResponse], error)
}

EchoClient is the client API for Echo 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.

Echo is the echo service.

func NewEchoClient

func NewEchoClient(cc grpc.ClientConnInterface) EchoClient

type EchoRequest

type EchoRequest struct {
	Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"`
	// contains filtered or unexported fields
}

EchoRequest is the request for echo.

func (*EchoRequest) Descriptor deprecated

func (*EchoRequest) Descriptor() ([]byte, []int)

Deprecated: Use EchoRequest.ProtoReflect.Descriptor instead.

func (*EchoRequest) GetMessage

func (x *EchoRequest) GetMessage() string

func (*EchoRequest) ProtoMessage

func (*EchoRequest) ProtoMessage()

func (*EchoRequest) ProtoReflect

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

func (*EchoRequest) Reset

func (x *EchoRequest) Reset()

func (*EchoRequest) String

func (x *EchoRequest) String() string

type EchoResponse

type EchoResponse struct {
	Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"`
	// contains filtered or unexported fields
}

EchoResponse is the response for echo.

func (*EchoResponse) Descriptor deprecated

func (*EchoResponse) Descriptor() ([]byte, []int)

Deprecated: Use EchoResponse.ProtoReflect.Descriptor instead.

func (*EchoResponse) GetMessage

func (x *EchoResponse) GetMessage() string

func (*EchoResponse) ProtoMessage

func (*EchoResponse) ProtoMessage()

func (*EchoResponse) ProtoReflect

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

func (*EchoResponse) Reset

func (x *EchoResponse) Reset()

func (*EchoResponse) String

func (x *EchoResponse) String() string

type EchoServer

type EchoServer interface {
	// UnaryEcho is unary echo.
	UnaryEcho(context.Context, *EchoRequest) (*EchoResponse, error)
	// ServerStreamingEcho is server side streaming.
	ServerStreamingEcho(*EchoRequest, grpc.ServerStreamingServer[EchoResponse]) error
	// ClientStreamingEcho is client side streaming.
	ClientStreamingEcho(grpc.ClientStreamingServer[EchoRequest, EchoResponse]) error
	// BidirectionalStreamingEcho is bidi streaming.
	BidirectionalStreamingEcho(grpc.BidiStreamingServer[EchoRequest, EchoResponse]) error
	// contains filtered or unexported methods
}

EchoServer is the server API for Echo service. All implementations must embed UnimplementedEchoServer for forward compatibility.

Echo is the echo service.

type Echo_BidirectionalStreamingEchoClient

type Echo_BidirectionalStreamingEchoClient = grpc.BidiStreamingClient[EchoRequest, EchoResponse]

This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.

type Echo_BidirectionalStreamingEchoServer

type Echo_BidirectionalStreamingEchoServer = grpc.BidiStreamingServer[EchoRequest, EchoResponse]

This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.

type Echo_ClientStreamingEchoClient

type Echo_ClientStreamingEchoClient = grpc.ClientStreamingClient[EchoRequest, EchoResponse]

This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.

type Echo_ClientStreamingEchoServer

type Echo_ClientStreamingEchoServer = grpc.ClientStreamingServer[EchoRequest, EchoResponse]

This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.

type Echo_ServerStreamingEchoClient

type Echo_ServerStreamingEchoClient = grpc.ServerStreamingClient[EchoResponse]

This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.

type Echo_ServerStreamingEchoServer

type Echo_ServerStreamingEchoServer = grpc.ServerStreamingServer[EchoResponse]

This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.

type UnimplementedEchoServer

type UnimplementedEchoServer struct{}

UnimplementedEchoServer 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 (UnimplementedEchoServer) BidirectionalStreamingEcho

func (UnimplementedEchoServer) ClientStreamingEcho

func (UnimplementedEchoServer) ServerStreamingEcho

func (UnimplementedEchoServer) UnaryEcho

type UnsafeEchoServer

type UnsafeEchoServer interface {
	// contains filtered or unexported methods
}

UnsafeEchoServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to EchoServer will result in compilation errors.

Jump to

Keyboard shortcuts

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