Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var WebsocketScheme = "ws"
WebsocketScheme represents a non-secure websocket scheme (ws://) to prepend to an URL.
var WebsocketSecureScheme = "wss"
WebsocketSecureScheme represents a secure websocket scheme (wss://) to prepend to an URL.
Functions ¶
This section is empty.
Types ¶
type Message ¶
type Message interface { // GetPayload returns the message payload. GetPayload(out interface{}) error }
Message represents a set of methods that message structs must implement to be used in a transport.
type Transporter ¶
Transporter represents a set of methods that will open and close communication between two processes.
type WebsocketConnector ¶
WebsocketConnector is a group of methods that handle websocket connections.
type WebsocketTransportMock ¶
type WebsocketTransportMock struct { WebsocketTransporter *mock.Mock }
WebsocketTransportMock represents a Transporter mock implementation.
func NewWebsocketTransporterMock ¶
func NewWebsocketTransporterMock() *WebsocketTransportMock
NewWebsocketTransporterMock initializes a new WebsocketTransportMock object.
func (*WebsocketTransportMock) Connect ¶
func (m *WebsocketTransportMock) Connect() error
Connect is a mock for the Connect method.
func (*WebsocketTransportMock) Connection ¶
func (m *WebsocketTransportMock) Connection() *websocket.Conn
Connection is a mock for the Connection method.
func (*WebsocketTransportMock) Disconnect ¶
func (m *WebsocketTransportMock) Disconnect() error
Disconnect is a mock for the Disconnect method.
func (*WebsocketTransportMock) IsConnected ¶
func (m *WebsocketTransportMock) IsConnected() bool
IsConnected is a mock for the IsConnected method.
type WebsocketTransporter ¶
type WebsocketTransporter interface { Transporter WebsocketConnector }
WebsocketTransporter extends the Transporter default behavior for websockets.
func NewWebsocketTransporter ¶
func NewWebsocketTransporter(host, path, scheme string) (WebsocketTransporter, error)
NewWebsocketTransporter initializes a new WebsocketTransporter instance using a websocket implementation. It will also establish a connection to the given addr. It will return an error if the connection to the given address failed.