This package provides the Julia SDK for CloudEvents.

Basic Usage

Below we provide the most common usages.

using CloudEvents

# Create a CloudEvent manually
data = Dict("message" => "Hello World!")
ce = CloudEvent(data; type="example", source="")

headers, body = to_http(ce)  # structure mode by default
# headers, body = to_http(ce, :binary)  # or binary mode

# Send CloudEvent
using HTTP"<your url>", headers, body)

# Receive CloudEvent
using JSON3
HTTP.serve() do req
    ce = from_http(HTTP.headers(req),