Documentation ¶
Index ¶
- Variables
- type Dummy
- func (d *Dummy) CleanupGateway(gatewayID string)
- func (d *Dummy) Connect() error
- func (d *Dummy) Disconnect() error
- func (d *Dummy) PublishConnect(message *types.ConnectMessage) error
- func (d *Dummy) PublishDisconnect(message *types.DisconnectMessage) error
- func (d *Dummy) PublishDownlink(message *types.DownlinkMessage) error
- func (d *Dummy) PublishStatus(message *types.StatusMessage) error
- func (d *Dummy) PublishUplink(message *types.UplinkMessage) error
- func (d *Dummy) SubscribeConnect() (<-chan *types.ConnectMessage, error)
- func (d *Dummy) SubscribeDisconnect() (<-chan *types.DisconnectMessage, error)
- func (d *Dummy) SubscribeDownlink(gatewayID string) (<-chan *types.DownlinkMessage, error)
- func (d *Dummy) SubscribeStatus(gatewayID string) (<-chan *types.StatusMessage, error)
- func (d *Dummy) SubscribeUplink(gatewayID string) (<-chan *types.UplinkMessage, error)
- func (d *Dummy) UnsubscribeConnect() error
- func (d *Dummy) UnsubscribeDisconnect() error
- func (d *Dummy) UnsubscribeDownlink(gatewayID string) error
- func (d *Dummy) UnsubscribeStatus(gatewayID string) error
- func (d *Dummy) UnsubscribeUplink(gatewayID string) error
- func (d *Dummy) WithHTTPServer(addr string) *WithServer
- type Server
- func (s *Server) Connect(gatewayID string)
- func (s *Server) ConnectedGateways() []string
- func (s *Server) Disconnect(gatewayID string)
- func (s *Server) Downlink(msg *types.DownlinkMessage)
- func (s *Server) Listen()
- func (s *Server) Status(msg *types.StatusMessage)
- func (s *Server) Uplink(msg *types.UplinkMessage)
- type WithServer
- func (d *WithServer) PublishDownlink(message *types.DownlinkMessage) error
- func (d *WithServer) PublishStatus(message *types.StatusMessage) error
- func (d *WithServer) PublishUplink(message *types.UplinkMessage) error
- func (d *WithServer) SubscribeUplink(gatewayID string) (<-chan *types.UplinkMessage, error)
- func (d *WithServer) UnsubscribeUplink(gatewayID string) error
Constants ¶
This section is empty.
Variables ¶
var BufferSize = 10
BufferSize indicates the maximum number of dummy messages that should be buffered
Functions ¶
This section is empty.
Types ¶
type Dummy ¶
type Dummy struct {
// contains filtered or unexported fields
}
Dummy backend
func (*Dummy) CleanupGateway ¶
CleanupGateway implements backend interfaces
func (*Dummy) Disconnect ¶
Disconnect implements backend interfaces
func (*Dummy) PublishConnect ¶
func (d *Dummy) PublishConnect(message *types.ConnectMessage) error
PublishConnect publishes connect messages to the dummy backend
func (*Dummy) PublishDisconnect ¶
func (d *Dummy) PublishDisconnect(message *types.DisconnectMessage) error
PublishDisconnect publishes disconnect messages to the dummy backend
func (*Dummy) PublishDownlink ¶
func (d *Dummy) PublishDownlink(message *types.DownlinkMessage) error
PublishDownlink implements backend interfaces
func (*Dummy) PublishStatus ¶
func (d *Dummy) PublishStatus(message *types.StatusMessage) error
PublishStatus implements backend interfaces
func (*Dummy) PublishUplink ¶
func (d *Dummy) PublishUplink(message *types.UplinkMessage) error
PublishUplink implements backend interfaces
func (*Dummy) SubscribeConnect ¶
func (d *Dummy) SubscribeConnect() (<-chan *types.ConnectMessage, error)
SubscribeConnect implements backend interfaces
func (*Dummy) SubscribeDisconnect ¶
func (d *Dummy) SubscribeDisconnect() (<-chan *types.DisconnectMessage, error)
SubscribeDisconnect implements backend interfaces
func (*Dummy) SubscribeDownlink ¶
func (d *Dummy) SubscribeDownlink(gatewayID string) (<-chan *types.DownlinkMessage, error)
SubscribeDownlink implements backend interfaces
func (*Dummy) SubscribeStatus ¶
func (d *Dummy) SubscribeStatus(gatewayID string) (<-chan *types.StatusMessage, error)
SubscribeStatus implements backend interfaces
func (*Dummy) SubscribeUplink ¶
func (d *Dummy) SubscribeUplink(gatewayID string) (<-chan *types.UplinkMessage, error)
SubscribeUplink implements backend interfaces
func (*Dummy) UnsubscribeConnect ¶
UnsubscribeConnect implements backend interfaces
func (*Dummy) UnsubscribeDisconnect ¶
UnsubscribeDisconnect implements backend interfaces
func (*Dummy) UnsubscribeDownlink ¶
UnsubscribeDownlink implements backend interfaces
func (*Dummy) UnsubscribeStatus ¶
UnsubscribeStatus implements backend interfaces
func (*Dummy) UnsubscribeUplink ¶
UnsubscribeUplink implements backend interfaces
func (*Dummy) WithHTTPServer ¶
func (d *Dummy) WithHTTPServer(addr string) *WithServer
WithHTTPServer returns the Dummy that also has a HTTP server exposing the events on addr
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server is a http server that exposes some events over websockets
func (*Server) ConnectedGateways ¶
ConnectedGateways returns the list of connected gateway IDs
func (*Server) Disconnect ¶
Disconnect emits a message when a gateway disconnects
func (*Server) Downlink ¶
func (s *Server) Downlink(msg *types.DownlinkMessage)
Downlink emits a downlink message on the server page
func (*Server) Listen ¶
func (s *Server) Listen()
Listen opens the server and starts listening for http requests
func (*Server) Status ¶
func (s *Server) Status(msg *types.StatusMessage)
Status emits a status message on the server page
func (*Server) Uplink ¶
func (s *Server) Uplink(msg *types.UplinkMessage)
Uplink emits an uplink message on the server page
type WithServer ¶
type WithServer struct { *Dummy // contains filtered or unexported fields }
WithServer is a Dummy backend that exposes some events on a http page with websockets
func (*WithServer) PublishDownlink ¶
func (d *WithServer) PublishDownlink(message *types.DownlinkMessage) error
PublishDownlink implements backend interfaces
func (*WithServer) PublishStatus ¶
func (d *WithServer) PublishStatus(message *types.StatusMessage) error
PublishStatus implements backend interfaces
func (*WithServer) PublishUplink ¶
func (d *WithServer) PublishUplink(message *types.UplinkMessage) error
PublishUplink implements backend interfaces
func (*WithServer) SubscribeUplink ¶
func (d *WithServer) SubscribeUplink(gatewayID string) (<-chan *types.UplinkMessage, error)
SubscribeUplink implements backend interfaces
func (*WithServer) UnsubscribeUplink ¶
func (d *WithServer) UnsubscribeUplink(gatewayID string) error
UnsubscribeUplink implements backend interfaces