communicator

package
Version: v0.0.0-...-d92090f Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2020 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Communicator

type Communicator struct {
	Logger *log.Logger
}

func New

func New(fileName string) *Communicator

func (*Communicator) Close

func (c *Communicator) Close() error

Close is a no op.

func (*Communicator) ReadMessage

func (c *Communicator) ReadMessage() (messageType int, p []byte, err error)

ReadMessage acts as the function that would receive data from the front end.

func (*Communicator) WriteMessage

func (c *Communicator) WriteMessage(messageType int, data []byte) error

WriteMessage acts as the function that would send data to the front end.

type MockCommunicator

type MockCommunicator struct {
	mock.Mock
}

func NewMock

func NewMock() *MockCommunicator

func (*MockCommunicator) Close

func (mc *MockCommunicator) Close() error

func (*MockCommunicator) ReadMessage

func (mc *MockCommunicator) ReadMessage() (int, []byte, error)

func (*MockCommunicator) WriteMessage

func (mc *MockCommunicator) WriteMessage(messageType int, data []byte) error

Jump to

Keyboard shortcuts

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