notification

package
v1.0.0-beta.26 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 13, 2022 License: Apache-2.0 Imports: 17 Imported by: 0

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

func NewLevelDBEventQueue(dsn string, opts *opt.Options, capacity uint64) (EventQueue, error)

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)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL