Documentation ¶
Index ¶
- Constants
- func AirportHook(old, new airports.Airport)
- func PIREPHook(pirep *pireps.PIREP)
- type IDSHub
- func (h *IDSHub) ConfigureHooks(airportService *airports.AirportService, pirepService *pireps.PIREPService)
- func (h *IDSHub) OnConnected(connectionID string)
- func (h *IDSHub) OnDisconnected(connectionID string)
- func (h *IDSHub) SendAirportUpdate(connectionID string, old, new airports.Airport)
- func (h *IDSHub) SendPirep(connectionID string, pirep *pireps.PIREP)
- func (h *IDSHub) SendServerMessage(connectionID string, message string)
- func (h *IDSHub) SubmitPIREP(pirep json.RawMessage)
- func (h *IDSHub) UpdateAirport(id string, patch json.RawMessage) json.RawMessage
- type Logger
- type SignalRHandler
Constants ¶
View Source
const ( RECEIVE_SERVER_MESSAGE = "ReceiveServerMessage" RECEIVE_AIRPORT_UPDATE = "ReceiveAirportUpdate" RECEIVE_PIREP = "ReceivePirep" )
Variables ¶
This section is empty.
Functions ¶
func AirportHook ¶
Types ¶
type IDSHub ¶
func New ¶
func New(ctx context.Context, r chi.Router, as *airports.AirportService, cs *charts.ChartService, ps *pireps.PIREPService) (*IDSHub, error)
func (*IDSHub) ConfigureHooks ¶
func (h *IDSHub) ConfigureHooks(airportService *airports.AirportService, pirepService *pireps.PIREPService)
func (*IDSHub) OnConnected ¶
We setup a clients table in our Handler which tracks connectionID to CID already
func (*IDSHub) OnDisconnected ¶
func (*IDSHub) SendAirportUpdate ¶
func (*IDSHub) SendServerMessage ¶
Helpers for sending messages to clients
func (*IDSHub) SubmitPIREP ¶
func (h *IDSHub) SubmitPIREP(pirep json.RawMessage)
func (*IDSHub) UpdateAirport ¶
func (h *IDSHub) UpdateAirport(id string, patch json.RawMessage) json.RawMessage
type SignalRHandler ¶
type SignalRHandler struct {
// contains filtered or unexported fields
}
func NewHandler ¶
func NewHandler(router chi.Router, server signalr.Server) *SignalRHandler
func (*SignalRHandler) FindClientByConnectionId ¶
func (h *SignalRHandler) FindClientByConnectionId(connectionID string) string
func (*SignalRHandler) HandleGet ¶
func (h *SignalRHandler) HandleGet(w http.ResponseWriter, r *http.Request)
Click to show internal directories.
Click to hide internal directories.