Documentation ¶
Index ¶
- type AlarmStreamBroker
- func (asb *AlarmStreamBroker) HandleAlarm(msg json.RawMessage) error
- func (asb *AlarmStreamBroker) HandleAllClear(msg json.RawMessage) error
- func (asb *AlarmStreamBroker) HandleHeartbeat(json.RawMessage) error
- func (asb *AlarmStreamBroker) HandleTestAlarm(msg json.RawMessage) error
- func (asb *AlarmStreamBroker) HandleTestAllClear(msg json.RawMessage) error
- func (asb *AlarmStreamBroker) RegisterClient(key string, id int64, queue *Queue)
- func (asb *AlarmStreamBroker) Run()
- func (asb *AlarmStreamBroker) SessionDied(key string)
- func (asb *AlarmStreamBroker) UnregisterClient(key string, queue *Queue)
- type MessageHandler
- type PointstreamBroker
- func (psb *PointstreamBroker) Handle(msg json.RawMessage) error
- func (psb *PointstreamBroker) HandleHeartbeat(json.RawMessage) error
- func (psb *PointstreamBroker) RegisterClient(key string, geom wkt.Geom, out *Queue)
- func (psb *PointstreamBroker) Run()
- func (psb *PointstreamBroker) SessionDied(key string)
- func (psb *PointstreamBroker) UnregisterClient(key string, out *Queue)
- type Queue
- type Receiver
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AlarmStreamBroker ¶
type AlarmStreamBroker struct {
// contains filtered or unexported fields
}
AlarmStreamBroker registers to a Receiver and broadcasts the transcripted alarm messages to the SSE clients.
func NewAlarmStreamBroker ¶
func NewAlarmStreamBroker() *AlarmStreamBroker
NewAlarmStreamBroker creates a new AlarmStreamBroker.
func (*AlarmStreamBroker) HandleAlarm ¶
func (asb *AlarmStreamBroker) HandleAlarm(msg json.RawMessage) error
HandleAlarm is the entry point for "Alarm" events.
func (*AlarmStreamBroker) HandleAllClear ¶
func (asb *AlarmStreamBroker) HandleAllClear(msg json.RawMessage) error
HandleAllClear is the entry point for "Entwarnung" events.
func (*AlarmStreamBroker) HandleHeartbeat ¶
func (asb *AlarmStreamBroker) HandleHeartbeat(json.RawMessage) error
HandleHeartbeat handles the hearbeat in the alarmstream
func (*AlarmStreamBroker) HandleTestAlarm ¶
func (asb *AlarmStreamBroker) HandleTestAlarm(msg json.RawMessage) error
HandleTestAlarm is the entry point for "Testalarm" events.
func (*AlarmStreamBroker) HandleTestAllClear ¶
func (asb *AlarmStreamBroker) HandleTestAllClear(msg json.RawMessage) error
HandleTestAllClear is the entry point for "Testentwarnung" events.
func (*AlarmStreamBroker) RegisterClient ¶
func (asb *AlarmStreamBroker) RegisterClient(key string, id int64, queue *Queue)
RegisterClient is called to register a SSE client.
func (*AlarmStreamBroker) Run ¶
func (asb *AlarmStreamBroker) Run()
Run starts the dispatching and does not return.
func (*AlarmStreamBroker) SessionDied ¶
func (asb *AlarmStreamBroker) SessionDied(key string)
SessionDied is a called when a session died.
func (*AlarmStreamBroker) UnregisterClient ¶
func (asb *AlarmStreamBroker) UnregisterClient(key string, queue *Queue)
UnregisterClient is called to remove a SSE client previously registered.
type MessageHandler ¶
type MessageHandler func(json.RawMessage) error
MessageHandler is the function type to receive the dispatched raw message.
type PointstreamBroker ¶
type PointstreamBroker struct {
// contains filtered or unexported fields
}
PointstreamBroker registers to a Receiver and broadcasts the transcripted lighting messages to the SSE clients.
func NewPointStreamBroker ¶
func NewPointStreamBroker() *PointstreamBroker
NewPointStreamBroker creates a new PointstreamBroker.
func (*PointstreamBroker) Handle ¶
func (psb *PointstreamBroker) Handle(msg json.RawMessage) error
Handle is the message entry point from the Listen/Notify receiver.
func (*PointstreamBroker) HandleHeartbeat ¶
func (psb *PointstreamBroker) HandleHeartbeat(json.RawMessage) error
HandleHeartbeat handle the heartbeat from the Listen/Notify receiver.
func (*PointstreamBroker) RegisterClient ¶
func (psb *PointstreamBroker) RegisterClient( key string, geom wkt.Geom, out *Queue)
RegisterClient is to be called to register new SSE clients.
func (*PointstreamBroker) Run ¶
func (psb *PointstreamBroker) Run()
Run starts the dispatching and does not return.
func (*PointstreamBroker) SessionDied ¶
func (psb *PointstreamBroker) SessionDied(key string)
SessionDied is called if a session dies to disconnect the respective clients.
func (*PointstreamBroker) UnregisterClient ¶
func (psb *PointstreamBroker) UnregisterClient(key string, out *Queue)
UnregisterClient is called to remove a SSE client from the broker.
type Queue ¶
type Queue struct {
// contains filtered or unexported fields
}
Queue is a queue to exchange byte slices between go routines without limited size of channels.
type Receiver ¶
type Receiver struct {
// contains filtered or unexported fields
}
Receiver encapsulates the de-multiplexing of messages from a PostgreSQL Listen/Notify to a number of registered handlers.
func NewReceiver ¶
NewReceiver creates a new reciever with a given domain source name.
func (*Receiver) AddHandler ¶
func (rcv *Receiver) AddHandler(msgType string, handler MessageHandler)
AddHandler registers a handler for a message type.