Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func StartMockServer ¶
StartMockServer starts a mock server on the given port
Types ¶
type MockService ¶
type MockService struct {
// contains filtered or unexported fields
}
MockService is a mock of a real service that would connect to exocom
func NewMockService ¶
func NewMockService(exocomPort int, role string) *MockService
NewMockService returns a new MockService
func (*MockService) Close ¶
func (m *MockService) Close() error
Close disconnects the mock service from exocom
func (*MockService) Connect ¶
func (m *MockService) Connect() error
Connect connects the mock service to exocom
func (*MockService) GetReceivedMessages ¶
func (m *MockService) GetReceivedMessages() []structs.Message
GetReceivedMessages gets the messages this mock service has received
func (*MockService) Send ¶
func (m *MockService) Send(message structs.Message) error
Send allows the mock service to send a websocket message to exocom
func (*MockService) WaitForMessageWithName ¶
func (m *MockService) WaitForMessageWithName(name string) (structs.Message, error)
WaitForMessageWithName tells this mock service to wait to receive a message with the given name
Click to show internal directories.
Click to hide internal directories.