testHelpers

package
v0.27.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 9, 2017 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func StartMockServer

func StartMockServer(port int) *http.Server

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL