Documentation ¶
Index ¶
- Constants
- Variables
- func CalculateEventSignature(secret, contentType string, eventType EventType, subscriptionID string, ...) string
- type Device
- type DevicesOffline
- type DevicesOnline
- type DevicesRegistered
- type DevicesUnregistered
- type EventHeader
- type EventType
- type EventTypes
- type ResourceChanged
- type ResourcesPublished
- type ResourcesUnpublished
- type SubscriptionRequest
- type SubscriptionResponse
Constants ¶
View Source
const AcceptEncodingKey = "Accept-Encoding"
View Source
const AcceptKey = "Accept"
View Source
const ContentEncodingKey = "Content-Encoding"
View Source
const ContentTypeKey = "Content-Type"
View Source
const CorrelationIDKey = "Correlation-ID"
View Source
const EventSignatureKey = "Event-Signature"
View Source
const EventTimestampKey = "Event-Timestamp"
View Source
const EventTypeKey = "Event-Type"
View Source
const SequenceNumberKey = "Sequence-Number"
View Source
const SubscriptionIDKey = "Subscription-ID"
Variables ¶
View Source
var AllDeviceEvents = []EventType{EventType_ResourcesPublished, EventType_ResourcesUnpublished}
View Source
var AllDevicesEvents = []EventType{EventType_DevicesOnline, EventType_DevicesOffline, EventType_DevicesRegistered, EventType_DevicesUnregistered}
View Source
var AllResourceEvents = []EventType{EventType_ResourceChanged}
View Source
var ContentType_JSON = message.AppJSON.String()
View Source
var ContentType_VNDOCFCBOR = message.AppOcfCbor.String()
Functions ¶
Types ¶
type DevicesOffline ¶
type DevicesOffline []Device
type DevicesOnline ¶
type DevicesOnline []Device
type DevicesRegistered ¶
type DevicesRegistered []Device
type DevicesUnregistered ¶
type DevicesUnregistered []Device
type EventHeader ¶
type EventHeader struct { CorrelationID string ID string ContentType string EventType EventType SequenceNumber uint64 EventTimestamp time.Time EventSignature string AcceptEncoding []string ContentEncoding string }
func ParseEventHeader ¶
func ParseEventHeader(r *http.Request) (h EventHeader, _ error)
func (EventHeader) GetContentDecoder ¶
func (h EventHeader) GetContentDecoder() (func(w []byte, v interface{}) error, error)
type EventType ¶
type EventType string
const ( // resource EventType_ResourceChanged EventType = "resource_contentchanged" // device EventType_ResourcesPublished EventType = "resources_published" EventType_ResourcesUnpublished EventType = "resources_unpublished" // devices EventType_DevicesOnline EventType = "devices_online" EventType_DevicesOffline EventType = "devices_offline" EventType_DevicesRegistered EventType = "devices_registered" EventType_DevicesUnregistered EventType = "devices_unregistered" // among all EventType_SubscriptionCanceled EventType = "subscription_cancelled" )
type EventTypes ¶
type EventTypes []EventType
func (EventTypes) Has ¶
func (e EventTypes) Has(ev EventType) bool
type ResourceChanged ¶
type ResourceChanged []byte
type ResourcesPublished ¶
type ResourcesPublished []schema.ResourceLink
type ResourcesUnpublished ¶
type ResourcesUnpublished []schema.ResourceLink
type SubscriptionRequest ¶
type SubscriptionResponse ¶
type SubscriptionResponse struct {
SubscriptionId string `json:"subscriptionId"`
}
Click to show internal directories.
Click to hide internal directories.