Documentation ¶
Overview ¶
Package server implement an echo server used for testing.
Index ¶
- type RPCEntityInfo
- 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) SetExpectedAuthEntity(entity string)
- func (srv *Server) SetExpectedAuthEntityData(data interface{})
- func (srv *Server) SetFail(fail bool)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RPCEntityInfo ¶ added in v0.1.17
type RPCEntityInfo struct { Entity string Data interface{} }
RPCEntityInfo prevents a package cycle. DO NOT set this to anything other than the real thing.
type Server ¶
type Server struct { echopb.UnimplementedEchoServiceServer // prevents a package cycle. DO NOT set this to anything other // than the real thing. MustContextAuthEntity func(ctx context.Context) RPCEntityInfo // 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.
func (*Server) SetExpectedAuthEntity ¶ added in v0.1.5
SetExpectedAuthEntity sets the expected auth entity
func (*Server) SetExpectedAuthEntityData ¶ added in v0.1.17
func (srv *Server) SetExpectedAuthEntityData(data interface{})
SetExpectedAuthEntityData sets the expected auth entity data
Click to show internal directories.
Click to hide internal directories.