Documentation ¶
Overview ¶
Package echo is written to as closely as possible mirror the behaviour of the C++ implementation in grpc/grpc-web: https://github.com/grpc/grpc-web/blob/92aa9f8fc8e7af4aadede52ea075dd5790a63b62/net/grpc/gateway/examples/echo/echo_service_impl.cc
Index ¶
- type Server
- func (s Server) ClientStreamingEcho(srv echo.EchoService_ClientStreamingEchoServer) error
- func (s Server) Echo(ctx context.Context, req *echo.EchoRequest) (*echo.EchoResponse, error)
- func (s Server) EchoAbort(ctx context.Context, req *echo.EchoRequest) (*echo.EchoResponse, error)
- func (s Server) FullDuplexEcho(srv echo.EchoService_FullDuplexEchoServer) error
- func (s Server) HalfDuplexEcho(srv echo.EchoService_HalfDuplexEchoServer) error
- func (s Server) NoOp(ctx context.Context, req *echo.Empty) (*echo.Empty, error)
- func (s Server) ServerStreamingEcho(req *echo.ServerStreamingEchoRequest, ...) error
- func (s Server) ServerStreamingEchoAbort(req *echo.ServerStreamingEchoRequest, ...) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Server ¶
type Server struct{}
func (Server) ClientStreamingEcho ¶
A sequence of requests followed by one response (streamed upload). The server returns the total number of messages as the result.
func (Server) Echo ¶
One request followed by one response The server returns the client message as-is.
func (Server) FullDuplexEcho ¶
A sequence of requests with each message echoed by the server immediately. The server returns the same client messages in order. E.g. this is how the speech API works.
func (Server) HalfDuplexEcho ¶
A sequence of requests followed by a sequence of responses. The server buffers all the client messages and then returns the same client messages one by one after the client half-closes the stream. This is how an image recognition API may work.
func (Server) NoOp ¶
One empty request, ZERO processing, followed by one empty response (minimum effort to do message serialization).
func (Server) ServerStreamingEcho ¶
func (s Server) ServerStreamingEcho(req *echo.ServerStreamingEchoRequest, srv echo.EchoService_ServerStreamingEchoServer) error
One request followed by a sequence of responses (streamed download). The server will return the same client message repeatedly.
func (Server) ServerStreamingEchoAbort ¶
func (s Server) ServerStreamingEchoAbort(req *echo.ServerStreamingEchoRequest, srv echo.EchoService_ServerStreamingEchoAbortServer) error
One request followed by a sequence of responses (streamed download). The server abort directly.