echo

package
v0.0.0-...-d1b0826 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2020 License: MIT Imports: 7 Imported by: 0

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

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

type Server struct{}

func (Server) ClientStreamingEcho

func (s Server) ClientStreamingEcho(srv echo.EchoService_ClientStreamingEchoServer) error

A sequence of requests followed by one response (streamed upload). The server returns the total number of messages as the result.

func (Server) Echo

func (s Server) Echo(ctx context.Context, req *echo.EchoRequest) (*echo.EchoResponse, error)

One request followed by one response The server returns the client message as-is.

func (Server) EchoAbort

func (s Server) EchoAbort(ctx context.Context, req *echo.EchoRequest) (*echo.EchoResponse, error)

Sends back abort status.

func (Server) FullDuplexEcho

func (s Server) FullDuplexEcho(srv echo.EchoService_FullDuplexEchoServer) error

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

func (s Server) HalfDuplexEcho(srv echo.EchoService_HalfDuplexEchoServer) error

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

func (s Server) NoOp(ctx context.Context, req *echo.Empty) (*echo.Empty, error)

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.

Jump to

Keyboard shortcuts

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