Options
All
  • Public
  • Public/Protected
  • All
Menu

cloudevents

Index

Variables

HTTP: Binding = ...

Bindings for HTTP transport support

implements

Binding

Kafka: Binding = ...

Bindings for Kafka transport

implements

Binding

MQTT: Binding = ...

Binding for MQTT transport support

implements

@linkcode Binding

V1: "1.0" = "1.0"

Constants representing the CloudEvent specification version

Functions

  • MQTTMessageFactory<T>(contentType: string, headers: Record<string, unknown>, body: T): MQTTMessage<T>
  • A helper function to create an MQTTMessage object, with "User Properties" as an alias for "headers" and "payload" an alias for body, and a "PUBLISH" record with a "Content Type" property.

    Type Parameters

    • T

    Parameters

    • contentType: string

      the "Content Type" attribute on PUBLISH

    • headers: Record<string, unknown>

      the headers and "User Properties"

    • body: T

      the message body/payload

    Returns MQTTMessage<T>

    a message initialized with the provided attributes

  • httpTransport provides a simple HTTP Transport function, which can send a CloudEvent, encoded as a Message to the endpoint. The returned function can be used with emitterFor() to provide an event emitter, for example:

    const emitter = emitterFor(httpTransport("http://example.com")); emitter.emit(myCloudEvent) .then(resp => console.log(resp));

    Parameters

    • sink: string | URL

      the destination endpoint for the event

    Returns TransportFunction

    a function which can be used to send CloudEvents to sink

Generated using TypeDoc