Documentation ¶
Index ¶
Constants ¶
View Source
const ( MCAST_EVENT_ADDR = "239.255.255.246" MCAST_EVENT_PORT = 7900 )
View Source
const ( DEFAULT_SUBSCRIPTION_DURATION = 30 * time.Minute MIN_SUBSCRIPTION_DURATION = 1 * time.Second )
Variables ¶
View Source
var Logger *log.Logger
Functions ¶
func ListenMulticastEvents ¶
func NewEventData ¶
func NewEventData() *eventData
func SendMulticastEvent ¶
func SendMulticastEvent(h *EventHeader, r *[]Result, laddr *net.UDPAddr) error
Types ¶
type Event ¶
type Event struct { EventHeader EventData }
type EventHeader ¶
type SubscriptionManager ¶
type SubscriptionManager struct { URL *url.URL SID string Lifetime time.Duration // contains filtered or unexported fields }
func NewSubscriptionManager ¶
FIXME - url may become invalid if device we're subscribing to restarts and the subscription url changes. Change this to the service name we want to subscribe to, and deal with the discovery and url building internally otherwise our subscription loops may crash when it attempts to resubscribe to a dead endpoint Provide ability to filter discovery/description data, in case more than 1 is found?
- description.DiscoverDeviceDescription() only returns the 1st discovered device, so either we modify that behavior, or we just go with it, and assume our service name is targeted enough to find the right one
func (*SubscriptionManager) EventLoop ¶
func (m *SubscriptionManager) EventLoop(ch chan<- map[string]string)
func (*SubscriptionManager) Unsubscribe ¶
func (m *SubscriptionManager) Unsubscribe() error
Click to show internal directories.
Click to hide internal directories.