Documentation ¶
Overview ¶
Package server implement an echo server.
Index ¶
- type Server
- func (srv *Server) Echo(ctx context.Context, req *echopb.EchoRequest) (*echopb.EchoResponse, error)
- func (srv *Server) EchoBiDi(server echopb.EchoService_EchoBiDiServer) error
- func (srv *Server) EchoMultiple(req *echopb.EchoMultipleRequest, server echopb.EchoService_EchoMultipleServer) error
- func (srv *Server) SetAuthorized(authorized bool)
- func (srv *Server) SetFail(fail bool)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Server ¶
type Server struct { echopb.UnimplementedEchoServiceServer // prevents a package cycle. DO NOT set this to anything other // than the real thing. ContextAuthEntity func(ctx context.Context) interface{} // contains filtered or unexported fields }
Server implements a simple echo service.
func (*Server) Echo ¶
func (srv *Server) Echo(ctx context.Context, req *echopb.EchoRequest) (*echopb.EchoResponse, error)
Echo responds back with the same message.
func (*Server) EchoBiDi ¶
func (srv *Server) EchoBiDi(server echopb.EchoService_EchoBiDiServer) error
EchoBiDi responds back with the same message one character at a time for each message sent to it.
func (*Server) EchoMultiple ¶
func (srv *Server) EchoMultiple(req *echopb.EchoMultipleRequest, server echopb.EchoService_EchoMultipleServer) error
EchoMultiple responds back with the same message one character at a time.
func (*Server) SetAuthorized ¶ added in v0.0.3
SetAuthorized instructs the server to check authorization at certain points.
Click to show internal directories.
Click to hide internal directories.