Documentation ¶
Index ¶
Constants ¶
View Source
const ( QueryParamType = "type" QueryParamFull = "diff" HeaderLastEventID = "Last-Event-ID" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Controller ¶
type Controller struct { // Events are pushed to this channel by the main events-gathering routine Notifier chan Event // contains filtered or unexported fields }
func NewController ¶
func NewController(s EventQueue) *Controller
func (*Controller) CreateHandler ¶
func (c *Controller) CreateHandler(new catalog.ThingDescription) error
func (*Controller) DeleteHandler ¶
func (c *Controller) DeleteHandler(old catalog.ThingDescription) error
func (*Controller) Stop ¶
func (c *Controller) Stop()
func (*Controller) UpdateHandler ¶
func (c *Controller) UpdateHandler(old catalog.ThingDescription, new catalog.ThingDescription) error
type Event ¶
type Event struct { ID string `json:"id"` Type wot.EventType `json:"event"` Data catalog.ThingDescription `json:"data"` }
type EventQueue ¶
type EventQueue interface { // Close all the resources acquired by the queue implementation Close() // contains filtered or unexported methods }
EventQueue interface
func NewLevelDBEventQueue ¶
type LevelDBEventQueue ¶
type LevelDBEventQueue struct {
// contains filtered or unexported fields
}
LevelDB storage
func (*LevelDBEventQueue) Close ¶
func (s *LevelDBEventQueue) Close()
type NotificationController ¶
type NotificationController interface { // Stop the controller Stop() catalog.EventListener // contains filtered or unexported methods }
NotificationController interface
type SSEAPI ¶
type SSEAPI struct {
// contains filtered or unexported fields
}
func NewSSEAPI ¶
func NewSSEAPI(controller NotificationController, version string) *SSEAPI
func (*SSEAPI) SubscribeEvent ¶
func (a *SSEAPI) SubscribeEvent(w http.ResponseWriter, req *http.Request)
Click to show internal directories.
Click to hide internal directories.