Documentation ¶
Index ¶
- type Server
- func (m *Server) AssertReceived(ctx context.Context, frameTypes ...api.BaseCommand_Type) error
- func (m *Server) Broadcast(f frame.Frame) error
- func (m *Server) CloseAll() error
- func (m *Server) SetIgnoreConnects(ignore bool)
- func (m *Server) SetIgnorePings(ignore bool)
- func (m *Server) SetTopicLookupResp(topic, serviceURL string, respType api.CommandLookupTopicResponse_LookupType, ...)
- func (m *Server) TotalNumConns() int
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Server ¶
type Server struct { Addr string Received <-chan frame.Frame // contains filtered or unexported fields }
Server emulates a Pulsar server
func NewServer ¶
NewServer returns a ready-to-use Pulsar test server. The server will be closed when the context is canceled.
func (*Server) AssertReceived ¶
AssertReceived accepts a list of message types. It then compares them to the frames it has received, and returns an error if they don't match or if the context times out. Note: The m.Received channel is buffered, so AssertReceived can be called from the main goroutine.
func (*Server) SetIgnoreConnects ¶
SetIgnoreConnects instructs the server to NOT respond to CONNECT requests if true.
func (*Server) SetIgnorePings ¶
SetIgnorePings instructs the server to NOT respond to PING requests if true.
func (*Server) SetTopicLookupResp ¶
func (m *Server) SetTopicLookupResp(topic, serviceURL string, respType api.CommandLookupTopicResponse_LookupType, proxyThroughServiceURL bool)
SetTopicLookupResp updates the BrokerServiceURL returned for the given topic from LOOKUP requests. If not set, the server's Addr is used by default. If connect if false, the response type is REDIRECT.
func (*Server) TotalNumConns ¶
TotalNumConns returns the total number of connections (active or inactive) received by the Server.