events

package
v0.0.0-...-cc2a774 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2020 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const AcceptEncodingKey = "Accept-Encoding"
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 ContentType_CBOR = coap.AppCBOR.String()
View Source
var ContentType_JSON = coap.AppJSON.String()
View Source
var ContentType_VNDOCFCBOR = coap.AppOcfCbor.String()

Functions

func CalculateEventSignature

func CalculateEventSignature(secret, contentType string, eventType EventType, subscriptionID string, seqNum uint64, timeStamp time.Time, body []byte) string

Types

type Device

type Device struct {
	ID string `json:"di"`
}

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
	SubscriptionID  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 (
	EventType_ResourceChanged      EventType = "resource_contentchanged"
	EventType_ResourcesPublished   EventType = "resources_published"
	EventType_ResourcesUnpublished EventType = "resources_unpublished"
	EventType_DevicesOnline        EventType = "devices_online"
	EventType_DevicesOffline       EventType = "devices_offline"
	EventType_DevicesRegistered    EventType = "devices_registered"
	EventType_DevicesUnregistered  EventType = "devices_unregistered"
	EventType_SubscriptionCanceled EventType = "subscription_canceled"
)

type ResourceChanged

type ResourceChanged []byte

type ResourcesPublished

type ResourcesPublished []schema.ResourceLink

type ResourcesUnpublished

type ResourcesUnpublished []schema.ResourceLink

type SubscriptionRequest

type SubscriptionRequest struct {
	URL           string      `json:"eventsUrl"`
	EventTypes    []EventType `json:"eventTypes"`
	SigningSecret string      `json:"signingSecret"`
}

type SubscriptionResponse

type SubscriptionResponse struct {
	SubscriptionId string `json:"subscriptionId"`
}

Jump to

Keyboard shortcuts

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