Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var (
ErrInvalidMessage = errors.New("Message type not binary")
)
Functions ¶
func MockCloser ¶
func MockCloser(id string)
MockCloser is a function signature which can be used in testing.
Types ¶
type HTTPStats ¶
type HTTPStats struct {
// contains filtered or unexported fields
}
HTTPStats is a listener for presenting the server $SYS stats on a JSON http endpoint.
func NewHTTPStats ¶
NewHTTPStats initialises and returns a new HTTP listener, listening on an address.
func NewHTTPStatsWithTLS ¶
NewHTTPStatsWithTLS initialises and returns a new HTTP listener, listening on an address.
type MockListener ¶
type MockListener struct { sync.RWMutex Listening bool // indiciate the listener is listening. Serving bool // indicate the listener is serving. ErrListen bool // throw an error on listen. // contains filtered or unexported fields }
MockListener is a mock listener for establishing client connections.
func NewMockListener ¶
func NewMockListener(id, address string) *MockListener
NewMockListener returns a new instance of MockListener
func (*MockListener) Close ¶
func (l *MockListener) Close(closer mqtt.CloseFunc)
Close closes the mock listener.
func (*MockListener) ID ¶
func (l *MockListener) ID() string
ID returns the id of the mock listener.
func (*MockListener) IsListening ¶
func (l *MockListener) IsListening() bool
IsServing indicates whether the mock listener is listening.
func (*MockListener) IsServing ¶
func (l *MockListener) IsServing() bool
IsServing indicates whether the mock listener is serving.
func (*MockListener) Listen ¶
func (l *MockListener) Listen(s *system.Info) error
SetConfig sets the configuration values of the mock listener.
func (*MockListener) Serve ¶
func (l *MockListener) Serve(establisher mqtt.EstablishFunc) error
Serve serves the mock listener.
type TCP ¶
type TCP struct {
// contains filtered or unexported fields
}
func NewTCPWithTLS ¶
NewTCP initialises and returns a new TCP listener, listening on an address.
type Websocket ¶
type Websocket struct {
// contains filtered or unexported fields
}
Websocket is a listener for establishing websocket connections.
func NewWebsocket ¶
NewWebsocket initialises and returns a new Websocket listener, listening on an address.
func NewWebsocketWithTLS ¶
NewWebsocket initialises and returns a new Websocket listener, listening on an address.