Documentation ¶
Index ¶
- type ExoComMock
- func (e *ExoComMock) AddMockReply(requestName string, data MockReplyData)
- func (e *ExoComMock) Close() error
- func (e *ExoComMock) CloseConnection() error
- func (e *ExoComMock) GetReceivedMessages() []structs.Message
- func (e *ExoComMock) HasConnection() bool
- func (e *ExoComMock) Listen(port int) error
- func (e *ExoComMock) Reset() error
- func (e *ExoComMock) Send(message structs.Message) error
- func (e *ExoComMock) WaitForConnection() (structs.Message, error)
- func (e *ExoComMock) WaitForMessageWithName(name string) (structs.Message, error)
- type MockReplyData
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ExoComMock ¶
type ExoComMock struct {
// contains filtered or unexported fields
}
ExoComMock is a mock implementation of ExoRelay, to be used for testing
func (*ExoComMock) AddMockReply ¶
func (e *ExoComMock) AddMockReply(requestName string, data MockReplyData)
AddMockReply adds a mock reply for the given message
func (*ExoComMock) Close ¶
func (e *ExoComMock) Close() error
Close takes this ExoComMock instance offline
func (*ExoComMock) CloseConnection ¶
func (e *ExoComMock) CloseConnection() error
CloseConnection closes any open connection
func (*ExoComMock) GetReceivedMessages ¶
func (e *ExoComMock) GetReceivedMessages() []structs.Message
GetReceivedMessages returns the received messages
func (*ExoComMock) HasConnection ¶
func (e *ExoComMock) HasConnection() bool
HasConnection returns whether or not a socket is connected
func (*ExoComMock) Listen ¶
func (e *ExoComMock) Listen(port int) error
Listen brings this ExoComMock instance online
func (*ExoComMock) Reset ¶
func (e *ExoComMock) Reset() error
Reset closes and nils the socket and clears all received messages
func (*ExoComMock) Send ¶
func (e *ExoComMock) Send(message structs.Message) error
Send sends the given message to the connected socket
func (*ExoComMock) WaitForConnection ¶
func (e *ExoComMock) WaitForConnection() (structs.Message, error)
WaitForConnection waits for a socket to connect
func (*ExoComMock) WaitForMessageWithName ¶
func (e *ExoComMock) WaitForMessageWithName(name string) (structs.Message, error)
WaitForMessageWithName waits to receive a message with the given name
type MockReplyData ¶
type MockReplyData struct { Name string Payload structs.MessagePayload }
MockReplyData defines the data needed to mock a reply to a specific request