Documentation
¶
Index ¶
- Variables
- func BuildRoutes(h *Hub, r *Repo, m *m.Middleware) http.Handler
- func ListenHandler(hub *Hub, repo *Repo) http.HandlerFunc
- func LoginHandler(hub *Hub, repo *Repo) http.HandlerFunc
- func NewClient(conn WebSocketConnection, device *datastore.Device, events []string, ...)
- type AckEventDelivery
- type CLIEvent
- type Client
- type Hub
- type ListenRequest
- type LoginRequest
- type LoginResponse
- type Repo
- type WatchCollectionFn
- type WebSocketConnection
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrFailedToUpdateDevice = errors.New("failed to update device last seen") ErrFailedToSendPongMessage = errors.New("failed to write pong message") )
Functions ¶
func BuildRoutes ¶
func ListenHandler ¶
func ListenHandler(hub *Hub, repo *Repo) http.HandlerFunc
func LoginHandler ¶
func LoginHandler(hub *Hub, repo *Repo) http.HandlerFunc
func NewClient ¶
func NewClient(conn WebSocketConnection, device *datastore.Device, events []string, deviceRepo datastore.DeviceRepository, eventDeliveryRepo datastore.EventDeliveryRepository)
Types ¶
type AckEventDelivery ¶
type AckEventDelivery struct {
UID string `json:"uid"`
}
type CLIEvent ¶
type CLIEvent struct {
UID string `json:"uid"`
Headers httpheader.HTTPHeader `json:"headers" bson:"headers"`
Data json.RawMessage `json:"data"`
// for filtering this event delivery
EventType string `json:"-"`
DeviceID string `json:"-"`
AppID string `json:"-"`
GroupID string `json:"-"`
}
type Client ¶
type Client struct {
EventTypes []string
Device *datastore.Device
// contains filtered or unexported fields
}
Client is a middleman between the websocket connection and the hub.
func (*Client) HasEventType ¶
func (*Client) ResendEventDeliveries ¶
func (*Client) UpdateEventDeliveryStatus ¶
type Hub ¶
type Hub struct {
// contains filtered or unexported fields
}
Hub maintains the set of active clients and broadcasts messages to the clients.
func (*Hub) StartClientStatusWatcher ¶
func (h *Hub) StartClientStatusWatcher()
func (*Hub) StartEventSender ¶
func (h *Hub) StartEventSender()
func (*Hub) StartEventWatcher ¶
func (h *Hub) StartEventWatcher()
func (*Hub) StartRegister ¶
func (h *Hub) StartRegister()
func (*Hub) StartUnregister ¶
func (h *Hub) StartUnregister()
type ListenRequest ¶
type LoginRequest ¶
type LoginResponse ¶
type Repo ¶
type Repo struct {
DeviceRepo datastore.DeviceRepository
SourceRepo datastore.SourceRepository
AppRepo datastore.ApplicationRepository
SubscriptionRepo datastore.SubscriptionRepository
EventDeliveryRepo datastore.EventDeliveryRepository
}
type WatchCollectionFn ¶
Click to show internal directories.
Click to hide internal directories.