Documentation
¶
Index ¶
- Constants
- Variables
- func RegisterEchoServer(s grpc.ServiceRegistrar, srv EchoServer)
- type EchoClient
- type EchoRequest
- type EchoResponse
- func (*EchoResponse) Descriptor() ([]byte, []int)deprecated
- func (x *EchoResponse) GetIndex() int32
- func (x *EchoResponse) GetMessage() string
- func (*EchoResponse) ProtoMessage()
- func (x *EchoResponse) ProtoReflect() protoreflect.Message
- func (x *EchoResponse) Reset()
- func (x *EchoResponse) String() string
- type EchoServer
- type EchoStreamRequest
- func (*EchoStreamRequest) Descriptor() ([]byte, []int)deprecated
- func (x *EchoStreamRequest) GetCount() int32
- func (x *EchoStreamRequest) GetMessage() string
- func (*EchoStreamRequest) ProtoMessage()
- func (x *EchoStreamRequest) ProtoReflect() protoreflect.Message
- func (x *EchoStreamRequest) Reset()
- func (x *EchoStreamRequest) String() string
- type Echo_EchoBidiClient
- type Echo_EchoBidiServer
- type Echo_EchoStreamClient
- type Echo_EchoStreamServer
- type UnimplementedEchoServer
- type UnsafeEchoServer
Constants ¶
const ( Echo_Echo_FullMethodName = "/grpcecho.Echo/Echo" Echo_EchoStream_FullMethodName = "/grpcecho.Echo/EchoStream" Echo_EchoBidi_FullMethodName = "/grpcecho.Echo/EchoBidi" )
Variables ¶
var Echo_ServiceDesc = grpc.ServiceDesc{ ServiceName: "grpcecho.Echo", HandlerType: (*EchoServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Echo", Handler: _Echo_Echo_Handler, }, }, Streams: []grpc.StreamDesc{ { StreamName: "EchoStream", Handler: _Echo_EchoStream_Handler, ServerStreams: true, }, { StreamName: "EchoBidi", Handler: _Echo_EchoBidi_Handler, ServerStreams: true, ClientStreams: true, }, }, Metadata: "grpcecho.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)
var File_grpcecho_proto protoreflect.FileDescriptor
Functions ¶
func RegisterEchoServer ¶
func RegisterEchoServer(s grpc.ServiceRegistrar, srv EchoServer)
Types ¶
type EchoClient ¶
type EchoClient interface {
// Echo returns the message it was sent.
Echo(ctx context.Context, in *EchoRequest, opts ...grpc.CallOption) (*EchoResponse, error)
// EchoStream returns the message it was sent count times, one response per
// message, each numbered with its position in the stream.
EchoStream(ctx context.Context, in *EchoStreamRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[EchoResponse], error)
// EchoBidi answers every request with one response, as each request arrives,
// numbered with its position in the stream. The caller decides how many to
// send and half-closes when it is done.
//
// Unlike EchoStream, the server must not wait for the client to finish: a
// caller that sends its next request only after reading the previous response
// deadlocks against an implementation -- or a relay -- that reads the request
// direction to exhaustion before writing anything back.
EchoBidi(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 smallest service that can prove a gRPC request and its response crossed a network path intact. It exists for the egress e2e coverage: the origin is internal/e2e/fixtures/testserver (its grpc subcommand) and the client is the egress demo actor, which reaches it through the egress gateway's CONNECT tunnel.
One method per streaming shape, because they fail differently. A unary response carries its status in trailers sent immediately after the message; a server-stream holds the connection open across many frames; a bidirectional stream has both directions carrying frames at once and then half-closes one of them. A path that buffers, downgrades to HTTP/1.1, serializes the two directions, or reaps an idle tunnel breaks one of these without touching the others.
func NewEchoClient ¶
func NewEchoClient(cc grpc.ClientConnInterface) EchoClient
type EchoRequest ¶
type EchoRequest struct {
// The message to be echoed back.
Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"`
// contains filtered or unexported fields
}
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 {
// The message echoed back.
Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"`
// The response's zero-based position in the stream, so a caller can tell a
// reordered or deduplicated stream from an intact one. Always 0 for Echo.
Index int32 `protobuf:"varint,2,opt,name=index,proto3" json:"index,omitempty"`
// contains filtered or unexported fields
}
func (*EchoResponse) Descriptor
deprecated
func (*EchoResponse) Descriptor() ([]byte, []int)
Deprecated: Use EchoResponse.ProtoReflect.Descriptor instead.
func (*EchoResponse) GetIndex ¶
func (x *EchoResponse) GetIndex() int32
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 {
// Echo returns the message it was sent.
Echo(context.Context, *EchoRequest) (*EchoResponse, error)
// EchoStream returns the message it was sent count times, one response per
// message, each numbered with its position in the stream.
EchoStream(*EchoStreamRequest, grpc.ServerStreamingServer[EchoResponse]) error
// EchoBidi answers every request with one response, as each request arrives,
// numbered with its position in the stream. The caller decides how many to
// send and half-closes when it is done.
//
// Unlike EchoStream, the server must not wait for the client to finish: a
// caller that sends its next request only after reading the previous response
// deadlocks against an implementation -- or a relay -- that reads the request
// direction to exhaustion before writing anything back.
EchoBidi(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 smallest service that can prove a gRPC request and its response crossed a network path intact. It exists for the egress e2e coverage: the origin is internal/e2e/fixtures/testserver (its grpc subcommand) and the client is the egress demo actor, which reaches it through the egress gateway's CONNECT tunnel.
One method per streaming shape, because they fail differently. A unary response carries its status in trailers sent immediately after the message; a server-stream holds the connection open across many frames; a bidirectional stream has both directions carrying frames at once and then half-closes one of them. A path that buffers, downgrades to HTTP/1.1, serializes the two directions, or reaps an idle tunnel breaks one of these without touching the others.
type EchoStreamRequest ¶
type EchoStreamRequest struct {
// The message to be echoed back in every response.
Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"`
// How many responses to send. Must be positive.
Count int32 `protobuf:"varint,2,opt,name=count,proto3" json:"count,omitempty"`
// contains filtered or unexported fields
}
func (*EchoStreamRequest) Descriptor
deprecated
func (*EchoStreamRequest) Descriptor() ([]byte, []int)
Deprecated: Use EchoStreamRequest.ProtoReflect.Descriptor instead.
func (*EchoStreamRequest) GetCount ¶
func (x *EchoStreamRequest) GetCount() int32
func (*EchoStreamRequest) GetMessage ¶
func (x *EchoStreamRequest) GetMessage() string
func (*EchoStreamRequest) ProtoMessage ¶
func (*EchoStreamRequest) ProtoMessage()
func (*EchoStreamRequest) ProtoReflect ¶
func (x *EchoStreamRequest) ProtoReflect() protoreflect.Message
func (*EchoStreamRequest) Reset ¶
func (x *EchoStreamRequest) Reset()
func (*EchoStreamRequest) String ¶
func (x *EchoStreamRequest) String() string
type Echo_EchoBidiClient ¶
type Echo_EchoBidiClient = 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_EchoBidiServer ¶
type Echo_EchoBidiServer = 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_EchoStreamClient ¶
type Echo_EchoStreamClient = 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_EchoStreamServer ¶
type Echo_EchoStreamServer = 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) Echo ¶
func (UnimplementedEchoServer) Echo(context.Context, *EchoRequest) (*EchoResponse, error)
func (UnimplementedEchoServer) EchoBidi ¶
func (UnimplementedEchoServer) EchoBidi(grpc.BidiStreamingServer[EchoRequest, EchoResponse]) error
func (UnimplementedEchoServer) EchoStream ¶
func (UnimplementedEchoServer) EchoStream(*EchoStreamRequest, grpc.ServerStreamingServer[EchoResponse]) error
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.